The context of a program
The one record that a program receives when it starts: 16 handles and 24 values. A role is a place of the record with a meaning.
The roles that the system fixes for each program
| Constant | Place | Handle or value | What the file says |
|---|---|---|---|
CONTEXT_LOG | 14 | handle | The two roles that the system fixes for each program. A handle that the program was not granted is 0. The log of the kernel. |
CONTEXT_VALUE_SEED | 9 | value | The values 9 to 12: the random seed of the program, 32 bytes, that its starter writes (docs/RANDOMNESS.md). A start with a seed of zeros is refused. The root service has none: it gathers its own. A program does not use the values 9 to 12 for another role. |
CONTEXT_VALUE_SEED_STRENGTH | 16 | value | The value 16: the strength of the seed of the system, from which the seed of the program comes (support/random, Seed_Strength): 1 weak (the cycle counter only), 2 processor (rdrand), 3 entropy (rdseed). The starter writes it with the seed. |
CONTEXT_VALUE_SETTINGS_BOOT_PASS | 17 | value | The value 17: the program `settings` runs its boot pass (1): it reads the settings kept in its store, writes the settings page, and stops, with no window (contract:settings). |
CONTEXT_VALUE_SECOND_POINTER_THEME_ADDRESS | 18 | value | The values 18 and 19: the address and the size of the second pointer theme file that the root service gives the compositor (the theme of the system, beside the theme of the owner at the values 6 and 7 of the compositor). The setting "pointer_theme" chooses between the two. |
CONTEXT_VALUE_SECOND_POINTER_THEME_SIZE | 19 | value | |
CONTEXT_VALUE_FIXED_RANGES_MAPPED | 20 | value | The value 20: a set of bits, bit n for the member n of the fixed ranges (contract:fixed_addresses, Fixed_Range): the ranges that the starter mapped for this program. A set bit is the statement of the starter that the range is mapped; a program reads nothing at a fixed range whose bit is clear. It is a value of the context, which only the starter writes, and not a field of a shared page, which another program can write. The values 21, 22 and 23 have no role. |
CONTEXT_BUDGET | 15 | handle | The budget of the program. |
ROOT_MACHINE | 0 | handle | The roles of the first program (the root service). |
ROOT_FRAMEBUFFER | 1 | handle | |
ROOT_BOOT_IMAGE | 2 | handle | |
ROOT_LOG_RECORDS | 3 | handle | Memory, with Read: the records of the log. |
ROOT_VALUE_WIDTH | 0 | value | |
ROOT_VALUE_HEIGHT | 1 | value | |
ROOT_VALUE_PIXELS_PER_LINE | 2 | value | |
ROOT_VALUE_FORMAT | 3 | value | |
ROOT_VALUE_BOOT_IMAGE_SIZE | 4 | value |
Read from contract/operation/operation.odin.
The roles of a program that the root service starts
| Constant | Place | Handle or value | What the file says |
|---|---|---|---|
GRANT_DISPLAY | 0 | handle | The roles of the context of a program that the root service starts. A handle that the program was not granted is 0. Memory: the ring to the compositor. |
GRANT_ROOT | 1 | handle | Memory: the ring to the root service, to start and stop programs. |
GRANT_MACHINE | 2 | handle | The machine, with the rights of the role: Inspect, or Inspect and Stop. |
GRANT_IMAGE | 3 | handle | Memory: the boot image, to list the modules. |
GRANT_LOG_RECORDS | 4 | handle | Memory, with Read: the records of the log. |
GRANT_SERVICE | 5 | handle | Memory: the service ring. The root service names each connection of a caller on it. |
GRANT_REPLACEMENTS | 10 | handle | Memory, with Read: the replacement table of the machine (Replacement_Table). 6 to 9 are the terminal and the store (packages terminal, storage). |
GRANT_VALUE_IMAGE_SIZE | 0 | value | |
GRANT_VALUE_FILE_ADDRESS | 1 | value | A service: where the file of the program is, read-only (the descriptions of its exports). |
GRANT_VALUE_FILE_SIZE | 2 | value |
Read from support/system/grants.odin.
