Changeset 675


Ignore:
Timestamp:
Nov 20, 2020, 12:06:16 AM (18 months 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.

Location:
trunk/kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/Makefile

    r667 r675  
    8989              build/kern/dqdt.o             \
    9090              build/kern/do_syscall.o       \
    91               build/kern/rpc.o
     91              build/kern/rpc.o              \
     92              build/kern/alarm.o            \
     93              build/kern/pipe.o
    9294
    9395DEV_OBJS    = build/devices/dev_txt.o       \
  • trunk/kernel/kernel_config.h

    r667 r675  
    138138#define DEBUG_PROCESS_COPY_INIT           0
    139139#define DEBUG_PROCESS_DESTROY             0
     140#define DEBUG_PROCESS_EXEC_GET_STRINGS    0
    140141#define DEBUG_PROCESS_FD_REGISTER         0
    141142#define DEBUG_PROCESS_FD_REMOVE           0
     
    180181
    181182#define DEBUG_SOCKET_ACCEPT               0
     183#define DEBUG_SOCKET_ALARM                0
    182184#define DEBUG_SOCKET_BIND                 0
    183185#define DEBUG_SOCKET_BUILD                0
     
    191193#define DEBUG_SOCKET_LINK                 0
    192194
    193 #define DEBUG_SYSCALLS_ERROR                 2
     195#define DEBUG_SYSCALLS_ERROR              0
    194196
    195197#define DEBUG_SYS_BARRIER                 0
     
    250252#define DEBUG_USER_DIR                    0
    251253
     254#define DEBUG_VFS_ERROR                   0
     255
    252256#define DEBUG_VFS_ADD_CHILD               0
    253257#define DEBUG_VFS_ADD_SPECIAL             0
     
    256260#define DEBUG_VFS_DENTRY_CREATE           0
    257261#define DEBUG_VFS_FILE_CREATE             0
     262#define DEBUG_VFS_FILE_DESTROY            0
    258263#define DEBUG_VFS_GET_PATH                0
    259264#define DEBUG_VFS_INODE_CREATE            0
     
    267272#define DEBUG_VFS_OPEN                    0
    268273#define DEBUG_VFS_OPENDIR                 0
     274#define DEBUG_VFS_REMOVE_CHILD            0
    269275#define DEBUG_VFS_STAT                    0
    270276#define DEBUG_VFS_USER_MOVE               0
     
    304310#define LOCK_KHM_STATE         6   // local  (B)  protect KHM allocator state
    305311#define LOCK_HTAB_STATE        7   // local  (B)  protect a local htab state
    306 
    307 #define LOCK_VFS_CTX           8   // remote (B)  protect vfs context state
    308 #define LOCK_PPM_FREE          9   // remote (B)  protect PPM allocator free_pages lists
    309 #define LOCK_THREAD_JOIN      10   // remote (B)  protect join/exit between two threads
    310 #define LOCK_XHTAB_STATE      11   // remote (B)  protect a distributed xhtab state
    311 #define LOCK_CHDEV_QUEUE      12   // remote (B)  protect chdev threads waiting queue
    312 #define LOCK_CHDEV_TXT0       13   // remote (B)  protect access to kernel terminal TXT0
    313 #define LOCK_CHDEV_TXTLIST    14   // remote (B)  protect xlist of processes using same TXT
    314 #define LOCK_PAGE_STATE       15   // remote (B)  protect physical page descriptor state
    315 #define LOCK_MUTEX_STATE      16   // remote (B)  protect user mutex state
    316 #define LOCK_CONDVAR_STATE    17   // remote (B)  protect user condvar state
    317 #define LOCK_SEM_STATE        18   // remote (B)  protect user semaphore state
    318 #define LOCK_PROCESS_CWD      19   // remote (B)  protect current working directory in process
    319 #define LOCK_BARRIER_STATE    20   // remote (B)  protect user barrier state
    320 #define LOCK_LISTEN_SOCKET    21   // remote (B)  protect xlist of listening sockets
    321 
    322 #define LOCK_CLUSTER_PREFTBL  22   // local  (Q)  protect array of ref. processes in cluster
    323 
    324 #define LOCK_SOCKET_STATE     23   // remote (Q)  protect kernel socket state
    325 #define LOCK_PPM_DIRTY        24   // remote (Q)  protect PPM dirty_pages list
    326 #define LOCK_CLUSTER_LOCALS   25   // remote (Q)  protect xlist of local processes in cluster
    327 #define LOCK_CLUSTER_COPIES   26   // remote (Q)  protect xlist of process copies in cluster
    328 #define LOCK_PROCESS_CHILDREN 27   // remote (Q)  protect xlist of chidren process in process
    329 #define LOCK_PROCESS_USERSYNC 28   // remote (Q)  protect lists of user synchros in process
    330 #define LOCK_PROCESS_FDARRAY  29   // remote (Q)  protect array of open files in owner process
    331 #define LOCK_PROCESS_DIR      30   // remote (Q)  protect xlist of open directories in process
    332 #define LOCK_VMM_VSL          31   // remote (Q)  protect VSL (local list of vsegs)
    333 
    334 #define LOCK_PROCESS_THTBL    32   // local  (RW) protect local array of threads in a process
    335 
    336 #define LOCK_MAPPER_STATE     33   // remote (RW) protect mapper state
    337 #define LOCK_VFS_SIZE         34   // remote (RW) protect inode state and associated mapper
    338 #define LOCK_VFS_FILE         35   // remote (RW) protect file descriptor state
    339 #define LOCK_VFS_MAIN         36   // remote (RW) protect vfs traversal (in root inode)
    340 #define LOCK_FATFS_FAT        37   // remote (RW) protect exclusive access to the VFS FAT
    341 #define LOCK_FBF_WINDOWS      38   // remote (RW) protect FBF windows set
     312#define LOCK_CORE_ALARMS       8   // local  (B)  protect list of alarms in core desc.
     313
     314#define LOCK_VFS_CTX           9   // remote (B)  protect vfs context state
     315#define LOCK_PPM_FREE         10   // remote (B)  protect PPM allocator free_pages lists
     316#define LOCK_THREAD_JOIN      11   // remote (B)  protect join/exit between two threads
     317#define LOCK_XHTAB_STATE      12   // remote (B)  protect a distributed xhtab state
     318#define LOCK_CHDEV_QUEUE      13   // remote (B)  protect chdev threads waiting queue
     319#define LOCK_CHDEV_TXT0       14   // remote (B)  protect access to kernel terminal TXT0
     320#define LOCK_CHDEV_TXTLIST    15   // remote (B)  protect xlist of processes using same TXT
     321#define LOCK_PAGE_STATE       16   // remote (B)  protect physical page descriptor state
     322#define LOCK_MUTEX_STATE      17   // remote (B)  protect user mutex state
     323#define LOCK_CONDVAR_STATE    18   // remote (B)  protect user condvar state
     324#define LOCK_SEM_STATE        19   // remote (B)  protect user semaphore state
     325#define LOCK_PROCESS_CWD      20   // remote (B)  protect current working directory in process
     326#define LOCK_BARRIER_STATE    21   // remote (B)  protect user barrier state
     327#define LOCK_LISTEN_SOCKET    22   // remote (B)  protect xlist of listening sockets
     328
     329#define LOCK_CLUSTER_PREFTBL  23   // local  (Q)  protect array of ref. processes in cluster
     330
     331#define LOCK_SOCKET_STATE     24   // remote (Q)  protect kernel socket state
     332#define LOCK_PPM_DIRTY        25   // remote (Q)  protect PPM dirty_pages list
     333#define LOCK_CLUSTER_LOCALS   26   // remote (Q)  protect xlist of local processes in cluster
     334#define LOCK_CLUSTER_COPIES   27   // remote (Q)  protect xlist of process copies in cluster
     335#define LOCK_PROCESS_CHILDREN 28   // remote (Q)  protect xlist of chidren process in process
     336#define LOCK_PROCESS_USERSYNC 29   // remote (Q)  protect lists of user synchros in process
     337#define LOCK_PROCESS_FDARRAY  30   // remote (Q)  protect array of open files in owner process
     338#define LOCK_PROCESS_DIR      31   // remote (Q)  protect xlist of open directories in process
     339#define LOCK_VMM_VSL          32   // remote (Q)  protect VSL (local list of vsegs)
     340
     341#define LOCK_PROCESS_THTBL    33   // local  (RW) protect local array of threads in a process
     342
     343#define LOCK_MAPPER_STATE     34   // remote (RW) protect mapper state
     344#define LOCK_VFS_SIZE         35   // remote (RW) protect inode state and associated mapper
     345#define LOCK_VFS_FILE         36   // remote (RW) protect file descriptor state
     346#define LOCK_VFS_MAIN         37   // remote (RW) protect vfs traversal (in root inode)
     347#define LOCK_FATFS_FAT        38   // remote (RW) protect exclusive access to the VFS FAT
     348#define LOCK_FBF_WINDOWS      39   // remote (RW) protect FBF windows set
    342349
    343350////////////////////////////////////////////////////////////////////////////////////////////
     
    386393
    387394#define CONFIG_MAX_PROCESS_PER_CLUSTER      16         // max number of owned process
    388 #define CONFIG_PROCESS_FILE_MAX_NR          16         // max number of open files
     395#define CONFIG_PROCESS_ARGS_MAX_NR          4          // max number of args per process
     396#define CONFIG_PROCESS_ENVS_MAX_NR          256        // max number of envs per process
     397#define CONFIG_PROCESS_FILE_MAX_NR          256        // max number of files per process
    389398#define CONFIG_PROCESS_MAX_CHILDREN         1024       // max number of children process
    390399#define CONFIG_PROCESS_HEAP_MIN_SIZE        0x00010000 // user heap min size (bytes)
     
    468477#define CONFIG_VMM_STACK_BASE         0x0C0000      // STACK zone base        : 3   Gbytes
    469478 
    470 #define CONFIG_VMM_ARGS_SIZE          0x000004      // args vseg size         : 16  Kbytes
    471 #define CONFIG_VMM_ENVS_SIZE          0x000008      // envs vseg size         : 32  Kbytes
     479#define CONFIG_VMM_ARGS_SIZE          0x000001      // args vseg size         : 4   Kbytes
     480#define CONFIG_VMM_ENVS_SIZE          0x000004      // envs vseg size         : 16  Kbytes
    472481#define CONFIG_VMM_STACK_SIZE         0x001000      // single stack vseg size : 16  Mbytes
    473482
    474 #define CONFIG_VMM_HEAP_MAX_ORDER     18           // max size of MMAP vseg  :  1  Gbytes
     483#define CONFIG_VMM_HEAP_MAX_ORDER     18           // max size of MMAP vseg  :  1   Gbytes
     484
    475485////////////////////////////////////////////////////////////////////////////////////////////
    476486//                      PHYSICAL MEMORY MANAGEMENT         
     
    487497
    488498////////////////////////////////////////////////////////////////////////////////////////////
     499//                  MISCELANEOUS BUFFER SIZES 
     500////////////////////////////////////////////////////////////////////////////////////////////
     501
     502#define CONFIG_PRINTK_BUF_SIZE        0x800        // max length of a formated string
     503#define CONFIG_PIPE_BUF_SIZE          0x1000       // max number of bytes in a pipe buffer
     504#define CONFIG_SOCK_RX_BUF_SIZE       0x100000     // max number of bytes in  RX buffer
     505#define CONFIG_SOCK_R2T_BUF_SIZE      0x64         // max number of requests in R2T queue
     506#define CONFIG_SOCK_CRQ_BUF_SIZE      0x8          // max number of requests in CRQ queue
     507#define CONFIG_SOCK_PKT_BUF_SIZE      0x800        // max length for one ETH/IP/TCP packet
     508
     509////////////////////////////////////////////////////////////////////////////////////////////
    489510//                 INSTRUMENTATION
    490511////////////////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.