The entry root
Live delegated service tracking and restart supervision in the root core .
Tracks the delegated system services (disk_processes, principals, devices, settings, powerbox, plans, recipes, projects) by their closed Role so the root core advances supervision generations and enforces bounded restart windows cleanly whenever a delegated service stops.
root module with an entry
- Hash
ee3f69d0ef0e54325b2c1e6675bf7c1385a7bb3dba14b7e53e5aa80aa37bab6f- Size
951201 bytes- Exports
0- Imports
0- Imported by
0- License
- MIT
Live delegated service tracking and restart supervision in the root core
| Fact | Value |
|---|---|
| Kind | Modules with an entry |
| Source | src/modules/system/root |
| Boot image | yes: in the boot image, 951201 bytes in this build |
| Build settings | none: the defaults of the source |
| Imports | none |
| Imported by | none |
Neighbours
It imports no module, and no module imports it. The module graph shows it with the other modules that have no edge.
Exports
| Export | What it does |
|---|---|
entry() | The entry of the root service: it brings up the system, then answers the root rings of the processes for the life of the machine |
entry
entry()
The entry of the root service: it brings up the system, then answers the root rings of the processes for the life of the machine.
The kernel starts it with the context of the root service: the machine, the boot image, the framebuffer and their values. The entry, in order:
- 1. maps the boot image and the debug image; writes "root: ok, N modules in the boot image";
- 2. takes the screen for the boot display;
- 3. checks the boot image against the system description (trust.odin); a failure stays on the screen and no process starts;
- 4. reads the principals, and seeds the random generator of the system from the sources of the processor; a seed of 32 zero bytes ends the boot;
- 5. creates the pages that it writes for every process: the settings page, the date page, the disk process page, the fresh bytes pages, the replacement table and the client table;
- 6. starts the entropy service when the machine has an entropy device, with no wait for its bytes, and the TPM service when the system is measured into a TPM;
- 7. writes the machine parts page, and, with a TPM service and a data disk, reads the choice of principal 0:
unlockwith no window unseals the machine key, and the disk grant table of principal 0 is read (start_policy_choice.odin); - 8. with a data disk and no rescue, starts the holder of Plans, which reads the current plan of principal 0 from its own store and gives its roles, and waits for its Loaded within the hang bound (plan_at_start.odin);
- 9. starts one start policy, measured into PCR 12 first: the start policy from the disk that principal 0 chose, the default start policy with the list start_list, or, when the boot record asks for it, the rescue start policy with the list rescue_list (start_policy.odin). The start policy asks for each other start: the parts of the system (
input, the compositor) start by their procedures here, each other process with the grants of its start grant set.
With no screen before the first start (modus:screen_presence), this service writes the line "root: no screen: no console, no window; the other services start" once, and the machine parts page has no screen: the processes that start with no screen are a decision of the start list, and this service starts none in place of the console, and refuses a compositor. unlock starts, as a machine key that the TPM releases needs no typing, and when it must have a key typed it writes its line and stops, and it is not started again. A compositor that stops by itself later gives one line and refuses the later windows and terminals; it starts nothing.
A failure in steps 1 to 5, or a refusal of the rights of a part of the system, calls fail: the boot display shows the cause, and the machine waits until it is stopped from outside. A start policy that fails starts the rescue start policy; with no start policy at all, the boot display shows the cause, and the loop runs.
Then one loop runs for ever. It waits on the control ring of the compositor (a start or a stop from the desktop), on the root ring of each process, and on the answers of the network service and of the entropy service, whose bytes it mixes into its generator; every 30 seconds it asks the entropy service for the fresh bytes of the running processes (entropy.odin). It checks each command against the grants of the caller, runs it, and sends a completion. After each pass, reap frees what this service held for the processes that stopped. The root service never returns.
See: The start policy in the repository
- Form
- The entry of the module: one parameter, an address, fixed by the contract.
src/modules/system/root/main.odin:724
Read from the source of the module, as the build reads it to describe the exports (tools/modustool/build/describe.odin).
What the root service gives it
| What | Value | As the root service says |
|---|---|---|
| Grants | none | No row: the kernel starts the root service, and a disk process has the start grant set of its row in the disk grant table of its principal. |
| Other terms of its start grant set | none | |
| Budget that it asks for |
| No MODULE_BUDGET in its source: it asks for the least budget. |
The start grant set is read from start_grant_sets in src/modules/system/root/start_grant_sets.odin. The stated budget is read from the constant MODULE_BUDGET of the source of the module; the build adds the counted parts and writes the sum in the module (tools/modustool/build/budget_count.odin); the root service accepts it up to the largest budget of a process, and adds the limits of processor time and of log records (src/modules/system/root/budgets.odin).
