Ignore:
Timestamp:
Jan 13, 2021, 12:36:17 AM (3 years ago)
Author:
alain
Message:

All modifications required to support the <tcp_chat> application
including error recovery in case of packet loss.A

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kernel_config.h

    r675 r683  
    2525#define _KERNEL_CONFIG_H_
    2626
    27 ////////////////////////////////////////////////////////////////////////////////////////////
     27////////////////////////////////////////////////////////////////////////////////////////
    2828//                              KERNEL DEBUG
    29 //  Each debug variable control one kernel function, or one small group of functions.
    30 //  - trace is generated only when cycle > debug_value.
    31 //  - detailed trace is enabled when (debug_value & Ox1) is non zero.
    32 ////////////////////////////////////////////////////////////////////////////////////////////
     29//
     30// 1) All errors detected by the kernel caused by a system call are reported to the
     31//    user process using the ERRNO mechanism. Moreover, the DEBUG_***_ERROR variables
     32//    force the compiler to display on TXT0 the error messages generated by
     33//    the low-level kernel function, to help the error cause analysis.
     34//
     35// 2) The other debug variable forece the compiler to display on TXT0 a trace for one
     36//    specific kernel function, or one small group of functions.
     37//    All these trace variables (but locks, kmem, kcm) respect the following rules:
     38//    - the trace is generated if the debug variable is non zeo.
     39//    - trace is generated only when cycle > debug_value.
     40//    - detailed trace is enabled when (debug_value & 0x1) is non zero.
     41////////////////////////////////////////////////////////////////////////////////////////
     42
     43// error reporting variables
     44
     45#define DEBUG_DEV_NIC_ERROR               1
     46#define DEBUG_KCM_ERROR                   1
     47#define DEBUG_KMEM_ERROR                  1
     48#define DEBUG_MAPPER_ERROR                1
     49#define DEBUG_PPM_ERROR                   1
     50#define DEBUG_PROCESS_ERROR               1
     51#define DEBUG_SOCKET_ERROR                1
     52#define DEBUG_SYSCALLS_ERROR              1
     53#define DEBUG_THREAD_ERROR                1
     54#define DEBUG_USER_DIR_ERROR              1
     55#define DEBUG_VFS_ERROR                   1
     56#define DEBUG_VMM_ERROR                   1
     57
     58
     59// trace activation variables
    3360
    3461#define DEBUG_BARRIER_CREATE              0
     
    3663#define DEBUG_BARRIER_WAIT                0
    3764
    38 #define DEBUG_BUSYLOCK_TYPE               0
    39 #define DEBUG_BUSYLOCK_PID                0        
    40 #define DEBUG_BUSYLOCK_TRDID              0      
     65#define DEBUG_BUSYLOCK_TYPE               0   // type 0 undefined => no debug
     66#define DEBUG_BUSYLOCK_PID                0   // owner process PID
     67#define DEBUG_BUSYLOCK_TRDID              0   // owner thread TRDID
    4168                 
    4269#define DEBUG_CHDEV_CMD_RX                0
     
    115142
    116143#define DEBUG_KCM                         0
    117 #define DEBUG_KCM_REMOTE                  0
     144#define DEBUG_KCM_ORDER                   0    // filter for DEBUG_KCM
     145#define DEBUG_KCM_CXY                     0    // filter for DEBUG_KCM
     146
     147#define DEBUG_KERNEL_INIT                 0
    118148
    119149#define DEBUG_KMEM                        0
    120 #define DEBUG_KMEM_REMOTE                 0
    121 
    122 #define DEBUG_KERNEL_INIT                 0
     150#define DEBUG_KMEM_ORDER                  0    // filter for DEBUG_KMEM
     151#define DEBUG_KMEM_CXY                    0    // filter for DEBUG_KMEM
    123152
    124153#define DEBUG_MAPPER_GET_PAGE             0
     
    133162#define DEBUG_PPM_ALLOC_PAGES             0
    134163#define DEBUG_PPM_FREE_PAGES              0
    135 #define DEBUG_PPM_REMOTE_ALLOC_PAGES      0
    136 #define DEBUG_PPM_REMOTE_FREE_PAGES       0
    137164   
    138165#define DEBUG_PROCESS_COPY_INIT           0
    139166#define DEBUG_PROCESS_DESTROY             0
    140 #define DEBUG_PROCESS_EXEC_GET_STRINGS    0
    141167#define DEBUG_PROCESS_FD_REGISTER         0
    142168#define DEBUG_PROCESS_FD_REMOVE           0
     
    151177#define DEBUG_PROCESS_ZERO_CREATE         0
    152178
    153 #define DEBUG_QUEUELOCK_TYPE              0           // type 0 undefined => no debug
    154 #define DEBUG_QUEUELOCK_PTR               0
    155 #define DEBUG_QUEUELOCK_CXY               0
     179#define DEBUG_QUEUELOCK_TYPE              0   // type 0 undefined => no debug
     180#define DEBUG_QUEUELOCK_PTR               0   // lock local pointer
     181#define DEBUG_QUEUELOCK_CXY               0   // lock cluster identifier
    156182
    157183#define DEBUG_RPC_CLIENT_GENERIC          0
     
    170196#define DEBUG_RPC_VMM_SET_COW             0
    171197
    172 #define DEBUG_RWLOCK_TYPE                 0           // type 0 undefined => no debug
    173 #define DEBUG_RWLOCK_PTR                  0
    174 #define DEBUG_RWLOCK_CXY                  0
     198#define DEBUG_RWLOCK_TYPE                 0   // type 0 undefined => no debug
     199#define DEBUG_RWLOCK_PTR                  0   // lock local pointer
     200#define DEBUG_RWLOCK_CXY                  0   // lock cluster identifier
    175201
    176202#define DEBUG_SCHED_HANDLE_SIGNALS        0
     
    189215#define DEBUG_SOCKET_DESTROY              0
    190216#define DEBUG_SOCKET_LISTEN               0
     217#define DEBUG_SOCKET_SEND                 0
    191218#define DEBUG_SOCKET_RECV                 0
    192 #define DEBUG_SOCKET_SEND                 0
    193219#define DEBUG_SOCKET_LINK                 0
    194 
    195 #define DEBUG_SYSCALLS_ERROR              0
    196220
    197221#define DEBUG_SYS_BARRIER                 0
     
    205229#define DEBUG_SYS_FG                      0
    206230#define DEBUG_SYS_FORK                    0
    207 #define DEBUG_SYS_GET_CONFIG              0
     231#define DEBUG_SYS_GET                     0 
    208232#define DEBUG_SYS_GETCWD                  0
    209233#define DEBUG_SYS_GETPID                  0
    210 #define DEBUG_SYS_GET_BEST_CORE           0
    211 #define DEBUG_SYS_GET_CORE_ID             0
    212 #define DEBUG_SYS_GET_NB_CORES            0
    213 #define DEBUG_SYS_GET_THREAD_INFO         0
    214234#define DEBUG_SYS_ISATTY                  0
    215235#define DEBUG_SYS_IS_FG                   0
     
    250270#define DEBUG_THREAD_USER_EXEC            0
    251271
    252 #define DEBUG_USER_DIR                    0
    253 
    254 #define DEBUG_VFS_ERROR                   0
     272#define DEBUG_USER_DIR_CREATE             0
     273#define DEBUG_USER_DIR_DESTROY            0
    255274
    256275#define DEBUG_VFS_ADD_CHILD               0
     
    277296#define DEBUG_VFS_UNLINK                  0
    278297
     298
    279299#define DEBUG_VMM_CREATE_VSEG             0
    280300#define DEBUG_VMM_DESTROY                 0
     
    352372////////////////////////////////////////////////////////////////////////////////////////////
    353373
    354 #define CONFIG_VERSION           "Version 2.3 / November 2019"
     374#define CONFIG_VERSION           "Version 2.4 / November 2020"
    355375
    356376////////////////////////////////////////////////////////////////////////////////////////////
     
    370390#define CONFIG_CLUSTER_SPAN                 32         // ln(phys. address space per cluster)
    371391#define CONFIG_CACHE_LINE_SIZE              64         // number of bytes in cache line
     392#define CONFIG_CACHE_LINE_ORDER             6          // ln( cache line size )
    372393
    373394#define CONFIG_CACHE_LINE_ALIGNED           __attribute__((aligned(CONFIG_CACHE_LINE_SIZE)))
     
    389410
    390411////////////////////////////////////////////////////////////////////////////////////////////
     412//                                  DQDT       
     413////////////////////////////////////////////////////////////////////////////////////////////
     414
     415#define CONFIG_DQDT_LEVELS_NR               5
     416
     417////////////////////////////////////////////////////////////////////////////////////////////
     418//                              FBF WINDOWS       
     419////////////////////////////////////////////////////////////////////////////////////////////
     420
     421#define CONFIG_FBF_WINDOWS_MAX_NR           64         // max number of windows
     422#define CONFIG_FBF_WINDOWS_MAX_WIDTH        1024       // max number of pixels in FBF line
     423#define CONFIG_FBF_WINDOWS_MAX_HEIGHT       1024       // max number of lines in FBF
     424
     425////////////////////////////////////////////////////////////////////////////////////////////
    391426//                            PROCESS MANAGEMENT       
    392427////////////////////////////////////////////////////////////////////////////////////////////
    393428
     429#define CONFIG_PROCESS_INIT_PATH            "/bin/user/init.elf"
    394430#define CONFIG_MAX_PROCESS_PER_CLUSTER      16         // max number of owned process
    395431#define CONFIG_PROCESS_ARGS_MAX_NR          4          // max number of args per process
     
    399435#define CONFIG_PROCESS_HEAP_MIN_SIZE        0x00010000 // user heap min size (bytes)
    400436#define CONFIG_PROCESS_HEAP_MAX_SIZE        0x30000000 // user heap max size (bytes)
    401 #define CONFIG_PROCESS_INIT_PATH            "/bin/user/init.elf"
     437#define CONFIG_PROCESS_DISPLAY_BUF_SIZE     128        // display one process on one line
     438
     439////////////////////////////////////////////////////////////////////////////////////////////
     440//                          PHYSICAL MEMORY MANAGEMENT         
     441////////////////////////////////////////////////////////////////////////////////////////////
     442
     443#define CONFIG_PPM_PAGE_SIZE          4096          // physical page size (bytes)
     444#define CONFIG_PPM_PAGE_ORDER         12            // ln(physical page size)
     445#define CONFIG_PPM_PAGE_MASK          0x00000FFF    // physical page mask     
     446#define CONFIG_PPM_MAX_ORDER          16            // ln(total number of pages per cluster)
     447#define CONFIG_PPM_MAX_RSVD           32            // max reserved zones on the machine
     448
     449#define CONFIG_PPM_PAGE_ALIGNED       __attribute__((aligned(CONFIG_PPM_PAGE_SIZE)))
     450
     451////////////////////////////////////////////////////////////////////////////////////////////
     452//                              RANDOM NUMBERS
     453////////////////////////////////////////////////////////////////////////////////////////////
     454
     455#define CONFIG_RDNG_PARAM_A                 65519
     456#define CONFIG_RDNG_PARAM_C                 64037
     457
     458////////////////////////////////////////////////////////////////////////////////////////////
     459//                             REMOTE PROCEDURE CALL
     460////////////////////////////////////////////////////////////////////////////////////////////
     461
     462#define CONFIG_RPC_FIFO_SLOTS                   16
     463#define CONFIG_RPC_FIFO_MAX_ITERATIONS      1024
     464#define CONFIG_RPC_THREADS_MAX              4       // max number of RPC threads per core
     465
     466////////////////////////////////////////////////////////////////////////////////////////////
     467//                                SCHEDULING
     468////////////////////////////////////////////////////////////////////////////////////////////
     469
     470#define CONFIG_SCHED_TICKS_PER_SECOND       1        // number of TICKS per seconds   
     471#define CONFIG_SCHED_TICKS_PER_QUANTUM      1        // number of ticks between scheduling
     472#define CONFIG_SCHED_MAX_THREADS_NR         32       // max number of threads per core
     473#define CONFIG_SCHED_IDLE_MODE_SLEEP        0        // idle thread use sleep mode if non 0
     474
     475////////////////////////////////////////////////////////////////////////////////////////////
     476//                                TCP/UDP/IP
     477////////////////////////////////////////////////////////////////////////////////////////////
     478
     479#define CONFIG_SOCK_ISS_CLIENT        0x10000      // initial sequence number for TCP client
     480#define CONFIG_SOCK_ISS_SERVER        0x20000      // initial sequence number for TCP server
     481#define CONFIG_SOCK_MAX_WINDOW        0xFFFFF      // initial window (bytes) for TCP
     482#define CONFIG_SOCK_RETRY_TIMEOUT     1000000      // number of cycles before retry for TCP
     483#define CONFIG_SOCK_QUEUES_DEPTH      4            // max number of packets in RX/TX queues
     484#define CONFIG_SOCK_RX_BUF_ORDER      20           // ln( number of bytes in socket rx_buf )
     485#define CONFIG_SOCK_TX_BUF_ORDER      20           // ln( number of bytes in socket tx_buf )
     486#define CONFIG_SOCK_R2T_BUF_SIZE      8            // max number of requests in R2T queue
     487#define CONFIG_SOCK_CRQ_BUF_SIZE      8            // max number of requests in CRQ queue
     488#define CONFIG_SOCK_PKT_BUF_SIZE      2048         // max length for one ETH/IP/TCP packet
     489#define CONFIG_SOCK_PAYLOAD_MAX       1500         // max user payload length for packet
     490
     491////////////////////////////////////////////////////////////////////////////////////////////
     492//                                 THREADS
     493////////////////////////////////////////////////////////////////////////////////////////////
     494
     495#define CONFIG_THREADS_MAX_PER_CLUSTER      32       // max threads per cluster per process
     496#define CONFIG_THREAD_DESC_SIZE             0x4000   // thread desc size (with kernel stack)
     497#define CONFIG_THREAD_DESC_ORDER            14       // ln( number of bytes )
    402498
    403499////////////////////////////////////////////////////////////////////////////////////////////
     
    419515#define CONFIG_MAPPER_GRDXT_W2              7          // number of bits for RADIX_TREE_IX2
    420516#define CONFIG_MAPPER_GRDXT_W3              7          // number of bits for RADIX_TREE_IX3
    421 
    422 ////////////////////////////////////////////////////////////////////////////////////////////
    423 //                              FBF WINDOWS       
    424 ////////////////////////////////////////////////////////////////////////////////////////////
    425 
    426 #define CONFIG_FBF_WINDOWS_MAX_NR           64         // max number of windows
    427 #define CONFIG_FBF_WINDOWS_MAX_WIDTH        1024       // max number of pixels in FBF line
    428 #define CONFIG_FBF_WINDOWS_MAX_HEIGHT       1024       // max number of lines in FBF
    429 
    430 ////////////////////////////////////////////////////////////////////////////////////////////
    431 //                                  DQDT       
    432 ////////////////////////////////////////////////////////////////////////////////////////////
    433 
    434 #define CONFIG_DQDT_LEVELS_NR               5
    435 
    436 ////////////////////////////////////////////////////////////////////////////////////////////
    437 //                              RANDOM NUMBERS
    438 ////////////////////////////////////////////////////////////////////////////////////////////
    439 
    440 #define CONFIG_RDNG_PARAM_A                 65519
    441 #define CONFIG_RDNG_PARAM_C                 64037
    442 
    443 ////////////////////////////////////////////////////////////////////////////////////////////
    444 //                                SCHEDULING
    445 ////////////////////////////////////////////////////////////////////////////////////////////
    446 
    447 #define CONFIG_SCHED_TICK_MS_PERIOD         10000    // number of milliseconds per period
    448 #define CONFIG_SCHED_TICKS_PER_QUANTUM      1        // number of ticks between scheduling
    449 #define CONFIG_SCHED_MAX_THREADS_NR         32       // max number of threads per core
    450 #define CONFIG_SCHED_IDLE_MODE_SLEEP        0        // idle thread use sleep mode if non 0
    451 
    452 ////////////////////////////////////////////////////////////////////////////////////////////
    453 //                                 THREADS
    454 ////////////////////////////////////////////////////////////////////////////////////////////
    455 
    456 #define CONFIG_THREADS_MAX_PER_CLUSTER      32       // max threads per cluster per process
    457 #define CONFIG_THREAD_DESC_SIZE             0x4000   // thread desc size (with kernel stack)
    458 #define CONFIG_THREAD_DESC_ORDER            2        // ln( number of 4K pages )
    459 
    460 ////////////////////////////////////////////////////////////////////////////////////////////
    461 //                             REMOTE PROCEDURE CALL
    462 ////////////////////////////////////////////////////////////////////////////////////////////
    463 
    464 #define CONFIG_REMOTE_FIFO_SLOTS                    16
    465 #define CONFIG_REMOTE_FIFO_MAX_ITERATIONS   1024
    466 #define CONFIG_RPC_THREADS_MAX              4       // max number of RPC threads per core
    467517
    468518////////////////////////////////////////////////////////////////////////////////////////////
     
    479529#define CONFIG_VMM_ARGS_SIZE          0x000001      // args vseg size         : 4   Kbytes
    480530#define CONFIG_VMM_ENVS_SIZE          0x000004      // envs vseg size         : 16  Kbytes
    481 #define CONFIG_VMM_STACK_SIZE         0x001000      // single stack vseg size : 16  Mbytes
    482 
    483 #define CONFIG_VMM_HEAP_MAX_ORDER     18           // max size of MMAP vseg  :  1   Gbytes
    484 
    485 ////////////////////////////////////////////////////////////////////////////////////////////
    486 //                      PHYSICAL MEMORY MANAGEMENT         
    487 ////////////////////////////////////////////////////////////////////////////////////////////
    488 
    489 #define CONFIG_PPM_PAGE_SIZE          4096          // physical page size (bytes)
    490 #define CONFIG_PPM_PAGE_SHIFT         12            // physical page shift (bits)
    491 #define CONFIG_PPM_PAGE_MASK          0x00000FFF    // physical page mask     
    492 #define CONFIG_PPM_MAX_ORDER          16            // ln(total number of pages per cluster)
    493 #define CONFIG_PPM_HEAP_ORDER         10            // ln(number of heap pages per cluster)
    494 #define CONFIG_PPM_MAX_RSVD           32            // max reserved zones on the machine
    495 
    496 #define CONFIG_PPM_PAGE_ALIGNED       __attribute__((aligned(CONFIG_PPM_PAGE_SIZE)))
     531#define CONFIG_VMM_STACK_SIZE         0x000100      // single stack vseg size : 1   Mbytes
     532
     533#define CONFIG_VMM_HEAP_MAX_ORDER     18            // max size of MMAP vseg  : 1   Gbytes
    497534
    498535////////////////////////////////////////////////////////////////////////////////////////////
     
    502539#define CONFIG_PRINTK_BUF_SIZE        0x800        // max length of a formated string
    503540#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
    508541
    509542////////////////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.