56 | | 1. The '''utils''' vzone is located in the lower part of the virtual space. It contains the three vsegs ''kentry'', ''args'', ''envs'', whose sizes are defined by configuration parameters. The ''kentry'' vseg has CODE type and contains the code that must be executed to enter the kernel from user space. The ''args'' vseg has DATA type, and contains the process main() thread arguments. The ''envs'' vseg has DATA type and contains the process environment variables. |
57 | | 1. The '''elf''' zone is located on top of the '''utils''' vzone. It is defined by the CONFIG_USER_ELF_BASE and CONFIG_USER_ELF_SIZE parameters. It contains the ''text'' vseg (CODE type) and ''data'' vseg (DATA type) defining the process binary code and global data. The actual vsegs sizes are defined in the .elf file and reported in the boot_info structure by the boot loader. |
58 | | 1. The '''HEAP''' vzone is located on top of the '''elf''' vzone. It is defined by the CONFIG_USER_HEAP_BASE and CONFIG_USER_HEAP_SIZE parameters. It contains one single ''heap'' vseg, used by the malloc() library. |
59 | | 1. The '''mmap''' vzone is located on top of the '''heap''' vzone. It is defined by the CONFIG_USER_MMAP_BASE and CONFIG_USER_MMAP_SIZE parameters. It contains all vsegs of type ANON, FILE, or REMOTE that are dynamically allocated / released by the user application. The VMM implements a specific MMAP allocator for this zone. |
60 | | 1. The '''stack''' vzone has a fixed size, defined by configuration parameters as CONFIG_USER_STACK_SIZE * CONFIG_PTHREAD_MAX_NR. It is located in the upper part of the virtual space. It contains an array of fixed size slots, and each slot contain one ''stack'' vseg. In each slot the first page is not mapped to detect stack overflow. |
| 56 | 1. The '''utils''' zone is located in the lower part of the virtual space. It contains the three vsegs ''kentry'', ''args'', ''envs'', whose sizes are defined by configuration parameters. The ''kentry'' vseg has CODE type and contains the code that must be executed to enter the kernel from user space. The ''args'' vseg has DATA type, and contains the process main() thread arguments. The ''envs'' vseg has DATA type and contains the process environment variables. |
| 57 | 1. The '''elf''' zone is located on top of the '''utils''' zone. It is defined by the CONFIG_USER_ELF_BASE and CONFIG_USER_ELF_SIZE parameters. It contains the ''text'' vseg (CODE type) and ''data'' vseg (DATA type) defining the process binary code and global data. The actual vsegs sizes are defined in the .elf file and reported in the boot_info structure by the boot loader. |
| 58 | 1. The '''heap''' zone is located on top of the '''elf''' zone. It is defined by the CONFIG_USER_HEAP_BASE and CONFIG_USER_HEAP_SIZE parameters. It contains one single ''heap'' vseg, used by the malloc() library. |
| 59 | 1. The '''mmap''' zone is located on top of the '''heap''' zone. It is defined by the CONFIG_USER_MMAP_BASE and CONFIG_USER_MMAP_SIZE parameters. It contains all vsegs of type ANON, FILE, or REMOTE that are dynamically allocated / released by the user application. The VMM implements a specific MMAP allocator for this zone. |
| 60 | 1. The '''stack''' zone is on top of the '''mmap''' zone. It is defined by the CONFIG_USER_STACK_BASE * CONFIG_USER_STACK_SIZE parameters. It contains an array of fixed size slots, and each slot contain one ''stack'' vseg. In each slot the first page is not mapped to detect stack overflow. |