Ignore:
Timestamp:
Nov 19, 2020, 11:45:52 PM (4 years ago)
Author:
alain
Message:

1) Introduce up to 4 command lines arguments in the KSH "load" command.
These arguments are transfered to the user process through the
argc/argv mechanism, using the user space "args" vseg.

2) Introduce the named and anonymous "pipes", for inter-process communication
through the pipe() and mkfifo() syscalls.

3) Introduce the "chat" application to validate the two above mechanisms.

4) Improve printk() and assert() fonctions in printk.c.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_fork.c

    r637 r670  
    22 * sys_fork.c - Kernel function implementing the "fork" system call.
    33 *
    4  * Authors  Alain Greiner  (2016,2017,2018,2019)
     4 * Authors  Alain Greiner  (2016,2017,2018,2019,2020)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    4646    xptr_t            parent_thread_xp;     // extended pointer on parent thread descriptor
    4747    pid_t             parent_pid;           // parent process identifier
    48     thread_t        * parent_thread_ptr;    // local pointer on local parent thread descriptor
     48    thread_t        * parent_thread_ptr;    // local pointer on local parent thread
    4949    cxy_t             parent_cxy;           // parent thread cluster
    5050
    5151    pid_t             child_pid;            // child process identifier
    52     thread_t        * child_thread_ptr;     // local pointer on remote child thread descriptor
     52    thread_t        * child_thread_ptr;     // local pointer on remote child thread
    5353    cxy_t             child_cxy;            // target cluster for forked child process
    5454 
     
    5858
    5959        error_t           error;
    60    
    6160
    6261    // get pointers on local parent process and thread
     
    6766    parent_cxy         = local_cxy;
    6867
    69 #if (DEBUG_SYS_FORK || CONFIG_INSTRUMENTATION_SYSCALLS)
     68#if DEBUG_SYS_FORK || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
    7069uint64_t     tm_start = hal_get_cycles();
    7170#endif
     
    8887
    8988#if DEBUG_SYSCALLS_ERROR
    90 printk("\n[ERROR] in %s : thread[%x,%x] cannot fork : too much children\n",
     89if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
     90printk("\n[ERROR] in %s : thread[%x,%x] / too much children\n",
    9191__FUNCTION__, parent_pid, parent_thread_ptr->trdid );
    9292#endif
     
    136136
    137137#if DEBUG_SYSCALLS_ERROR
     138if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
    138139printk("\n[ERROR] in %s : thread[%x,%x] cannot fork\n",
    139140__FUNCTION__, parent_pid, parent_thread_ptr->trdid );
Note: See TracChangeset for help on using the changeset viewer.