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


Ignore:
Timestamp:
Aug 2, 2018, 11:47:13 AM (6 years ago)
Author:
alain
Message:

This version modifies the exec syscall and fixes a large number of small bugs.
The version number has been updated (0.1)

File:
1 edited

Legend:

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

    r445 r457  
    5050    for( i = 1 ; i <  NB_TXT_CHANNELS ; i++ )
    5151    {
     52
     53#if DEBUG_PROCESS_INIT
     54snprintf( string , 64 , "[INIT] start child[%d] creation" , i );
     55display_string( string );
     56#endif
     57
    5258        // INIT process fork process CHILD[i]
    5359        ret_fork = fork();
     
    5662        {
    5763            // INIT display error message 
    58             snprintf( string , 64 , "[INIT] cannot fork child[%d] => suicide" , i );
     64            snprintf( string , 64 , "[INIT ERROR] cannot fork child[%d] => suicide" , i );
    5965            display_string( string );
    6066
     
    7783        else                                      // we are in INIT process
    7884        {
    79              // INIT display CHILD[i] process PID
    80              snprintf( string , 64 , "[INIT] created KSH[%d] / pid = %x", i , ret_fork );
    81              display_string( string );
     85            // INIT display CHILD[i] process PID
     86            snprintf( string , 64 , "[INIT] created KSH[%d] / pid = %x", i , ret_fork );
     87            display_string( string );
    8288        }
    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 );
    8889    }
    8990 
    9091#if DEBUG_PROCESS_INIT
     92unsigned int  x_size;        // number of clusters in a row
     93unsigned int  y_size;        // number of clusters in a column
     94unsigned int  ncores;        // number of cores per cluster
     95unsigned int  x;             // cluster x coordinate
     96unsigned int  y;             // cluster y coordinate
     97unsigned int  cxy;           // cluster identifier
     98unsigned int  lid;           // core local index
    9199
    92     unsigned int  x_size;        // number of clusters in a row
    93     unsigned int  y_size;        // number of clusters in a column
    94     unsigned int  ncores;        // number of cores per cluster
    95     unsigned int  x;             // cluster x coordinate
    96     unsigned int  y;             // cluster y coordinate
    97     unsigned int  cxy;           // cluster identifier
    98     unsigned int  lid;           // core local index
    99 
    100     // get hardware config
    101     get_config( &x_size , &y_size , &ncores );
     100// get hardware config
     101get_config( &x_size , &y_size , &ncores );
    102102   
    103     // INIT displays processes and threads in all clusters
    104     for( x = 0 ; x < x_size ; x++ )
     103// INIT displays processes and threads in all clusters
     104for( x = 0 ; x < x_size ; x++ )
     105{
     106    for( y = 0 ; y < y_size ; y++ )
    105107    {
    106         for( y = 0 ; y < y_size ; y++ )
    107         {
    108             cxy = CXY_FROM_XY( x , y );
    109             display_cluster_processes( cxy );
    110             for( lid = 0 ; lid < ncores ; lid++ )
    111             {
    112                 display_sched( cxy , lid );
    113             }
     108        cxy = CXY_FROM_XY( x , y );
     109        display_cluster_processes( cxy );
     110        for( lid = 0 ; lid < ncores ; lid++ )
     111        {
     112            display_sched( cxy , lid );
    114113        }
    115114    }
    116 
     115}
    117116#endif
    118117
Note: See TracChangeset for help on using the changeset viewer.