Fixed ranges
The addresses of the mappings that the system gives a process: one slot of the band for each range, so that no two ranges overlap.
The fixed addresses of the mappings that the system gives a process: one table of named ranges. The owner of each range (the contract that describes what is mapped there) takes its address from here.
One process can receive several of these mappings at one time: the root service gives each process with a surface the settings page, the font outlines and the date page, and the same process can also have the files of its modules, a storage file or the pointer themes. So no two ranges overlap.
The enumeration Fixed_Range is the table, and the only place of a range: the range of a member is the slot of its number, and each named address below is the address of a member. A new range is a new member; an address written another way is not a fixed range. So two ranges cannot overlap, and the compiler checks that the band holds every member.
An address of the band has no other source than this table. No other file computes an address from BAND_START or SLOT:
modustool checkrefuses a file of kernel, contract, support, private or modules outside this folder that names them (tools/modustool/checks/fixed_addresses_check.odin).A mapping that a process places by its own choice goes outside the band, at OWN_CHOICE_START or after. The modules that a process loads end at MODULES_END or before: src/library/modus/system (load.odin) refuses a module that passes it.
Example: the settings page of each process with a surface is at
SETTINGS_PAGE_ADDRESS, 0x0000_3200_0000_0000: the slot 2 of the band. A process reads it only when the bitSettings_Pageofranges_mapped(&ctx.values)is set.See fixed range and mapped ranges.
The comment above package fixed_addresses in src/library/modus/contract/fixed_addresses/fixed_addresses.odin.
The band starts at 0x0000300000000000; each slot is 0x10000000000 bytes (1 TiB) from the start of the one before. The table gives the slot of each range, its address, and what is mapped there.
The table of the fixed ranges: a new range is a new member, and its address is its slot. A constant written by hand in the band, with no member, is not a fixed range, and the check of the tool refuses it.
A starter maps a range in its child before the child runs. For the settings page, the font outlines, the date page, the debug image, the disk process page and the fresh bytes page, it also sets the bit of the range in the value 20 of the context of the child (
range_mapped_add). The child reads nothing at a range whose bit is clear (ranges_mapped): an address that is not mapped faults at the first read, and the bit tells the child before it reads. The other ranges come with their size in a value of the context.The value of each member is its slot and its bit in the value 20 of the context, which crosses the border between a starter and its child, so each value is written. A range that leaves keeps its number free: the slots 3, 4, 5, 9, 10 and 13 name no member (the first five held the glyph caches of the boot image), and the border refuses their bits, so a module of an earlier build never takes another range for one.
The comment above Fixed_Range in src/library/modus/contract/fixed_addresses/fixed_addresses.odin.
| Slot | Range | Address | What is mapped there |
|---|---|---|---|
| 0 | Module_Files | 0x0000300000000000 | The files of a module and of its imports, in the process that runs the module (modus:contract/isolated). A call host finds there, read-only, the module that it runs, its imports and the replacement records, as one list in the form of the boot image. The console or the root service maps them before the call host starts, and states their size in the values of its context: a call host has no handle to the boot image, so it cannot look for them. |
| 1 | Pointer_Themes | 0x0000310000000000 | The pointer themes of the compositor, one after the other (src/modules/system/root). The root service maps the theme files of the boot image there, read-only, in the compositor, and gives the address and the size of each one in the values of its context. |
| 2 | Settings_Page | 0x0000320000000000 | The settings page (modus:contract/settings). One page, read-only, that the process settings writes and every process with a surface or a terminal reads: the value of each setting of the machine. The root service maps it. A process reads a change at its next read of the page, with no message. |
| 6 | Date_Page | 0x0000360000000000 | The date page (modus:contract/date). One page, read-only, that the process date writes from the real-time clock: each process reads the date of the day there with no call. The root service maps it. |
| 7 | Storage_File | 0x0000370000000000 | The file of the storage service (src/library/modus/storage). The file of the module of the storage service, read-only, in a process that the root service connects to the storage service at its start: the process reads the descriptions of the exports there. The root service maps it, and gives its size at the value 3 of the context. |
| 8 | Module_Tables | 0x0000380000000000 | The tables of the parameters of one export, in the process that receives the call (modus:contract/isolated). A receiver maps the memory object of each table parameter there for the time of one call: the parameter n at TABLE_ADDRESS plus n times 16 GiB. The same addresses at each call cost no new page tables, where an address that the kernel chooses would. |
| 11 | Debug_Image | 0x00003B0000000000 | The debug image, read-only: the debug objects of the modules, by the hash of each module (modus:contract/debug_object). The root service maps it in a process that prints stop reports, as the console, and gives its size at the value 21 of the context. The report then names the procedure and the line of each frame. |
| 12 | Disk_Process_Page | 0x00003C0000000000 | The disk process page (modus:contract/disk_process_page). One page, read-only, that the root service writes: the nickname and the hash of each disk process that runs, by its process slot. The root service maps it in each process that it starts with the right Inspect of the machine, as the monitor. |
| 14 | Font_Outlines | 0x00003E0000000000 | The font outlines, read-only (modus:contract/font_outlines). The font files of the system, one resource of the boot image: each process draws from them each glyph of its text into its private glyph cache. The root service maps it beside the settings page. |
| 15 | Fresh_Bytes_Page | 0x00003F0000000000 | The fresh bytes page of the process, read-only (modus:contract/fresh_bytes). The root service writes there, now and then, 32 bytes of its stream for this process alone, after a read of the entropy device; the random generator of the process mixes them into its key. |
| 16 | Start_Policy_Pages | 0x0000400000000000 | The machine parts page, then the start list, read-only, in a start policy (modus:contract/start_list). The root service writes the machine parts page once, before the start policy starts, and maps the list that the start policy reads after it: a resource of the boot image, with its size in a value of the context. |
| 17 | Edit_Target_Page | 0x0000410000000000 | The target store name and object path, read-only, in an editor started with edit(store, name) (modus:contract/root_ring). One page, read-only, that the root service writes before the editor starts when a principal opens an object of a store with edit(store, name). |
Read from src/library/modus/contract/fixed_addresses/fixed_addresses.odin.
SETTINGS_PAGE_ADDRESS constant of the package fixed_addresses
SETTINGS_PAGE_ADDRESS :: BAND_START + SLOT * u64(Fixed_Range.Settings_Page)
A constant with no comment in its source.
src/library/modus/contract/fixed_addresses/fixed_addresses.odin:172
range_mapped_add procedure of the package fixed_addresses
range_mapped_add :: proc "contextless" (values: ^[op.CONTEXT_VALUES]u64, range: Fixed_Range)
range_mapped_add is for a starter: it states in the values of its child.
src/library/modus/contract/fixed_addresses/fixed_addresses.odin:160
ranges_mapped procedure of the package fixed_addresses
ranges_mapped :: proc "contextless" (values: ^[op.CONTEXT_VALUES]u64) -> Fixed_Ranges
ranges_mapped gives the ranges that the starter of a process mapped for.
src/library/modus/contract/fixed_addresses/fixed_addresses.odin:153
TABLE_ADDRESS constant of the package isolated
TABLE_ADDRESS :: fixed_addresses.MODULE_TABLES_ADDRESS
Where a receiver maps the memory object of table parameter n for the.
