The program address_space
A program drives its own virtual memory (docs/ARCHITECTURE.md, "The virtual memory of a program").
At its start the program runs its cases, with their numbers:
an arena: a range of 1 GiB of addresses with no memory behind it, whose
pages are committed as the arena grows, with tables of 1, 16 and 256
ranges for each kernel entry;
a sparse table: a fixed base of 1 GiB, 1024 pages committed at random;
decommit: the frames and the pages return to the budget at once, and a
page committed again is zero;
protection: a part of a mapping becomes read only, with the time of the
shoot-down when 1, 2 or 4 processors run threads of the program;
a guard page: a child program writes down its stack into a page with no
access, and the kernel stops it there;
large pages: random reads over 64 MiB of one object, through a mapping
of large pages and through a mapping of pages of 4 KiB;
the refusals, each with its error record.
The window shows the numbers. The log has one line for each case and a line "address_space: ok, ..." when each check holds. The checks do not depend on the load of the host.
The program needs the machine with the right Inspect (its own mappings) and the boot image (its child).
| Fact | Value |
|---|---|
| Source | programs/address_space |
| Boot image | in the boot image; the image is not built, so its size is not known |
| Imports | none |
| Imported by | none |
Exports
| Export | What it does |
|---|---|
| entry() |
Read from the source of the module, as the build reads it to describe the exports (tools/kerneltool/describe.odin).
What the root service gives it
| What | Value | As the root service says |
|---|---|---|
| Grants | {.Inspect, .Image} | It reads its own mappings, and starts its child from the boot image. |
| Budget: pages, programs, threads | {pages = 40960, programs = 2, threads = 6} | 64 MiB of large pages, two ranges of 1 GiB with their page tables, a child. |
Read from grants_of and things_of in programs/root/main.odin; budget_of in the same file adds the limits of processor time and of log records.
