Changeset 676 for trunk/user/init


Ignore:
Timestamp:
Nov 20, 2020, 12:11:35 AM (4 years ago)
Author:
alain
Message:

Introduce chat application to test the named pipes.

File:
1 edited

Legend:

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

    r659 r676  
    2020#include <shared_syscalls.h>
    2121
    22 #define DEBUG_PROCESS_INIT    1
     22#define DEBUG_PROCESS_INIT    0
    2323
    2424////////////////
     
    3636#endif
    3737
    38     // get Number of TXT channels from hard configuration
     38    // get number of TXT channels from hard configuration
    3939    hard_config_t config;     
     40
    4041    get_config( &config );
    4142
    4243    unsigned int  txt_channels = config.txt_channels;
    43     unsigned int  x_size       = config.x_size;
    44     unsigned int  y_size       = config.y_size;
    45     unsigned int  ncores       = config.ncores;
    4644
    4745    // check number of TXT channels
     
    4947    {
    5048        snprintf( string , 64 ,
    51         "\n[init ERROR] number of TXT channels must be larger than 1\n");
     49        "\n[init ERROR] number of TXT channels must be larger than 1");
    5250        display_string( string );
    5351        exit( EXIT_FAILURE );
     
    6462            // INIT display error message 
    6563            snprintf( string , 64 ,
    66             "[init ERROR] cannot fork child[%d] => suicide" , i );
     64            "\n[init ERROR] cannot fork child[%d] => suicide" , i );
    6765            display_string( string );
    6866
     
    7270        else if( ret_fork == 0 )                    // we are in CHILD[i] process
    7371        {
     72
     73#if DEBUG_PROCESS_INIT
     74            snprintf( string , 64 ,
     75            "\n[init] CHILD[%d] process forked / call execve", i );
     76            display_string( string );
     77#endif
    7478            // CHILD[i] process exec process KSH[i]
    7579            ret_exec = execve( "/bin/user/ksh.elf" , NULL , NULL );
     
    7983                // CHILD[i] display error message
    8084                snprintf( string , 64 ,
    81                 "[init ERROR] CHILD[%d] cannot exec KSH / ret_exec = %d" , i , ret_exec );
     85                "\n[init ERROR] CHILD[%d] cannot exec KSH" , i );
    8286                display_string( string );
    8387
     
    9094            // INIT display CHILD[i] process PID
    9195            snprintf( string , 64 ,
    92             "[init] (pid 0x1) created ksh[%d] (pid %x)", i , ret_fork );
     96            "\n[init] (pid 0x1) create ksh[%d] (pid %x)", i , ret_fork );
    9397            display_string( string );
    9498
     
    104108    unsigned int  cxy;           // cluster identifier
    105109    unsigned int  lid;           // core local index
     110
     111    unsigned int  x_size       = config.x_size;
     112    unsigned int  y_size       = config.y_size;
     113    unsigned int  ncores       = config.ncores;
    106114
    107115    // INIT displays processes and threads in all clusters
Note: See TracChangeset for help on using the changeset viewer.