Changeset 445 for trunk/user/init/init.c


Ignore:
Timestamp:
May 29, 2018, 9:27:23 AM (4 years ago)
Author:
alain
Message:

Restructure the mini_libc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/user/init/init.c

    r444 r445  
    1717#include <stdio.h>
    1818#include <pthread.h>
    19 #include <almos-mkh.h>
    20 #include <assert.h>
     19#include <almosmkh.h>
    2120#include <sys/wait.h>
    2221
    2322#define DEBUG_PROCESS_INIT    0
    2423
    25 // TODO make the cxy computation portable [AG]
     24// TODO make the cxy computation portable
     25// and avoid this TSAR specific define [AG]
     26
    2627#define CXY_FROM_XY( x , y )  ((x<<4) + y)
     28
     29// TODO improve the get_config() syscall to return nb_txt_channels
     30// and avoid the hard_config include [AG]
    2731
    2832//////////
     
    3741
    3842    // check number of TXT channels
    39     assert( NB_TXT_CHANNELS > 1 );
     43    if( NB_TXT_CHANNELS < 2 )
     44    {
     45        printf("\n[ERROR] in init process : number of TXT channels must be larger than 1\n");
     46        exit( EXIT_FAILURE );
     47    }
    4048
    4149    // create the KSH processes (one per user terminal)
     
    7381             display_string( string );
    7482        }
     83
     84        // INIT wait CHILD[i] process deletion before creating KSH[i+1]
     85        // int n;
     86        // for( n = 0 ; n < 100000 ; n++ ) asm volatile ( "nop" );
     87        wait( &status );
    7588    }
    7689 
Note: See TracChangeset for help on using the changeset viewer.