| 41 | |
| 42 | == 2) User process virtual space organisation == |
| 43 | |
| 44 | The virtual space of an user process P in a given cluster K is split in five zones called ''vzone''. Each vzone contains one or several vsegs. |
| 45 | |
| 46 | 1. The '''utils''' vzone has a fixed size, and 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. These vsegs are set by the kernel each time a new process is created. 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. |
| 47 | |
| 48 | 1. The '''text''' vzone has a variable size, and contains the ''text'' vseg containing the process code. The size is defined in the .elf file and reported in the boot_info structure by the boot loader. |
| 49 | |
| 50 | 1. The '''data''' vzone has a variable size, and contains the ''data'' vseg containing the process global data. The size is defined in the .elf file and reported in the boot_info structure by the boot loader. |
| 51 | |
| 52 | 1. The '''stack''' vzone has a fixed size, and is located in the upper part of the virtual space. It contains as many vsegs of type STACK as the max number of threads for a process in a cluster. The total size is defined as CONFIG_VSPACE_STACK_SIZE * CONFIG_PTHREAD_MAX_NR. |
| 53 | |
| 54 | 1. The '''heap''' vzone has a variable size, and occupies all space between the top of the data vzone and the base of the stack'' zone. It contains all vsegs of type dynamically allocated by the reference VMM manager. |