modus
Menu

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

ConstantPlaceHandle or valueWhat the file says
CONTEXT_LOG14handleThe 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_SEED9valueThe 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_STRENGTH16valueThe 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_PASS17valueThe 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_ADDRESS18valueThe 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_SIZE19value
CONTEXT_VALUE_FIXED_RANGES_MAPPED20valueThe 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_BUDGET15handleThe budget of the program.
ROOT_MACHINE0handleThe roles of the first program (the root service).
ROOT_FRAMEBUFFER1handle
ROOT_BOOT_IMAGE2handle
ROOT_LOG_RECORDS3handleMemory, with Read: the records of the log.
ROOT_VALUE_WIDTH0value
ROOT_VALUE_HEIGHT1value
ROOT_VALUE_PIXELS_PER_LINE2value
ROOT_VALUE_FORMAT3value
ROOT_VALUE_BOOT_IMAGE_SIZE4value

Read from contract/operation/operation.odin.

The roles of a program that the root service starts

ConstantPlaceHandle or valueWhat the file says
GRANT_DISPLAY0handleThe 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_ROOT1handleMemory: the ring to the root service, to start and stop programs.
GRANT_MACHINE2handleThe machine, with the rights of the role: Inspect, or Inspect and Stop.
GRANT_IMAGE3handleMemory: the boot image, to list the modules.
GRANT_LOG_RECORDS4handleMemory, with Read: the records of the log.
GRANT_SERVICE5handleMemory: the service ring. The root service names each connection of a caller on it.
GRANT_REPLACEMENTS10handleMemory, 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_SIZE0value
GRANT_VALUE_FILE_ADDRESS1valueA service: where the file of the program is, read-only (the descriptions of its exports).
GRANT_VALUE_FILE_SIZE2value

Read from support/system/grants.odin.