modus
Menu
On this page

Types

Each type that the pages of the reference show: 337 types. The size, the alignment, the offsets and the values come from the compiler, which builds this tool with the contract; the declaration, the text and the line come from the source.

struct: 81, enum: 63, bit set: 11, distinct: 11, basic: 14, wire form: 7, record of a module: 150.

Wherever a page shows a type, the name of the type opens its card: a click, a tap, or Enter; a pointer that rests on it opens the card too.

The machine of this page and the target

The tool runs on linux amd64, and its sizes are those of that machine. The system is built for x86-64 with no operating system. A size that the contract asserts with #assert is checked twice: when the tool is built, and when the system is built. A type that holds an address, a slice, a string, int or uintptr says so on its card: its size follows the size of an address of the target, 8 bytes on x86-64.

The package operation

Form

Form :: enum u8 {
	None    = 0, // No parameter.
	Value   = 1, // A number that the form does not check. The operation can check it with another argument: the outcome of `Process_Stop` depends on its target.
	Handle  = 2, // A handle of `kind` (None: any kind) with `rights`.
	Handle_Or_Zero = 3, // The same, or 0: the caller itself, or no handle.
	Address = 4, // An address in the process.
	Count   = 5, // A count. `limit`: the largest, or 0.
	Flags   = 6, // A set of flags. `limit`: the flags that the operation knows.
	Choice  = 7, // A value of an enumeration. `limit`: the largest.
	Bounded = 8, // A number that is neither a count nor a choice, from 0 to `limit`: the code of `Machine_Stop`.
}

The form of one parameter of a kernel operation: what the kernel checks on it before the operation, and how a sentence names its value.

The kernel reads it in src/modulus/diagnose.odin to find which argument of a failed operation is wrong; src/library/modus/sentence reads it to say the argument by its name and its value in its form.

Kind
enum
Package
src/library/modus/contract/operation
Size
1 byte
Alignment
1 byte
Base type
Named by
Source
src/library/modus/contract/operation/forms.odin:14
MemberValueHexadecimal
None00x0
Value10x1
Handle20x2
Handle_Or_Zero30x3
Address40x4
Count50x5
Flags60x6
Choice70x7
Bounded80x8

Parameter_Form

Parameter_Form :: struct {
	name:   string, // The name of the parameter, as the comment of the operation names it: "budget", "pages".
	form:   , // What the value is.
	kind:   , // For a handle: the kind of object that it must name. `None`: any kind.
	rights: , // For a handle: the rights that it must have.
	limit:  u64, // For a count, a set of flags, a choice or a bounded value: the bound that the comment of `Form` gives. 0: none.
}

One parameter of a kernel operation, as OPERATIONS describes it.

Example: the first parameter of Memory_Create is {"budget", .Handle, .Budget, {.Spend}, 0}: a budget handle with Spend.

Kind
struct
Package
src/library/modus/contract/operation
Size
32 bytes
Alignment
8 bytes
Padding
2 bytes
On the target
string has the size of an address of the target: the sizes here are those of linux amd64, where the page was made
Source
src/library/modus/contract/operation/forms.odin:30
FieldTypeOffsetSize
name016
form161
kind171
padding182
rights204
limit248

30 bytes of fields and 2 bytes of padding: 32 bytes.

Operation_Form

Operation_Form :: struct {
	name:       string, // The name of the operation, as `Operation` names it.
	parameters: [7], // In the order of the values of the command record.
}

One kernel operation, as a sentence names it: its name and its seven parameters, in the order of the values of its command record. A parameter with the form None is a value that the operation does not take.

Kind
struct
Package
src/library/modus/contract/operation
Size
240 bytes
Alignment
8 bytes
Padding
0 bytes
On the target
string has the size of an address of the target: the sizes here are those of linux amd64, where the page was made
Source
src/library/modus/contract/operation/forms.odin:41
FieldTypeOffsetSize
name016
parameters[7]Parameter_Form16224

240 bytes of fields and 0 bytes of padding: 240 bytes.

Error_Details_Place

Error_Details_Place :: struct {
	address:  u64, // The first record, in memory of the process.
	count:    u64, // On the command, the records already there; after a refusal, the count of the full answer.
	capacity: u64, // The records that fit at `address`.
}

The table place of the error details of a command: the layout of system.Error_Details, an Append table of . The kernel writes the records count ..< capacity that fit, and sets count to the count of the full answer: a count above the capacity says that details did not fit.

Kind
struct
Package
src/library/modus/contract/operation
Size
24 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/error_details.odin:32
FieldTypeOffsetSize
address08
count88
capacity168

24 bytes of fields and 0 bytes of padding: 24 bytes.

Time_Record

Time_Record :: struct {
	// Since the kernel made the time page. It never goes back. The kernel
	// writes it at each tick of its timer, from the cycle counter: a tick
	// that comes late loses no time, and the value is at most one tick old.
	milliseconds: u64,
	// Cycles of the cycle counter in one second. It does not change after
	// boot.
	cycle_frequency: u64,
	// The cycle counter at the time 0. It does not change after boot. A
	// process that needs a time finer than one millisecond reads the cycle
	// counter, subtracts this, and divides by the frequency.
	cycle_start: u64,
}

The record at TIME_ADDRESS. A process reads milliseconds with one load of 64 bits: the value is always complete.

The kernel is the one writer; a process maps the page read only. The clock that it gives is the clock of the machine since boot: it is not a date (the date page gives the date). system.time reads milliseconds.

Example: a process that reads milliseconds = 5230 5.23 seconds after the kernel made the page; with cycle_frequency = 2_000_000_000, a cycle count of cycle_start + 3_000_000 is 1.5 ms after the time 0.

Kind
struct
Package
src/library/modus/contract/operation
Size
24 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:129
FieldTypeOffsetSize
milliseconds08
cycle_frequency88
cycle_start168

24 bytes of fields and 0 bytes of padding: 24 bytes.

Handle

Handle :: distinct u32

A handle: the number by which one process names one kernel object, with the rights that it holds on it. 0 names no object.

A handle names a slot of the handle table of its process: the same number in another process names another object, or none. Its low 16 bits are the index of the slot, and the next 16 bits a generation that changes at each close of the slot: an old number of a closed handle names no new object, and gives Bad_Handle. A process gets a handle from an operation that makes an object (Memory_Create), from its starter in its Context, or from another process with Handle_Give. The kernel checks each handle argument: a handle that names no object of the kind that an operation needs gives Bad_Handle; a handle with too few rights gives No_Right. Handle_Close ends a handle; an object ends when no handle and no mapping names it. See handle and .

Example: the log handle of a process is context.handles[CONTEXT_LOG].

See: Architecture: Handle table

Kind
distinct
Package
src/library/modus/contract/operation
Size
4 bytes
Alignment
4 bytes
Base
Source
src/library/modus/contract/operation/operation.odin:160

Right

Right :: enum u32 {
	Give    = 0, // Each kind: give a copy of the handle to another process.
	Read    = 1, // Memory: map it; the memory of the log: also copy the own log ring of a process (Log_Read). Process, Thread: read its state. Interrupt: read its count. Budget: read what it holds (Budget_Read).
	// Memory: map it with Write. Log: write text on the log. Thread: write its registers and its extended state
	// while it is held (Thread_Control): full control of the code that its process runs.
	Write   = 2,
	Execute = 3, // Memory: map it with Execute.
	// Process: map memory in it, give handles to it, start it, stop it. Thread: end it, make it the fault handler,
	// write its weight and its request (Thread_Control).
	Control = 4,
	// Machine: read the reports. Thread: hold it and release it, and read its registers, its extended state and its
	// schedule (Thread_Control): what a sampling profiler needs, and no write.
	Inspect = 5,
	Devices = 6, // Machine: create device handles.
	Stop    = 7, // Machine: stop the machine.
	Spend   = 8, // Budget: create objects with it, and take a part of it for a new budget.
	Physical = 9, // Machine: read the physical address of a memory object (Memory_Physical).
	// Machine: change the scheduling strategy of the machine (Strategy_Set), and the weight, the request, the
	// two weight limits and the placement of any thread (Thread_Control).
	Schedule = 10,
	// Budget: pay pages of a memory object that this budget already pays for (Memory_Commit), and nothing else: no
	// object, thread, process or budget is created with it. The narrow form of Spend, to give to another process.
	Commit = 11,
	// Machine: give the event table of the machine (Events_Set): the kernel then writes records of its own work,
	// for every process or for the processes that the rules name, into memory of the caller.
	Events = 12,
	// Process: debug it. The holder becomes the debugger of the process (Fault_Handler_Set with the process
	// handle): it receives its debug exceptions and its breakpoints, holds its threads by their numbers, reads
	// and writes their registers and their breakpoints, and reads the memory of the process (Thread_Control).
	// The handle of a new process has it; the root service gives it to no process at its start.
	Debug = 13,
	// Machine: count the events of the processor for the code of the calling thread (Thread_Control, the
	// commands of the thread counters). A count of the misses of a shared cache measures what other processes do,
	// so it is a grant, as a precise clock is (src/md/features/processor_counters.md).
	Counters = 14,
}

A right: one kind of operation that a handle permits on its object. The handle of a new object has each right of its kind. Handle_Give copies a handle with a part of its rights. No operation adds a right to a handle.

One name serves several kinds of objects: the comment of each member says what it permits on each kind. A right that has no meaning for the kind of the object permits nothing. Handle_State gives the rights of a handle. In the comment of each operation the rights that it needs are in bold. See right.

Example: a starter gives a process read-only memory with Handle_Give and the rights {.Read}: the process maps it with no Write and gives no copy of it, because it has no Give.

Kind
enum
Package
src/library/modus/contract/operation
Size
4 bytes
Alignment
4 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:175
MemberValueHexadecimal
Give00x0
Read10x1
Write20x2
Execute30x3
Control40x4
Inspect50x5
Devices60x6
Stop70x7
Spend80x8
Physical90x9
Schedule100xA
Commit110xB
Events120xC
Debug130xD
Counters140xE

Rights

Rights :: bit_set[;u32]

The rights of one handle, as a set: bit n is the Right n. It is the form in which an operation takes and gives rights (Handle_Give, Handle_State).

Kind
bit set
An alias of
bit_set[Right; u32]
Package
src/library/modus/contract/operation
Size
4 bytes
Alignment
4 bytes
Underlying type
Element
Named by
Source
src/library/modus/contract/operation/operation.odin:214
BitMemberMask
0Give0x1
1Read0x2
2Write0x4
3Execute0x8
4Control0x10
5Inspect0x20
6Devices0x40
7Stop0x80
8Spend0x100
9Physical0x200
10Schedule0x400
11Commit0x800
12Events0x1000
13Debug0x2000
14Counters0x4000

Object_Kind

Object_Kind :: enum u8 {
	None      = 0, // No object: the handle number is free, or was never given.
	Memory    = 1, // A memory object: pages that a process maps (`Memory_Create`). Rights: Give, Read, Write, Execute.
	Process   = 2, // A process: its addresses, its handles and its threads (`Process_Create`). Rights: Give, Read, Control, Debug.
	Interrupt = 3, // One interrupt line or message interrupt of a device, which wakes the threads of its holder (`Device_Create`). Rights: Give, Read.
	Ports     = 4, // A range of input and output ports of a device (`Device_Create`). Rights: Give.
	Machine   = 5, // The machine: its rights are Give, Inspect, Devices, Stop, Physical, Schedule, Events and Counters.
	Thread    = 6, // One thread of a process (`Thread_Create`). Rights: Give, Read, Write, Control, Inspect.
	Budget    = 7, // A budget: what its holders can still create (`Budget_Create`). Rights: Give, Read, Spend, Commit.
	Log       = 8, // The log of the kernel. Rights: Give, Write. Each process has one at `CONTEXT_LOG`.
}

The kind of the object that a handle names. Handle_State gives it; the kernel checks it at each handle argument.

Kind
enum
Package
src/library/modus/contract/operation
Size
1 byte
Alignment
1 byte
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:218
MemberValueHexadecimal
None00x0
Memory10x1
Process20x2
Interrupt30x3
Ports40x4
Machine50x5
Thread60x6
Budget70x7
Log80x8

Operation

Operation :: enum u32 {
	None           = 0,
	Log            = 1, // (log, address, length, level: Log_Level, runs, form: Log_Record_Form).
	// Writes one text or one log fact on the log of the kernel: records of the log, which a reader with the
	// memory of the log reads, and one line `[name] text` on the serial port. The kernel sets the time, the
	// process and the thread of each record, so a process cannot write a record of another process. The
	// operation writes the records only; the tick of the first processor writes their line on the serial port
	// after it, so a `Log` never waits for the lines of other processes.
	//
	// **Arguments**
	//
	// - `log`: the log handle, with **Write**. Each process has it in its context at `CONTEXT_LOG`.
	// - `address`, `length`: the bytes of the record, in memory that the process can read. For the form `Text`,
	//   the text, at most `LOG_TEXT_BYTES_MOST` bytes. A text longer than `LOG_TEXT_CAPACITY` continues in the
	//   next records (`Log_Record`, `more`). For the form `Fact`, a `Log_Fact_Call` up to the end of its
	//   values: from `LOG_FACT_HEAD_BYTES` to `LOG_FACT_CALL_BYTES_MOST` bytes. The kernel cuts the values in
	//   parts of `LOG_FACT_VALUE_CAPACITY` bytes and writes one record of each part, in a row, each with the
	//   module hash and the key, and `more` but on the last; it writes `value_count`, `part` and `part_count`
	//   of each, and reads no other field.
	// - `level`: a `Log_Level`, from `Info` (0) to `Error` (3).
	// - `runs`: the count of the value runs of the text, at most `LOG_CALL_RUN_LIMIT`; 0 is a plain text. The
	//   runs (`value_kinds.Value_Run_In_Call`) follow the `length` bytes of the text at `address`. A run says
	//   which bytes of the text are one value, and its kind: a reader of the log shows each value in the color
	//   of its kind. The text is written whole in every case: if a run is wrong, the record is plain. A fact
	//   has no runs: 0.
	// - `form`: a `Log_Record_Form`. 0 is `Text`, so a writer of text gives five arguments.
	//
	// **Results**: none.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `log` is not a log handle with **Write**.
	// - `Bad_Address`: `length` is above `LOG_TEXT_BYTES_MOST`, or the process cannot read the text and its runs.
	//   For a fact: `length` is below `LOG_FACT_HEAD_BYTES` or above `LOG_FACT_CALL_BYTES_MOST`, or the
	//   process cannot read the bytes.
	// - `Bad_Operation`: `level` is above `Error`, `runs` is above `LOG_CALL_RUN_LIMIT`, `form` names no
	//   `Log_Record_Form`, or a fact has runs.
	// - `No_Budget`: the budget of the process accepted all the records of its amount in this second
	//   (`Budget_Amounts`, `log_records`). No other budget counts the record, so the refusal says nothing of
	//   what other processes wrote. A fact counts one record for each of its parts.
	Memory_Create  = 2, // (budget, pages, flags: Memory_Flags) -> memory handle.
	// Makes a memory object of `pages` pages of 4096 bytes, and gives a handle to it with each right of
	// memory: **Give**, **Read**, **Write** and **Execute**. The memory is zero. The budget pays now, so an
	// access to the memory never fails for lack of memory.
	//
	// **Arguments**
	//
	// - `budget`: a budget handle with **Spend**. It pays now for each page and for the frame list of the
	//   object (`memory_cost`). A `Contiguous` object has no frame list; an `Uncommitted` object pays its
	//   frame list only, and at least one page.
	// - `pages`: the count of pages, from 1; at most `MEMORY_PAGE_LIMIT` (1 GiB) for an object that is not
	//   contiguous.
	// - `flags`: a `Memory_Flags`:
	//   - `Frames_Now`: each page gets its page frame now, not at its first use (a page on first use);
	//   - `Contiguous`: the frames follow each other in physical memory and do not move, for a device;
	//   - `Uncommitted`: no page is paid now, and `Memory_Commit` pays them later; with no other flag;
	//   - `Large_Pages`: `Contiguous`, in one run aligned on 2 MiB, with `pages` a multiple of
	//     `LARGE_PAGE_PAGES`, so that a mapping uses large pages.
	//
	// **Results**: the memory handle.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `budget` is not a budget handle with **Spend**.
	// - `Bad_Operation`: `pages` is 0, or above the limit; a flag that the kernel does not know;
	//   `Uncommitted` with another flag; `Large_Pages` with a count that is not a multiple of
	//   `LARGE_PAGE_PAGES`.
	// - `No_Budget`: the budget cannot pay.
	// - `No_Slot`: the table of the memory objects of the kernel is full, or the handle table of the process.
	// - `No_Memory`: a contiguous object finds no free run of its length, though the budget can pay.
	//
	// ```odin
	// memory, status := system.memory_create(16, flags = {.Frames_Now})
	// ```
	Memory_Map     = 3, // (memory, process, address, flags: Map_Flags, first, pages) -> address.
	// Maps pages of a memory object in this process or in another process, and gives the address of the
	// first page.
	//
	// **Arguments**
	//
	// - `memory`: a memory handle with **Read**, and **Write** to map with `Write`, **Execute** to map with
	//   `Execute`.
	// - `process`: 0 for this process, or a process handle with **Control**.
	// - `address`: the address of the first page: a multiple of 4096, at least 4096, with the mapping below
	//   `USER_END` and over no other mapping. 0: the kernel chooses the lowest free place from
	//   `CHOSEN_BASE`, with a page with no mapping before and after it, on 2 MiB for an object of
	//   `Large_Pages` that is mapped by whole large pages. With `At_Address_Zero`, the address is 0.
	// - `flags`: a `Map_Flags`: `Write`, `Execute`, `No_Access` (the pages fault until `Memory_Protect`
	//   gives them access), `Receive_Handles` (this process agrees to receive handles through this memory
	//   object from `Handle_Give`), `At_Address_Zero`, or `Write_Combining` (device memory of
	//   `Device_Kind.Memory` that is write-combining, not uncached). No flag: read only. The kernel refuses any other
	//   bit. `Write` with `Execute` needs `No_Access`: no page is writable and executable. Such a switching
	//   mapping gets `Write`, `Execute` or `No_Access` from `Memory_Protect` for the whole mapping, and
	//   the kernel switches each page between `Write` and `Execute` at the fault of the guest. `Write` with `Execute` and
	//   `At_Address_Zero` are guest memory: only for another process that no thread ran
	//   ([a guest](docs/ARCHITECTURE.md#a-guest)), which `Process_Start` then refuses.
	// - `first`: the first page of the object.
	// - `pages`: the count of pages, or 0 for each page from `first` to the end of the object.
	//
	// **Results**: the address of the first page.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `memory` or `process` is not a handle of its kind with its rights.
	// - `No_Right`: also, the process maps in itself at addresses that meet a module record of the
	//   writer `Starter` (`Module_Writer`). The error kind is `Starter_Module`. The kernel checks it before
	//   the other mappings. An address that the kernel chooses meets no such record.
	// - `Bad_State`: the process is stopped; a part of the object has a protection of its own
	//   (`Memory_Protect`): such an object has one mapping only; guest memory for this process, or for
	//   a process that a thread ran; or device memory with a live mapping of another cache type (no cache,
	//   `Write_Combining`, or the entry of a screen) through this object or another object whose physical
	//   pages meet its pages. The error kind is `Object_Shared`.
	// - `Bad_Address`: the pages are not inside the object; the address is not a multiple of 4096, is below
	//   4096 with no `At_Address_Zero`, is not 0 with it, ends above `USER_END`, or meets another mapping.
	// - `Bad_Operation`: `Write` with `Execute` and with no `No_Access`; `Write_Combining` on memory that is
	//   not device memory of `Device_Kind.Memory`, or with `Execute`; or a flag that the kernel does not know, which it refuses
	//   before it reads the handles; or, with the IOMMU in use, `memory` is device memory over the
	//   registers of a device with a domain and `process` names another process: only the holder of the
	//   registers maps them, so that its mappings keep the domain of the device.
	// - `No_Slot`: the process has 128 mappings, or the kernel finds no free place for the address that it
	//   chooses.
	// - `No_Budget`, `No_Memory`: the budget of the process that receives the mapping cannot pay its page
	//   tables, or no page frame is free.
	//
	// ```odin
	// address, status := system.memory_map(memory, flags = {.Write})
	// ```
	Memory_Unmap   = 4, // (process, address).
	// Removes the mapping that starts at an address, in this process or in another process. The memory
	// object ends when no handle and no mapping names it.
	//
	// **Arguments**
	//
	// - `process`: 0 for this process, or a process handle with **Control**.
	// - `address`: the first byte of a mapping, below `THREAD_AREA_BASE`: the thread areas and the time page
	//   stay.
	//
	// **Results**: none.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `process` is not a process handle with **Control**.
	// - `No_Right`: also, the process unmaps in itself a mapping that meets a module record of the writer
	//   `Starter` (`Module_Writer`). The error kind is `Starter_Module`.
	// - `Bad_State`: the process is stopped.
	// - `Bad_Address`: no mapping starts at the address, or it is a thread area or the time page.
	Memory_Size    = 5, // (memory) -> pages.
	// Gives the count of pages of a memory object.
	//
	// **Arguments**
	//
	// - `memory`: a memory handle, with any rights.
	//
	// **Results**: the count of pages.
	//
	// **Statuses**
	//
	// - `Bad_Handle`: `memory` is not a memory handle.
	Process_Create = 6, // (budget, name, name_length) -> process handle.
	// Makes a process, in the state `Created`, and gives a handle to it with **Give**, **Read** and
	// **Control**. The process has no memory and no handle: its addresses hold the time page only.
	// `Process_Start` starts it.
	//
	// **Arguments**
	//
	// - `budget`: a budget handle with **Spend**. It pays for one process slot, for the page tables of
	//   the process, and for the `OWN_LOG_PAGES` pages of its own log ring, which return to it when the
	//   slot of the process is free. The process keeps it: it pays for its first thread at `Process_Start`, and for each
	//   page table of the process after.
	// - `name`, `name_length`: the name of the process, at most `PROCESS_NAME_BYTES_MOST` bytes, in memory that the process can
	//   read: the reports and the log show it. Each byte is a printable character of ASCII or the
	//   space (32 to 126): a name starts each line of the log on the serial port.
	//
	// **Results**: the process handle.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `budget` is not a budget handle with **Spend**.
	// - `Bad_Address`: `name_length` is above `PROCESS_NAME_BYTES_MOST`, or the process cannot read the name.
	// - `Bad_Operation`: a byte of the name is outside 32 to 126.
	// - `No_Budget`: the budget has no process slot or no page left, or it cannot pay the page tables or
	//   the own log ring.
	// - `No_Slot`: the table of the processes of the kernel is full, or the handle table of the process.
	Process_Start  = 7, // (process, entry, stack, context).
	// Starts a process that `Process_Create` made: its first thread runs at `entry`, and the process goes
	// from `Created` to `Ready`. The budget of the process pays for the thread, as `Thread_Create` does.
	// The first thread gets the limit of a new thread of the calling thread
	// (`new_thread_weight_limit_of_creation`: the smaller of the new-thread weight limit of the calling
	// thread and the one of its process) and the limit of its placement (`Thread_Placement`): a process
	// does not leave a limit by a process that it starts.
	//
	// **Arguments**
	//
	// - `process`: a process handle with **Control**, of a process in the state `Created`.
	// - `entry`: the address of the first instruction, below `USER_END`.
	// - `stack`: the top of the stack, from 8 to `USER_END`; the thread starts with its stack pointer at
	//   `stack` minus 8, as after a call.
	// - `context`: the value of the first register of the thread. By the rule of the system it is the
	//   address of the `Context` of the process (`CONTEXT_ADDRESS`); the kernel does not read it.
	//
	// **Results**: none.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `process` is not a process handle with **Control**.
	// - `Bad_State`: the process is not in the state `Created`, is a guest (`Guest_Run`), or holds guest
	//   memory: a mapping at the address 0, or one with `Write` and `Execute` (`Memory_Map`).
	// - `Bad_Address`: `entry` or `stack` is out of its range.
	// - `No_Budget`: the budget of the process has no thread slot left, or it cannot pay for the thread
	//   area or its page tables.
	// - `No_Slot`: the thread table of the kernel is full, or the process has `THREAD_CAPACITY` threads.
	// - `No_Memory`: no free run of page frames for the thread area.
	Process_Stop   = 8, // (process, outcome: Stop_Outcome, error: Error_Record).
	// Stops a process: this one or another one. Each of its threads ends, and the operation returns when no
	// thread of the process runs an instruction any more. The process is `Stopped` with its stop cause and its
	// stop outcome, which `Process_State` gives. Its handles, its mappings and its memory end when its last
	// thread left its processor. A process that is stopped already keeps its first stop cause and outcome.
	//
	// The kernel records the stop cause from the target, never from the argument: `Itself` when the target is
	// the process that asks (by 0 or by a handle that names it), `Holder` for another process. Only a process
	// that stops itself says what its work gave: a holder cannot forge the end of another process
	// (src/md/api/process_stop.md).
	//
	// **Arguments**
	//
	// - `process`: 0 for this process, or a process handle with **Control**. With 0, the thread that asks
	//   ends with its process: the operation does not return.
	// - `outcome`: for a stop of this process, the word of a `Stop_Outcome` other than `None`: `Done`,
	//   `Failed`, `Refused` or `Stopped_On_Request`. For a stop of another process, 0.
	// - `error`: 0, or the address of a readable `errors.Error_Record` in the caller. A non-zero address is
	//   allowed only when the target is this process and `outcome` is `Failed` or `Refused`, and the copied
	//   record must have a known non-zero `kind` and a known `unit`. For `Done`, `Stopped_On_Request`, and any
	//   holder stop, `error` must be 0.
	//
	// **Results**: none.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `process` is not a process handle with **Control**.
	// - `Bad_Address`: `error` is non-zero and names bytes that the caller cannot read.
	// - `Bad_Operation`: `outcome` names no valid outcome for the target, `error` is non-zero when disallowed,
	//   or the copied error record has an invalid kind or unit. Nothing changes: the target runs on.
	Process_State  = 9, // (process, report: Stop_Report) -> state: Process_State, cause: Stop_Cause, outcome: Stop_Outcome, entries, slot, serial.
	// Gives the state of a process, its stop cause and its stop outcome, its count of kernel entries, and its
	// place in the reports of `Inspect`. With an address, the kernel also writes there where the process
	// stopped on a fault. A reader takes the first three results through `stop_of_words`.
	//
	// The root service states facts of a process that it started by that place: the disk process page names
	// each disk process by its slot and its serial, which the reports of `Inspect` give too
	// (`modus:contract/disk_process_page`).
	//
	// **Arguments**
	//
	// - `process`: a process handle with **Read**.
	// - `report`: 0, or the address of a `Stop_Report` that the process can write: the instruction, the
	//   address of a page fault, the module and the stack trace of the fault that stopped the process. All
	//   zero while the process runs, or when its stop cause is not `Fault`, `Not_Committed` or
	//   `Cannot_Return`.
	//
	// **Results**
	//
	// 1. the `Process_State` of the process: `Created`, `Ready` (one of its threads is ready), `Waiting` or
	//    `Stopped`;
	// 2. its `Stop_Cause`: `None` while it runs;
	// 3. its `Stop_Outcome`: `None` while it runs, and for each stop cause but `Itself`;
	// 4. its kernel entries since its start;
	// 5. its process slot: the index that `Inspect` with the kind `Process` takes for it;
	// 6. its process serial, as `Process_Report.process_serial` gives it: the slot and the serial name this
	//    process and no later one. The kernel keeps both until the last handle of the process closes.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `process` is not a process handle with **Read**.
	// - `Bad_Address`: the process cannot write the `Stop_Report` at `report`.
	Handle_Give    = 10, // (target, handle, rights: Rights) -> the handle in the target.
	// Copies a handle into a process, with a part of its rights: a grant never adds a right. The kernel
	// records where the copy came from (its origin): `Handle_Revoke` of the given handle ends the copy, and
	// when the given handle closes, the copy comes from the origin of the given handle.
	//
	// **Arguments**
	//
	// - `target`: where the copy goes:
	//   - 0: this process, with no right needed;
	//   - a process handle with **Control**: that process;
	//   - a memory handle: the one other process that maps this memory with `Map_Flag.Receive_Handles`.
	//     A process that holds or maps this memory without `Receive_Handles` never receives handles
	//     through it. The kernel keeps, with the copy, the memory object that it came through:
	//     `Handle_State` proves it to the receiver.
	// - `handle`: the handle to give, with **Give** when the target is another process.
	// - `rights`: the rights of the copy are the rights of `handle` that are also in `rights`. A process
	//   handle that goes to the process that it names also loses **Control** and **Give**: a process never
	//   holds the authority of its starter over itself, so it cannot give it to a child that would change
	//   its module records ([the writer of a module record](docs/MODULE_CONTRACT.md#the-writer-of-a-module-record)).
	//
	// **Results**: the number of the copy in the target process.
	//
	// **Statuses**
	//
	// - `Bad_Handle`: `handle` or `target` names nothing; `target` is a handle of another kind; or it is a
	//   memory object that no other process maps, or that two other processes map with `Receive_Handles`.
	// - `No_Right`: `handle` has not **Give**, the process handle `target` has not **Control**, or `target`
	//   is a memory object that another process maps without `Receive_Handles`.
	// - `Bad_State`: the target process is stopped; or `handle` names a memory object with a protection of
	//   its own on a part (`Memory_Protect`), and the target is another process.
	// - `No_Slot`: the handle table of the target process is full.
	//
	// ```odin
	// copy, status := system.give(process, memory, {.Read})
	// ```
	Handle_Close   = 11, // (handle).
	// Closes a handle of this process. What came from it (its copies and its mappings) comes from its origin
	// now. The object ends when nothing names it:
	//
	// - a memory object, when no handle and no mapping names it;
	// - a budget, when its last handle closes: what it holds returns to the budget that it came from, which
	//   pays for its objects;
	// - a process: it stops with the stop cause `Handles_Closed` when its last handle closes;
	// - the event table of the machine, when the last machine handle with **Events** of its process closes.
	//
	// **Arguments**
	//
	// - `handle`: any handle of this process.
	//
	// **Results**: none.
	//
	// **Statuses**
	//
	// - `Bad_Handle`: `handle` names nothing.
	Interrupt_Read = 12, // (interrupt) -> count.
	// Gives the count of the interrupts of a line or of a message interrupt since the last read, and sets
	// it to 0. Each interrupt also adds 1 to the `events` word of the threads of the process that holds the
	// handle, and wakes them.
	//
	// **Arguments**
	//
	// - `interrupt`: an interrupt handle with **Read**.
	//
	// **Results**: the count of interrupts.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `interrupt` is not an interrupt handle with **Read**.
	Device_Create  = 13, // (machine, kind: Device_Kind, a, b) -> handle, address, value.
	// Makes a handle to a part of the machine, for a device service.
	//
	// **Arguments**
	//
	// - `machine`: the machine handle, with **Devices**.
	// - `kind`, `a`, `b`: a `Device_Kind` and its two values:
	//   - `Ports`: `a` the first port, below 65536, and `b` the count, from 1 to 65536 minus `a`: a ports
	//     handle with **Give**; the threads of the process use the ports with `in` and `out`;
	//   - `Interrupt`: `a` a line of the 8259, from 1 to 15: an interrupt handle with **Give** and **Read**;
	//   - `Memory`: `a` the physical address, a multiple of 4096, and `b` the count of pages of the
	//     registers of a device: a memory handle with **Give**, **Read** and **Write**, mapped with no cache.
	//     The range meets no memory that the firmware gave as free or as loaded;
	//   - `Display_Memory`: as `Memory`, for the video memory of a display: the range must hold the
	//     address of the framebuffer of the firmware; the mapping has the page attribute of that
	//     framebuffer, not "no cache", and the object has no requester for the IOMMU;
	//   - `Message`: `a` the physical address where a memory base address register of the device starts:
	//     a message interrupt (MSI-X) of the first processor, for that device: an interrupt handle with
	//     **Give** and **Read**. With interrupt remapping in use, the entry of the message names that device,
	//     and the unit refuses the message to every other device; with none, `a` is not read. Behind a
	//     conventional bridge, the entry names the requester that the devices there share, and it is present
	//     only while their one domain lives (`Memory_Physical`).
	//
	// **Results**
	//
	// 1. the handle;
	// 2. for `Message`: the address that the device writes: the remappable form of the entry with
	//    interrupt remapping of Intel in use, else the compatible form of the first processor; for
	//    `Memory`: the `Device_Memory_Facts` of the device whose base address register starts at `a`
	//    (empty with no IOMMU in use, and always empty for `Display_Memory`);
	// 3. for `Message` only: the value that the device writes there: 0 in the remappable form; the
	//    index of the entry in the interrupt table of the device with interrupt remapping of AMD in use;
	//    else the vector.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `machine` is not the machine handle with **Devices**.
	// - `Bad_Address`: the ports, the line or the range of memory is out of its range.
	// - `Bad_Operation`: `kind` is `None` or a kind that the kernel does not know; or `Display_Memory` over
	//   a range that does not hold the framebuffer of the firmware: the error record has the kind
	//   `Bad_Value` for `a`, with the address of that framebuffer as its limit.
	// - `No_Slot`: no free memory object, no free message interrupt (`MESSAGE_CAPACITY`), or the handle
	//   table of the process is full.
	Inspect        = 14, // (machine, kind: Inspect_Kind, index, address, size) -> bytes written.
	// Writes a report of the kernel into memory of the process. Each `Inspect_Kind` has its report:
	//
	// - `System`: a `System_Report`; `index` is not read;
	// - `Process`: the `Process_Report` of the process slot `index`;
	// - `Processor`: the `Processor_Report` of the processor `index`;
	// - `Boot`: the `Boot_Report`;
	// - `Mappings`: the `Mapping_Report` of the page table: `index` 0 for the kernel half of the addresses,
	//   another value for the half of the process that asks;
	// - `Modules`: the `Module_Report` of the process slot `index`;
	// - `Process_Mappings`, `Threads`, `Stop`: the reports of a developer tool for the process slot `index`:
	//   `Process_Mapping_Report`, `Thread_Table_Report`, `Stop_Report`;
	// - `Pages`: the `Page_Report` of the process that asks, for the address that it wrote in the record;
	//   `index` must be 0.
	//
	// A slot or a processor with no process, or out of the table, gives a report of zeros.
	//
	// **Arguments**
	//
	// - `machine`: the machine handle, with **Inspect**.
	// - `kind`, `index`: the report, as above.
	// - `address`, `size`: the memory of the report: `size` is at least the size of the report, and the
	//   process can write it.
	//
	// **Results**: the bytes written: the size of the report.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `machine` is not the machine handle with **Inspect**.
	// - `Bad_Address`: `size` is below the size of the report, or the process cannot write the memory.
	// - `Bad_Operation`: `kind` is `None` or a kind that the kernel does not know; for `Pages`, `index` is
	//   not 0, or the address in the record is not a multiple of 4096, or its 64 pages pass `USER_END`.
	Machine_Stop   = 15, // (machine, code).
	// Stops the machine: the kernel writes `kernel: the machine stops with code <code>` on the log, then
	// stops each processor. The operation does not return.
	//
	// **Arguments**
	//
	// - `machine`: the machine handle, with **Stop**.
	// - `code`: the code of the stop, from 0 to `MACHINE_STOP_CODE_MOST`: the machine gives it to its host.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `machine` is not the machine handle with **Stop**.
	// - `Bad_Operation`: `code` is above `MACHINE_STOP_CODE_MOST`. A code that the host cannot receive
	//   whole is refused: else a code of 256 would end the machine with 0, the code of a normal end.
	Thread_Create  = 16, // (budget, entry, stack, parameter, weight, request) -> thread handle.
	// Starts a new thread of this process, and gives a handle to it with **Give**, **Read**, **Write**,
	// **Control** and **Inspect**. The thread is ready at once: it starts at `entry` with `parameter` in its
	// first register, and its stack pointer at `stack` minus 8.
	//
	// **Arguments**
	//
	// - `budget`: a budget handle with **Spend**. It pays for the thread slot and for the thread area: the
	//   thread record, the kernel ring and a page with no memory. The budget of the process pays for the
	//   page tables of the area.
	// - `entry`: the address of the first instruction, below `USER_END`.
	// - `stack`: the top of the stack, from 8 to `USER_END`.
	// - `parameter`: any value.
	// - `weight`: from 1 to the limit of a new thread: the smaller of the new-thread weight limit of the
	//   calling thread (`Thread_Schedule`) and the one of its process (`Process_Schedule`,
	//   `new_thread_weight_limit_of_creation`). Each is `WEIGHT_FULL` unless the holder of the machine
	//   lowered it; 0 is that limit. A weight above it is refused. While the share policy of the process
	//   `scheduler` is on, it writes the process weight divided by 32 there, so the limit can be 32: a
	//   process that passes a weight reads its own schedule first, or passes 0. The share of the thread
	//   under the strategies that use weights. A weight can only be lower than the weight of a thread
	//   created with 0. The new thread gets that limit as its weight limit and as its own new-thread
	//   weight limit (`thread_schedule_of_new_thread`). It also gets the limit of the
	//   placement of the calling thread, as its set of processors and as its limit (`Thread_Placement`).
	// - `request`: microseconds, from 1 to `REQUEST_LIMIT`; 0 is `REQUEST_DEFAULT`. The delay that the
	//   thread asks for under EEVDF ([weights and requests](docs/SCHEDULING.md#weights-and-requests-a-field-at-thread-creation)).
	//
	// **Results**: the thread handle.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `budget` is not a budget handle with **Spend**.
	// - `Bad_Operation`: `weight` is above the limit of a new thread, or `request` above
	//   `REQUEST_LIMIT`.
	// - `Bad_Address`: `entry` or `stack` is out of its range.
	// - `Bad_State`: the process stops.
	// - `No_Slot`: the thread table of the kernel is full, the process has `THREAD_CAPACITY` threads, or
	//   its handle table is full.
	// - `No_Budget`: the budget has no thread slot left, or it cannot pay for the thread area or its page
	//   tables.
	// - `No_Memory`: no free run of page frames for the thread area.
	//
	// ```odin
	// thread, status := system.thread_start(worker, nil)
	// ```
	Thread_Stop    = 17, // (thread).
	// Ends a thread: the calling thread, or a thread that a handle names, of this process or of another one.
	// A thread on another processor leaves it at once, and the operation returns after it left. The other
	// threads of its process get an event. A process with no thread left stops, with the stop cause
	// `Last_Thread_Ended` and no stop outcome.
	//
	// **Arguments**
	//
	// - `thread`: 0 for the calling thread, which ends: the operation does not return. Else a thread handle
	//   with **Control**.
	//
	// **Results**: none. A thread that ended already stays as it is.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `thread` is not a thread handle with **Control**.
	Thread_State   = 18, // (thread) -> state: Process_State, stop count, area bytes, components, form.
	// Gives the state of a thread, and what a holder of the thread needs for `Thread_Control`.
	//
	// **Arguments**
	//
	// - `thread`: a thread handle with **Read**.
	//
	// **Results**
	//
	// 1. its `Process_State`: `Ready`, `Waiting` or `Stopped`. A thread that a stop holds is `Ready` when
	//    its wait ended, and runs only when its stop count is 0;
	// 2. its stop count (`Thread_Control`);
	// 3. the bytes of the extended state area of a thread on this machine;
	// 4. its components: the bits of XCR0 (0 x87, 1 SSE, 2 AVX, 5 to 7 AVX-512);
	// 5. its `Extended_State_Layout`: `With_Header` when the area has the header of `xsave` at byte 512,
	//    `Legacy` when it is the 512 bytes of `fxsave`.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `thread` is not a thread handle with **Read**.
	Word_Wait      = 19, // (words: Word, count).
	// Adds words to the wait of this kernel entry: the one way to wait for something else than a time. A
	// thread that asks for a wait when it enters the kernel waits at the end of the entry while each word
	// of its list holds its value. The wait ends when `Word_Wake` names one of its words, or at its
	// deadline. The kernel names a word by its page frame, so two processes that map one memory object wait
	// on one word. If a word does not hold its value already, the wait ends at once: no wake is lost
	// between a read of the word and the wait.
	//
	// **Arguments**
	//
	// - `words`: the address of `count` records `Word`: each one is the address of a word of 32 bits, a
	//   multiple of 4 that the process can read, and the value that the word holds while the thread waits
	//   (the low 32 bits of `value`).
	// - `count`: the words of this command. One entry holds at most `WORD_WAIT_CAPACITY` words in all its
	//   commands.
	//
	// **Results**: none.
	//
	// **Statuses**
	//
	// - `No_Slot`: the entry would hold more than `WORD_WAIT_CAPACITY` words.
	// - `Bad_Address`: the process cannot read the table or a word, or a word is not a multiple of 4. The
	//   entry then does not wait.
	//
	// ```odin
	// system.word_wait(&ready, 0, deadline)
	// ```
	Word_Wake      = 20, // (word, count) -> threads woken.
	// Ends the wait of at most `count` threads that wait on a word. A thread that put the word in the wait
	// of its entry and does not wait yet counts too: it does not wait, and reads its words again.
	//
	// **Arguments**
	//
	// - `word`: the address of a word of 32 bits, a multiple of 4 that the process can read.
	// - `count`: the most threads to wake.
	//
	// **Results**: the count of threads woken.
	//
	// **Statuses**
	//
	// - `Bad_Address`: the process cannot read the word, or its address is not a multiple of 4.
	//
	// ```odin
	// system.word_wake(&ready)
	// ```
	Budget_Create  = 21, // (budget, pages, processes, threads, processor, log_records) -> budget handle.
	// Makes a budget from a budget, and gives a handle to it with **Give**, **Read**, **Spend** and
	// **Commit** (`Budget_Amounts` says what each amount is). The pages, the process slots, the thread
	// slots and the log records of each second move from `budget` to the new budget. The processor time is
	// a limit for each second, for the new budget and each budget that comes from it. When the last handle
	// to the new budget closes, what it holds returns to `budget`, which pays for its objects.
	//
	// **Arguments**
	//
	// - `budget`: a budget handle with **Spend**.
	// - `pages`, `processes`, `threads`: what moves to the new budget.
	// - `processor`: microseconds of processor time in each second, on all the processors together: at most
	//   the limit of `budget`.
	// - `log_records`: records of the log in each second, which move to the new budget.
	//
	// **Results**: the budget handle.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `budget` is not a budget handle with **Spend**.
	// - `No_Budget`: `budget` holds less than an amount that moves, or a limit is above its own.
	// - `No_Slot`: the table of the budgets of the kernel is full, or the handle table of the process.
	Budget_Read    = 22, // (budget) -> pages, processes, threads, processor, log_records, processor time, refused.
	// Gives what a budget can still pay, its limits, and what it used.
	//
	// **Arguments**
	//
	// - `budget`: a budget handle with **Read**.
	//
	// **Results**
	//
	// 1. the pages that it can still pay;
	// 2. the process slots that it can still pay;
	// 3. the thread slots that it can still pay;
	// 4. its limit of processor time: microseconds in each second;
	// 5. the log records of each second that it holds: its amount, after the budgets that came from it;
	// 6. the microseconds of processor time that its threads used since it was made;
	// 7. the log records that the kernel refused to it.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `budget` is not a budget handle with **Read**.
	Handle_State   = 23, // (handle, memory) -> kind: Object_Kind, rights: Rights, through, holdings.
	// Gives the kind and the rights of a handle of this process, and proves where it came from. A process
	// that receives the number of a handle from another process, in a ring, proves with this operation that
	// the other process gave the handle through that ring (`Handle_Give` with the memory of the ring as its
	// target). Without the proof, the other process can name a handle that the receiver holds for itself.
	//
	// **Arguments**
	//
	// - `handle`: any handle of this process.
	// - `memory`: 0, or a memory handle with any rights: the memory of the ring.
	//
	// **Results**
	//
	// 1. the `Object_Kind` of the object;
	// 2. the `Rights` of the handle;
	// 3. 1 when the handle came through the memory object of `memory`, else 0;
	// 4. the count of the holdings that came from this handle, in all processes: what `Handle_Revoke` ends.
	//
	// **Statuses**
	//
	// - `Bad_Handle`: `handle` names nothing, or `memory` is not a memory handle.
	Handle_Revoke  = 24, // (handle, process) -> holdings ended.
	// Ends each holding that came from a handle. A holding is a handle or a mapping. The origin of a handle
	// that `Handle_Give` made is the handle that was given; the origin of a mapping is the memory handle
	// that was mapped. When a handle closes, what came from it comes from its origin. The operation ends
	// each holding that came from the handle, and what came from those holdings, in any process. The handle
	// stays, and the mappings of the process that revokes stay. A process that lost a holding gets an event.
	// A thread that uses memory that its process lost stops its process on a page fault.
	//
	// **Arguments**
	//
	// - `handle`: any handle of this process, with any rights: the process that holds it is the origin of
	//   what came from it.
	// - `process`: 0 for each process, or a process handle with **Control**: only the holdings in that
	//   process.
	//
	// **Results**: the count of the holdings that ended.
	//
	// **Statuses**
	//
	// - `Bad_Handle`: `handle` names nothing, or `process` is not a process handle.
	// - `No_Right`: the process handle has not **Control**.
	Memory_Physical = 25, // (machine, memory) -> device address.
	// Gives the address that a device uses for the first page of a memory object, so that a device service
	// gives it to its device, which reads and writes the memory with no processor (direct memory access).
	// For an object whose pages follow each other in physical memory and do not move (an object created
	// `Contiguous` or `Large_Pages`, or the registers of a device), it is the physical address of the first
	// page.
	//
	// When the IOMMU is in use, the call is also the declaration: each page of the object, which is not
	// device memory, becomes memory that each device whose registers the caller holds by a handle can read,
	// and write only while the caller holds a handle with **Write** to the object. A process that holds no
	// such handle declares nothing. An object that is not contiguous then has a device window: its pages
	// get their frames now, and the devices see them in their order from the address that the call gives,
	// at 2^38 or above: a device that gives fewer than 39 bits of address must get contiguous objects only
	// (`Device_Create` says whether the unit of a device gives windows: `Device_Memory_Facts`). The pages leave the
	// device when the process closes or loses its last handle to the object, when it holds neither a handle
	// nor a mapping of the registers of the device, when the object ends, or when the process stops
	// (docs/ARCHITECTURE.md, "K5. Device grant and interrupts"). The devices behind a conventional bridge
	// share one domain: it lives while the caller holds the registers of each of them.
	//
	// **Arguments**
	//
	// - `machine`: the machine handle, with **Physical**.
	// - `memory`: a memory handle with **Read**.
	//
	// **Results**: the device address: the physical address, or the address of the window.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `machine` or `memory` is not a handle of its kind with its right.
	// - `Bad_Operation`: the pages of the object are not contiguous, and no IOMMU is in use or the caller
	//   holds the registers of no device: they get their frames at their first use, from anywhere.
	// - `Bad_Operation`: also, with the IOMMU in use, a contiguous object ends above 2^38 or above the
	//   address width of the unit of a device; or an object that is not contiguous is `Uncommitted`, larger
	//   than 128 MiB (`iommu.WINDOW_SIZE`), or declared to a device whose unit gives no windows.
	// - `Bad_State`: another process declared memory to the same device, and it still holds or maps its
	//   registers; or the device is behind a conventional bridge, and the caller does not hold the registers
	//   of each device behind that bridge, which all share its requester and its domain (the log names the
	//   device that it misses).
	// - `No_Slot`: the caller holds the registers of more than 4 devices, or the 32 slots of the devices of
	//   the kernel are in use.
	// - `No_Budget`: the budget of the caller cannot pay for a page of the tables of the device.
	Process_Module = 26, // (process, record: Module_Record).
	// Records a module that a loader put in a process, in the module records of the process. The kernel
	// does not read the module: the record is what the loader asserts. The kernel names the module of the
	// address of a fault with it, and `Inspect` gives the records (`Module_Report`). The kernel writes the
	// writer of the record (`Module_Writer`): `Process` when the process records a module in itself,
	// `Starter` when another process does it through the process handle. A process cannot replace or
	// remove a record of the writer `Starter`, and cannot map or unmap where such a record is, so the
	// record names the code that its starter put there
	// ([the writer of a module record](docs/MODULE_CONTRACT.md#the-writer-of-a-module-record)).
	//
	// **Arguments**
	//
	// - `process`: 0 for this process, or a process handle with **Control**.
	// - `record`: the address of a `Module_Record` that the process can read. A record with the base of a
	//   record that exists replaces it; a record with the size 0 removes the record of its base. A process
	//   has at most `PROCESS_MODULE_CAPACITY` records, and no two of them share an address. The kernel
	//   does not read the field `writer`.
	//
	// **Results**: none.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `process` is not a process handle with **Control**.
	// - `No_Right`: also, the process replaces or removes in itself a record of the writer `Starter`. The
	//   error kind is `Starter_Module`: the fix is with the holder of the process handle.
	// - `Bad_State`: the process is stopped.
	// - `Bad_Address`: the process cannot read the record; the module passes `USER_END`; it meets another
	//   record; or a record of size 0 names a base that no record has.
	// - `No_Slot`: the process has `PROCESS_MODULE_CAPACITY` records.
	Strategy_Set = 27, // (machine, strategy: Strategy) -> the strategy before.
	// Changes the scheduling strategy of the machine while it runs: no thread stops, and none is lost. The
	// state of the strategy of each thread starts from zero
	// ([the change of strategy](docs/SCHEDULING.md#the-change-of-strategy-is-a-kernel-operation-with-a-right)).
	//
	// **Arguments**
	//
	// - `machine`: the machine handle, with **Schedule**.
	// - `strategy`: `Round_Robin`, `Fair` or `Eevdf`.
	//
	// **Results**: the `Strategy` before.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `machine` is not the machine handle with **Schedule**.
	// - `Bad_Operation`: `strategy` is `None` or a strategy that the kernel does not know.
	//
	// ```odin
	// before, status := system.strategy_set(machine, .Eevdf)
	// ```
	Memory_Commit = 28, // (memory, budget, ranges: Page_Range, count, flags: Commit_Flags) -> pages changed.
	// Commits the pages of ranges of an object made with `Uncommitted`: the budget pays one page for each
	// page that was not committed, and each gets a frame at its first use. With `Decommit`, the committed
	// pages of the ranges are no longer paid: their frames and their pages return at once to the budget of
	// the object, and a page committed again is zero
	// ([the virtual memory of a process](docs/ARCHITECTURE.md#the-virtual-memory-of-a-process)).
	//
	// **Arguments**
	//
	// - `memory`: a memory handle with **Write**, of an object made with `Uncommitted`.
	// - `budget`: a handle to the budget of the object, with **Commit** or **Spend**. **Write** on the object
	//   does not spend the budget of its maker: to let another process commit, give it the object and a
	//   budget handle with **Commit** only ([who pays a commit](docs/ARCHITECTURE.md#who-pays-a-commit)).
	//   Not read with `Decommit`.
	// - `ranges`, `count`: a table of `count` records `Page_Range`, from 1 to `RANGE_TABLE_CAPACITY`, in
	//   increasing order, with no overlap, inside the object, with at most `RANGE_TABLE_PAGE_LIMIT` pages in
	//   all.
	// - `flags`: a `Commit_Flags`: `Decommit`, or none.
	//
	// **Results**: the count of pages that changed.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `memory` is not a memory handle with **Write**; `budget` is not a budget
	//   handle with **Commit** or **Spend**.
	// - `Bad_Handle`: `budget` names another budget than the budget of the object.
	// - `Bad_Operation`: `count` is 0 or above `RANGE_TABLE_CAPACITY`; a flag that the kernel does not know;
	//   the table has more than `RANGE_TABLE_PAGE_LIMIT` pages; the object was not made `Uncommitted`.
	// - `Bad_Address`: the process cannot read the table, or the ranges are not in order, overlap, or pass
	//   the end of the object.
	// - `No_Budget`: the budget cannot pay the table: nothing changes.
	// - `Bad_State`: a `Decommit` of an object that another process names, or that has more than one
	//   mapping.
	//
	// ```odin
	// changed, status := system.memory_commit(memory, ranges[:])
	// ```
	Memory_Protect = 29, // (ranges: Address_Range, count, flags: Map_Flags, process) -> pages changed.
	// Changes the protection of pages of mappings of this process, or of a guest: read only (no flag),
	// `Write`, `Execute`, or `No_Access`. A switching mapping (guest memory mapped with `Write`, `Execute`
	// and `No_Access`) takes only `Write`, `Execute` or `No_Access`, for the whole mapping: the kernel then
	// switches each page between `Write` and `Execute` at the fault of the guest, never both at once
	// ([a guest](docs/ARCHITECTURE.md#a-guest)). Each processor that runs a thread of the process forgets the old translations before
	// the operation returns (one shoot-down). A table is done whole or not at all
	// ([protection and the shoot-down](docs/ARCHITECTURE.md#protection-and-the-shoot-down)).
	//
	// **Arguments**
	//
	// - `ranges`, `count`: a table of `count` records `Address_Range`, from 1 to `RANGE_TABLE_CAPACITY`.
	//   Each range is inside one mapping of this process, below `THREAD_AREA_BASE`.
	// - `flags`: a `Map_Flags` within `PROTECT_FLAGS_KNOWN` (`Receive_Handles` is refused). A protection
	//   can only take away what the mapping was made with: `Write` needs a mapping made with `Write`,
	//   `Execute` one made with `Execute`. `No_Access` takes no other flag, and `Write` with `Execute`
	//   is refused.
	// - `process`: 0 for this process, or a process handle with **Control** of a process in the state
	//   `Created` with no thread: a guest, or a process that will be one.
	//
	// A range that is a part of a mapping, not its whole, takes away from the protection of the mapping now:
	// it cannot get more. It needs an object with a frame list that only this process names, with one
	// mapping; while a part has its own protection, the object is not mapped again and not given
	// (`Bad_State`). At most `RANGE_TABLE_PAGE_LIMIT` pages change in one call.
	//
	// **Results**: the count of pages that changed.
	//
	// **Statuses**
	//
	// - `Bad_Operation`: `count` is 0 or above `RANGE_TABLE_CAPACITY`; a flag that the kernel does not know;
	//   `Write` with `Execute`, or `No_Access` with another flag; more than the mapping was made with; one
	//   table names a mapping whole and in part; more than `RANGE_TABLE_PAGE_LIMIT` pages; read only, or a
	//   part, of a switching mapping: the switch of a page gives it `Write` or `Execute` whatever such a
	//   protection said.
	// - `Bad_Address`: the process cannot read the table; a range is not on whole pages, is empty, or is not
	//   inside one mapping; the mapping is a thread area or the time page; a part of a mapping of a
	//   contiguous object.
	// - `Bad_State`: a part of a mapping of an object that another process names, or that has another
	//   mapping; `process` names a process that a thread ran.
	// - `Bad_Handle`, `No_Right`: `process` is not 0 and not a process handle with **Control**.
	//
	// ```odin
	// changed, status := system.memory_protect(ranges[:], {})
	// ```
	Fault_Handler_Set = 30, // (thread, end: Fault_Handler_Action, kinds: Fault_Kinds, process).
	// Makes a thread of this process the fault handler of the process: the faults of the chosen kinds of
	// the other threads of the process become records of the
	// [fault ring](docs/ARCHITECTURE.md#the-fault-ring) in the thread record of the handler, in place of a
	// stop. The thread of a fault waits for `Fault_Answer`. A page fault is delivered only below
	// `THREAD_AREA_BASE`. A fault of a kind that the handler did not ask for stops the process as with no
	// handler. A new handler replaces the one before, and its ring starts empty.
	//
	// **Arguments**
	//
	// - `thread`: 0 for the calling thread, or a thread handle with **Control** of a live thread of this
	//   process.
	// - `end`: a `Fault_Handler_Action`: `End` (1) ends the delivery, and each fault stops the process
	//   again; `Set` (0) sets the handler.
	// - `kinds`: the `Fault_Kinds` to deliver, or 0 for page faults only, so that a handler of pages never
	//   gets a kind that it does not know. Only the kinds of `FAULT_KINDS_DELIVERED`.
	// - `process`: 0, or a process handle with **Debug** of another process. Then the thread becomes the
	//   [debug handler](docs/ARCHITECTURE.md#the-debugger-of-a-process) of that process: the caller is its
	//   debugger. The faults of the kinds `Debug` and `Breakpoint` of that process become records of the ring
	//   of this thread, before the fault handler of the process itself, and each faulting thread waits for a
	//   `Fault_Answer` with the same handle. `kinds` is then 0 or the whole of
	//   `FAULT_KINDS_DEBUGGER`: the debugger takes both kinds. `end` `End` ends the debugging (the detach). A process has one debugger at a
	//   time, and a thread is the debug handler of one process and not the fault handler of its own.
	//
	// The debugging ends at the detach, when the debug handler thread ends, when the last handle of the
	// debugger to the process with **Debug** closes or is revoked, and when the process stops. The kernel
	// then removes the breakpoints of each thread of the process and the trap flag that the debugger wrote,
	// takes back the stops that the debugger made, and resumes each thread that waits for its answer: a
	// debugger that ends never holds and never stops the process.
	//
	// When a thread of the process waits for an answer, a new handler or the end of the delivery ends the
	// ring that holds its record: the process stops with the stop cause `Fault_Unanswered`, as when the handler
	// thread ends, and the operation gives `Ok`.
	//
	// **Results**: none.
	//
	// **Statuses**
	//
	// - `Bad_Operation`: `end` names no `Fault_Handler_Action`; a kind that the kernel never delivers; kinds with the end of the
	//   delivery; with `process`, kinds that are not 0 and not the whole of `FAULT_KINDS_DEBUGGER`.
	// - `Bad_Handle`, `No_Right`: `thread` is not a thread handle with **Control**; `process` is not a
	//   process handle with **Debug**.
	// - `Bad_State`: the thread is not a live thread of this process; the thread is the debug handler of a
	//   process and would become the fault handler of its own, or the reverse; with `process`: the process is
	//   the caller, it stopped, it has another debugger, the thread is the debug handler of another process,
	//   or, for `End`, the caller is not its debugger.
	//
	// ```odin
	// status := system.fault_handler_set(kinds = {.Page_Fault, .Breakpoint})
	// ```
	Fault_Answer = 31, // (thread, serial, answer: Fault_Answer_Kind, process).
	// Answers a thread of this process that waits in the fault ring, by the two values of its
	// `Fault_Record`.
	//
	// **Arguments**
	//
	// - `thread`, `serial`: the `thread` and the `serial` of the record.
	// - `answer`: a `Fault_Answer_Kind`:
	//   - `Resume`: the thread continues with its registers, at the instruction of its record (the faulting
	//     instruction again, or the next one after a trap), or where `Thread_Control` wrote;
	//   - `Stop`: the process stops as with no handler: the stop cause and the stop report of the fault.
	// - `process`: 0, or the process handle with **Debug** of the process that the caller debugs: the answer
	//   is for a thread of that process, whose record came to the debug handler. Only `Resume`: a debugger
	//   stops a process with `Process_Stop` and the right **Control**. After a `Debug` fault of an execute
	//   breakpoint, `Resume` at the same instruction sets the resume flag of the thread, so that the
	//   instruction runs once and the breakpoint stays.
	//
	// **Results**: none.
	//
	// **Statuses**
	//
	// - `Bad_Operation`: `answer` is not `Resume` or `Stop`; `Stop` with `process`.
	// - `Bad_Handle`, `No_Right`: `process` is not a process handle with **Debug**.
	// - `Bad_State`: no thread with that number waits for the fault of that serial: a wrong answer, a second
	//   answer, or an answer from another process; an answer with no `process` for a fault that went to the
	//   debugger of the process; with `process`, the caller is not the debugger. Also for `Resume` after a fault kind that does not resume
	//   by itself (`fault_kind_resumes`) when `Thread_Control` wrote neither the registers nor the extended
	//   state of the thread since its fault: the thread still waits, and `Stop` ends it.
	//
	// ```odin
	// status := system.fault_answer(record, .Resume)
	// ```
	Events_Set = 32, // (machine, memory, rules: Event_Rule, count, records) -> ring bytes, processors.
	// Gives the event table of the machine: the kernel writes an `Event_Record` into the event ring of the
	// processor of each [kernel event](docs/ARCHITECTURE.md#kernel-events) that a rule accepts. A new table
	// replaces the table of the caller. The table also ends when its process ends, and when the last
	// machine handle of its process with **Events** closes or is revoked: the table lives while the right
	// that made it lives.
	//
	// **Arguments**
	//
	// - `machine`: the machine handle, with **Events**.
	// - `memory`: a memory handle with **Write** of an object made `Contiguous` (not the registers of a
	//   device), with room for one ring of `EVENT_RING_HEAD_BYTES` plus `records` times 64 bytes for each
	//   processor, one after the other from its first byte. 0: the caller takes its table away; when the
	//   operation returns, no processor writes in the old memory object.
	// - `rules`, `count`: a table of `count` records `Event_Rule`, from 1 to `EVENT_RULE_CAPACITY`.
	// - `records`: the records of each ring: a power of two from `EVENT_RING_RECORDS_LEAST` to
	//   `EVENT_RING_RECORDS_MOST`.
	//
	// **Results**
	//
	// 1. the bytes of one event ring;
	// 2. the count of processors: the count of rings.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `machine` is not the machine handle with **Events**, or `memory` not a
	//   memory handle with **Write**; the process of a rule is not a process handle with **Read**.
	// - `Bad_State`: `memory` is 0 and the caller has no table; or another process has the table: one table
	//   at a time.
	// - `No_Slot`: `count` is above `EVENT_RULE_CAPACITY`.
	// - `Bad_Operation`: `count` is 0; `records` is not a power of two in its range; the object is not
	//   contiguous, is the registers of a device, or is too small for the rings; a rule that the kernel
	//   refuses (its kind, its flags, its reserved values, its least duration or its one in N).
	// - `Bad_Address`: the process cannot read the table of rules.
	Thread_Control = 33, // (thread, number, command: Thread_Control_Command, address, size, source) -> see the command.
	// Controls a thread: holds it and releases it, reads its registers and its extended state, and writes
	// them ([the control of a thread](docs/ARCHITECTURE.md#the-control-of-a-thread)). `Stop` and `Resume`
	// change the stop count of the thread: it runs only while the count is 0. The registers and the
	// extended state are read and written only while the thread is held: its stop count is above 0, or it
	// waits for an answer of the fault ring. It also reads and writes the schedule of a thread: its weight
	// and its request (`Thread_Schedule`), also while the thread runs
	// ([the schedule of a live thread](docs/SCHEDULING.md#the-schedule-of-a-live-thread)). And it reads and
	// writes the placement of a thread: the processors that can run it (`Thread_Placement`), also while the
	// thread runs ([the placement of a thread](docs/SCHEDULING.md#the-placement-of-a-thread)). Two more
	// commands read and write the schedule of a process (`Process_Schedule`): the new-thread weight limit
	// of all the threads of one process at once, through the machine handle only. Three commands count the
	// events of the processor for the code of the calling thread (`Thread_Counters`,
	// [the counters of a thread](docs/ARCHITECTURE.md#the-counters-of-a-thread)).
	//
	// **Arguments**
	//
	// - `thread`: a thread handle with the rights of the command (`thread_control_rights`): **Inspect**,
	//   and **Write** too for a write of the registers or of the extended state; **Control** for
	//   `Write_Schedule` and `Write_Placement`. Or 0, and then `number` names a live thread of this process
	//   (`Thread_Record.number`, `Fault_Record.thread`). Or, for the two commands of the schedule and the
	//   two commands of the placement only, the machine handle with **Schedule** and **Inspect**
	//   (`thread_control_machine_rights`), and then `number` names any thread of the machine. A
	//   thread of another process needs a handle. Or the process handle with **Debug** of the process that
	//   the caller debugs (`Fault_Handler_Set` with that handle first), and then `number` names a live thread
	//   of that process, for each command but the two of the schedule and the two of the placement
	//   (`thread_control_takes_debug_handle`). The two commands of the schedule of a process take the
	//   machine handle with **Schedule** and **Inspect** only. The three commands of the thread counters
	//   act on the calling thread (`thread_control_counts_the_caller`): `Start_Counters` and
	//   `Read_Counters` take the machine handle with **Counters** only; `Stop_Counters` reads no handle.
	// - `number`: the number of the thread when `thread` is 0; the machine number of the thread
	//   (`Thread_Report.machine_number`) when `thread` is the machine handle. For the two commands of the
	//   schedule of a process: the slot of the process in the low 32 bits and its serial
	//   (`Process_Report.process_serial`) in the high 32 bits (`process_slot_and_serial`). Not read by
	//   the three commands of the thread counters.
	// - `command`: a `Thread_Control_Command`.
	// - `address`, `size`: the memory of the command that reads or writes: `size` is at least the size of
	//   a `Thread_Registers`, of the extended state area (`Thread_State`), of a `Thread_Schedule`, of a
	//   `Thread_Breakpoints`, of a `Thread_Placement` or of a `Thread_Counters`, and the process can read it, or write it for a read
	//   of the thread. For
	//   `Read_Memory`, `size` is the count of bytes to read, at most `THREAD_MEMORY_READ_LIMIT`.
	// - `source`: for `Read_Memory`, the address of the first byte in the process of the thread.
	//
	// **Results**: what the command gives: the stop count, or the bytes written and the components.
	// `Read_Memory` gives the count of bytes that it copied.
	//
	// **Statuses**
	//
	// - `Bad_Operation`: `command` is `None` or a command that the kernel does not know; a write of values
	//   that a thread of a process cannot hold changes nothing (`thread_registers_refusal`,
	//   `extended_state_refusal`); a `Write_Schedule` through 0 or a thread handle with a weight above
	//   the weight of the thread or a request above its request; a `Write_Schedule` with a weight above
	//   `WEIGHT_FULL`, a request above `REQUEST_LIMIT`, or a weight limit or a new-thread weight limit
	//   above `WEIGHT_FULL`, changes nothing; a `Write_Process_Schedule` with a new-thread weight limit
	//   above `WEIGHT_FULL` changes nothing; a `Write_Breakpoints` with a breakpoint that a thread cannot have
	//   (`thread_breakpoints_refusal`) changes nothing; a `Read_Memory` of more than
	//   `THREAD_MEMORY_READ_LIMIT` bytes; a `Write_Placement` that `thread_placement_after_write` refuses
	//   changes nothing: through 0 or a thread handle a set with a processor that the set of the thread
	//   does not have, and for each writer a set or a limit with no processor that the machine has;
	//   `Start_Counters` or `Read_Counters` on a machine whose processors have no counters that the
	//   kernel uses, with the error kind `Unsupported`.
	// - `Bad_Handle`, `No_Right`: `thread` is not a thread handle with the rights of the command, and not
	//   the machine handle with the rights of a command of the schedule or of the placement. The machine
	//   handle with another command gives `Bad_Handle`. A process handle with no **Debug** gives
	//   `No_Right`, and a process handle with a command of the schedule or of the placement `Bad_Handle`.
	//   A command of the schedule of a process, `Start_Counters` or `Read_Counters` with 0 or with a
	//   handle that is not the machine handle gives `Bad_Handle`; the machine handle with no
	//   **Counters** gives `No_Right` for `Start_Counters` and `Read_Counters`.
	// - `Bad_State`: no live process has the slot and the serial of `number`, for a command of the
	//   schedule of a process; no live thread of this process has `number`; no live thread of the machine has the
	//   machine number `number`; the thread or its process ended, also for a read or a write of a
	//   schedule or of a placement of a thread that ends; a read or
	//   a write of the registers or of the breakpoints of a thread that is not held, or of the calling
	//   thread; a `Stop` above
	//   `THREAD_STOP_COUNT_LIMIT` or of a thread that ends; a `Resume` at the count 0; through a process
	//   handle with **Debug**: the caller is not the debugger of the process, the process is the caller, or a
	//   `Resume` of a thread that the debugger did not stop; a `Read_Counters` of a thread that does not
	//   count.
	// - `Bad_Address`: `size` is too small, or the process cannot read or write the memory; a `Read_Memory`
	//   whose first byte the process of the thread cannot read, or whose range is not below `USER_END`.
	Guest_Run = 34, // (process, registers: Guest_Registers, processor) -> kind: Guest_Exit_Kind, a, b, c, next, exit code, exit information.
	// Runs one guest processor of a process on the calling thread, until an exit that the kernel does not
	// handle itself, and gives that exit ([a guest](docs/ARCHITECTURE.md#a-guest)). The process is a guest:
	// a process that `Process_Create` made and that no thread ran. Its addresses are the guest physical
	// addresses: `Memory_Map` with its handle gives the guest memory. The first run makes the process a
	// guest: the time page leaves it, the `OWN_LOG_PAGES` pages of its own log ring return to its budget (a
	// guest writes no log record), and `Process_Start` of it gives `Bad_State` after. The first run of each
	// guest processor takes two pages from the budget of the process. A guest processor starts in 16-bit
	// real mode, with each segment at base 0, unless the record asks for the load of another mode.
	//
	// A guest has up to `GUEST_PROCESSOR_CAPACITY` guest processors. One thread runs one guest processor at
	// a time; several threads of the caller run several guest processors of one guest at once. The record
	// can ask for one event to deliver at the entry (`Guest_Inject_Kind`). The kernel delivers an
	// `External_Interrupt` only when the guest takes interrupts: else it opens the interrupt window, and
	// the run ends with `Interrupt_Window` when the guest takes interrupts again.
	//
	// The kernel gives a page on first use of a mapping of the guest its frame when the guest touches it,
	// and enters the guest again: that exit does not end the operation. A page of a mapping made with
	// `Write`, `Execute` and `No_Access` is writable or executable, never both: a fault that asks it for the
	// other access switches that page, and does not end the operation either. The operation ends at each other
	// exit, with the exit in its results.
	//
	// **Arguments**
	//
	// - `process`: a process handle with **Control**, of a process in the state `Created`, with no thread,
	//   which is not the caller.
	// - `registers`: the address of a `Guest_Registers` record that the process can read and write. The
	//   kernel reads it before the entry, and writes the registers of the guest processor there after the
	//   exit. The process answers an exit by a change of the record before the next run.
	// - `processor`: the index of the guest processor, from 0 to `GUEST_PROCESSOR_CAPACITY - 1`.
	//
	// **Results**
	//
	// 1. the `Guest_Exit_Kind` of the exit;
	// 2. to 4. the values of the exit kind: `a`, `b` and `c` (`Guest_Exit_Kind` says what each one holds);
	// 5. the address of the instruction after the one that exited, for `Port_Write`, `Port_Read`, `Halt`
	//    and `Cpuid`, and for an exit `Other` of `rdmsr`, `wrmsr`, `rdtsc` or `rdtscp`; else 0;
	// 6. the exit code of the processor (the AMD manual, volume 2, appendix C): what an exit `Other` was;
	// 7. the first exit information of the processor.
	//
	// **Statuses**
	//
	// - `Bad_Operation`: the processors of the machine have no virtualization support that the kernel uses
	//   (AMD SVM with nested paging), and the error kind is `Unsupported`; the record has a field that its
	//   rules refuse (`guest_registers_refusal`); or `processor` is past the last guest processor.
	// - `Bad_Handle`, `No_Right`: `process` is not a process handle with **Control**.
	// - `Bad_State`: the process is the caller, was started, stopped, or another thread runs this guest
	//   processor now.
	// - `Bad_Address`: the process cannot read and write the record.
	// - `No_Budget`: at the first run of the guest processor, the budget of the process cannot pay its two
	//   pages.
	//
	// ```odin
	// exit, status := system.guest_run(guest, &registers)
	// ```
	Log_Read = 35, // (memory, process, serial, after, records: Log_Record, count) -> copied, lost, total.
	// Copies the records of the own log ring of one process: the last `OWN_LOG_RECORD_CAPACITY` records
	// that the process wrote, which only its own records push out. The ring lives until the slot of the
	// process is free: after its stop, while a handle names it, it is still read. The log service reads
	// the [own records](term:own-records) of a caller with it, and the records of a process whose handle
	// a starter lends (src/md/features/own_log_ring.md). The kernel
	// copies whole records under the log lock, so no copy is torn, and gives them to the caller after
	// the lock. A guest has no own log ring after its first `Guest_Run`.
	//
	// **Arguments**
	//
	// - `memory`: a handle of the memory of the log (`ROOT_LOG_RECORDS`) with **Read**. Its holder reads
	//   each record of the whole log, so a copy of an own log ring gives it no new fact.
	// - `process`, `serial`: the process slot and the process serial of the process, as `Process_State`
	//   gives them.
	// - `after`: an own number (`Log_Record.own_number`), modulo 2^32: the first record to copy. An `after`
	//   past the count of the records of the process gives no record (`own_log_window`).
	// - `records`: the address of `count` records that the process can write.
	// - `count`: the records that fit at `records`, at most `OWN_LOG_RECORD_CAPACITY`.
	//
	// **Results**
	//
	// 1. the records copied, in the order of their own numbers;
	// 2. the own records from `after` that the ring no longer keeps: the process wrote more records after
	//    them than the ring holds;
	// 3. the records that the ring keeps from the first one copied to the last one: more than the first
	//    result when `count` is too small.
	//
	// **Statuses**
	//
	// - `Bad_Handle`, `No_Right`: `memory` is not a handle of the memory of the log with **Read**.
	// - `Bad_Operation`: `process` is 0 or past the process slots, or `count` is above
	//   `OWN_LOG_RECORD_CAPACITY`.
	// - `Bad_State`: the slot holds no process with this serial and an own log ring: the slot is free,
	//   another process has it, or the process is a guest.
	// - `Bad_Address`: the process cannot write the `count` records at `records`.
	//
	// ```odin
	// results, status := system.call(.Log_Read, u64(log_memory), slot, serial, after, u64(uintptr(&rows[0])), u64(len(rows)))
	// ```
}

What a process asks the kernel. A thread asks for an operation with one command record in its kernel ring: kind is the operation, and the values are its arguments, in the order of its form. Then it enters the kernel with the syscall instruction. The kernel executes the commands of the ring in their order, and gives one completion record for each: kind is a Status, and the values are the results, in the order that each operation states. A completion with the status Ok has the results; with another status the operation failed, and the values of its completion are an : the argument that was wrong, its value, and what the kernel found (the errors of the kernel). A command whose kind has the bit COMMAND_NAMES_ERROR_DETAILS also receives one error detail for each other wrong argument, in the table of error details that its last value names. The kind 0 (None) and each kind past the last operation name no operation: the kernel refuses the command with Bad_Operation and the error record Unknown_Operation, and changes nothing.

A handle argument names an object of this process by the number that a grant or an operation gave. When the handle names no object of the kind that the operation needs, the status is Bad_Handle; when it names the object but has not the right that the operation needs, No_Right. The rights that each operation needs are in bold.

src/library/modus/system calls each operation with a procedure of its own (system.memory_create) or with system.call.

Kind
enum
Package
src/library/modus/contract/operation
Size
4 bytes
Alignment
4 bytes
Base type
Source
src/library/modus/contract/operation/operation.odin:256
MemberValueHexadecimal
None00x0
Log10x1
Memory_Create20x2
Memory_Map30x3
Memory_Unmap40x4
Memory_Size50x5
Process_Create60x6
Process_Start70x7
Process_Stop80x8
Process_State90x9
Handle_Give100xA
Handle_Close110xB
Interrupt_Read120xC
Device_Create130xD
Inspect140xE
Machine_Stop150xF
Thread_Create160x10
Thread_Stop170x11
Thread_State180x12
Word_Wait190x13
Word_Wake200x14
Budget_Create210x15
Budget_Read220x16
Handle_State230x17
Handle_Revoke240x18
Memory_Physical250x19
Process_Module260x1A
Strategy_Set270x1B
Memory_Commit280x1C
Memory_Protect290x1D
Fault_Handler_Set300x1E
Fault_Answer310x1F
Events_Set320x20
Thread_Control330x21
Guest_Run340x22
Log_Read350x23

Strategy

Strategy :: enum u32 {
	None        = 0, // No strategy: only in a report of a kernel that has none.
	Round_Robin = 1, // A queue in order, a time slice of 10 ms, no wake preemption. The reference: it reads no weight and no request.
	// Virtual time and weights: the least virtual time runs (the idea of CFS). A target latency of 6 ms divided by
	// weight, a least stint of 0.75 ms, a sleeper credit of 3 ms, and wake preemption with a granularity of 1 ms.
	Fair        = 2,
	// Earliest eligible virtual deadline first: weights for the share, the request for the delay. A thread is
	// eligible when it is owed time (its lag is not negative); of those, the earliest virtual deadline runs.
	Eevdf       = 3,
}

The scheduling strategy of the machine: the rule that orders the ready threads of each run queue. 0 is no strategy: a report of a kernel that has none.

Strategy_Set changes it at run time, with the right Schedule of the machine; System_Report.strategy and Processor_Report.strategy show it. A change gives each thread the zero values of the new strategy: each thread starts equal. Each strategy ends a stint after the time slice of 10 ticks at most.

See: Scheduling strategies, Scheduling strategies: The change at run time

Kind
enum
Package
src/library/modus/contract/operation
Size
4 bytes
Alignment
4 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:1369
MemberValueHexadecimal
None00x0
Round_Robin10x1
Fair20x2
Eevdf30x3

Module_Record

Module_Record :: struct {
	base:     u64, // The address of the first byte of the module in the process.
	size:     u64, // The bytes of addresses of the module. 0: no module.
	hash:     [32]u8, // The hash of the module that is loaded: BLAKE3 of its file, the name of the module in the module store.
	replaces: [32]u8, // Zero, or the hash that an import names and that a replacement changed to `hash`.
	writer:   u64, // Who wrote the record: the word of a Module_Writer. The kernel writes it; `Process_Module` does not read it.
}

A module record: one module that a loader put in a process (Process_Module). The identity of a process that runs is the list of its module records: the hash of each module, and the hash that a replacement put it in place of.

A loader writes it with Process_Module; the kernel keeps at most PROCESS_MODULE_CAPACITY for each process and gives them in a , in a and in each . The kernel does not check the hash: it is what the loader asserted. The kernel writes writer: a record of the writer Starter is a claim of the starter of the process, which the process cannot change; a record of the writer Process is a claim of the process. 88 bytes. See module record.

The writer is a word, not a member: a reader takes it from a report of the kernel through module_writer_of_word, and refuses a word that names no writer.

Kind
struct
Package
src/library/modus/contract/operation
Size
88 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
Source
src/library/modus/contract/operation/operation.odin:1692
FieldTypeOffsetSize
base08
size88
hash[32]u81632
replaces[32]u84832
writer808

88 bytes of fields and 0 bytes of padding: 88 bytes.

Module_Writer

Module_Writer :: enum u64 {
	Process = 0, // The process wrote the record for itself. It can replace or remove it.
	Starter = 1, // Another process wrote it, through the process handle with Control: the starter, or a process to which it gave that handle. The kernel writes the record of the root service so. The process cannot change it.
}

Who wrote a module record (Module_Record.writer). The kernel knows it at each Process_Module: it compares the process of the record with the process that calls.

Example: the root service starts imports and writes the record of its module: Starter. imports loads agenda in its own memory and writes its record: Process. imports cannot remove the first record, nor unmap or map at its addresses (No_Right).

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Source
src/library/modus/contract/operation/operation.odin:1709
MemberValueHexadecimal
Process00x0
Starter10x1

Stop_Report

Stop_Report :: struct {
	cause:       u32, // The word of the `Stop_Cause`: `Fault`, `Not_Committed` or `Cannot_Return`, which a reader takes through `stop_cause_of_word`. 0 in a report of another stop, which stays zero.
	vector:      u32, // The vector of the processor exception: a `Fault_Kind` when the kernel delivers that kind.
	instruction: u64, // The address of the instruction.
	address:     u64, // A page fault: the address that the instruction used. 0 for another fault.
	module:      , // The module of the instruction, as the loader recorded it: the module that ran. Zero: no record.
	// The stack trace: frame 0 is the instruction, each next frame the
	// return address of a call, from the frame pointers of the thread.
	// At most `STOP_FRAME_CAPACITY`. The walk also stops at a frame
	// pointer that is 0, not aligned on 8, not readable, or not above the
	// one before it, and at a return address 0.
	frame_count: u64,
	frames:      [STOP_FRAME_CAPACITY],
	// Inspect_Kind.Stop only: the serial of the process of the slot, and the
	// values that the kernel took out (see Inspect_Kind.Stop).
	process_serial: u64,
	hidden_value_count: u64,
	// Optional typed error record attached to a Failed or Refused self-stop
	// through Process_Stop; zero for every other stop.
	error: errors.,
}

Where a process stopped on a fault (Process_State). Zero: the process runs, or it stopped with no fault.

The kernel writes it when it stops a process on a fault; a holder of the process handle with Read gets it whole from Process_State, and a holder of the machine with Inspect gets it from Inspect with the kind Stop, with the values that can show memory of the process taken out. The console and the process errors turn it into a stack trace with names (see stop report).

Example: a null pointer read gives cause = u32(Stop_Cause.Fault), vector = 14, address = 0, and frames[0].address the instruction.

Kind
struct
Package
src/library/modus/contract/operation
Size
960 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
Source
src/library/modus/contract/operation/operation.odin:1763
FieldTypeOffsetSize
cause04
vector44
instruction88
address168
module2488
frame_count1128
frames[16]Stop_Frame120768
process_serial8888
hidden_value_count8968
error90456

960 bytes of fields and 0 bytes of padding: 960 bytes.

Stop_Frame

Stop_Frame :: struct {
	address: u64, // The instruction (frame 0) or a return address. All zero: the kernel hid a value that no module holds.
	base:    u64, // The base of the module record that holds the address. 0: no record holds it.
	hash:    [32]u8, // The hash of that module.
}

One frame of a stack trace. A reader names it "module + offset": the offset is address - base. A return address is the instruction after the call.

Example: address = 0x0040_1234, base = 0x0040_0000 is the offset 0x1234 in the module of hash; the process errors finds the procedure there in the debug object of that module.

A frame has no writer (). A reader that must know whether the module of a frame is a claim of the process matches base with the record of the same base in the of the process, which carries the writer. Stop_Report.module carries the writer of the module of the instruction.

Kind
struct
Package
src/library/modus/contract/operation
Size
48 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:1802
FieldTypeOffsetSize
address08
base88
hash[32]u81632

48 bytes of fields and 0 bytes of padding: 48 bytes.

Module_Report

Module_Report :: struct {
	count:   u64, // The records in `modules`: at most `PROCESS_MODULE_CAPACITY`.
	modules: [PROCESS_MODULE_CAPACITY],
	process_serial: u64, // The serial of the process of the slot: a reader drops reports of two processes.
}

The module records of one process, in the order of their addresses. Inspect with the kind Modules writes it, with the right Inspect of the machine. The developer tools name each address of a sample with it.

Kind
struct
Package
src/library/modus/contract/operation
Size
1424 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:1811
FieldTypeOffsetSize
count08
modules[16]Module_Record81408
process_serial14168

1424 bytes of fields and 0 bytes of padding: 1424 bytes.

Budget_Amounts

Budget_Amounts :: struct {
	pages:       u64, // Moves. The pages of memory objects, of thread areas, of frame lists and of page tables.
	processes:    u64, // Moves. Process slots: one for each `Process_Create`.
	threads:     u64, // Moves. Thread slots: one for each thread that runs, the first one included.
	processor:   u64, // A limit. Microseconds of processor time in each second, on all the processors together: 1 000 000 is one full processor.
	log_records: u64, // Moves. Records on the log in each second; `Log` gives `No_Budget` above it.
}

A budget: what its holders can still create. No operation creates an object from nothing: Memory_Create, Process_Create and Thread_Create take a budget handle, and the budget pays.

The record holds five amounts. Four of them are amounts that move: Budget_Create takes them from a budget for a new budget, and an object or a budget that ends gives them back. The log records of each second move too: a budget counts only the records of its own processes against what it holds, so a refusal tells a process nothing of what the others wrote. Processor time is a limit for each period.

A limit is for a budget and for each budget that came from it: what a thread uses counts in its budget and in each budget above. A new budget cannot have a limit above the limit of the budget that it came from. With the limit 0 a budget has no time: its threads do not run. With no log records, Log gives No_Budget. The processor limit holds in each period of 100 ms, the log records in each second.

The kernel gives one budget to the root service: all the free memory and all the slots. Budget_Create moves a part of a budget to a new budget. When an object ends, what it used returns to the budget that paid. When the last handle to a budget closes, what the budget holds returns to the budget that it came from, and that budget pays for its objects.

The record travels in two directions: a process gives it to Budget_Create (through system.budget_create), and Budget_Read and Process_Report.budget give what a budget still holds. See budget and limit.

Example: {pages = 4096, processes = 1, threads = 4, processor = 250_000, log_records = 100} is 16 MiB, one process of four threads, a quarter of one processor, and 100 lines of log in each second.

Kind
struct
Package
src/library/modus/contract/operation
Size
40 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
Source
src/library/modus/contract/operation/operation.odin:1849
FieldTypeOffsetSize
pages08
processes88
threads168
processor248
log_records328

40 bytes of fields and 0 bytes of padding: 40 bytes.

Word

Word :: struct {
	address: u64, // The address of the word in the process: a multiple of 4 that the process can read.
	value:   u64, // The low 32 bits.
}

One word of a word wait: the address of 32 bits of memory, and the value that they hold while the thread waits.

Word_Wait takes a table of them: the thread waits at the end of its kernel entry while each word holds its value, and wakes when Word_Wake names one of its words, or at its deadline. The kernel names a word by its page frame, so two processes that map one memory object wait on one word. See word wait.

Kind
struct
Package
src/library/modus/contract/operation
Size
16 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
Source
src/library/modus/contract/operation/operation.odin:1865
FieldTypeOffsetSize
address08
value88

16 bytes of fields and 0 bytes of padding: 16 bytes.

Thread_Record

Thread_Record :: struct {
	self:      u64, // The address of this record. The kernel ring is PAGE_SIZE after it.
	parameter: u64, // The parameter of the entry of the thread.
	number:    u64, // The number of the thread in its process. The first thread is 0.
	events:    u32, // The kernel adds 1 for each event: see Word_Wait.
	processors: u32, // The processors that run threads: a thread that is alone on the machine does not spin. The kernel writes it when the thread starts.
	// The fault ring of the process, when this thread is its fault handler
	// (Fault_Handler_Set; docs/ARCHITECTURE.md, "The fault ring"). The kernel
	// writes fault_records[n % FAULT_RECORD_CAPACITY] for the record n, then
	// fault_written = n + 1, then wakes the threads that wait on
	// fault_written. The handler reads the records from fault_read to
	// fault_written and writes fault_read: a record is free again once
	// fault_read passed it. A fault that finds FAULT_RECORD_CAPACITY records
	// not read stops the process as a fault does with no handler, and the
	// kernel adds 1 to fault_full.
	fault_written: u32, // The kernel writes it: the count of fault records written since the handler was set.
	fault_read:    u32, // The handler writes it: the count of fault records that it read.
	fault_full:    u32, // The kernel writes it: the faults that found the ring full and stopped the process, since the process started.
	fault_reserved: u32, // Not read.
	fault_records: [FAULT_RECORD_CAPACITY],
}

What a thread can read about itself, at the address in its gs register. The kernel writes it when the thread starts. After that it only adds to events.

The record is the first page of the thread area of the thread, at THREAD_AREA_BASE + number * THREAD_AREA_PAGES * PAGE_SIZE; the kernel ring of the thread follows it. The process can write the page, so the kernel reads back from it only fault_read, and treats that value as a claim . At most one page (#assert below). See thread record.

Example: system.thread_record().number is 0 in the first thread of a process, and the events word is the word that a thread waits on for an interrupt.

See: Architecture: The fault ring

Kind
struct
Package
src/library/modus/contract/operation
Size
1072 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:1895
FieldTypeOffsetSize
self08
parameter88
number168
events244
processors284
fault_written324
fault_read364
fault_full404
fault_reserved444
fault_records[16]Fault_Record481024

1072 bytes of fields and 0 bytes of padding: 1072 bytes.

Fault_Record

Fault_Record :: struct {
	thread:      u64, // The number of the thread in its process (Thread_Record.number).
	serial:      u64, // The serial of the fault: a count of the faults of this process that went to a ring (the first is 1). Fault_Answer names it, so an answer for an earlier fault, or for an ended thread whose number serves again, is refused.
	address:     u64, // A page fault: the address of the access. 0 for another kind.
	access:      u64, // A page fault: Fault_Access, what the access was. 0 for another kind.
	// The address where the thread continues after Resume. A fault: the
	// instruction that faulted, which runs again. A trap (Debug,
	// Breakpoint): the instruction after the one that trapped, so its
	// length is not known here: int3 (the byte CC) and int1 (the byte F1) are one byte, int 3
	// (CD 03) is two. A debugger that wrote CC subtracts 1. A Debug fault of
	// an execute breakpoint is the one Debug that is a fault: the
	// instruction of the breakpoint, which did not run.
	instruction: u64,
	kind:        u64, // The processor exception: the word of a Fault_Kind, read through fault_kind_of_word.
	// The error code that the processor gave with the exception, whole.
	// General_Protection: 0; a selector that the process loaded or named;
	// or (n << 3) | 2 for an `int n` whose gate a process cannot use (0x72
	// for int 14), which is never the exception n. Segment_Not_Present and
	// Stack_Fault: 0 or a selector. Page_Fault: the bits of the access.
	// Debug: the debug status, what made the exception
	// (`DEBUG_STATUS_STEP`, `DEBUG_STATUS_BREAKPOINTS`); 0 for int1. 0
	// for a kind with no error code.
	error_code:  u64,
	reserved:    u64, // 0.
}

One fault that the kernel gave to the fault handler of a process, in the fault ring of the thread record of the handler.

The kernel writes it; the handler reads it, decides, and answers with Fault_Answer and the serial. The thread of the record waits until the answer. A handler that resolves a page fault on first use commits the page (Memory_Commit) or changes its protection (Memory_Protect), then answers Resume; a debugger reads the registers with Thread_Control. 64 bytes. See fault record and .

Example: a write to an uncommitted page at 0x1000_0000_2000 gives kind = .Page_Fault, address = 0x1000_0000_2000, access = {.Write} (2), and error_code = 2.

See: Architecture: The fault ring

Kind
struct
Package
src/library/modus/contract/operation
Size
64 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:1941
FieldTypeOffsetSize
thread08
serial88
address168
access248
instruction328
kind408
error_code488
reserved568

64 bytes of fields and 0 bytes of padding: 64 bytes.

Fault_Access_Bit

Fault_Access_Bit :: enum u64 {
	Present = 0, // The page has a translation: the access was not permitted. Without it: the page has no frame (not committed, or no mapping).
	Write   = 1, // The access was a write. Without it: a read, or an instruction fetch.
	Execute = 4, // The access was an instruction fetch.
}

What a faulting access was: the bits of the error code of the processor.

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:2099
MemberValueHexadecimal
Present00x0
Write10x1
Execute40x4

Fault_Access

Fault_Access :: bit_set[; u64]

What a faulting access was, as the bits of the error code of a page fault: Fault_Record.access.

Kind
bit set
An alias of
bit_set[Fault_Access_Bit; u64]
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Underlying type
Element
Source
src/library/modus/contract/operation/operation.odin:2106
BitMemberMask
0Present0x1
1Write0x2
4Execute0x10

Fault_Kind

Fault_Kind :: enum u64 {
	Divide_Error        = 0, // Fault. div or idiv by 0, or a quotient too large.
	Debug               = 1, // Trap: the trap flag after an instruction, int1, or a data breakpoint after the access. Fault: an execute breakpoint, before its instruction. The error code of the record is the debug status.
	Breakpoint          = 3, // Trap. int3.
	Invalid_Opcode      = 6, // Fault. ud2, or an instruction that this processor does not have.
	Segment_Not_Present = 11, // Fault. A load of a segment register with a selector whose descriptor is not present.
	Stack_Fault         = 12, // Fault. A stack access at an address that is not canonical.
	General_Protection  = 13, // Fault. A privileged instruction, an address that is not canonical, a bad selector, `int n` for a vector other than 3; sgdt, sidt, sldt, smsw and str when the processor has UMIP.
	Page_Fault          = 14, // Fault. An access that the page table refuses.
	X87_Floating_Point  = 16, // Fault. An unmasked exception of the x87 unit, at the next x87 instruction (the kernel sets CR0.NE on each processor).
	Alignment_Check     = 17, // Fault. An access that is not aligned, with the flag AC set (the kernel sets CR0.AM on each processor).
	Simd_Floating_Point = 19, // Fault. An unmasked exception of an SSE or AVX instruction.
}

The kind of a fault: the processor exception, named by its vector. These are the kinds that the kernel delivers to a fault handler. A fault class says where the thread continues after Resume.

Fault: the instruction did not run; its address is in the frame, and it
       runs again.
Trap:  the instruction ran; the frame holds the address of the next one.
Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:1974
MemberValueHexadecimal
Divide_Error00x0
Debug10x1
Breakpoint30x3
Invalid_Opcode60x6
Segment_Not_Present110xB
Stack_Fault120xC
General_Protection130xD
Page_Fault140xE
X87_Floating_Point160x10
Alignment_Check170x11
Simd_Floating_Point190x13

Fault_Kinds

Fault_Kinds :: bit_set[; u64]

A set of fault kinds, by their vectors: the form of the argument of Fault_Handler_Set (fault_kinds_of_argument).

Kind
bit set
An alias of
bit_set[Fault_Kind; u64]
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Underlying type
Element
Named by
Source
src/library/modus/contract/operation/operation.odin:2002
BitMemberMask
0Divide_Error0x1
1Debug0x2
3Breakpoint0x8
6Invalid_Opcode0x40
11Segment_Not_Present0x800
12Stack_Fault0x1000
13General_Protection0x2000
14Page_Fault0x4000
16X87_Floating_Point0x10000
17Alignment_Check0x20000
19Simd_Floating_Point0x80000

Fault_Class

Fault_Class :: enum u8 {
	Never_Delivered = 0, // The kernel never gives this vector to a fault handler: it stops the process, or it is not a fault of a thread.
	Fault           = 1, // The instruction did not run: after Resume it runs again.
	Trap            = 2, // The instruction ran: after Resume the thread continues at the next one.
}

The class of a vector of the processor (fault_kind_class): Fault and Trap as above; a vector that is not a Fault_Kind is never delivered.

Kind
enum
Package
src/library/modus/contract/operation
Size
1 byte
Alignment
1 byte
Base type
Source
src/library/modus/contract/operation/operation.odin:2041
MemberValueHexadecimal
Never_Delivered00x0
Fault10x1
Trap20x2

Fault_Answer_Kind

Fault_Answer_Kind :: enum u64 {
	None   = 0, // No answer: refused.
	Resume = 1, // The thread continues with its registers: at the instruction of its record (the faulting instruction again, or the next one after a trap), or where Thread_Control wrote. For a kind of FAULT_KINDS_RESUMABLE, or after a write of Thread_Control.
	Stop   = 2, // The process stops as if no handler were set: the stop cause and the stop report of the fault.
}

The answer for a thread that waits in the fault ring.

A thread of the process gives it to Fault_Answer with the serial of the fault record. A kind that is not Resume or Stop is refused.

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:2112
MemberValueHexadecimal
None00x0
Resume10x1
Stop20x2

Thread_Control_Command

Thread_Control_Command :: enum u64 {
	None                 = 0, // Refused.
	// Adds 1 to the stop count -> the count. When the operation returns, the
	// thread runs no instruction until its count is 0 again: a thread on
	// another processor left it; a thread in a wait stays in it, and does
	// not run when it ends. The calling thread itself stops after its kernel
	// entry. At most THREAD_STOP_COUNT_LIMIT (Bad_State above).
	// One case returns earlier: when the calling thread is itself held (it
	// stopped itself earlier in the same entry, or another thread stopped
	// it), the operation does not wait for a thread on another processor to
	// leave it, so that two threads that stop each other do not wait for
	// each other. That thread then leaves its processor at the interrupt
	// that the stop sent, and a read of its registers gets Bad_State until
	// it left.
	Stop                 = 1,
	// Takes 1 from the stop count -> the count. Bad_State at 0. At 0, a
	// thread whose wait ended runs again. The debugger of the process
	// takes back only the stops that it made, and the other callers only
	// the stops that the debugger did not make: Bad_State when the caller
	// has no stop of its own on the thread.
	Resume               = 2,
	// Writes a Thread_Registers at the address (size: at least its size) ->
	// the bytes written.
	Read_Registers       = 3,
	// Reads a Thread_Registers at the address (size: at least its size): the
	// thread continues with these registers. Bad_Operation for values that
	// a thread cannot hold (thread_registers_refusal): nothing changes.
	Write_Registers      = 4,
	// Writes the extended state area of the thread at the address (size: at
	// least the bytes of the area, Thread_State) -> the bytes written, the
	// components. The layout is the one of the processor: the standard form
	// of xsave, with the offset of each component from CPUID leaf 0xD; or
	// the 512 bytes of fxsave on a processor with no xsave.
	Read_Extended_State  = 5,
	// Reads the extended state area at the address: the thread continues
	// with it. Bad_Operation for an area that the processor would refuse
	// (extended_state_refusal): nothing changes.
	Write_Extended_State = 6,
	// Writes the Thread_Schedule of the thread at the address (size: at
	// least its size) -> the bytes written. The values are the ones in use:
	// never 0. The thread is not held. A thread handle needs Inspect; the
	// machine handle with Schedule and Inspect names any thread by its
	// machine number.
	Read_Schedule        = 7,
	// Reads a Thread_Schedule at the address: the thread has this weight and
	// this request from now on, also while it runs. Through 0 or a thread
	// handle (with Control) the write only lowers: Bad_Operation for a
	// weight above the weight of the thread or a request above its request,
	// and nothing changes; 0 keeps a value. The machine handle with Schedule
	// and Inspect names any thread by its machine number; its write gives
	// the four values, raises too, and sets the weight limit and the
	// new-thread weight limit: a weight above the new limit becomes the
	// limit (thread_schedule_after_machine_write). A raised weight starts the
	// thread again as a new thread for its strategy.
	Write_Schedule       = 8,
	// Writes the Thread_Breakpoints of the thread at the address (size: at
	// least its size) -> the bytes written. The thread is held.
	Read_Breakpoints     = 9,
	// Reads a Thread_Breakpoints at the address: the thread has these
	// breakpoints from now on, and no other. The thread is held. Only
	// through the process handle with Debug, from the debugger of the
	// process (thread_control_needs_the_debugger): Bad_Handle with 0 or a
	// thread handle.
	// Bad_Operation for a breakpoint that a thread cannot have
	// (thread_breakpoints_refusal): nothing changes. A reached breakpoint is
	// a fault of the kind Debug of the thread.
	Write_Breakpoints    = 10,
	// Copies `size` bytes (at most THREAD_MEMORY_READ_LIMIT) from the
	// address `source` of the process of the thread to the address -> the
	// bytes copied. The thread is not held. The copy reads only pages that
	// the process maps, that it can read and that have a frame: no read
	// gives a frame to a page. It stops before the first page that is not
	// so, and gives the count before it; Bad_Address when that page holds
	// the first byte. Device memory is never read.
	Read_Memory          = 11,
	// Writes the Thread_Placement of the thread at the address (size: at
	// least its size) -> the bytes written. Each set holds only processors
	// that the machine has, and is never 0. The thread is not held. A
	// thread handle needs Inspect; the machine handle with Schedule and
	// Inspect names any thread by its machine number.
	Read_Placement       = 12,
	// Reads a Thread_Placement at the address: only the processors of the
	// set run the thread from now on, also when it runs now: it then
	// leaves a processor that is not in the set at the end of its stint at
	// the latest. Through 0 or a thread handle (with Control) the write
	// only narrows: Bad_Operation for a set with a processor that the set
	// of the thread does not have, and nothing changes; 0 keeps the set.
	// The machine handle with Schedule and Inspect names any thread by its
	// machine number; its write gives the set and the limit, and widens
	// too. Bad_Operation for a set or a limit with no processor that the
	// machine has, and for a set with no processor inside the limit
	// (thread_placement_after_write): nothing changes.
	Write_Placement      = 13,
	// Writes the Process_Schedule of a process at the address (size: at
	// least its size) -> the bytes written. Only the machine handle with
	// Schedule and Inspect; `number` names the process by its slot and its
	// serial (process_slot_and_serial). The value in use: never 0.
	Read_Process_Schedule = 14,
	// Reads a Process_Schedule at the address: each thread of the process
	// creates its threads under it from now on (the creations that come
	// after the write in the order of the kernel). Only the machine handle
	// with Schedule and Inspect. Bad_Operation for a value above
	// WEIGHT_FULL (process_schedule_after_write): nothing changes.
	Write_Process_Schedule = 15,
	// The calling thread counts the four events of Thread_Counters from 0,
	// from now on, in user mode only -> nothing. A thread that counts starts
	// again from 0. Only the machine handle with Counters; `number` is not
	// read (thread_control_counts_the_caller). Read_Counters takes the same
	// handle.
	Start_Counters       = 16,
	// Writes the Thread_Counters of the calling thread at the address (size:
	// at least its size) -> the bytes written. The thread goes on counting.
	// Bad_State when the thread does not count.
	Read_Counters        = 17,
	// The calling thread stops counting -> nothing. A thread that does not
	// count is left as it is. It needs no handle and no right, and gives Ok
	// on each machine: it only takes a capability away, so a thread whose
	// right was revoked can still stop.
	Stop_Counters        = 18,
	// Starts recording process inputs of the target process (handle in
	// `thread` with Debug) into the contiguous memory object named by the
	// handle in `number` (with Read and Write) -> nothing. The target must
	// be in state Created, hold no device or shared writable mapping, and
	// not already be recorded or replayed.
	Record_Start         = 19,
	// Ends recording or replay of the target process (handle in `thread`
	// with Debug), writes the end record into the input history, and
	// restores any point copies -> nothing.
	Record_End           = 20,
	// Starts replaying the target process (handle in `thread` with Debug)
	// from the input history in the contiguous memory object named by the
	// handle in `number` (with Read and Write) -> nothing. The target must
	// be in state Created and not already be recorded or replayed.
	Replay_Start         = 21,
}

What Thread_Control does. The results are in the completion record.

Each command of the registers and of the stop count needs Inspect on the thread handle, and a write of the registers and a read of the memory need Write too (thread_control_rights). A write of the breakpoints takes only the process handle with Debug of the debugger. A read or a write of the registers or of the breakpoints needs the thread held: its stop count above 0 and its processor left (Bad_State before). The two commands of the schedule, the two of the placement and the read of the memory need no hold. The three commands of the thread counters act on the calling thread: a start and a read through the machine handle with Counters, a stop with no handle. See thread control and .

See: Architecture: The control of a thread

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:2133
MemberValueHexadecimal
None00x0
Stop10x1
Resume20x2
Read_Registers30x3
Write_Registers40x4
Read_Extended_State50x5
Write_Extended_State60x6
Read_Schedule70x7
Write_Schedule80x8
Read_Breakpoints90x9
Write_Breakpoints100xA
Read_Memory110xB
Read_Placement120xC
Write_Placement130xD
Read_Process_Schedule140xE
Write_Process_Schedule150xF
Start_Counters160x10
Read_Counters170x11
Stop_Counters180x12
Record_Start190x13
Record_End200x14
Replay_Start210x15

Thread_Control_State_Refusal

Thread_Control_State_Refusal :: enum u8 {
	None                 = 0,
	Thread_Absent        = 1,  // Thread number (process-local or machine) names no live thread.
	Process_Absent       = 2,  // Process slot and serial name no live process.
	Thread_Ended         = 3,  // Target thread ended or is stopping.
	Process_Stopped      = 4,  // Target process is stopped or empty.
	Not_Debugger         = 5,  // Caller is not the attached debugger of the target process.
	Stop_Count_Limit     = 6,  // Thread stop count reached THREAD_STOP_COUNT_LIMIT.
	Not_Stopped          = 7,  // Resume with no stop held by this caller.
	Not_Held             = 8,  // Registers, extended state, or breakpoints on a thread that is not held off a processor.
	Counters_Not_Started = 9,  // Read_Counters while the calling thread is not counting.
	Thread_Recording     = 10, // Write_Placement while the thread is recording or replaying.
	Process_Recording    = 11, // Record_Start or Replay_Start while recording or replaying is already active.
	Process_Not_Created  = 12, // Record_Start or Replay_Start on a process that is not Created, or is the caller.
	Process_Disqualified = 13, // Record_Start or Replay_Start on a process disqualified for recording.
	History_In_Use       = 14, // Record_Start or Replay_Start with a history memory object already in use.
	No_Pinned_Processor  = 15, // Record_Start or Replay_Start when no processor can be pinned.
	Not_Recording        = 16, // Record_End on a process not recorded by this caller.
}

Why Thread_Control refused with Bad_State: the kernel records this member in Operation_In_Progress at the point of refusal, and diagnose turns it into an through thread_control_state_error. Keeping the mapping here lets host tests check every refusal path without booting a machine.

Kind
enum
Package
src/library/modus/contract/operation
Size
1 byte
Alignment
1 byte
Base type
Source
src/library/modus/contract/operation/thread_control_state.odin:11
MemberValueHexadecimal
None00x0
Thread_Absent10x1
Process_Absent20x2
Thread_Ended30x3
Process_Stopped40x4
Not_Debugger50x5
Stop_Count_Limit60x6
Not_Stopped70x7
Not_Held80x8
Counters_Not_Started90x9
Thread_Recording100xA
Process_Recording110xB
Process_Not_Created120xC
Process_Disqualified130xD
History_In_Use140xE
No_Pinned_Processor150xF
Not_Recording160x10

Fault_Handler_Action

Fault_Handler_Action :: enum u64 {
	Set = 0, // The thread becomes the fault handler of the process, or the debug handler of the process of `process`.
	End = 1, // The delivery ends: each fault stops the process again. With `process`: the debugging ends (the detach).
}

What Fault_Handler_Set does, in its argument end. Its word crosses the command record, so each value is explicit.

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:2093
MemberValueHexadecimal
Set00x0
End10x1

Extended_State_Layout

Extended_State_Layout :: enum u64 {
	Legacy      = 0, // The EXTENDED_STATE_LEGACY_BYTES bytes of fxsave, with no header.
	With_Header = 1, // The header of xsave at EXTENDED_STATE_LEGACY_BYTES, then the components of XCR0.
}

The layout of the extended state area of a thread on this machine: the result 5 of Thread_State. Its word crosses the completion record, so each value is explicit; a reader takes it through member_of_word.

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Source
src/library/modus/contract/operation/operation.odin:2639
MemberValueHexadecimal
Legacy00x0
With_Header10x1

Thread_Registers

Thread_Registers :: struct {
	// The general registers. `rsp` is the stack address: a write refuses an address that is not canonical.
	rax, rbx, rcx, rdx: u64,
	rsi, rdi, rbp, rsp: u64,
	r8, r9, r10, r11:   u64,
	r12, r13, r14, r15: u64,
	rip:    u64, // The address of the next instruction of the thread: below USER_END.
	rflags: u64, // THREAD_FLAGS_REQUIRED set, and no bit outside THREAD_FLAGS_ALLOWED.
	cs:     u64, // THREAD_CODE_SELECTOR: the one code selector of a process.
	ss:     u64, // THREAD_STACK_SELECTOR: the one stack selector of a process.
	// Read only, 1: the last entry of the thread into the kernel was a
	// syscall that has not returned yet: the thread waits in it, or its
	// processor left it after the operations of the entry and before the
	// return (its time slice ended, or a stop held it). At that return, rax
	// is the time, as after each kernel entry (the line at the top of this
	// file): a write of rax is lost; rcx and r11 hold what the syscall
	// instruction left there. 0: the thread left at an interrupt or a fault
	// of its own code, and each register is its own.
	in_kernel_entry: u64,
	reserved:        u64, // Not read.
}

The general registers, the instruction address and the flags of a thread that Thread_Control holds. The names are the names of the registers of the processor.

Read_Registers writes it into memory of the caller; Write_Registers reads it from there. A written image is hostile input to the kernel: it must pass thread_registers_refusal, so that the return of the processor to the thread never faults in the kernel. 176 bytes. See register image.

Example: a debugger that wrote int3 (the byte CC) at a breakpoint reads the registers after the trap, subtracts 1 from rip, writes them back, and answers Resume.

Kind
struct
Package
src/library/modus/contract/operation
Size
176 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:2546
FieldTypeOffsetSize
rax08
rbx88
rcx168
rdx248
rsi328
rdi408
rbp488
rsp568
r8648
r9728
r10808
r11888
r12968
r131048
r141128
r151208
rip1288
rflags1368
cs1448
ss1528
in_kernel_entry1608
reserved1688

176 bytes of fields and 0 bytes of padding: 176 bytes.

Thread_Write_Refusal

Thread_Write_Refusal :: enum u64 {
	None                = 0, // Nothing refused: the write is accepted.
	Code_Selector       = 1, // `cs` is not `THREAD_CODE_SELECTOR`.
	Stack_Selector      = 2, // `ss` is not `THREAD_STACK_SELECTOR`.
	Flags               = 3, // A required flag is clear, or a flag outside THREAD_FLAGS_ALLOWED is set.
	Instruction_Address = 4, // Not below USER_END.
	Stack_Address       = 5, // Not canonical.
	Mxcsr               = 6, // A bit that the processor does not take (its MXCSR mask).
	Header_Components   = 7, // XSTATE_BV names a component that the kernel does not save.
	Header_Reserved     = 8, // A byte of the header after XSTATE_BV is not 0.
	Weight              = 9, // The weight of a Thread_Schedule is above WEIGHT_FULL, or, in a write that only lowers, above the weight that the thread has: the error record gives the most that applied.
	Request             = 10, // The request of a Thread_Schedule is above REQUEST_LIMIT, or, in a write that only lowers, above the request that the thread has: the error record gives the most that applied.
	Weight_Limit        = 11, // The weight limit of a Thread_Schedule, in a write through the machine handle, is above WEIGHT_FULL.
	Breakpoint_Kind     = 12, // The kind of a breakpoint of a Thread_Breakpoints is not a Thread_Breakpoint_Kind.
	Breakpoint_Length   = 13, // The length of a data breakpoint is not 1, 2, 4 or 8; or the length of an execute breakpoint or of an empty place is not 0.
	Breakpoint_Address  = 14, // The address of a breakpoint is not below USER_END, is not a multiple of the length of a data breakpoint, or is not 0 in an empty place.
	Processors          = 15, // The set of processors of a Thread_Placement has no processor that the machine has, has none inside the limit, or, in a write that only narrows, has a processor that the set of the thread does not have: the error record gives the set that it had to stay inside.
	Processors_Limit    = 16, // The limit of a Thread_Placement, in a write through the machine handle, has no processor that the machine has: the error record gives the processors of the machine.
	New_Thread_Weight_Limit = 17, // The new-thread weight limit of a Thread_Schedule or of a Process_Schedule, in a write through the machine handle, is above WEIGHT_FULL.
}

Which part of a Thread_Registers, of an extended state area, of a Thread_Schedule, of a Thread_Breakpoints or of a Thread_Placement a write refused.

Thread_Control gives Bad_Operation for a refused write, and the error record names the refusal and the value. Nothing of the thread changes.

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Source
src/library/modus/contract/operation/operation.odin:2589
MemberValueHexadecimal
None00x0
Code_Selector10x1
Stack_Selector20x2
Flags30x3
Instruction_Address40x4
Stack_Address50x5
Mxcsr60x6
Header_Components70x7
Header_Reserved80x8
Weight90x9
Request100xA
Weight_Limit110xB
Breakpoint_Kind120xC
Breakpoint_Length130xD
Breakpoint_Address140xE
Processors150xF
Processors_Limit160x10
New_Thread_Weight_Limit170x11

Thread_Schedule

Thread_Schedule :: struct {
	weight:       u32, // From 1 to the weight limit of the thread. The share of the thread under the strategies that use weights. 0 in a write: the weight that the thread has, or the limit in a write through the machine handle.
	request:      u32, // Microseconds, from 1 to `REQUEST_LIMIT`. The delay that the thread asks for under EEVDF. 0 in a write: the request that the thread has, or `REQUEST_DEFAULT` in a write through the machine handle.
	weight_limit: u32, // From 1 to `WEIGHT_FULL`; 0 in a write is `WEIGHT_FULL`. Read from a write through the machine handle only.
	new_thread_weight_limit: u32, // From 1 to `weight_limit`: the weight limit of a thread that this thread creates. 0 in a write is the weight limit of the write. Read from a write through the machine handle only.
}

The schedule of a thread: the two values that a process sets for the scheduling strategies. Thread_Control reads it (Read_Schedule) and writes it (Write_Schedule) while the thread lives, also while it runs; Thread_Create takes the same two values. See thread schedule and.

A read gives the values in use, never 0.

Who writes decides what a write can do:

  • A write through 0 (a thread of the calling process) or through a thread handle only lowers: a weight above the weight that the thread has now, or a request above its request, gives Bad_Operation, and nothing changes. 0 keeps the value that the thread has. weight_limit and new_thread_weight_limit are not read.
  • A write through the machine handle with Schedule and Inspect gives the four values, and it alone raises a weight or a request. 0 is the default of each: WEIGHT_FULL for the limit, the limit for the weight and for the new-thread weight limit, REQUEST_DEFAULT for the request. A weight or a new-thread weight limit above the new limit becomes the limit (thread_schedule_after_machine_write). A thread whose weight was raised starts again as a new thread for its scheduling strategy: what it owed and what it was owed are gone.

The weight limit is the most that the weight of the thread can be. The new-thread weight limit is the weight limit that the thread gives to a thread that it creates, and to the first thread of a process that it starts (thread_schedule_of_new_thread). So a weight that the holder of Schedule lowered stays lowered, also in the new threads. The share policy of the process scheduler uses the second limit to bound the weight of a thread that no round of the policy saw (new-thread weight limit).

Example: {weight = 256, request = 500} gives the thread a quarter of the share of a thread of the full weight, and asks for stints of 500 microseconds under EEVDF.

See: Scheduling strategies: The schedule of a live thread

Kind
struct
Package
src/library/modus/contract/operation
Size
16 bytes
Alignment
4 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:1438
FieldTypeOffsetSize
weight04
request44
weight_limit84
new_thread_weight_limit124

16 bytes of fields and 0 bytes of padding: 16 bytes.

Process_Schedule

Process_Schedule :: struct {
	new_thread_weight_limit: u32, // From 1 to `WEIGHT_FULL`: a thread of the process creates no thread with a higher weight limit. 0 in a write is `WEIGHT_FULL`.
}

The schedule of a process: the value that bounds each creation by any thread of one process at once. Only the machine handle with Schedule and Inspect reads it (Read_Process_Schedule) and writes it (Write_Process_Schedule). A process created has the full value. The share policy of the process scheduler writes it before it reads the threads of a process: one write then bounds each thread that the process creates after it, also a thread that a thread created a moment before the write and that the policy never saw.

Example: {new_thread_weight_limit = 32} gives each thread that the process creates after the write the weight 32 at most.

Kind
struct
Package
src/library/modus/contract/operation
Size
4 bytes
Alignment
4 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:1474
FieldTypeOffsetSize
new_thread_weight_limit04

4 bytes of fields and 0 bytes of padding: 4 bytes.

Thread_Placement

Thread_Placement :: struct {
	processors:       u64, // Bit n: the processor n can run the thread. 0 in a write: the set that the thread has, or the limit in a write through the machine handle.
	processors_limit: u64, // The most that `processors` can be. 0 in a write is every processor. Read from a write through the machine handle only.
}

The placement of a thread: the processors that can run it, and the most that this set can be. Thread_Control reads it (Read_Placement) and writes it (Write_Placement) while the thread lives, also while it runs. See thread placement and (Scheduling strategies, "The placement of a thread").

A set of processors is a u64: bit n is the processor n of . A read gives sets that hold only processors that the machine has, and that are never 0. A thread that never got a placement has every processor of the machine in both sets.

Who writes decides what a write can do (thread_placement_after_write):

  • A write through 0 (a thread of the calling process) or through a thread handle with Control only narrows: a set with a processor that the set of the thread does not have gives Bad_Operation, and nothing changes. 0 keeps the set that the thread has. processors_limit is not read.
  • A write through the machine handle with Schedule and Inspect gives the two sets, and it alone widens a set. 0 is the default of each: every processor for the limit, the limit for the set. The part of the set that is outside the new limit is dropped. As a write of a through the machine handle, it always gives each value: the set 0 is the whole limit, not the set that the thread has, so it undoes a narrowing that the process of the thread made. A holder that keeps the set reads the placement first and writes the set that it read.

For each writer, the bits of processors that the machine does not have are dropped, so a writer can give all ones. A set that then has no processor, and a set with no processor inside the limit, give Bad_Operation: a thread with no processor never runs, and that is Stop, which has its own right.

The limit is the most that the set of the thread can be. A new thread, and the first thread of a process that a thread starts, get the limit of the thread that creates them, as their set and as their limit. So a limit that the holder of Schedule wrote stays.

A thread whose processor left its set leaves that processor at the end of its stint at the latest: the write sends no interrupt.

Example: {processors = 0b0100} keeps a thread on the processor 2.

Kind
struct
Package
src/library/modus/contract/operation
Size
16 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:1587
FieldTypeOffsetSize
processors08
processors_limit88

16 bytes of fields and 0 bytes of padding: 16 bytes.

Thread_Counters

Thread_Counters :: struct {
	instructions_retired: u64,
	cycles:               u64, // Cycles of the processor while it runs the thread, not halted.
	cache_misses:         u64,
	branch_misses:        u64, // Branches mispredicted, retired.
}

The counts of the events of the processor for the code of one thread, in user mode only, since its last Start_Counters (Read_Counters). 32 bytes. The order of the fields is the order of the general counters 0 to 3.

The cache misses are the misses of one level of one vendor: the last level cache on Intel, the L2 cache on AMD. Compare two counts on one machine, not two machines. See thread counters and .

Example: a loop of 1 000 000 turns of 3 instructions each gives instructions_retired of at least 3 000 000.

See: Architecture: The counters of a thread

Kind
struct
Package
src/library/modus/contract/operation
Size
32 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:2304
FieldTypeOffsetSize
instructions_retired08
cycles88
cache_misses168
branch_misses248

32 bytes of fields and 0 bytes of padding: 32 bytes.

Thread_Breakpoint_Kind

Thread_Breakpoint_Kind :: enum u32 {
	None          = 0, // No breakpoint in this place.
	Execute       = 1, // The thread reaches the instruction at the address: a Debug fault before the instruction runs.
	Write         = 2, // The thread writes a byte of the range: a Debug trap after the instruction.
	Read_Or_Write = 3, // The thread reads or writes a byte of the range: a Debug trap after the instruction.
}

What a breakpoint of a thread stops on.

Kind
enum
Package
src/library/modus/contract/operation
Size
4 bytes
Alignment
4 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:2417
MemberValueHexadecimal
None00x0
Execute10x1
Write20x2
Read_Or_Write30x3

Thread_Breakpoint

Thread_Breakpoint :: struct {
	address: u64, // Below USER_END: an address of a process, never of the kernel. A data breakpoint: a multiple of `length`.
	kind:    ,
	length:  u32, // A data breakpoint: 1, 2, 4 or 8 bytes. Execute and None: 0.
}

One breakpoint of a thread: an address of its process, and what stops there. 16 bytes.

Example: {address = 0x40_1000, kind = .Execute} stops the thread before the instruction at 0x40_1000; {address = 0x7FFF_0010, kind = .Write, length = 8} stops it after a write to one of the 8 bytes from that address.

Kind
struct
Package
src/library/modus/contract/operation
Size
16 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:2431
FieldTypeOffsetSize
address08
kind84
length124

16 bytes of fields and 0 bytes of padding: 16 bytes.

Thread_Breakpoints

Thread_Breakpoints :: struct {
	breakpoints: [THREAD_BREAKPOINT_CAPACITY],
}

The breakpoints of one thread, as Read_Breakpoints and Write_Breakpoints of Thread_Control give and take them. The place of a breakpoint is its number in the debug status of a fault record (DEBUG_STATUS_BREAKPOINTS). A breakpoint is of one thread: no other thread and no other process stops on it. A written image is hostile input to the kernel: it must pass thread_breakpoints_refusal. 64 bytes. See breakpoint.

Kind
struct
Package
src/library/modus/contract/operation
Size
64 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:2445
FieldTypeOffsetSize
breakpoints[4]Thread_Breakpoint064

64 bytes of fields and 0 bytes of padding: 64 bytes.

Event_Kind

Event_Kind :: enum u32 {
	None      = 0, // No kind: a rule of this kind is refused.
	Operation = 1, // One kernel operation, at its end.
	Switch    = 2, // A processor takes a thread from a run queue.
	Fault     = 3, // An exception of a thread of a process.
	Lock_Wait = 4, // A processor took a lock of the kernel after a wait.
}

Kernel events. The kind of a kernel event, and what the fields of its Event_Record hold:

Operation: one operation of a kernel entry. detail: the Operation;
           value_0: its cycles of the cycle counter, from the start of
           its execution to its end; value_1: its Status.
Switch:    a processor takes a thread from a run queue. The process and
           the thread of the record are the thread taken; value_0: the
           process slot of the thread that the processor left just
           before (0: none: it was idle, or it took no thread first);
           value_1: the number of that thread.
Fault:     an exception of a thread of a process. detail: the vector;
           value_0: the address of a page fault, only when a rule that
           names the process accepted the event (a rule for every
           process gets 0: the order of the pages that a process
           touches can show its data); 0 for another vector;
           value_1: the Event_Fault_Outcome.
Lock_Wait: a processor took a lock of the kernel after a wait. detail:
           the Lock_Kind; value_0: the cycles of the wait. The process
           and the thread are the current thread of the processor (0:
           none).

A process with the right Events on the machine chooses the kinds to record with the rules of its event table (Events_Set). See kernel event.

See: Architecture: Kernel events

Kind
enum
Package
src/library/modus/contract/operation
Size
4 bytes
Alignment
4 bytes
Base type
Source
src/library/modus/contract/operation/operation.odin:2706
MemberValueHexadecimal
None00x0
Operation10x1
Switch20x2
Fault30x3
Lock_Wait40x4

Event_Fault_Outcome

Event_Fault_Outcome :: enum u64 {
	None      = 0,
	First_Use = 1, // A page on first use: the page has its frame, and the instruction runs again.
	Fault_Ring = 2, // A record of the fault ring of the process: the thread waits for an answer.
	Stopped   = 3, // The process stops.
}

What the kernel did with a fault of a process (Event_Record.value_1 of a Fault).

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Source
src/library/modus/contract/operation/operation.odin:2729
MemberValueHexadecimal
None00x0
First_Use10x1
Fault_Ring20x2
Stopped30x3

Event_Rule_Flag

Event_Rule_Flag :: enum u32 {
	Match_Detail = 0, // The detail of the event must be the detail of the rule. Not for Switch.
}

A flag of an event rule. A flag that the kernel does not know makes the rule not valid: Events_Set gives Bad_Operation.

Kind
enum
Package
src/library/modus/contract/operation
Size
4 bytes
Alignment
4 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:2738
MemberValueHexadecimal
Match_Detail00x0

Event_Rule_Flags

Event_Rule_Flags :: bit_set[;u32]

The flags of one .

Kind
bit set
An alias of
bit_set[Event_Rule_Flag; u32]
Package
src/library/modus/contract/operation
Size
4 bytes
Alignment
4 bytes
Underlying type
Element
Named by
Source
src/library/modus/contract/operation/operation.odin:2742
BitMemberMask
0Match_Detail0x1

Event_Rule

Event_Rule :: struct {
	kind:    u32, // The word of an Event_Kind (event_kind_of_word). None is refused.
	flags:   , // `Match_Detail`, or no flag.
	// A process handle of the caller with the right Read: only the events
	// of that process, with the address of its page faults (Read gives its
	// stop report, which has that address already). 0: every process and
	// the kernel itself (process 0), with no address of a fault.
	process: u64,
	detail:  u64, // With Match_Detail: the Operation, the vector of a Fault, or the Lock_Kind.
	// Operation and Lock_Wait: the least duration in nanoseconds, at most
	// EVENT_LEAST_NANOSECONDS_MOST. 0 for Switch and Fault.
	least_nanoseconds: u64,
	one_in:  u64, // 0 and 1: each event. N: one in N, at most EVENT_ONE_IN_MOST.
	reserved: [3]u64, // 0.
}

One rule of the event table. A rule accepts a kernel event of its kind when each of its tests passes: the process, the detail with Match_Detail, the least duration; then "one in N": of the events that passed the other tests of this rule, since the table was given, the event N, 2N, 3N and so on. A kernel event that a rule accepts is one Event_Record, whatever the other rules say. The kernel tests the rules in their order: at most EVENT_RULE_CAPACITY tests of a few fields, with no lock.

A process gives a table of rules to Events_Set; the kernel copies it and checks each rule first: an unknown kind or flag, a reserved word that is not 0, a duration for Switch or Fault, a detail for Switch or a duration above EVENT_LEAST_NANOSECONDS_MOST gives Bad_Operation; a bad process handle gives Bad_Handle. "One in N" is a count, never a random choice. 64 bytes. See event rule.

Example: {kind = u32(Event_Kind.Operation), flags = {.Match_Detail}, detail = u64(Operation.Memory_Map), least_nanoseconds = 10_000} records each Memory_Map of the machine that takes 10 ยตs or more.

Kind
struct
Package
src/library/modus/contract/operation
Size
64 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
Source
src/library/modus/contract/operation/operation.odin:2762
FieldTypeOffsetSize
kind04
flags44
process88
detail168
least_nanoseconds248
one_in328
reserved[3]u644024

64 bytes of fields and 0 bytes of padding: 64 bytes.

Event_Record

Event_Record :: struct {
	time:      u64, // The cycle counter at the event point (Time_Record: cycle_start and cycle_frequency).
	kind:      u32, // The word of an Event_Kind, read through event_kind_of_word.
	processor: u32, // The index of the processor.
	process:   u32, // The slot of the process. 0: the kernel, with no thread.
	thread:    u32, // The number of the thread in its process (Thread_Record.number). 0 when process is 0.
	process_serial: u64, // The serial of the process of the slot (Process_Report.process_serial).
	detail:    u64, // By kind: the Operation, the vector of a Fault, or the Lock_Kind. 0 for Switch.
	value_0:   u64, // By kind: see `Event_Kind`.
	value_1:   u64, // By kind: see `Event_Kind`.
	reserved:  u64, // 0.
}

One kernel event, in the event ring of the processor where it came.

The kernel writes it at an event point when a rule accepts the event; the process that gave the event table reads it with no kernel entry. What detail, value_0 and value_1 hold depends on kind (see Event_Kind). A record shows the address of a page fault only when a rule names its process with a handle with Read. 64 bytes. See event record.

Example: a Switch record with process = 7, thread = 2, value_0 = 0: the processor was idle, and took the thread 2 of the process in slot 7.

Kind
struct
Package
src/library/modus/contract/operation
Size
64 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:2835
FieldTypeOffsetSize
time08
kind84
processor124
process164
thread204
process_serial248
detail328
value_0408
value_1488
reserved568

64 bytes of fields and 0 bytes of padding: 64 bytes.

Event_Ring

Event_Ring :: struct {
	// The line that the kernel writes.
	written:   u64, // The count of records written in this ring since the table was given.
	lost:      u64, // The records that the kernel dropped because the ring was full (the lost count).
	records:   u64, // The capacity of the ring, written when the table is given.
	processor: u64, // The index of the processor of this ring.
	reserved_kernel: [4]u64, // Not written.
	// The line that the process writes.
	read:      u64, // The count of records that the process read: the kernel can write over each record before it.
	reserved_process: [7]u64, // Not read.
}

The head of one event ring. The ring of processor p starts at the byte p * (EVENT_RING_HEAD_BYTES + records * 64) of the memory object; its records follow its head. The kernel writes the record n at the index n % records, then written = n + 1. The process reads the records from read to written, then writes read: a place is free for the kernel again once read passed it. When records - (written - read) is 0, the kernel drops the record and adds 1 to lost: it never waits, and it never writes over a record that the process did not read. The kernel keeps its own counts; it reads only read from this memory, and a false value there loses records of this process, or lets the kernel write over records that this process did not read: nothing else.

The two lines of 64 bytes keep the words that the kernel writes and the word that the process writes on two cache lines. 128 bytes. See event ring.

Kind
struct
Package
src/library/modus/contract/operation
Size
128 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:2864
FieldTypeOffsetSize
written08
lost88
records168
processor248
reserved_kernel[4]u643232
read648
reserved_process[7]u647256

128 bytes of fields and 0 bytes of padding: 128 bytes.

Guest_Registers

Guest_Registers :: struct {
	rax, rbx, rcx, rdx: u64,
	rsi, rdi, rbp, rsp: u64,
	r8, r9, r10, r11:   u64,
	r12, r13, r14, r15: u64,
	rip:    u64, // In real mode, the offset in the code segment.
	rflags: u64, // Only the bits of `GUEST_FLAGS_DEFINED`; the kernel sets bit 1, which is always 1.
	cr0:    u64, // Only the low 32 bits; the kernel sets the extension type (bit 4), which is always 1.
	cr3:    u64, // The top table of the guest: the bits from 52 are 0.
	cr4:    u64, // Only the bits of `GUEST_CONTROL_4_DEFINED`.
	efer:   u64, // Only the bits of `GUEST_EFER_DEFINED`; the kernel sets SVME (bit 12), which the processor needs.
	inject_error_code:       u32, // The error code of an `Exception` with `inject_error_code_valid`, else 0.
	inject_vector:           u8, // The vector of the event to deliver.
	inject_kind:             u8, // The word of a `Guest_Inject_Kind`.
	inject_error_code_valid: u8, // 1: the exception pushes `inject_error_code`. 0 or 1.
	mode_load:               u8, // The word of a `Guest_Mode_Load`.
	code_selector:           u16, // The selector of the code segment of a mode load; after the exit, the selector of `cs` of the guest.
	data_selector:           u16, // The selector of the data segments of a mode load; after the exit, the selector of `ds` of the guest.
	interrupt_shadow:        u8, // 1: the guest is just after `sti` or `mov ss`, and takes no interrupt before the next instruction completes. 0 or 1.
	event_pending:           u8, // Written by the kernel: 1 when the guest processor holds an event that an exit interrupted, which its next entry delivers before any request. Not read; 0 or 1.
	reserved:                [2]u8, // 0.
	star:                    u64, // STAR: bits 32 to 47 the selectors of `syscall`, 48 to 63 those of `sysret`. Any value.
	lstar:                   u64, // LSTAR: the address that `syscall` enters in 64-bit mode. Canonical.
	sfmask:                  u64, // SFMASK: the flags that `syscall` clears. Bits 32 to 63 are 0.
	fs_base:                 u64, // The base of `fs` (FS_BASE). Canonical. A mode load does not change it.
	gs_base:                 u64, // The base of `gs` (GS_BASE). Canonical. A mode load does not change it.
	kernel_gs_base:          u64, // KERNEL_GS_BASE: the base that `swapgs` exchanges with `gs_base`. Canonical.
}

The registers of a guest processor that Guest_Run takes and gives: the general registers, the instruction address, the flags, the control registers, and the 64-bit system state that a system writes through model-specific registers (the targets of syscall, the bases of fs and gs), and the interrupt shadow. The kernel keeps the rest of the state of the guest processor (its segments, its descriptor tables, its extended state) between two runs. See guest and.

A process answers an exit by a change of the record before the next run: for Port_Read, the value in the low bytes of rax and the next instruction in rip; for Port_Write and Halt, the next instruction in rip; for a write of EFER (an exit Other), the new value in efer; for a write of LSTAR, SFMASK, STAR or a base of fs or gs, the new value in its field; for rdtsc and rdtscp (exits Other), the count in rdx:rax and the next instruction in rip. A process that moves rip past the instruction of the exit clears interrupt_shadow: that instruction ended the shadow. The kernel loads the control registers before each entry and writes them back after each exit: a process passes back the record that it got.

Two parts are requests of one run, which the kernel clears in the record when it serves them: mode_load, and the event (inject_kind and its fields). An event waits while the guest processor still holds an event that an exit interrupted: the kernel then leaves the request in the record, and the process runs again.

A record of zeros is a guest processor at the address 0 in real mode, with no flag set and nothing to deliver. 240 bytes.

Example: a guest at 0x1000 in real mode is {rip = 0x1000}; after the exit Port_Write of out dx, al with dx 0x80 and al 42, rax & 0xFF is 42.

See: Architecture: A guest

Kind
struct
Package
src/library/modus/contract/operation
Size
240 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
Source
src/library/modus/contract/operation/guest_registers.odin:90
FieldTypeOffsetSize
rax08
rbx88
rcx168
rdx248
rsi328
rdi408
rbp488
rsp568
r8648
r9728
r10808
r11888
r12968
r131048
r141128
r151208
rip1288
rflags1368
cr01448
cr31528
cr41608
efer1688
inject_error_code1764
inject_vector1801
inject_kind1811
inject_error_code_valid1821
mode_load1831
code_selector1842
data_selector1862
interrupt_shadow1881
event_pending1891
reserved[2]u81902
star1928
lstar2008
sfmask2088
fs_base2168
gs_base2248
kernel_gs_base2328

240 bytes of fields and 0 bytes of padding: 240 bytes.

Guest_Exit_Kind

Guest_Exit_Kind :: enum u64 {
	None          = 0, // Not an exit: a completion with a status that is not Ok.
	Port_Write    = 1, // `out`: a the port, b the size in bytes (1, 2 or 4), c the value.
	Port_Read     = 2, // `in`: a the port, b the size in bytes. The process writes the value in `rax` and the next instruction in `rip`.
	Halt          = 3, // `hlt`: the guest waits for an interrupt.
	Cpuid         = 4, // `cpuid`: the leaf is in `rax` and `rcx` of the record. The process writes the four answers and the next instruction.
	Memory        = 5, // An access to a guest physical address that no mapping allows: a the address, b the access (`Fault_Access`).
	Interrupted   = 6, // An interrupt of the machine ended the run, or its process stopped: nothing to answer. Run again.
	Shutdown      = 7, // The guest processor shut down: a fault while it delivered a double fault. Its state means nothing now.
	Refused_State = 8, // The processor refused the state of the guest processor: no instruction of the guest ran.
	Other         = 9, // Another instruction that the guest may not run alone: the exit code of the processor is the sixth result. `rdtsc` (0x6E) and `rdtscp` (0x87) are here: the process answers them from its own clock.
	// The guest opened its interrupt window: the record asked for an `External_Interrupt` while the guest
	// took no interrupt (its interrupt flag clear, or in its interrupt shadow), and the guest now takes one.
	// The request stays in the record: the next run delivers it.
	Interrupt_Window = 10,
	// An instruction writes the page of a switching mapping that holds it: `a` is the guest physical address
	// that it writes, `b` is 1 when the instruction is 64-bit code (its code segment has L, in long mode), else
	// 0. A page is never writable and executable at once, so the instruction never completes: the
	// process does the write for it through its own mapping of the memory and moves `rip` past it, or
	// stops the guest.
	Writes_Own_Page = 11,
}

What ended a run of a guest processor: the first result of Guest_Run. The comment of each member says what the results a, b and c hold. The fifth result is the address of the instruction after the one that exited, for the four kinds that name an instruction.

Example: out dx, al with dx 0x80 and al 42 gives Port_Write, a 0x80, b 1, c 42.

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:1653
MemberValueHexadecimal
None00x0
Port_Write10x1
Port_Read20x2
Halt30x3
Cpuid40x4
Memory50x5
Interrupted60x6
Shutdown70x7
Refused_State80x8
Other90x9
Interrupt_Window100xA
Writes_Own_Page110xB

Guest_Mode_Load

Guest_Mode_Load :: enum u8 {
	Keep         = 0, // No load: the segments stay as the guest left them. A new guest processor starts in real mode.
	Real_16      = 1, // Real mode: each segment of 64 KiB at the base of its selector times 16.
	Protected_32 = 2, // Protected mode: flat segments of 4 GiB, 32-bit code.
	Long_64      = 3, // Long mode: flat segments, 64-bit code.
}

The state of a mode that Guest_Run loads in the guest processor before its entry: the segments, the descriptor tables and the privilege level. The guest then changes its own segments, so a load is a request of one run: the kernel writes Keep in the record after it.

Example: a process that put a system in long mode at 0x20_0000 runs once with mode_load = u8(Guest_Mode_Load.Long_64), rip = 0x20_0000 and the control registers of long mode, then answers each exit with the record that the kernel gave back.

Kind
enum
Package
src/library/modus/contract/operation
Size
1 byte
Alignment
1 byte
Base type
Named by
Source
src/library/modus/contract/operation/guest_registers.odin:29
MemberValueHexadecimal
Keep00x0
Real_1610x1
Protected_3220x2
Long_6430x3

Guest_Inject_Kind

Guest_Inject_Kind :: enum u8 {
	None                   = 0, // Nothing to deliver.
	External_Interrupt     = 1, // An interrupt of a device, at a vector from `GUEST_VECTOR_FIRST_EXTERNAL`, with no error code, when the guest takes interrupts.
	Non_Maskable_Interrupt = 2, // The non-maskable interrupt: the vector 2.
	Exception              = 3, // An exception of the vectors 0 to 31, with its error code for the vectors that have one.
	Software_Interrupt     = 4, // `int n`: the guest returns to `rip`, the address after the instruction.
}

An event that Guest_Run delivers to the guest at its entry: an interrupt of a device that the process models, or an exception of an instruction that the process ran in place of the guest. The processor delivers it through the interrupt table of the guest, with no check of the interrupt flag. The kernel delivers an external interrupt only when the record says that the guest takes interrupts: the interrupt flag set in rflags and interrupt_shadow 0. Else it opens the interrupt window of the guest processor, enters with no event, and ends the run with the exit Interrupt_Window when the guest takes interrupts: the request stays in the record for the next run. The kernel refuses the non-maskable interrupt while the record says that the guest is in its interrupt shadow.

Example: a guest runs cli and later sti. A record with an External_Interrupt of the vector 0x30 and the interrupt flag clear runs the guest to the instruction after sti, then ends with Interrupt_Window; the next run with the same record delivers 0x30.

Kind
enum
Package
src/library/modus/contract/operation
Size
1 byte
Alignment
1 byte
Base type
Named by
Source
src/library/modus/contract/operation/guest_registers.odin:52
MemberValueHexadecimal
None00x0
External_Interrupt10x1
Non_Maskable_Interrupt20x2
Exception30x3
Software_Interrupt40x4

Guest_Registers_Refusal

Guest_Registers_Refusal :: enum u8 {
	None                = 0, // The record is accepted.
	Flags               = 1, // `rflags` has a bit outside `GUEST_FLAGS_DEFINED`.
	Control_0           = 2, // `cr0` has a bit past 31, NW without CD, or PG without PE.
	Control_3           = 3, // `cr3` has a bit from 52.
	Control_4           = 4, // `cr4` has a bit outside `GUEST_CONTROL_4_DEFINED`.
	Efer                = 5, // `efer` has a bit outside `GUEST_EFER_DEFINED`.
	Long_Mode           = 6, // LMA without LME, PG and PAE; or LME and PG without LMA.
	Instruction_Address = 7, // In long mode, `rip` is not canonical.
	Mode_Load           = 8, // `mode_load` names no `Guest_Mode_Load`, or the control registers do not fit the mode.
	Inject_Kind         = 9, // `inject_kind` names no `Guest_Inject_Kind`, or `inject_error_code_valid` is not 0 or 1.
	Inject_Vector       = 10, // A vector that the kind does not take.
	Inject_Error_Code   = 11, // An error code for an event that pushes none.
	Reserved            = 12, // A byte of `reserved` is not 0.
	System_Call_Address = 13, // `lstar` is not canonical.
	System_Call_Mask    = 14, // `sfmask` has a bit outside `GUEST_SYSTEM_CALL_MASK_DEFINED`.
	Segment_Base        = 15, // `fs_base`, `gs_base` or `kernel_gs_base` is not canonical.
	Interrupt_Shadow    = 16, // `interrupt_shadow` is not 0 or 1.
	Inject_In_Interrupt_Shadow = 17, // A `Non_Maskable_Interrupt` while `interrupt_shadow` is 1: it would come one instruction early.
	Event_Pending              = 18, // `event_pending` is not 0 or 1.
}

Why Guest_Run refuses a registers record, with Bad_Operation: the first field that the rules refuse, in the order of the checks.

Kind
enum
Package
src/library/modus/contract/operation
Size
1 byte
Alignment
1 byte
Base type
Source
src/library/modus/contract/operation/guest_registers.odin:177
MemberValueHexadecimal
None00x0
Flags10x1
Control_020x2
Control_330x3
Control_440x4
Efer50x5
Long_Mode60x6
Instruction_Address70x7
Mode_Load80x8
Inject_Kind90x9
Inject_Vector100xA
Inject_Error_Code110xB
Reserved120xC
System_Call_Address130xD
System_Call_Mask140xE
Segment_Base150xF
Interrupt_Shadow160x10
Inject_In_Interrupt_Shadow170x11
Event_Pending180x12

Guest_Requests

Guest_Requests :: struct {
	mode_load:   ,
	inject_kind: ,
}

The requests of a registers record that the checks accepted, as members: the kernel reads the words of the record only through guest_registers_check.

Kind
struct
Package
src/library/modus/contract/operation
Size
2 bytes
Alignment
1 byte
Padding
0 bytes
Source
src/library/modus/contract/operation/guest_registers.odin:219
FieldTypeOffsetSize
mode_load01
inject_kind11

2 bytes of fields and 0 bytes of padding: 2 bytes.

Status

Status :: enum u32 {
	Ok            = 0, // The operation ran: the values of the completion are its results.
	Bad_Operation = 1, // An argument has a value that the operation never takes.
	// A kind, a flag or a command that the kernel does not know, a count of 0 or above its limit, a combination
	// that the operation refuses (`Write` with `Execute`). The same call with the same arguments fails again: it
	// is a mistake of the caller.
	Bad_Handle    = 2, // A handle argument names no object of the kind that the operation needs.
	// The handle number is 0 where 0 is not allowed, was never given, was closed, or names an object of another
	// kind. Each operation that takes a handle can give it.
	Bad_Address   = 3, // An address argument is wrong.
	// The process cannot read or write the memory that it names, the address is not aligned as the operation
	// needs, or a range is outside its object, below 4096 or above `USER_END`, or meets another mapping.
	No_Memory     = 4, // No page frame is free, though the budget can pay.
	// A contiguous run of the length asked does not exist, or a page table finds no frame. `Memory_Create`,
	// `Memory_Map`, `Process_Start` and `Thread_Create` give it. Another try can pass after other objects end.
	No_Slot       = 5, // A table of fixed capacity is full.
	// The handle table of a process, the 128 mappings of a process, the threads of a process
	// (`THREAD_CAPACITY`), the module records (`PROCESS_MODULE_CAPACITY`), the words of a wait
	// (`WORD_WAIT_CAPACITY`), the message interrupts (`MESSAGE_CAPACITY`), the rules of an event table, or a
	// table of the kernel. Another try can pass after a slot frees.
	Bad_State     = 6, // The object is not in a state where the operation applies.
	// The process is stopped or not created, the thread is not held or ended, no thread waits for the fault
	// that an answer names, another process has the event table, the memory object has a protection of its
	// own. The arguments are right; the moment is wrong.
	No_Right      = 7, // The handle names the object, but it does not have the right for this operation.
	// The `Handle_State` of the handle gives the rights that it has. No operation adds a right: a process
	// that needs it asks the holder of a handle with that right for a new grant. A process also gets it
	// when it changes a module record of its starter in itself, or maps or unmaps over it
	// (`Module_Writer`): only a holder of its process handle does that.
	No_Budget     = 8, // The budget cannot pay for the operation.
	// The budget, or a budget above it, does not hold the pages, the process slot or the thread slot that the
	// operation takes; or for `Log`, the budget accepted all the records of its amount in this second. See
	// `Budget_Amounts`.
}

The result kind of a kernel operation: the kind of its completion record.

The kernel writes one completion for each command of the kernel ring; src/library/modus/system gives it back as the second result of each wrapper (system.Status is this type). With Ok the values of the completion are the results of the operation. With another status the operation failed, and the values are an : which argument was wrong, its value, and what the kernel found. A status says which class of mistake it is; the error record says which one. The comment of each Operation lists its statuses and when each comes. See status.

Example: memory, status := system.memory_create(1 << 20) gives Bad_Operation: the count is above MEMORY_PAGE_LIMIT.

Kind
enum
Package
src/library/modus/contract/operation
Size
4 bytes
Alignment
4 bytes
Base type
Source
src/library/modus/contract/operation/operation.odin:2894
MemberValueHexadecimal
Ok00x0
Bad_Operation10x1
Bad_Handle20x2
Bad_Address30x3
No_Memory40x4
No_Slot50x5
Bad_State60x6
No_Right70x7
No_Budget80x8

Memory_Flag

Memory_Flag :: enum u64 {
	// Each page gets its page frame at creation, not at its first use. With no flag the frames come on first
	// use: the budget pays now, and the first access takes the frame (a page on first use).
	Frames_Now = 0,
	// The page frames follow each other in physical memory, each one from the creation, and they do
	// not move: memory that a device reads and writes (Memory_Physical). The budget pays for no frame
	// list. It can give No_Memory when the budget can pay: no free run is long enough.
	Contiguous = 1,
	// The pages are not paid at the creation: the budget pays the frame list only. Memory_Commit pays pages
	// and makes them usable; a page that is not committed has no frame, and an access to it is a fault.
	Uncommitted = 2,
	// Contiguous, in one run aligned on 2 MiB, and the page count is a multiple of LARGE_PAGE_PAGES: a mapping
	// uses a large page for each 2 MiB whose address and first page are aligned.
	Large_Pages = 3,
}

A flag of Memory_Create: how the pages of a new memory object get their page frames and who pays them. A flag that the kernel does not know gives Bad_Operation.

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:2983
MemberValueHexadecimal
Frames_Now00x0
Contiguous10x1
Uncommitted20x2
Large_Pages30x3

Memory_Flags

Memory_Flags :: bit_set[;u64]

The flags of one Memory_Create. Example: {.Frames_Now}.

Kind
bit set
An alias of
bit_set[Memory_Flag; u64]
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Underlying type
Element
Named by
Source
src/library/modus/contract/operation/operation.odin:2999
BitMemberMask
0Frames_Now0x1
1Contiguous0x2
2Uncommitted0x4
3Large_Pages0x8

Page_Range

Page_Range :: struct {
	first:      u64, // The first page of the object, from 0.
	page_count: u64, // The pages of the range, from 1.
}

A range of pages of a memory object (Memory_Commit).

A process writes a table of them in its own memory; the kernel reads it as hostile input: the ranges must be in increasing order, with no overlap, inside the object. Example: {first = 16, page_count = 4} is the pages 16 to 19.

Kind
struct
Package
src/library/modus/contract/operation
Size
16 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
Source
src/library/modus/contract/operation/operation.odin:3017
FieldTypeOffsetSize
first08
page_count88

16 bytes of fields and 0 bytes of padding: 16 bytes.

Address_Range

Address_Range :: struct {
	address:    u64, // A multiple of PAGE_SIZE.
	page_count: u64, // The pages of the range, from 1.
}

A range of addresses of the process (Memory_Protect).

The same rules as , on addresses: in increasing order, with no overlap, inside one mapping. Example: {address = 0x1000_0000_0000, page_count = 1} is one page.

Kind
struct
Package
src/library/modus/contract/operation
Size
16 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
Source
src/library/modus/contract/operation/operation.odin:3027
FieldTypeOffsetSize
address08
page_count88

16 bytes of fields and 0 bytes of padding: 16 bytes.

Commit_Flag

Commit_Flag :: enum u64 {
	Decommit = 0, // The committed pages of the ranges are no longer paid: their frames return to the budget at once, and a page committed again is zero.
}

A flag of Memory_Commit.

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:3033
MemberValueHexadecimal
Decommit00x0

Commit_Flags

Commit_Flags :: bit_set[;u64]

The flags of one Memory_Commit: {} commits, {.Decommit} decommits.

Kind
bit set
An alias of
bit_set[Commit_Flag; u64]
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Underlying type
Element
Named by
Source
src/library/modus/contract/operation/operation.odin:3037
BitMemberMask
0Decommit0x1

Map_Flag

Map_Flag :: enum u64 {
	Write           = 0, // The pages can be written. Needs **Write** on the memory handle.
	Execute         = 1, // The pages can be executed. Needs **Execute** on the memory handle. With `Write` in Memory_Map: guest memory, with `No_Access`.
	No_Access       = 2, // Memory_Map: a mapping whose pages fault until Memory_Protect gives them access. Memory_Protect: no access.
	Receive_Handles = 3, // Memory_Map: this process agrees to receive handles through this memory object (`Handle_Give`). Refused by `Memory_Protect`.
	At_Address_Zero = 4, // Memory_Map: the mapping starts at the address 0, the guest physical address 0 of a guest. Refused by `Memory_Protect`.
	// Memory_Map: the pages are write-combining: the processor gathers the writes and sends them to the
	// device in bursts, and does not cache a read. Only for device memory of `Device_Kind.Memory`, which
	// is else mapped with no cache, and never with `Execute` (map_write_combining_refused). The mappings of a
	// device memory object, and of each object whose pages meet its pages, have one cache type at a time: a
	// live mapping with no cache refuses a write-combining one, and the reverse. Refused by
	// `Memory_Protect`. For the memory of a device that the processor fills and the device reads: a
	// shared memory region of a GPU.
	Write_Combining = 5,
}

A flag of Memory_Map and of Memory_Protect: the access that a mapping gives. No flag is read only. A page is never writable and executable.

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:3043
MemberValueHexadecimal
Write00x0
Execute10x1
No_Access20x2
Receive_Handles30x3
At_Address_Zero40x4
Write_Combining50x5

Map_Flags

Map_Flags :: bit_set[;u64]

The flags of one Memory_Map or Memory_Protect. Example: {.Write}.

Kind
bit set
An alias of
bit_set[Map_Flag; u64]
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Underlying type
Element
Named by
Source
src/library/modus/contract/operation/operation.odin:3059
BitMemberMask
0Write0x1
1Execute0x2
2No_Access0x4
3Receive_Handles0x8
4At_Address_Zero0x10
5Write_Combining0x20

Process_State

Process_State :: enum u32 {
	None    = 0, // No process or no thread in the slot.
	Created = 1, // `Process_Create` made the process; `Process_Start` has not started it. It has no thread.
	Ready   = 2, // A thread runs or waits for a processor in a run queue.
	Waiting = 3, // Each thread is in a wait: a deadline or a word wait. A wake makes it Ready again. A hold does not change it.
	// The process ended: `Process_Stop`, a fault with no fault handler, the close of the last handle to it, or
	// the end of its last thread. Its `Stop_Cause` says which. A thread that ended is Stopped too.
	Stopped = 4,
}

The state of a process or of a thread. A process is Ready when one of its threads is Ready.

Process_State gives the state of a process; Thread_State and Thread_Report.state give the state of a thread. The states of a process: Created, then Ready and Waiting in turn while it runs, then Stopped, which it never leaves.

Kind
enum
Package
src/library/modus/contract/operation
Size
4 bytes
Alignment
4 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:3092
MemberValueHexadecimal
None00x0
Created10x1
Ready20x2
Waiting30x3
Stopped40x4

Stop_Cause

Stop_Cause :: enum u32 {
	None              = 0, // The process has not stopped.
	Itself            = 1, // It called `Process_Stop` on itself. Its `Stop_Outcome` says why.
	Holder            = 2, // Another process stopped it with a process handle with **Control**.
	Last_Thread_Ended = 3, // Its last thread ended with `Thread_Stop`. It chose no stop outcome.
	Handles_Closed    = 4, // The last handle to it closed.
	Fault             = 5, // A processor exception that no fault handler took, or that a handler answered with a stop. The vector is in the stop report.
	Not_Committed     = 6, // A page fault on a page of an Uncommitted object that is not committed.
	Cannot_Return     = 7, // The processor refused the return of the kernel to one of its threads: its instruction or stack address (docs/ARCHITECTURE.md, "The return to a process"). The stop report has the address.
	Fault_Unanswered  = 8, // Its fault ring ended while one of its threads waited for an answer there: the handler thread ended, or `Fault_Handler_Set` named another handler or ended the delivery.
}

Why a process stopped: the kernel records it at every stop, and no process chooses or forges it. Process_State gives its word as the second result, Stop_Report.cause and Process_Report.stop_cause hold it too. A reader takes the word through stop_of_words or stop_cause_of_word, never through a cast.

The vector of a fault is not in the cause: the stop report holds it in vector, so the cause stays a closed set.

Example: a null pointer read gives the state Stopped, the cause Fault, and Stop_Report.vector == u32(Fault_Kind.Page_Fault).

See: The stop of a process: its stop cause and its stop outcome in the repository

Kind
enum
Package
src/library/modus/contract/operation
Size
4 bytes
Alignment
4 bytes
Base type
Named by
Source
src/library/modus/contract/operation/stop_cause.odin:16
MemberValueHexadecimal
None00x0
Itself10x1
Holder20x2
Last_Thread_Ended30x3
Handles_Closed40x4
Fault50x5
Not_Committed60x6
Cannot_Return70x7
Fault_Unanswered80x8

Stop_Outcome

Stop_Outcome :: enum u32 {
	None               = 0, // No outcome: the process did not stop itself, or it runs.
	Done               = 1, // The work is finished. Not 0: a zeroed word or a forgotten argument must not claim a finished work.
	Failed             = 2, // The work could not be done. The cause is in its log.
	Refused            = 3, // Its input, its arguments or its context were refused: no fault of the process.
	Stopped_On_Request = 4, // A call or an event asked it to stop, and it stopped cleanly.
}

What a process says about its work when it stops itself . The process passes it to Process_Stop when the target is the process itself; a holder that stops another process passes None, so no holder can forge the end of a process. Process_State gives its word as the third result, and Process_Report.stop_outcome holds it too. A reader takes the word through stop_of_words or stop_outcome_of_word, never through a cast.

The outcome is None for each stop cause but Itself: a reader that checks outcome == .Done has also checked that the process stopped itself.

Example: system.stop(.Done) at the end of the work gives the cause Itself and the outcome Done.

See: The stop of a process: its stop cause and its stop outcome in the repository

Kind
enum
Package
src/library/modus/contract/operation
Size
4 bytes
Alignment
4 bytes
Base type
Named by
Source
src/library/modus/contract/operation/stop_outcome.odin:20
MemberValueHexadecimal
None00x0
Done10x1
Failed20x2
Refused30x3
Stopped_On_Request40x4

Device_Kind

Device_Kind :: enum u64 {
	None      = 0, // Refused: `Bad_Operation`.
	Ports     = 1, // A range of input and output ports: `a` the first port, `b` the count.
	Interrupt = 2, // A line of the 8259: `a` from 1 to 15.
	Memory    = 3, // The registers of a device: `a` the physical address, `b` the count of pages; mapped with no cache, or write-combining with `Map_Flag.Write_Combining`.
	Message   = 4, // A message interrupt (MSI-X): the results give the address and the value that the device writes.
	// The video memory of a display, which holds its screen pages: `a` the physical address, `b` the count of
	// pages; the range must hold the address of the framebuffer of the firmware. The same device memory as
	// `Memory`, with no requester for the IOMMU, and its mapping has the page attribute of the framebuffer of the
	// firmware: the default entry of the page attribute table, so the memory type ranges (MTRR) that the
	// firmware set decide the type. A mapping with no cache makes each write of a pixel a write to the device
	// (src/md/infrastructure/whole_frame.md).
	Display_Memory = 5,
}

The kind of a part of the machine that Device_Create gives to a device service. The two values a and b of the call have a meaning for each kind.

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:3105
MemberValueHexadecimal
None00x0
Ports10x1
Interrupt20x2
Memory30x3
Message40x4
Display_Memory50x5

Device_Memory_Fact

Device_Memory_Fact :: enum u64 {
	Domain  = 0, // The IOMMU gives the device a device domain: it reaches only the memory that its service declares. Behind a conventional bridge, the one domain of each device there.
	Windows = 1, // The remapping unit of the device gives device windows: `Memory_Physical` accepts an object that is not contiguous.
}

What Device_Create of the kind Memory says of the device whose registers the range holds, in its second result. The root service reads it to choose the memory that it makes for the device: with Windows, an object that is not contiguous serves (The IOMMU in the repository, "Device addresses"). An empty set: no IOMMU in use, or a device that gets no domain.

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:3126
MemberValueHexadecimal
Domain00x0
Windows10x1

Device_Memory_Facts

Device_Memory_Facts :: bit_set[; u64]
Kind
bit set
An alias of
bit_set[Device_Memory_Fact; u64]
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Underlying type
Element
Source
src/library/modus/contract/operation/operation.odin:3130
BitMemberMask
0Domain0x1
1Windows0x2

Inspect_Kind

Inspect_Kind :: enum u64 {
	None    = 0, // Refused: `Bad_Operation`.
	System  = 1, // The `System_Report` of the machine. `index` is not read.
	Process   = 2, // The `Process_Report` of the process slot `index`.
	Processor = 3, // The `Processor_Report` of the processor `index`, from 0.
	Boot      = 4, // The `Boot_Report`. `index` is not read.
	Mappings  = 5, // The `Mapping_Report` of a page table. `index` 0: the kernel half of the addresses. Another value: the half of the process that asks.
	Modules   = 6, // The `Module_Report` of the process slot `index`.
	// The reports of a developer tool (docs/TOOLS.md): what one process has,
	// read with the right Inspect: counts, places and states. A process
	// without that right sees no other process.
	// Each one has the serial of the process, so that a reader drops a
	// sample of two processes in one slot.
	Process_Mappings = 7, // Process_Mapping_Report of process slot `index`.
	Threads          = 8, // Thread_Table_Report of process slot `index`.
	// Stop_Report of process slot `index`: zero when it did not stop on a
	// fault, or when the slot has no process. A frame of a stack trace comes
	// from the stack of the process, and a corrupt chain of frame pointers
	// gives values of its memory; the address of a page fault can be a
	// value too. So the kernel gives a frame only when a module record of
	// the process holds its address (else the frame is all zero), and the
	// address of the fault only in the first page or in a module record
	// (else 0). hidden_value_count counts what it took out. The holder of the
	// process handle with Read still reads the whole report (Process_State).
	Stop             = 9,
	// Page_Report of the process that asks, for the address that it writes
	// in the Page_Report: which of the 64 pages from it have a frame. Index
	// must be 0: a page that gets a frame in another process is a fact that
	// it can watch page by page (a side channel), so no slot but its own.
	Pages            = 10,
}

What Inspect writes: the kind of a report of the kernel, and what its index argument names. Each kind needs Inspect on the machine. A slot or a processor with no process, or out of the table, gives a report of zeros.

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:3140
MemberValueHexadecimal
None00x0
System10x1
Process20x2
Processor30x3
Boot40x4
Mappings50x5
Modules60x6
Process_Mappings70x7
Threads80x8
Stop90x9
Pages100xA

Process_Mapping_Flag

Process_Mapping_Flag :: enum u32 {
	Write       = 0, // The process can write the pages.
	Execute     = 1, // The process can execute the pages.
	Uncached    = 2, // The registers of a device.
	Device      = 3, // The frames are not from the page frame table: a framebuffer, boot data, a device.
	Contiguous  = 4, // The memory object was made `Contiguous`: its frames follow each other and do not move.
	Shared      = 5, // Another mapping or another handle names the memory object.
	Thread_Area = 6, // The thread record and the kernel ring of a thread.
	Uncommitted = 7, // An object made with Uncommitted: `committed` says which part its budget pays.
	Large       = 8, // The mapping uses large pages of 2 MiB.
	Protected   = 9, // Memory_Protect changed the protection of pages of the mapping.
	No_Access   = 10, // The protection of the mapping is No_Access now.
	Write_Combining = 11, // Memory_Map gave `Write_Combining`: the pages of device memory are write-combining, not uncached.
}

A fact about one mapping of a process, in Process_Mapping.flags.

Kind
enum
Package
src/library/modus/contract/operation
Size
4 bytes
Alignment
4 bytes
Base type
Source
src/library/modus/contract/operation/operation.odin:3173
MemberValueHexadecimal
Write00x0
Execute10x1
Uncached20x2
Device30x3
Contiguous40x4
Shared50x5
Thread_Area60x6
Uncommitted70x7
Large80x8
Protected90x9
No_Access100xA
Write_Combining110xB

Process_Mapping

Process_Mapping :: struct {
	address:       u64, // The first byte of the mapping in the process.
	page_count:    u64, // The pages of the mapping.
	first:         u64, // The first page of the memory object.
	present:       u64, // The pages of this mapping that have a page frame, from the page table.
	region_pages:  u64, // The pages of the memory object.
	region_serial: u64, // The memory object: two mappings with one serial map one object.
	flags:         bit_set[;u32], // What the mapping and its memory object are.
	references:    u32, // The handles and the mappings that name the memory object, in all processes.
	committed:     u64, // The committed pages of the memory object: all its pages, unless it was made Uncommitted.
}

One mapping of a process: Process_Mapping_Report.

The kernel writes it for a developer tool from its own table of mappings and from the page table. Example: a stack of 64 pages of which the process touched 3 has page_count = 64, present = 3 and the flag Write. 64 bytes.

Kind
struct
Package
src/library/modus/contract/operation
Size
64 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3194
FieldTypeOffsetSize
address08
page_count88
first168
present248
region_pages328
region_serial408
flagsbit_set[Process_Mapping_Flag; u32]484
references524
committed568

64 bytes of fields and 0 bytes of padding: 64 bytes.

Process_Mapping_Report

Process_Mapping_Report :: struct {
	process_serial: u64, // The serial of the process of the slot: a reader drops reports of two processes.
	count:    u64, // The records in `mappings`.
	mappings: [MAPPING_REPORT_CAPACITY], // By address; `count` of them are used.
}

The mappings of one process, in the order of their addresses. Inspect with the kind Process_Mappings writes it; the developer tools show the memory of a process with it.

Kind
struct
Package
src/library/modus/contract/operation
Size
8208 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3216
FieldTypeOffsetSize
process_serial08
count88
mappings[128]Process_Mapping168192

8208 bytes of fields and 0 bytes of padding: 8208 bytes.

Thread_Report

Thread_Report :: struct {
	// The machine number of the thread: the name of this thread among all the threads of the machine. A new
	// thread never has the machine number of a thread that ended. `Thread_Control` takes it with the machine handle.
	machine_number:   u64,
	number:           u32, // The thread area of the thread in the process.
	state:            , // Ready or Waiting (Stopped: it ended).
	processor:        u32, // 1 + the processor that runs it now. 0: none.
	home:             u32, // The processor of its run queue.
	weight:           u32, // From 1 to `WEIGHT_FULL`.
	request:          u32, // Microseconds.
	words:            u32, // The words of the word wait that it is in. 0: no word.
	queued:           u32, // 1: it is in the run queue of home.
	virtual:          u64, // Its virtual time, in weighted cycles: the fair strategy and EEVDF.
	virtual_deadline: u64, // Its virtual deadline under EEVDF, in weighted cycles.
	lag:              i64, // Its lag: under EEVDF the time that it is owed; under the fair strategy its distance to the queue clock while it waits.
	run_time:         u64, // Milliseconds of processor time: the ticks in which it ran.
	deadline:         u64, // The end of its wait, in milliseconds since the start. WAIT_FOREVER: none.
}

One thread of a process: Thread_Table_Report. The kernel reads the fields of the scheduler with no lock: each field is whole, two fields can come from two instants.

Kind
struct
Package
src/library/modus/contract/operation
Size
80 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3225
FieldTypeOffsetSize
machine_number08
number84
state124
processor164
home204
weight244
request284
words324
queued364
virtual408
virtual_deadline488
lag568
run_time648
deadline728

80 bytes of fields and 0 bytes of padding: 80 bytes.

Thread_Table_Report

Thread_Table_Report :: struct {
	process_serial: u64, // The serial of the process of the slot: a reader drops reports of two processes.
	count:   u64, // The records in `threads`.
	threads: [THREAD_REPORT_CAPACITY], // `count` of them are used.
}

The threads of one process, with the state of the scheduler of each. Inspect with the kind Threads writes it.

Kind
struct
Package
src/library/modus/contract/operation
Size
2576 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3249
FieldTypeOffsetSize
process_serial08
count88
threads[32]Thread_Report162560

2576 bytes of fields and 0 bytes of padding: 2576 bytes.

Page_Report

Page_Report :: struct {
	address: u64, // The first page: the caller writes it, a multiple of 4096.
	present: u64, // Bit n: page n has a frame.
	mapped:  u64, // Bit n: page n is in a mapping.
}

Which of 64 pages of the process that asks have a page frame, and which are mapped. The process writes address; Inspect with the kind Pages writes the two sets. A memory viewer reads only the present pages, so its read gives no frame to a page.

Example: present = 0b101, mapped = 0b111: the pages 0 and 2 have a frame, the page 1 is mapped and has none yet.

Kind
struct
Package
src/library/modus/contract/operation
Size
24 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3269
FieldTypeOffsetSize
address08
present88
mapped168

24 bytes of fields and 0 bytes of padding: 24 bytes.

System_Report

System_Report :: struct {
	time:          u64, // Milliseconds since boot.
	page_count:    u64, // Pages of memory that the kernel manages.
	free_pages:    u64, // The free frames: in the frame table and in the frame caches of the processors.
	process_slots: u64, // The process slots in use.
	region_count:  u64, // Memory objects in use.
	entries:       u64, // Kernel entries since boot.
	interrupts:    u64, // Interrupts since boot.
	budget_pages:  u64, // The pages of all the budgets. free_pages - reserved_pages is always budget_pages, exactly: each page is free or paid.
	// free_pages and reserved_pages alone are not values of one instant: the processors take frames from their
	// caches while the kernel reads them; their difference is exact (docs/ARCHITECTURE.md, "The frame caches").
	processors:    u64, // The processors that run threads.
	reserved_pages:   u64, // Pages that a budget paid for and that have no page frame yet: pages on first use.
	first_use_faults: u64, // Page faults of processes after which the page was present.
	locks:            [LOCK_KIND_CAPACITY], // By Lock_Kind.
	strategy:         , // The scheduling strategy of the machine (Strategy_Set): the new one as soon as a change starts, before each run queue converted (Processor_Report.strategy).
	strategy_changes: u32, // The calls of Strategy_Set since boot.
}

The state of the whole machine: the memory, the slots, the counts of the kernel and of its locks. Inspect with the kind System writes it.

Kind
struct
Package
src/library/modus/contract/operation
Size
288 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3277
FieldTypeOffsetSize
time08
page_count88
free_pages168
process_slots248
region_count328
entries408
interrupts488
budget_pages568
processors648
reserved_pages728
first_use_faults808
locks[12]Lock_Count88192
strategy2804
strategy_changes2844

288 bytes of fields and 0 bytes of padding: 288 bytes.

Lock_Kind

Lock_Kind :: enum u64 {
	Control = 0, // The paths that cross processes or end objects that several processes name: rare.
	Process = 1, // The handles, the mappings and the page table of one process.
	Origin  = 2, // The origin tree of the holdings.
	Region  = 3, // One memory object: it gives a page on first use one frame.
	Frame   = 4, // The page frames, the reserved pages, the pages of the budgets, the slots of the memory objects.
	Cache   = 5, // The stack of free page frames of one processor (its frame cache).
	Log     = 6, // The records of the log and the own log rings. The serial port has its own writer.
	Wait    = 7, // One bucket of the wait table: the threads that wait on its words.
	Run     = 8, // The run queue of one processor, and the scheduling state of its threads.
}

The locks of the kernel, by the data that each one protects . The order of the kinds is the lock order: a processor takes a lock only if it holds no lock of a later kind.

See: Architecture: Locks of the kernel

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Source
src/library/modus/contract/operation/operation.odin:3300
MemberValueHexadecimal
Control00x0
Process10x1
Origin20x2
Region30x3
Frame40x4
Cache50x5
Log60x6
Wait70x7
Run80x8

Lock_Count

Lock_Count :: struct {
	takes: u64, // The times that a processor took a lock of this kind.
	waits: u64, // The times that the lock was held, and the processor had to wait for it.
}

What the kernel counts for one kind of lock, on all the processors. System_Report.locks holds one for each . See lock count.

Kind
struct
Package
src/library/modus/contract/operation
Size
16 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3331
FieldTypeOffsetSize
takes08
waits88

16 bytes of fields and 0 bytes of padding: 16 bytes.

Processor_Report

Processor_Report :: struct {
	process:   u64, // The slot of the process that the processor runs. 0: the processor is idle.
	busy_time: u64, // Milliseconds with a thread.
	same:      u64, // 1: the process is the process that asks.
	apic_id:   u64, // The number that the machine gives to the processor.
	// The scheduler (docs/SCHEDULING.md), since boot.
	strategy:    , // The strategy of the run queue of the processor.
	queued:      u32, // The threads in the run queue now.
	picks:       u64, // Threads that a pick gave to the processor.
	preemptions: u64, // Stints that a wake preemption ended.
	moves:       u64, // Threads that the processor took from the queue of another processor.
	pick_cycles: u64, // Cycles of the cycle counter in all the picks.
	interrupt_preemptions: u64, // Wake preemptions by an interrupt from another processor.
	preempt_cycles: u64, // Their cycles in the kernel: from the handler of the interrupt to the next thread.
	// The frame cache of the processor: a stack of free page frames.
	cache_frames:        u64, // The frames on the stack now.
	cache_batches_taken: u64, // Batches that the stack took from the frame table.
	cache_batches_given: u64, // Batches that the stack gave back.
	cache_drains:        u64, // Drains that took the frames of the stack, for a take that found no free frame.
}

The state of one processor: what it runs, its scheduler and its frame cache. Inspect with the kind Processor writes it.

Kind
struct
Package
src/library/modus/contract/operation
Size
120 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3338
FieldTypeOffsetSize
process08
busy_time88
same168
apic_id248
strategy324
queued364
picks408
preemptions488
moves568
pick_cycles648
interrupt_preemptions728
preempt_cycles808
cache_frames888
cache_batches_taken968
cache_batches_given1048
cache_drains1128

120 bytes of fields and 0 bytes of padding: 120 bytes.

Log_Level

Log_Level :: enum u8 {
	Info    = 0, // A fact of the normal work: a service started, a file was written.
	Debug   = 1, // For the principal who looks for a fault: details that a normal reader hides.
	Warning = 2, // Something went wrong and the process went on: a refused request, a retry.
	Error   = 3, // Something failed: an operation that the process needed, a check of a test.
}

The log: records of text, each with its process and its level.

The kernel keeps the last LOG_RECORD_CAPACITY records in one memory object. The kernel is the one writer: it sets the time, the process and the thread of each record, so a process cannot write a record of another process. A process chooses only the level and the text. A reader maps the memory object without Write. It reads Log_Head.written, and it waits on the low 32 bits of that word (Word_Wait).

Record n is at index n % LOG_RECORD_CAPACITY, after the head. A reader that is late by more than the capacity lost records: it knows how many. The kernel can write over a record while a reader copies it: the reader reads written again after the copy, with the two rules of log_first_kept and log_copy_kept (log_ring.odin).

The level of one record of the log: how much the text matters. A process gives it to Log; a reader of the log filters on it. See level.

Kind
enum
Package
src/library/modus/contract/operation
Size
1 byte
Alignment
1 byte
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:3377
MemberValueHexadecimal
Info00x0
Debug10x1
Warning20x2
Error30x3

Log_Head

Log_Head :: struct {
	written:  u64, // The count of records since the start of the machine.
	capacity: u64, // LOG_RECORD_CAPACITY.
	reserved: [30]u64, // 0: the head has the size of a record.
}

The head of the memory of the log: the first 256 bytes, before the records. A reader reads written, copies the records that it has not read, then reads written again: a record that the kernel wrote over in the meantime is lost, and the reader knows how many.

Kind
struct
Package
src/library/modus/contract/operation
Size
256 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3436
FieldTypeOffsetSize
written08
capacity88
reserved[30]u6416240

256 bytes of fields and 0 bytes of padding: 256 bytes.

Log_Record

Log_Record :: struct {
	sequence:       u64, // The number of the record in the whole log, from 0.
	time:           u64, // Microseconds since the start of the machine.
	process:        u8, // The process slot. 0: the kernel.
	thread:         u8, // The slot of the thread. 0: the kernel.
	level:          , // The level that the writer gave.
	more:           u8, // 1: the text continues in the next record.
	process_serial: u32, // The process serial: it changes for each new process in the slot. 0: the kernel.
	own_number:     u32, // The number of the record among the records of its process, from 0 at its start; it starts again from 0 after 2^32 records. 0 for the kernel.
	text_count:     u16, // The bytes of `text` in use, at most `LOG_TEXT_CAPACITY`. 0 for a fact.
	run_count:      u8, // The value runs of the text: runs[:run_count]. 0 for a fact.
	form:           u8, // The byte of a `Log_Record_Form` (`log_record_form`): what the bytes after the name hold. 0: a text.
	name:           [PROCESS_NAME_BYTES_MOST + 1]u8, // The name of the process, or "kernel".
	runs:           [LOG_RUN_CAPACITY]value_kinds.Value_Run, // In order, inside text[:text_count]. A fact: the first bytes of its `Log_Fact`.
	text:           [LOG_TEXT_CAPACITY]u8, // The text, UTF-8, `text_count` bytes. A fact: the rest of its `Log_Fact`.
}

One record of the log of the kernel: one text, or a part of a longer text, of one thread, with its time and its level.

The kernel writes it for a Log operation, or for a line of its own; the root service gives the memory of the records (ROOT_LOG_RECORDS) to the readers of the log. The kernel sets time, process, process_serial, own_number, thread and name: a process cannot write a record of another process. The process slot with the process serial names one process: the log service gives a reader that does not act for the principal the records of those two numbers only, numbered by own_number (modus:contract/log_scope), from the own log ring of its process (Log_Read): the kernel writes each record of a process in the whole log and in that ring. The slots have one byte each: the kernel has at most 256 process slots and 256 thread slots, which leaves room for the two numbers in 256 bytes. See log record.

Example: the line [console] started on the serial port is one record with name = "console", level = .Info, text_count = 7.

Kind
struct
Package
src/library/modus/contract/operation
Size
256 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
Source
src/library/modus/contract/operation/operation.odin:3460
FieldTypeOffsetSize
sequence08
time88
process161
thread171
level181
more191
process_serial204
own_number244
text_count282
run_count301
form311
name[32]u83232
runs[8]Value_Run6424
text[168]u888168

256 bytes of fields and 0 bytes of padding: 256 bytes.

Log_Record_Form

Log_Record_Form :: enum u8 {
	Text = 0, // The value runs and the text. A zero record is a text record.
	Fact = 1, // A part of a log fact: one `Log_Fact`. A fact of more values than one record holds is several records, each with `more` but the last (`log_fact_join_take`).
}

The form of a log record: what its bytes after the name of the process hold. A reader takes the byte Log_Record.form through log_record_form, and shows a record of a byte that names no member with its head only .

See: Log facts: typed records in place of formatted lines: The record in the repository

Kind
enum
Package
src/library/modus/contract/operation
Size
1 byte
Alignment
1 byte
Base type
Named by
Source
src/library/modus/contract/operation/operation.odin:3485
MemberValueHexadecimal
Text00x0
Fact10x1

Log_Fact

Log_Fact :: struct {
	module_hash: [32]u8, // The hash of the module that holds the description of the fact: its own-hash place. Zero: no module.
	key:         u64, // The fact key: the typeid of the record type. Never 0 from `system.log_fact`.
	value_count: u16, // The bytes of `values` in use in this record, at most `LOG_FACT_VALUE_CAPACITY`: the kernel writes it.
	part:        u8, // The place of this record among the records of its fact, from 0: the kernel writes it.
	part_count:  u8, // The records of its fact, 1 to `LOG_FACT_RECORDS_MOST`: the kernel writes it.
	reserved:    [4]u8, // 0: the kernel writes it.
	values:      [LOG_FACT_VALUE_CAPACITY]u8, // The bytes of the record of the fact type from the place part * LOG_FACT_VALUE_CAPACITY, in the order of its fields.
}

The bytes of a log record after the name of the process, for the form Fact: the module hash, the fact key, the count of the value bytes, and the values. The writer gives it to Log, up to the end of its values; the kernel writes value_count from the length and copies the bytes with no check of their content.

Example: the fact storage.Bad_Block{block = 12, ...} of the module whose hash starts with 1a 2b is the hash, the key 18017458693634389201, a count of 16, and the 16 bytes of the record.

See: Log facts: typed records in place of formatted lines: The record in the repository

Kind
struct
Package
src/library/modus/contract/operation
Size
192 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3518
FieldTypeOffsetSize
module_hash[32]u8032
key328
value_count402
part421
part_count431
reserved[4]u8444
values[144]u848144

192 bytes of fields and 0 bytes of padding: 192 bytes.

Log_Fact_Call

Log_Fact_Call :: struct {
	module_hash: [32]u8,
	key:         u64,
	value_count: u16,
	part:        u8,
	part_count:  u8,
	reserved:    [4]u8,
	values:      [LOG_FACT_VALUES_MOST]u8,
}

The bytes that a writer gives to Log of the form Fact: the head of a fact, then each value byte of its fact type, up to LOG_FACT_VALUES_MOST. The writer fills the module hash, the key and the values; the kernel writes the count, the part and the count of the parts of each record.

Kind
struct
Package
src/library/modus/contract/operation
Size
1216 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3535
FieldTypeOffsetSize
module_hash[32]u8032
key328
value_count402
part421
part_count431
reserved[4]u8444
values[1168]u8481168

1216 bytes of fields and 0 bytes of padding: 1216 bytes.

Log_Fact_Part

Log_Fact_Part :: struct {
	number:      u64, // The number of the record in the numbering of the reader: the whole log, or the own records of a process. The records of one fact have numbers that follow each other.
	writer:      u64, // The process of the record: its slot and its process serial (log_fact_writer), or 0 for a reader that does not know it.
	module_hash: [32]u8,
	key:         u64,
	part:        int, // The place of the record in its fact, from 0.
	part_count:  int, // The records of its fact.
	values:      []u8, // The value bytes of the record: value_count of them.
}

One record of a fact, as a reader read it.

Kind
struct
Package
src/library/modus/contract/operation
Size
88 bytes
Alignment
8 bytes
Padding
0 bytes
On the target
int has the size of an address of the target: the sizes here are those of linux amd64, where the page was made
Source
src/library/modus/contract/operation/log_fact_join.odin:42
FieldTypeOffsetSize
number08
writer88
module_hash[32]u81632
key488
part568
part_count648
values7216

88 bytes of fields and 0 bytes of padding: 88 bytes.

Log_Fact_Join

Log_Fact_Join :: struct {
	open:        bool, // A fact has its first records here, and waits for the next one.
	number:      u64, // The number of the last record taken.
	writer:      u64,
	module_hash: [32]u8,
	key:         u64,
	part_count:  int,
	next_part:   int,
	value_count: int, // The value bytes taken: values[:value_count] of a whole fact.
	values:      [LOG_FACT_VALUES_MOST]u8,
}

What a reader keeps while it joins the records of one fact. A zero value has no open fact.

Kind
struct
Package
src/library/modus/contract/operation
Size
1256 bytes
Alignment
8 bytes
Padding
7 bytes
On the target
int has the size of an address of the target: the sizes here are those of linux amd64, where the page was made
Source
src/library/modus/contract/operation/log_fact_join.odin:54
FieldTypeOffsetSize
open01
padding17
number88
writer168
module_hash[32]u82432
key568
part_count648
next_part728
value_count808
values[1168]u8881168

1249 bytes of fields and 7 bytes of padding: 1256 bytes.

Log_Fact_Join_Fault

Log_Fact_Join_Fault :: enum u8 {
	None               = 0, // The record is the next part of the open fact, or a fact of its own.
	Part_Without_First = 1, // A record after the first of its fact, and no fact is open: its first record is lost.
	Missing_Part       = 2, // The open fact lost a record: the number of the record is not the next one, or its part is not the next part.
	Other_Process      = 3, // The record after a record of the open fact is a record of another process.
	Other_Fact         = 4, // The next record of the process is a part of another fact: another hash, key or count of records.
	Part_Count         = 5, // A count of records of 0, or past LOG_FACT_RECORDS_MOST, or a part past its count.
	Value_Count        = 6, // A record before the last of its fact that does not hold LOG_FACT_VALUE_CAPACITY bytes, or a record of more.
}

Why a reader cannot join a fact of several records.

Kind
enum
Package
src/library/modus/contract/operation
Size
1 byte
Alignment
1 byte
Base type
Source
src/library/modus/contract/operation/log_fact_join.odin:31
MemberValueHexadecimal
None00x0
Part_Without_First10x1
Missing_Part20x2
Other_Process30x3
Other_Fact40x4
Part_Count50x5
Value_Count60x6

Status_Word

Status_Word :: distinct u64

The word of a Status: a Status has 4 bytes.

Kind
distinct
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base
Named by
Source
src/library/modus/contract/operation/contract_enums.odin:77

Log_Record_Form_Word

Log_Record_Form_Word :: distinct u64

The word of a Log_Record_Form: a Log_Record_Form has 1 byte.

Kind
distinct
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base
Source
src/library/modus/contract/operation/contract_enums.odin:83

Stop_Cause_Word

Stop_Cause_Word :: distinct u64

The word of a Stop_Cause: a Stop_Cause has 1 byte.

Kind
distinct
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base
Source
src/library/modus/contract/operation/contract_enums.odin:79

Stop_Outcome_Word

Stop_Outcome_Word :: distinct u64

The word of a Stop_Outcome: a Stop_Outcome has 1 byte.

Kind
distinct
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base
Source
src/library/modus/contract/operation/contract_enums.odin:81

Object_Kind_Word

Object_Kind_Word :: distinct u64

The word of an Object_Kind: an Object_Kind has 1 byte.

Kind
distinct
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base
Source
src/library/modus/contract/operation/contract_enums.odin:85

Mapping_Flag

Mapping_Flag :: enum u64 {
	Write   = 0, // The pages can be written.
	Execute = 1, // The pages can be executed.
	Process = 2, // A process can use the pages.
	Large   = 3, // The table holds pages of 2 MiB.
}

A run of pages that a page table gives, with one protection.

Kind
enum
Package
src/library/modus/contract/operation
Size
8 bytes
Alignment
8 bytes
Base type
Source
src/library/modus/contract/operation/operation.odin:3580
MemberValueHexadecimal
Write00x0
Execute10x1
Process20x2
Large30x3

Mapping_Run

Mapping_Run :: struct {
	start:      u64, // The address of the first page.
	page_count: u64, // Pages of 4096 bytes.
	flags:      bit_set[;u64], // The protection of the run.
}

One run of a : pages that follow each other in the addresses, with the same flags.

Kind
struct
Package
src/library/modus/contract/operation
Size
24 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3589
FieldTypeOffsetSize
start08
page_count88
flagsbit_set[Mapping_Flag; u64]168

24 bytes of fields and 0 bytes of padding: 24 bytes.

Mapping_Report

Mapping_Report :: struct {
	run_count:           u64, // The runs of the table. `runs` has the first ones.
	runs:                [MAPPING_RUN_CAPACITY], // By address.
	pages:               u64, // The pages of all the runs.
	write_pages:         u64, // The pages that can be written.
	execute_pages:       u64, // The pages that can be executed.
	write_execute_pages: u64, // Always 0: no page is both.
	guard_pages:         u64, // Kernel half: the pages around the kernel stacks that have no memory.
	guards_expected:     u64, // Kernel half: the guard pages that the layout of the kernel stacks has. Equal to `guard_pages` when each guard is in place.
	kernel_guard:        u64, // 1: the processors refuse the memory of processes to the kernel, outside a copy.
	kernel_no_execute:   u64, // 1: the processors refuse to execute the memory of processes in the kernel.
}

What the page table says, as the kernel reads it from the table itself.

Inspect with the kind Mappings writes it, for the kernel half of the addresses or for the half of the process that asks. A test reads it to prove that no page is writable and executable and that each kernel stack has its guard pages: the report comes from the table that the processor uses, not from the records of the kernel.

Kind
struct
Package
src/library/modus/contract/operation
Size
2376 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3606
FieldTypeOffsetSize
run_count08
runs[96]Mapping_Run82304
pages23128
write_pages23208
execute_pages23288
write_execute_pages23368
guard_pages23448
guards_expected23528
kernel_guard23608
kernel_no_execute23688

2376 bytes of fields and 0 bytes of padding: 2376 bytes.

Boot_Stage

Boot_Stage :: struct {
	name:     [48]u8, // Zero bytes after the name.
	start:    u64, // Microseconds since the machine started.
	duration: u64, // Microseconds.
}

One stage of the start of the machine: the boot program or the kernel timed it. See stage.

Kind
struct
Package
src/library/modus/contract/operation
Size
64 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3626
FieldTypeOffsetSize
name[48]u8048
start488
duration568

64 bytes of fields and 0 bytes of padding: 64 bytes.

Boot_Range

Boot_Range :: struct {
	start:      u64, // The physical address of the first page.
	page_count: u64, // Pages of 4096 bytes.
	kind:       u64, // A `boot_info.Memory_Kind`.
}

A run of physical memory, as the firmware gave it. kind is a boot_info.Memory_Kind: 0 not usable, 1 free, 2 loaded by the boot program.

Kind
struct
Package
src/library/modus/contract/operation
Size
24 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3634
FieldTypeOffsetSize
start08
page_count88
kind168

24 bytes of fields and 0 bytes of padding: 24 bytes.

Boot_Report

Boot_Report :: struct {
	time:                   u64, // Now: microseconds since the machine started.
	stage_count:            u64, // The stages in `stages`.
	stages:                 [BOOT_STAGE_CAPACITY], // In the order of their start; `stage_count` of them are used.
	range_count:            u64, // The runs in `ranges`.
	ranges:                 [BOOT_RANGE_CAPACITY], // By address. Neighbours of one kind are one range.
	firmware_ranges:        u64, // The ranges that the firmware gave.
	firmware_vendor:        [32]u8, // The name of the firmware vendor, as ASCII; zero bytes after it.
	firmware_revision:      u64, // The revision of the firmware, as the firmware gives it.
	framebuffer_address:    u64, // The physical address of the framebuffer. 0: no framebuffer.
	framebuffer_width:      u64, // Pixels.
	framebuffer_height:     u64, // Pixels.
	framebuffer_line:       u64, // Pixels from one line to the next.
	framebuffer_format:     u64, // A boot_info.Pixel_Format.
	kernel_size:            u64, // Bytes of the kernel in memory.
	kernel_file_size:       u64, // Bytes of the file of the kernel.
	boot_image_size:        u64, // Bytes of the boot image.
	direct_map_size:        u64, // Bytes of physical memory that the direct map of the kernel covers.
	acpi_root:              u64, // The physical address of the root table of ACPI. 0: none.
	cycle_frequency:        u64, // Cycles of the cycle counter per second.
	timer_frequency:        u64, // Counts of the timer of a processor per second.
	trust:                  info.Boot_Trust, // The trust record of the boot program, as it wrote it.
	// The remapping units of the IOMMU that translate the accesses of the devices. 0: no IOMMU in use, and
	// each device reaches all memory. Whether one device has a domain and device windows is the second
	// result of `Device_Create` of its registers (`Device_Memory_Facts`).
	iommu_unit_count:       u64,
	// The words of the start request of the boot program, as it wrote them: a
	// boot_info.Start_Request and a boot_info.Start_Request_Source, which the root
	// service reads through boot_info.start_request_of_words.
	start_request:          u64,
	start_request_source:   u64,
}

How the machine started: the stages and their times, the memory that the firmware gave, the framebuffer, the sizes of the kernel and of the boot image, and the trust record of the boot program. Inspect with the kind Boot writes it. The kernel keeps it from the boot record; nothing in it changes after the start, but time.

Kind
struct
Package
src/library/modus/contract/operation
Size
2720 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3674
FieldTypeOffsetSize
time08
stage_count88
stages[12]Boot_Stage16768
range_count7848
ranges[64]Boot_Range7921536
firmware_ranges23288
firmware_vendor[32]u8233632
firmware_revision23688
framebuffer_address23768
framebuffer_width23848
framebuffer_height23928
framebuffer_line24008
framebuffer_format24088
kernel_size24168
kernel_file_size24248
boot_image_size24328
direct_map_size24408
acpi_root24488
cycle_frequency24568
timer_frequency24648
trustBoot_Trust2472224
iommu_unit_count26968
start_request27048
start_request_source27128

2720 bytes of fields and 0 bytes of padding: 2720 bytes.

Process_Report

Process_Report :: struct {
	state:          , // `None` for a slot with no process.
	// The word of its `Stop_Cause`: 0 while the process runs. A record of the kernel holds the word, which a
	// reader takes through `stop_cause_of_word`.
	stop_cause:     u32,
	// The word of its `Stop_Outcome`: 0 while the process runs, and for each cause but `Itself`. A reader
	// takes it through `stop_outcome_of_word`.
	stop_outcome:   u32,
	name:           [PROCESS_NAME_BYTES_MOST + 1]u8, // The name that `Process_Create` gave; zero bytes after it.
	mapped_pages:   u64, // The pages of all its mappings.
	handle_count:   u64, // The handles currently in its handle table.
	run_time:       u64, // Milliseconds of processor time.
	entries:        u64, // Its kernel entries since its start.
	thread_count:   u64, // Its threads that did not end.
	start_time:     u64, // Microseconds since the machine started.
	budget:         , // What the budget that pays for the process still holds.
	present_pages:  u64, // The mapped pages that have a page frame.
	process_serial: u64, // A number that changes for each new process in the slot: two reports with the same serial are of one process.
	handles_peak:   u64, // Largest count of handles held at once since this process was created.
	mapping_count:  u64, // Mappings currently in its mapping table.
	mappings_peak:  u64, // Largest count of mappings held at once since this process was created.
}

The state of one process slot: its state, its name, its counts and what its budget still holds. Inspect with the kind Process writes it; the developer tools list the processes with it. A slot with no process gives zeros.

Kind
struct
Package
src/library/modus/contract/operation
Size
176 bytes
Alignment
8 bytes
Padding
4 bytes
Source
src/library/modus/contract/operation/operation.odin:3711
FieldTypeOffsetSize
state04
stop_cause44
stop_outcome84
name[32]u81232
padding444
mapped_pages488
handle_count568
run_time648
entries728
thread_count808
start_time888
budget9640
present_pages1368
process_serial1448
handles_peak1528
mapping_count1608
mappings_peak1688

172 bytes of fields and 4 bytes of padding: 176 bytes.

Context

Context :: struct {
	handles: [CONTEXT_HANDLES], // The granted handles. The role of each index below 14 is fixed by who starts the process,
	// from 14 by the system.
	values:  [CONTEXT_VALUES]u64, // Numbers that the starter gives: sizes, addresses, flags. The role of each index is fixed by who starts the process, from 16 by the system.
}

It holds no text: a process has nothing to parse.

The starter writes the record in one page that it maps at CONTEXT_ADDRESS in the new process, and gives that address as the parameter of the entry. The process reads it once, at its start (system.context_record). Each starter and its process agree on the role of each index below 16; the roles that the system fixes have constants here. A handle at an index that the starter did not grant is 0. See context.

Example: the handle of the log is handles[CONTEXT_LOG], the budget of the process handles[CONTEXT_BUDGET], and the random seed the four values from values[CONTEXT_VALUE_SEED].

Kind
struct
Package
src/library/modus/contract/operation
Size
272 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/operation/operation.odin:3790
FieldTypeOffsetSize
handles[20]Handle080
values[24]u6480192

272 bytes of fields and 0 bytes of padding: 272 bytes.

Seed_Strength

Seed_Strength :: enum u8 {
	None      = 0, // No gathering yet.
	Weak      = 1, // The cycle counter only: no claim of entropy.
	Processor = 2, // rdrand: the generator of the processor.
	Entropy   = 3, // rdseed: the entropy source of the processor.
}

How strong the source of a seed is: the strongest source that gave all its values at the gathering of the root service. Its word crosses the context (CONTEXT_VALUE_SEED_STRENGTH), so each value is explicit, and the order is the order of the strength: random.fill_for_a_key refuses a seed below the strength that the caller asks.

Kind
enum
Package
src/library/modus/contract/operation
Size
1 byte
Alignment
1 byte
Base type
Source
src/library/modus/contract/operation/operation.odin:3830
MemberValueHexadecimal
None00x0
Weak10x1
Processor20x2
Entropy30x3

The package errors

Error_Record

Error_Record :: struct {
	kind:      i64, // A Kind. 0: no error.
	unit:      i64, // A Unit: what value, limit and found count.
	operation: i64, // A kernel operation (op.Operation), or the number of the export in the file of its module.
	argument:  i64, // The number of the argument that is wrong, from 1. 0: the call as a whole.
	value:     i64, // The value that the argument had: see Kind.
	limit:     i64, // What the argument must respect: see Kind.
	found:     i64, // What the system found: see Kind.
}

The error record: what a call that failed says about why, as seven integers.

The callee writes it, and only when the call fails; the caller reads it. A record from another process is a claim of that process: a reader shows it, and checks a kind or a unit that it does not know (kind_known, unit_known) before it indexes a table with it. 56 bytes: the seven values of a completion record.

Example: Memory_Create of 16 pages, with a budget handle with Read whose budget holds 10 pages, fails with {kind = .Budget, unit = .Pages, argument = 1, value = <the budget handle>, limit = 17, found = 10}: the object costs its 16 pages and one list page (operation.memory_cost).

Kind
struct
Package
src/library/modus/contract/errors
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
Source
src/library/modus/contract/errors/errors.odin:47
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Kind

Kind :: enum i64 {
	None              = 0, // No error: the record of a call that did not fail is all zero.
	Empty             = 1, // A text argument has no byte. limit: the most that it can have.
	// Given by the storage service and by the HTTP server (`src/modules/demonstrations/server`) for an empty name, and by QUIC.
	Too_Long          = 2, // value: the size of the argument; limit: the most that it can have.
	// The unit names what the size counts: `Words` for a word wait, `Bytes` for a name of the storage service or a
	// frame of the frame service.
	Too_Small         = 3, // value: the size of the argument; limit: the least that it must have.
	// The kernel gives it for a report buffer below the size of its report (`Inspect`), and for a count of 0 where
	// one is needed. The block, frame and network services give it for a buffer too small for one block or frame.
	Bad_Value         = 4, // value: a value that the call refuses; limit: the largest value that it takes, or 0 when the sentence gives no range;
	// found: 0, or the part of the argument that the call refuses, as the call numbers its parts (Thread_Control:
	// op.Thread_Write_Refusal).
	//
	// The general kind for a number out of its range or with no meaning: a level of the log, a weight of a
	// thread, a setting that names no value, a command of the terminal ring.
	Bad_Flags         = 5, // value: the flags; limit: the flags that the call knows.
	// The kernel gives it for `Memory_Create`, `Memory_Map`, `Memory_Commit`, `Memory_Protect` and `Fault_Handler_Set` with a
	// flag or a kind that it does not know, or with two flags that do not go together.
	Bad_Byte          = 6, // value: the offset of the byte in the text; found: the byte.
	// A name or a text holds a byte that the call refuses: the storage service for a byte 0 or `/` in a name, or a
	// name `.` or `..`, the HTTP server for a byte that a name of a page cannot hold.
	Bad_Address       = 7, // value: the address; limit: the count of bytes; found: 1 when the call writes there.
	// The kernel gives it with the status `Bad_Address`: the process cannot read, or write, the bytes that an
	// argument names.
	Handle_Absent     = 8, // value: a number that names no handle of the caller.
	// With the unit `Lent_Handles`: in an isolated call, the handle did not come through the call ring.
	Handle_Ended      = 9, // value: the handle; found: an End.
	// The handle named an object once: it was closed or revoked. The kernel gives it with `Bad_Handle`.
	Handle_Kind       = 10, // value: the handle; limit: the kind of object that the call needs; found: the kind of its object (op.Object_Kind).
	// The kernel gives it with `Bad_Handle`: for example a memory handle given to `Process_Start`.
	Handle_Rights     = 11, // value: the handle; limit: the rights that the call needs; found: the rights of the handle (op.Rights).
	// The kernel gives it with `No_Right`. Both sets are `op.Rights` as integers.
	Budget            = 12, // value: the handle of the budget; limit: what the call asks; found: what the budget holds.
	// The kernel gives it with `No_Budget` when the handle has **Read**. The unit names the amount: `Pages`,
	// `Processes`, `Threads`, `Processor` or `Log_Records`.
	Budget_Hidden     = 13, // value: the handle of the budget; limit: what the call asks. The handle has no right Read: the budget is not described.
	// The kernel gives it with `No_Budget`. The record depends on the call alone, so it tells nothing of a budget
	// that another process shares.
	Over_Limit        = 14, // value: what the call makes; limit: the limit. Unit Blocks (the storage service): the blocks of the current objects with the change, with no earlier version kept.
	// The kernel gives it for `Log` above the records of the second (`Log_Records`). The network service gives it
	// with `Bytes` when a send passes the limit of the address check; the remote service with `Milliseconds` when
	// a call passes its time limit.
	Full              = 15, // A table has no free place. limit: its capacity.
	// The unit names the table: `Handles`, `Mappings`, `Threads`, `Modules`, `Interrupts`, `Places`,
	// `Connections`, `Principals`, `Commit_Blocks`. Another try can pass after a place frees.
	State             = 16, // value: the handle; found: the op.Process_State of its object, or 0 when the handle has no right Read.
	// The kernel gives it with `Bad_State`: the process is stopped, or not started yet. A service gives it for a
	// connection or a stream that is not in the state of the command.
	Absent            = 17, // No object has the name or the number of the argument. found: 0, or the number from 1 of the row of a table argument that names it.
	// The unit names what is absent: `Objects` or `Trees` (a name of the storage service), `Places`, `Versions`,
	// `Principals`, `Region`, a setting, a host of the network.
	Damaged           = 18, // The object of the argument exists, and a block of it has a wrong check.
	// The storage service gives it when a block of an object or of a tree does not match its hash. With the unit
	// `Counts`: the counts of the blocks are not trusted after a fault of the service.
	Device            = 19, // A device reported an error. found: the status of the device.
	// The storage service gives it when the block service failed a read or a write. With the unit
	// `Dropped_Writes`, the device answered Ok and did not keep a write: the read back of the commit found it.
	No_Grant          = 20, // The caller has no grant for this call: the unit says which grant.
	// Given by a service: the storage service (`Store`, `Changes`), the root service (`Root_Commands`,
	// `Acts_For_Principal`), the compositor (`Display`), the terminal (`Terminal`), the network service
	// (`Endpoint`, `Connection`). The fix is a grant from the starter of the process, not another call.
	Malformed         = 21, // The module of the argument breaks a rule of the module format. value: the kind of the problem; found: the byte of the file.
	// Given by the loader of `src/library/modus/system` and by the process `manual`. Also by `system.ring_open` with
	// argument 1: the header of a ring is not one that `ring.open` takes.
	No_Target         = 22, // value: the handle of a memory object that names no one other process to receive the handle.
	// The kernel gives it for `Handle_Give` whose target is a memory object that no one other process maps or
	// holds.
	Overlap           = 23, // value: an address, or with the unit Region an offset in the call region of an isolated call; limit: the count of bytes. They overlap something that the process has, or another argument of the call that is written.
	// The kernel gives it for `Memory_Map` at an address that another mapping holds, for `Process_Module` over
	// another module record, and for `Memory_Commit` with ranges that overlap.
	Unknown_Operation = 24, // value: the number of the operation.
	// The kernel gives it for a command record whose kind is 0 or above the last `op.Operation`; limit is the
	// last operation.
	Refused           = 25, // The call refused, and gives no more detail. found: the status (op.Status for the kernel, and with the unit Kernel_Status).
	// The last resort of a callee that has no better kind: a reader names the status in words with the unit
	// Kernel_Status, and keeps any other status on the detail lines. `src/library/modus/system`
	// gives it for a kernel call whose answer has another tag than its command, or is absent.
	No_Answer         = 26, // No answer before the time limit. value: the IPv4 address that did not answer, or 0; limit: the milliseconds waited; found: the word of an Unanswered, what did not answer.
	// The network service gives it, with the unit `Milliseconds`. The block service gives it with `Device` for each
	// request in flight when the device did not answer one by its deadline or needs a reset; the storage service then refuses each
	// call that needs the disk with the kind `Device`.
	Unsupported       = 27, // The receiver does not do this command. value: the command, or the field that it does not do.
	// Given by the block and frame services for a command that the device does not have, by the network
	// service, the root service and QUIC. The kernel gives it with `Bad_Operation` for `Guest_Run` on a machine
	// whose processors have no virtualization support that it uses: value is the operation.
	Link_Down         = 28, // The link of the network device is down.
	// The network service gives it for a send while the device reports no link.
	Busy              = 29, // Too many requests are in flight. value: the requests in flight, or 0 when the receiver does not count them; limit: the most.
	// The block, frame and network services give it, with the unit `Requests`. Another try can pass after a
	// completion. `src/library/modus/system` gives it with `Bad_Operation` and limit 0 for a kernel call on a
	// kernel ring that holds a command or a completion: its command does not run.
	Out_Of_Range      = 30, // The argument names units past the end. value: the end of what it names (its first unit and its count); limit: the units that exist; found: 0, or the number from 1 of the record of a table argument that names them (a record that names bytes of another argument by an offset, docs/MODULE_CONTRACT.md, "Tables and bytes as parameters").
	// The services of rings give it for a place and a count past the end of their data region (the unit `Bytes`),
	// and the storage service for a range past the end of an object.
	Reserved          = 31, // The argument names a process of the system that the call does not act on: it starts at boot, or it is a device service.
	// The root service gives it for `Start` or `Stop` of such a process.
	Not_Payer         = 32, // value: the handle of a budget that does not pay for the memory object of the call. It says nothing of the budget.
	// The kernel gives it for `Memory_Commit` with a budget that is not the budget of the object.
	Object_Shared     = 33, // value: the handle of a memory object, or 0; the call needs an object that only this process names, with one mapping at most.
	// The kernel gives it for a decommit (`Memory_Commit`) and for `Memory_Protect` on an object that another
	// handle or another mapping names.
	Object_Marked     = 34, // value: the handle of a memory object; found: its pages with a protection of their own. The object is not mapped again and not given.
	// The kernel gives it for `Memory_Map` and `Handle_Give` of an object that `Memory_Protect` changed.
	Whole_Only        = 35, // value: an address; limit: the bytes of the range. The range is a part of a mapping whose protection changes only whole (device memory, large pages), or of an area that the system keeps (a thread area).
	// The kernel gives it for `Memory_Protect`.
	Not_Multiple      = 36, // value: the argument; limit: the number that it must be a multiple of; found: the rest.
	// The kernel gives it for `Memory_Create` with `Large_Pages` and a count that is not a multiple of 512.
	Not_Authentic     = 37, // The bytes of the argument do not prove what they must: the tag of a sealed text, or a signature, does not verify. No byte of the result is given.
	// The cryptography module gives it for an open of a sealed text, and QUIC for a packet or a handshake that
	// does not verify. See [not authentic](term:not-authentic).
	Seed_Too_Weak     = 38, // The random seed of the process is weaker than the least strength that the caller accepts. value: the word of the op.Seed_Strength of the seed; limit: the word of the least strength asked. Nothing is made.
	// `random.fill_for_a_key` gives it when the seed of the generator has a lower `Seed_Strength` than the call
	// asks. A plain draw (`random.fill`) never gives it.
	Exists            = 39, // The name of the argument names something that exists already, and the call makes a new one. found: 0, or the number from 1 of the row of a table argument that names it.
	// The storage service gives it for a new tree or object at a name in use.
	Starter_Module    = 40, // value: the address that the call names; limit: the base of a module record that the starter of the process wrote (op.Module_Writer.Starter); found: its size in bytes.
	// The kernel gives it with `No_Right` for `Process_Module`, `Memory_Map` and `Memory_Unmap` of a process in
	// itself over that record: only a holder of its process handle changes it.
}

What is wrong. The meaning of value, limit and found for each kind:

A kind names the class of the mistake, and the unit names what the values count. The comment of each member gives what value, limit and found hold, and which calls give it. A kind that is not in this list is "unknown" to a reader (kind_known). The page "Error kinds and units" of the site shows this table.

Kind
enum
Package
src/library/modus/contract/errors
Size
8 bytes
Alignment
8 bytes
Base type
Source
src/library/modus/contract/errors/errors.odin:65
MemberValueHexadecimal
None00x0
Empty10x1
Too_Long20x2
Too_Small30x3
Bad_Value40x4
Bad_Flags50x5
Bad_Byte60x6
Bad_Address70x7
Handle_Absent80x8
Handle_Ended90x9
Handle_Kind100xA
Handle_Rights110xB
Budget120xC
Budget_Hidden130xD
Over_Limit140xE
Full150xF
State160x10
Absent170x11
Damaged180x12
Device190x13
No_Grant200x14
Malformed210x15
No_Target220x16
Overlap230x17
Unknown_Operation240x18
Refused250x19
No_Answer260x1A
Unsupported270x1B
Link_Down280x1C
Busy290x1D
Out_Of_Range300x1E
Reserved310x1F
Not_Payer320x20
Object_Shared330x21
Object_Marked340x22
Whole_Only350x23
Not_Multiple360x24
Not_Authentic370x25
Seed_Too_Weak380x26
Exists390x27
Starter_Module400x28

Unit

Unit :: enum i64 {
	None        = 0, // The values are plain numbers, or the kind gives them their meaning.
	Bytes       = 1, // Bytes of memory, of a file or of a text.
	Pages       = 2, // Pages of 4096 bytes.
	Blocks      = 3, // Blocks of a disk or of a store.
	Objects     = 4, // Objects of a store.
	Stores      = 5, // Stores of the storage service.
	Processes    = 6, // Process slots of a budget.
	Threads     = 7, // Thread slots of a budget, or the threads of a process.
	Handles     = 8, // The handle table of a process.
	Mappings    = 9, // The mappings of a process (`op.MAPPING_REPORT_CAPACITY`).
	Modules     = 10, // Module records of a process.
	Words       = 11, // The words of one word wait.
	Log_Records = 12, // Log records in one second.
	Processor   = 13, // Microseconds of processor time in one second.
	Budgets     = 14, // Budgets of the kernel.
	Interrupts  = 15, // Message interrupts (`op.MESSAGE_CAPACITY`).
	Memory      = 16, // Memory objects of the machine.
	Store       = 17, // No_Grant: a private store.
	Acts_For_Principal = 18, // No_Grant: to act for the principal whose session the caller belongs to.
	Records     = 19, // Records of a table argument: ranges, rules, rows.
	Connection  = 20, // No_Grant: a connection to the service.
	Milliseconds = 21, // A time: a time limit or a time waited.
	Connections = 22, // The records of a TCP connection table (src/library/modus/tcp).
	Tcp_Ports   = 23, // The local TCP ports of a client grant.
	Requests    = 24, // Requests in flight.
	Endpoint    = 25, // A remote of the network: an IPv4 address and a port, in one value (endpoint_pack). No_Grant: value the remote that the call names, limit the remote of the grant (0: none), found the local port when it is not a port of the endpoint.
	Region      = 26, // Absent: the data region of a ring. Overlap: bytes of the call region of an isolated call; value is their offset, limit their count.
	Root_Commands = 27, // No_Grant: the commands of the root ring that change other processes.
	Services    = 28, // Services that run.
	Grants      = 29, // The grants of a process (system.Root_Grant).
	Display     = 30, // No_Grant: a surface on the screen (the ring to the compositor).
	Terminal    = 31, // No_Grant: a terminal (the terminal ring and the text region).
	Lent_Handles = 32, // Handle_Absent: the handle did not come through the call ring for this call (an isolated call).
	Versions    = 33, // Absent: the versions of an object (value: the generation that the argument named).
	Counts      = 34, // Damaged: the counts of the blocks of a store are not trusted after a fault of the service; it makes no change in the store.
	References  = 35, // Over_Limit: the names of one block, which a count holds.
	Commit_Blocks = 36, // Full: the blocks that one commit can change or write.
	Principals  = 37, // The named principals of the root service (docs/PRINCIPALS.md). Full: limit the named principals that it holds; Absent: no such principal, or no session runs.
	Places      = 38, // The places of a connection to the storage service (docs/STORAGE.md): Absent, the number names no place of the connection, or the tree of the place was removed or renamed; Full, the table of places.
	Trees       = 39, // Absent: the name names no tree. Bad_Value: a tree would move inside itself.
	Changes     = 40, // No_Grant: a change of a store; the connection reads only.
	Pending     = 41, // The pending changes of an object in the storage service (docs/STORAGE.md, "Ranges"). Full: limit the blocks that the service holds for them. Absent: the object has no pending change on this connection; found 1: another change of the object came first, and its pending changes are dropped.
	Debug_Objects = 42, // Absent: the debug objects of the modules of a debugged process; no one describes the module of the address (docs/TOOLS.md, "The debugger").
	Breakpoints = 43, // The breakpoints of a thread. Full: limit the breakpoints that a thread has (`op.THREAD_BREAKPOINT_CAPACITY`). Absent: the number names no breakpoint of the debugger.
	Held_Threads = 44, // Absent: the threads that the debugger holds; the thread of the argument runs, or the process has no thread with this number.
	Debugged_Processes = 45, // The processes that the debugger service debugs. Absent: the caller attached to none. Full: the service debugs a process for another caller; limit the processes that it debugs at one time.
	Readable_Variables = 46, // Absent: the variables that are visible and readable at the instruction of a frame; the name of the argument is none of them, or its location is not readable there.
	Debug_Access = 47, // No_Grant: the debug access to a process. found: 0, or 1 + the number of the start grant of the process that refuses it (start_grant.Grant); a sentence writes the name of that grant.
	Stack_Frames = 48, // Absent: the frames of the stack of a held thread; the number of the argument is past the last frame.
	Source_Places = 49, // Absent: the procedures and the source lines of the debug objects; the place of the argument names none.
	Stop_Reports = 50, // Absent: the stop reports of disk processes that the root service keeps; no disk process of the principal of the caller with this nickname stopped on a fault, or newer reports took its place (src/md/features/debug_object_of_a_disk_process.md).
	Versions_Erase = 51, // No_Grant: the erase of the versions of an object (the start grant Versions_Erase, docs/STORAGE.md, "4.8 The erase of versions").
	Dropped_Writes = 52, // Device: the blocks of a commit that the disk answered with Ok and did not keep; found: their count. The storage service refused the commit (docs/STORAGE.md, "3.3 The commit and the open").
	Nanoseconds = 53, // A time of the system clock, or a span of it, in nanoseconds: the time of a record of a timed stream (src/library/modus/contract/timed_stream).
	Frames      = 54, // Frames of a timed stream: one sample of each channel (src/library/modus/contract/timed_stream).
	Record_Types = 55, // Bad_Value: the record descriptions of the two ends of a wiring differ (src/library/modus/contract/output, record_descriptions_compare). value: the Description_Difference; limit: the first field that differs, from 1, or 0 for the record; found: the row of the wiring list.
	Wiring_Rows = 56, // Bad_Value: a row of a wiring list. argument: the field, from 1 (output.Wiring_Field); value: the word; limit: the largest word there; found: the row from 1, or 0 for the list as a whole.
	Wiring_Terms = 57, // Bad_Value or Out_Of_Range: the wiring terms of a row. value: their count of bytes; limit: the size of their description, 0 for a record input that takes none; found: the row.
	Wirings     = 58, // The wirings of the root service. No_Grant: the asker did not start the process of the end, or does not act for the principal of the connection. Busy: the wiring ring of a process has no room, limit its capacity. Bad_Value: one process at both ends. found: the row.
	Input_Histories = 59, // The input history of the process that the debugger service debugs (src/md/features/record_and_replay.md). Absent: the debugger started no record of it, or no record runs. Full: a record or a replay of it runs already. Out_Of_Range: value the input points of a step back, or the point before which a watch back looks, limit the input points of the history. Bad_Value: the module of the boot image is not the module of the history. Damaged: the header of the history is not a valid header.
	Checkpoints = 60, // The checkpoints that the debugger service keeps of a recorded process (src/md/features/record_and_replay.md). Absent: no checkpoint is at or before the input point that a step back names. Exists: a checkpoint is at this input point, or at a later one, already.
	Recorded_Writes = 61, // Absent: no input of the history before the point wrote a byte of the range of a watch back (src/md/features/record_and_replay.md). value: the address; limit: the count of bytes; found: the point, 0 for the whole history.
	Kernel_Status = 62, // Refused: a kernel operation inside the call refused, and found is its op.Status, which a sentence names in words.
}

What value, limit and found count.

With the kinds No_Grant, Absent, Damaged and Handle_Absent the unit names instead the grant, the table or the thing that the kind is about: the comment of each member says so. UNIT_NAMES gives the words that a sentence uses for each unit.

Kind
enum
Package
src/library/modus/contract/errors
Size
8 bytes
Alignment
8 bytes
Base type
Source
src/library/modus/contract/errors/errors.odin:243
MemberValueHexadecimal
None00x0
Bytes10x1
Pages20x2
Blocks30x3
Objects40x4
Stores50x5
Processes60x6
Threads70x7
Handles80x8
Mappings90x9
Modules100xA
Words110xB
Log_Records120xC
Processor130xD
Budgets140xE
Interrupts150xF
Memory160x10
Store170x11
Acts_For_Principal180x12
Records190x13
Connection200x14
Milliseconds210x15
Connections220x16
Tcp_Ports230x17
Requests240x18
Endpoint250x19
Region260x1A
Root_Commands270x1B
Services280x1C
Grants290x1D
Display300x1E
Terminal310x1F
Lent_Handles320x20
Versions330x21
Counts340x22
References350x23
Commit_Blocks360x24
Principals370x25
Places380x26
Trees390x27
Changes400x28
Pending410x29
Debug_Objects420x2A
Breakpoints430x2B
Held_Threads440x2C
Debugged_Processes450x2D
Readable_Variables460x2E
Debug_Access470x2F
Stack_Frames480x30
Source_Places490x31
Stop_Reports500x32
Versions_Erase510x33
Dropped_Writes520x34
Nanoseconds530x35
Frames540x36
Record_Types550x37
Wiring_Rows560x38
Wiring_Terms570x39
Wirings580x3A
Input_Histories590x3B
Checkpoints600x3C
Recorded_Writes610x3D
Kernel_Status620x3E

End

End :: enum i64 {
	Unknown = 0, // The kernel no longer knows how: the slot served again for a later handle since.
	Closed  = 1, // Its process closed it.
	Revoked = 2, // A revocation ended it (Handle_Revoke).
}

How a handle ended (Handle_Ended).

The kernel keeps, in each slot of the handle table, how its last handle ended, so that Handle_Ended tells a closed handle from a revoked one.

Kind
enum
Package
src/library/modus/contract/errors
Size
8 bytes
Alignment
8 bytes
Base type
Source
src/library/modus/contract/errors/errors.odin:484
MemberValueHexadecimal
Unknown00x0
Closed10x1
Revoked20x2

Unanswered

Unanswered :: enum i64 {
	Not_Said         = 0, // The record does not say what did not answer: the time limit alone passed.
	Hardware_Address = 1, // The hardware address of the IPv4 address (ARP).
	Echo             = 2, // The echo of an ICMP echo request.
	Device           = 3, // The device of the service.
}

What did not answer, in found of a record No_Answer. The record crosses each border of the system, so each value is explicit; a reader takes the word with unanswered_of_word, which refuses a word that names no member.

Kind
enum
Package
src/library/modus/contract/errors
Size
8 bytes
Alignment
8 bytes
Base type
Source
src/library/modus/contract/errors/errors.odin:190
MemberValueHexadecimal
Not_Said00x0
Hardware_Address10x1
Echo20x2
Device30x3

Error_Record_Fact_Fields

Error_Record_Fact_Fields :: struct {
	kind:      , // What is wrong.
	unit:      , // What value, limit and found count.
	operation: i64, // The kernel operation, or the number of the export or of the command.
	argument:  i64, // The number of the argument that is wrong, from 1. 0: the call as a whole.
	value:     i64, // The value that the argument had.
	limit:     i64, // What the argument must respect.
	found:     i64, // What the system found.
}

The fields of an error record in a log fact: the seven values of the record, with the kind and the unit as the words of their contract enums, so that a reader writes their names and a condition reads them by name (where(kind = Too_Long)). A module declares its fact type as a distinct type of it, with its own template, and writes it with error_record_fact_fields:

@(log_fact = "storage: the block service refused a request: kind {kind}, unit {unit}, operation {operation}, argument {argument}, value {value}, limit {limit}, found {found}")
Block_Request_Refused :: distinct errors.

system.log_fact(.Warning, Block_Request_Refused(errors.error_record_fact_fields(record)))
Kind
struct
Package
src/library/modus/contract/errors
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/errors/errors.odin:449
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Kind_Word

Kind_Word :: distinct u64

The word of a Kind as the record of another party holds it: a field of a log fact copies it with no cast to Kind, and a reader writes the name of its member, or its number when it names none . It is unsigned, as each field of a contract enum is: the word -1 of a record is the largest word, which names no member.

See: Log facts: typed records in place of formatted lines: The error record as fields in the repository

Kind
distinct
Package
src/library/modus/contract/errors
Size
8 bytes
Alignment
8 bytes
Base
Named by
Source
src/library/modus/contract/errors/errors.odin:431

Unit_Word

Unit_Word :: distinct u64

The word of a Unit as the record of another party holds it, as Kind_Word.

Kind
distinct
Package
src/library/modus/contract/errors
Size
8 bytes
Alignment
8 bytes
Base
Named by
Source
src/library/modus/contract/errors/errors.odin:434

The package fixed_addresses

Fixed_Range

Fixed_Range :: enum u8 {
	Module_Files = 0, // 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.
	Pointer_Themes = 1, // 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.
	Settings_Page = 2, // 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.
	Date_Page = 6, // 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.
	Storage_File = 7, // 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.
	Module_Tables = 8, // 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.
	Debug_Image = 11, // 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.
	Disk_Process_Page = 12, // 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.
	Font_Outlines = 14, // 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.
	Fresh_Bytes_Page = 15, // 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.
	Start_Policy_Pages = 16, // 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.
	Edit_Target_Page = 17, // 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).
}

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.

Kind
enum
Package
src/library/modus/contract/fixed_addresses
Size
1 byte
Alignment
1 byte
Base type
Named by
Source
src/library/modus/contract/fixed_addresses/fixed_addresses.odin:69
MemberValueHexadecimal
Module_Files00x0
Pointer_Themes10x1
Settings_Page20x2
Date_Page60x6
Storage_File70x7
Module_Tables80x8
Debug_Image110xB
Disk_Process_Page120xC
Font_Outlines140xE
Fresh_Bytes_Page150xF
Start_Policy_Pages160x10
Edit_Target_Page170x11

Fixed_Ranges

Fixed_Ranges :: bit_set[;u64]

Fixed_Ranges: a set of ranges, one bit for each member, the bit of the value of the member. The value op.CONTEXT_VALUE_FIXED_RANGES_MAPPED of the context of a process is the set that its starter mapped.

Kind
bit set
An alias of
bit_set[Fixed_Range; u64]
Package
src/library/modus/contract/fixed_addresses
Size
8 bytes
Alignment
8 bytes
Underlying type
Element
Source
src/library/modus/contract/fixed_addresses/fixed_addresses.odin:132
BitMemberMask
0Module_Files0x1
1Pointer_Themes0x2
2Settings_Page0x4
6Date_Page0x40
7Storage_File0x80
8Module_Tables0x100
11Debug_Image0x800
12Disk_Process_Page0x1000
14Font_Outlines0x4000
15Fresh_Bytes_Page0x8000
16Start_Policy_Pages0x10000
17Edit_Target_Page0x20000

Address_Range

Address_Range :: struct {
	address: u64, // The first byte of the range.
	span:    u64, // The bytes of addresses of the range: RANGE_SPAN.
}

The addresses of one range.

Kind
struct
Package
src/library/modus/contract/fixed_addresses
Size
16 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/fixed_addresses/fixed_addresses.odin:184
FieldTypeOffsetSize
address08
span88

16 bytes of fields and 0 bytes of padding: 16 bytes.

The package module

Load_Stage

Load_Stage :: enum u32 {
	None  = 0, // No error: the load did not fail.
	Find  = 1, // Find the file of a module: the load source has no file with its hash.
	Read  = 2, // Read the file: it does not have the hash that names it, or its tables are not valid (`file_error`).
	Cycle = 3, // A module imports itself through its imports. Only a replacement can make a cycle: an import names a hash.
	Check = 4, // Check a replacement: an export that an import slot uses is missing in the module of the replacement, or its description differs (`difference`).
	Bind  = 5, // Bind an import slot: the import slot names no import or no export, or it is not in writable data.
	Map   = 6, // Map the memory of a module: a kernel operation failed (`status`).
	Room  = 7, // The module space, the imports of one module, or the table of prepared modules of the loader have no room for one more.
	Unmap = 8, // Remove a module: a kernel operation failed (`status`).
}

The stage of the load that failed.

Kind
enum
Package
src/library/modus/contract/module
Size
4 bytes
Alignment
4 bytes
Base type
Source
src/library/modus/contract/module/error.odin:13
MemberValueHexadecimal
None00x0
Find10x1
Read20x2
Cycle30x3
Check40x4
Bind50x5
Map60x6
Room70x7
Unmap80x8

Difference

Difference :: enum u32 {
	None            = 0, // The two descriptions agree.
	Missing_Export  = 1, // The module of the replacement has no export with the name.
	Parameter_Count = 2, // expected.detail and found.detail are the counts.
	Parameter_Type  = 3, // Parameter `parameter` has another type.
	Parameter_Detail = 4, // Parameter `parameter`: a Handle with other rights, another Record, an Integer in another unit, another Enum, or an Enum that one side may leave out and the other needs.
	Result_Type     = 5, // The result has another type.
	Result_Detail   = 6, // A Record or Table result with another record, or an Enum result with another enum.
	Error_Record    = 7, // One gives an error record and the other does not, or the two records differ.
	Parameter_Direction = 8, // Parameter `parameter`: a Table or Bytes with another direction.
}

What differs between the description of an export in the module that an import names (expected) and in the module of its replacement (found).

functions_compare gives it, and the loader writes it in Load_Error.difference at the stage Check.

Kind
enum
Package
src/library/modus/contract/module
Size
4 bytes
Alignment
4 bytes
Base type
Source
src/library/modus/contract/module/error.odin:30
MemberValueHexadecimal
None00x0
Missing_Export10x1
Parameter_Count20x2
Parameter_Type30x3
Parameter_Detail40x4
Result_Type50x5
Result_Detail60x6
Error_Record70x7
Parameter_Direction80x8

Described

Described :: struct {
	type:      u8, // The type of the parameter or of the result: the byte of a Type as the file holds it, read through type_of_word.
	direction: u8, // A Table or Bytes parameter: the byte of a Direction (direction_of_word).
	_:         [2]u8,
	detail: u32, // The detail of the type: the rights of a Handle, the index of a record, or a count of parameters.
	record: [NAME_SIZE]u8, // A Record or a Table: the name of its record; an Enum: the name of its enum; zero bytes after it.
}
Kind
struct
Package
src/library/modus/contract/module
Size
40 bytes
Alignment
4 bytes
Padding
0 bytes
Named by
Source
src/library/modus/contract/module/error.odin:63
FieldTypeOffsetSize
type01
direction11
_[2]u822
detail44
record[32]u8832

40 bytes of fields and 0 bytes of padding: 40 bytes.

Named

Named :: struct {
	hash: [HASH_SIZE]u8, // Zero: no module.
	name: [NAME_SIZE]u8, // Zero: the load source gives no name to the hash.
}

A module, as the load source names it.

Kind
struct
Package
src/library/modus/contract/module
Size
64 bytes
Alignment
1 byte
Padding
0 bytes
Named by
Source
src/library/modus/contract/module/error.odin:72
FieldTypeOffsetSize
hash[32]u8032
name[32]u83232

64 bytes of fields and 0 bytes of padding: 64 bytes.

Load_Error

Load_Error :: struct {
	stage:       u32, // The word of a Load_Stage (load_stage_of_word). 0 (None): no error.
	status:      u32, // Map, Unmap: the status of the kernel operation.
	file_error:  u32, // Read: the word of an Error (file_error_of_word); 0 (None) when the hash differs.
	difference:  u32, // Check: the word of a Difference (difference_of_word).
	module:      , // The module that was being loaded: the importer, when the stage concerns one of its imports.
	imported:    , // The import of `module` that the stage concerns, as the file of `module` names it. Zero: the stage concerns `module` itself.
	// A replacement on the path of the load: where a module imported
	// `replaced`, the loader gave `replacement` in its place. It says who
	// decided: the party that gave the replacements.
	replaced:    ,
	replacement: ,
	export:      [NAME_SIZE]u8, // Check, Bind: the name of the export, in the module that the import names.
	import_slot: u32, // Bind: the number of the import slot.
	parameter:   u32, // Parameter_Type, Parameter_Detail: the number of the parameter, from 1.
	expected:    , // Check: in the module that the import names.
	found:       , // Check: in the module of the replacement.
}

Why a load failed: the stage, the module, the import, and the fact that the stage found. A loader fills it (system.Module_Space, a call host); a caller writes it as text (system.load_error_text). The fields that a stage does not use are zero. See load error.

Example: a module whose import has no file in the load source gives {stage = u32(Load_Stage.Find), module = <the importer>, imported = <the hash of the import>}.

Kind
struct
Package
src/library/modus/contract/module
Size
392 bytes
Alignment
4 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/error.odin:85
FieldTypeOffsetSize
stage04
status44
file_error84
difference124
module1664
imported8064
replaced14464
replacement20864
export[32]u827232
import_slot3044
parameter3084
expected31240
found35240

392 bytes of fields and 0 bytes of padding: 392 bytes.

Load_Stage_Word

Load_Stage_Word :: distinct u64

The words of Load_Stage, Error and Difference in 8 bytes, for a record that holds them beside fields of 8 bytes with no padding.

Kind
distinct
Package
src/library/modus/contract/module
Size
8 bytes
Alignment
8 bytes
Base
Source
src/library/modus/contract/module/contract_enums.odin:71

Error_Word

Error_Word :: distinct u64
Kind
distinct
Package
src/library/modus/contract/module
Size
8 bytes
Alignment
8 bytes
Base
Named by
Source
src/library/modus/contract/module/contract_enums.odin:72

Difference_Word

Difference_Word :: distinct u64
Kind
distinct
Package
src/library/modus/contract/module
Size
8 bytes
Alignment
8 bytes
Base
Named by
Source
src/library/modus/contract/module/contract_enums.odin:73

Load_Find_Fields

Load_Find_Fields :: struct {
	module_hash:   value_kinds.Hash_Head_Field,
	imported_hash: value_kinds.Hash_Head_Field,
	module_name:   [40]u8,
	imported_name: [40]u8,
}

Find: the load source has no file with the hash of the import, or of the module itself (no import: imported is zero).

Kind
struct
Package
src/library/modus/contract/module
Size
144 bytes
Alignment
1 byte
Padding
0 bytes
Source
src/library/modus/contract/module/load_facts.odin:38
FieldTypeOffsetSize
module_hashHash_Head_Field032
imported_hashHash_Head_Field3232
module_name[40]u86440
imported_name[40]u810440

144 bytes of fields and 0 bytes of padding: 144 bytes.

Load_Read_Fields

Load_Read_Fields :: struct {
	file_error:   ,
	subject_hash: value_kinds.Hash_Head_Field,
	subject_name: [40]u8,
}

Read: the file of the module that the stage concerns does not have the hash that names it (file_error None), or is not a valid module.

Kind
struct
Package
src/library/modus/contract/module
Size
80 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/load_facts.odin:47
FieldTypeOffsetSize
file_error08
subject_hashHash_Head_Field832
subject_name[40]u84040

80 bytes of fields and 0 bytes of padding: 80 bytes.

Load_Cycle_Fields

Load_Cycle_Fields :: struct {
	module_name:      [40]u8,
	imported_name:    [40]u8,
	replacement_name: [40]u8,
}

Cycle: a module imports itself through its imports, by a replacement.

Kind
struct
Package
src/library/modus/contract/module
Size
120 bytes
Alignment
1 byte
Padding
0 bytes
Source
src/library/modus/contract/module/load_facts.odin:54
FieldTypeOffsetSize
module_name[40]u8040
imported_name[40]u84040
replacement_name[40]u88040

120 bytes of fields and 0 bytes of padding: 120 bytes.

Load_Check_Fields

Load_Check_Fields :: struct {
	difference:    ,
	parameter:     u64,
	module_name:   [40]u8,
	imported_name: [40]u8,
	export:        [40]u8,
}

Check: an export that an import slot uses differs in the module of the replacement: the difference, and the parameter for a difference of one.

Kind
struct
Package
src/library/modus/contract/module
Size
136 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/load_facts.odin:62
FieldTypeOffsetSize
difference08
parameter88
module_name[40]u81640
imported_name[40]u85640
export[40]u89640

136 bytes of fields and 0 bytes of padding: 136 bytes.

Load_Bind_Fields

Load_Bind_Fields :: struct {
	import_slot:   u32,
	module_name:   [40]u8,
	imported_name: [40]u8,
	export:        [40]u8,
}

Bind: an import slot names no import or no export, or is not in writable data.

Kind
struct
Package
src/library/modus/contract/module
Size
124 bytes
Alignment
4 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/load_facts.odin:71
FieldTypeOffsetSize
import_slot04
module_name[40]u8440
imported_name[40]u84440
export[40]u88440

124 bytes of fields and 0 bytes of padding: 124 bytes.

Load_Memory_Fields

Load_Memory_Fields :: struct {
	status:      op.Status_Word,
	module_hash: value_kinds.Hash_Head_Field,
	module_name: [40]u8,
}

Map and Unmap: a kernel operation on the memory of a module failed.

Kind
struct
Package
src/library/modus/contract/module
Size
80 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/load_facts.odin:79
FieldTypeOffsetSize
status08
module_hashHash_Head_Field832
module_name[40]u84040

80 bytes of fields and 0 bytes of padding: 80 bytes.

Load_Room_Fields

Load_Room_Fields :: struct {
	module_hash: value_kinds.Hash_Head_Field,
	module_name: [40]u8,
}

Room: the module space, the imports of one module, or the table of the loader has no room for one more.

Kind
struct
Package
src/library/modus/contract/module
Size
72 bytes
Alignment
1 byte
Padding
0 bytes
Source
src/library/modus/contract/module/load_facts.odin:87
FieldTypeOffsetSize
module_hashHash_Head_Field032
module_name[40]u83240

72 bytes of fields and 0 bytes of padding: 72 bytes.

Machine

Machine :: enum u32 {
	None   = 0, // No machine: refused.
	X86_64 = 1, // The 64-bit x86 processor.
}

The processor whose instructions the segments hold. A loader refuses a module of another machine (Error.Unknown_Machine).

Kind
enum
Package
src/library/modus/contract/module
Size
4 bytes
Alignment
4 bytes
Base type
Named by
Source
src/library/modus/contract/module/format.odin:54
MemberValueHexadecimal
None00x0
X86_6410x1

Header

Header :: struct {
	magic:           u64, // `MAGIC`.
	version:         u32, // `VERSION`.
	header_size:     u32, // The table directory starts at this offset.
	must_understand: u64, // Feature bits: a reader refuses a file with a bit outside `UNDERSTOOD_FEATURES`.
	machine:         , // The processor of the code.
	table_count:     u32, // The number of entries of the table directory.
	memory_size:     u64, // The size of the address range of the loaded module.
	entry_export:    u32, // An index in the export table. 0: the module has no entry.
	category:        , // What the module is to a reader: the manual groups its list by it; the start menu has it from the table of the modules of the tool.
	reserved:        u8, // 0.
	tags:            , // What the module is about: the manual filters on these words.
}

The first 48 bytes of a module file. A loader reads it first and refuses the file when one field is not one that it takes (validate).

Example: the header of a module with an entry starts with the bytes "MODULE", the version 7, the machine X86_64, and entry_export the index of its export main.

Kind
struct
Package
src/library/modus/contract/module
Size
48 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/format.odin:65
FieldTypeOffsetSize
magic08
version84
header_size124
must_understand168
machine244
table_count284
memory_size328
entry_export404
category441
reserved451
tags462

48 bytes of fields and 0 bytes of padding: 48 bytes.

Module_Category

Module_Category :: enum u8 {
	None           = 0, // The file states no category: a kernel, or a file that a host test writes.
	Application    = 1, // A program of the principal with a window, for the work of the principal: the group applications.
	System_Tool    = 2, // A window that shows or sets the system for the principal: the console, the monitor, the log, the settings, the manual.
	Developer_Tool = 3, // A window that shows how the system runs, for a developer: inspect, the debugger, the pages.
	Service        = 4, // A process with no window of its own, that serves other processes: the root service, the devices, the storage, the compositor.
	Library        = 5, // A module that other modules import or wire: the group libraries.
	Demonstration  = 6, // A module that shows one property of the system to a principal: the group demonstrations.
	Test           = 7, // A module that only a machine test starts or imports: the group tests.
}

The module category: what a module is to a reader, one word for each module. The tool writes it from the table of the modules, and refuses a category that disagrees with the module group, the folder of the source. The manual groups the modules of the boot image by it; the start menu reads no module file, and its lists come from the same table. No loader and no root service decides anything by it. The values cross the border of the file: they are fixed.

See: Glossary: Module category

Kind
enum
Package
src/library/modus/contract/module
Size
1 byte
Alignment
1 byte
Base type
Named by
Source
src/library/modus/contract/module/format.odin:88
MemberValueHexadecimal
None00x0
Application10x1
System_Tool20x2
Developer_Tool30x3
Service40x4
Library50x5
Demonstration60x6
Test70x7

Module_Tag

Module_Tag :: enum u8 {
	Graphics  = 0, // Draws pictures, shapes or text.
	Text      = 1, // Reads, writes or shows text.
	Network   = 2, // Talks to another machine.
	Storage   = 3, // Keeps data on a disk.
	Security  = 4, // Rights, keys, grants, isolation.
	Processes = 5, // Starts, stops, schedules or counts processes.
	Memory    = 6, // Pages, memory objects, address spaces.
	Time      = 7, // Clocks, dates, timers.
	Sound     = 8, // Plays or records sound.
	Input     = 9, // Keys, pointer, devices of input.
	Faults    = 10, // Shows or contains a fault.
	Kernel    = 11, // Shows a mechanism of the kernel.
}

A module tag: one word of what a module is about. The manual filters the list of the modules on the words of the tags as on the names. A closed set, so that two modules about one thing carry one word.

Kind
enum
Package
src/library/modus/contract/module
Size
1 byte
Alignment
1 byte
Base type
Named by
Source
src/library/modus/contract/module/format.odin:102
MemberValueHexadecimal
Graphics00x0
Text10x1
Network20x2
Storage30x3
Security40x4
Processes50x5
Memory60x6
Time70x7
Sound80x8
Input90x9
Faults100xA
Kernel110xB

Module_Tags

Module_Tags :: bit_set[; u16]
Kind
bit set
An alias of
bit_set[Module_Tag; u16]
Package
src/library/modus/contract/module
Size
2 bytes
Alignment
2 bytes
Underlying type
Element
Named by
Source
src/library/modus/contract/module/format.odin:116
BitMemberMask
0Graphics0x1
1Text0x2
2Network0x4
3Storage0x8
4Security0x10
5Processes0x20
6Memory0x40
7Time0x80
8Sound0x100
9Input0x200
10Faults0x400
11Kernel0x800

Table_Kind

Table_Kind :: enum u32 {
	None          = 0, // The entry 0 of the directory: no table.
	Segments      = 1, // `Segment` records: the bytes to map.
	Imports       = 2, // `Import` records: the modules that this one calls.
	Import_Slots  = 3, // `Import_Slot` records: the places that receive the address of an imported export.
	Exports       = 4, // `Export` records: the entry points that other modules call.
	Rebases       = 5, // The rebase table: words, not records.
	Functions     = 6, // `Function` records: the call form of each export.
	Strings       = 7, // The string table: bytes.
	Documentation = 8, // `Documentation` records: the help of the module and of each export.
	Records       = 9, // `Record` records: the descriptions of the records that the exports take and give.
	Fields        = 10, // `Field` records: the fields of those records.
	Budget        = 11, // One `Budget_Request` record, at index 1: the budget that the module asks for.
	Facts         = 12, // `Fact` records: the log facts that the module writes, sorted by fact key.
	Own_Hash      = 13, // One `Own_Hash_Place` record, at index 1: where a loader writes the hash of the module.
	Record_Outputs = 14, // `Record_Output` records: the record outputs that the module declares, sorted by name.
	Record_Inputs  = 15, // `Record_Input` records: the record inputs that the module declares, sorted by name.
	Enums          = 16, // `Enum_Type` records: the descriptions of the enums that the exports take and give.
	Members        = 17, // `Member` records: the members of those enums.
	Member_Texts   = 18, // `Member_Text` records: the display text of a member in a language, in the order of the enum, the member and the language.
}

The number of a table is its index in the table directory.

Kind
enum
Package
src/library/modus/contract/module
Size
4 bytes
Alignment
4 bytes
Base type
Source
src/library/modus/contract/module/format.odin:125
MemberValueHexadecimal
None00x0
Segments10x1
Imports20x2
Import_Slots30x3
Exports40x4
Rebases50x5
Functions60x6
Strings70x7
Documentation80x8
Records90x9
Fields100xA
Budget110xB
Facts120xC
Own_Hash130xD
Record_Outputs140xE
Record_Inputs150xF
Enums160x10
Members170x11
Member_Texts180x12

Table_Entry

Table_Entry :: struct {
	offset:      u64, // From the start of the file.
	count:       u32, // The records of the table, record 0 included; bytes for the string table.
	record_size: u32, // The bytes of one record in this file: at least the bytes that the reader needs, or the reader reads zeros. At least 1 when the table has records: `validate` refuses records of no byte.
}

A table can gain fields at the end of its record: record_size says how large a record is in this file. A reader ignores the bytes that it does not know, and reads the bytes that the file does not have as zero.

Kind
struct
Package
src/library/modus/contract/module
Size
16 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/format.odin:152
FieldTypeOffsetSize
offset08
count84
record_size124

16 bytes of fields and 0 bytes of padding: 16 bytes.

Segment_Flag

Segment_Flag :: enum u32 {
	Read                 = 0, // The module reads the bytes.
	Write                = 1, // The module writes the bytes: its data.
	Execute              = 2, // The bytes are instructions.
	Read_Only_After_Load = 3, // The loader writes it (rebases, import slots), then removes Write.
}

The access of a segment once loaded. A loader never maps a segment with Write and Execute: the kernel refuses such a mapping.

Kind
enum
Package
src/library/modus/contract/module
Size
4 bytes
Alignment
4 bytes
Base type
Named by
Source
src/library/modus/contract/module/format.odin:161
MemberValueHexadecimal
Read00x0
Write10x1
Execute20x2
Read_Only_After_Load30x3

Segment_Flags

Segment_Flags :: bit_set[;u32]

The flags of one Segment.

Kind
bit set
An alias of
bit_set[Segment_Flag; u32]
Package
src/library/modus/contract/module
Size
4 bytes
Alignment
4 bytes
Underlying type
Element
Named by
Source
src/library/modus/contract/module/format.odin:168
BitMemberMask
0Read0x1
1Write0x2
2Execute0x4
3Read_Only_After_Load0x8

Segment

Segment :: struct {
	file_offset:   u64, // Where the bytes start in the file: a multiple of PAGE_SIZE.
	file_size:     u64, // The bytes in the file: at most memory_size.
	memory_offset: u64, // From the base of the module in memory.
	memory_size:   u64, // The bytes of addresses of the segment.
	flags:         , // Its access.
	reserved:      u32, // 0.
}

One run of bytes of the module that a loader maps, with one access. memory_offset and memory_size are multiples of PAGE_SIZE. The bytes of memory after file_size are zero.

Example: the code of a module is a segment with flags = {.Read, .Execute}, memory_offset = 0; its data a segment with {.Read, .Write} after it.

Kind
struct
Package
src/library/modus/contract/module
Size
40 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/format.odin:177
FieldTypeOffsetSize
file_offset08
file_size88
memory_offset168
memory_size248
flags324
reserved364

40 bytes of fields and 0 bytes of padding: 40 bytes.

Import

Import :: struct {
	hash: [HASH_SIZE]u8, // The BLAKE3 hash of the whole file of the module.
}

One imported module, named by the BLAKE3 hash of its file.

A loader finds the file in its load source by this hash, and refuses a file whose hash is another (Load_Stage.Read). A replacement can change the hash that an import names before the load (Replacement).

Kind
struct
Package
src/library/modus/contract/module
Size
32 bytes
Alignment
1 byte
Padding
0 bytes
Source
src/library/modus/contract/module/format.odin:192
FieldTypeOffsetSize
hash[32]u8032

32 bytes of fields and 0 bytes of padding: 32 bytes.

Import_Slot

Import_Slot :: struct {
	memory_offset: u64, // The place of the 8 bytes, from the base of the module.
	import_index:  u32, // An index in the import table, from 1.
	export_index:  u32, // An index in the export table of that module, from 1.
}

One import slot: 8 bytes of memory that receive the address of an export.

The loader writes there the address of the export export_index of the module import_index, then maps the segment without Write when it is Read_Only_After_Load.

Kind
struct
Package
src/library/modus/contract/module
Size
16 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/format.odin:201
FieldTypeOffsetSize
memory_offset08
import_index84
export_index124

16 bytes of fields and 0 bytes of padding: 16 bytes.

Export

Export :: struct {
	code_offset: u64, // The memory offset of the first instruction.
	function:    u32, // An index in the function table.
	reserved:    u32, // 0.
}

One export: a procedure of the module that another module or the loader calls. Its index is its number in the module: an import slot and an error record name it by that index. See export.

Kind
struct
Package
src/library/modus/contract/module
Size
16 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/format.odin:211
FieldTypeOffsetSize
code_offset08
function84
reserved124

16 bytes of fields and 0 bytes of padding: 16 bytes.

Type

Type :: enum u8 {
	None    = 0, // No parameter, or no result: an export with the result None gives nothing.
	Integer = 1, // A signed integer of 64 bits, in a register.
	Text    = 2, // The address of a slice record {address, count} of UTF-8 bytes.
	// A Text result: the caller gives one more argument after the parameters,
	// the address of a buffer record {address, capacity}. The callee writes
	// the text in the buffer, and its integer result is the count of bytes of
	// the full text. A count larger than the capacity means "the text did
	// not fit": the caller owns all memory, and the callee allocates no
	// larger buffer.
	Record  = 3, // The address of a record: bytes with a fixed size and described fields (Record).
	// A record holds values only, and no address: its bytes mean the same
	// in each process. The detail of the parameter is the index of the
	// description of the record, in the record table.
	// A Record result: the caller gives one more argument after the
	// parameters, the address of the memory of the record. The callee
	// writes the record there. The export has no integer result.
	Handle  = 4, // A handle that the caller lends for the time of the call, in a register.
	// The detail of the parameter is the rights that the callee needs: a
	// bit set of rights (the kernel operations name the bits). The caller
	// keeps its handle. In an isolated call, the receiver has a copy of the
	// handle with these rights only, and closes it when the export returns.
	Table   = 5, // Records of one description that follow each other (a table).
	// The detail is the index of the description of the record, in the
	// record table. A record of a table has no Handle field.
	// A Table parameter: the address of a Table_Place in memory of the
	// caller, with a Direction (Function.parameter_directions).
	// A Table result: the caller gives one more argument after the
	// parameters, the address of a buffer record {address, capacity}: the
	// capacity is a count of records. The callee writes the records that
	// fit, and its integer result is the count of records of the full
	// table. A count larger than the capacity means "the table did not
	// fit". It is the case of an Append table from a count of 0 whose new
	// count is the integer result.
	Bytes   = 6, // Bytes with no description. A parameter: with a Direction.
	// The address of a Table_Place in memory of the caller, where the
	// count and the capacity are in bytes. The detail is 0.
	// A field of a record: detail bytes in the record, of the field kind
	// Hash only (Field.kind): a reader has no form for other bytes.
	Enum    = 7, // One member of a closed set, as its value, in a register (enums.odin).
	// A parameter: the detail names the description of the enum in the
	// table Enums and the export that gives the value in use
	// (enum_detail_of). An optional parameter that a call leaves out gets
	// the absent word (enum_absent_word). A result: the detail is the
	// index of the description of the enum, and the callee gives the value
	// in the low bytes of its integer result. A field of a record is never
	// an Enum.
}

The type of a parameter or of a result of an export, in the call form .

The site shows each member as a wire form. A description that names a type outside this list is refused by isolated.record_size.

See: Module contract: The call form

Kind
enum
Package
src/library/modus/contract/module
Size
1 byte
Alignment
1 byte
Base type
Source
src/library/modus/contract/module/format.odin:223
MemberValueHexadecimal
None00x0
Integer10x1
Text20x2
Record30x3
Handle40x4
Table50x5
Bytes60x6
Enum70x7

Direction

Direction :: enum u8 {
	Read   = 0, // It reads the records 0 ..< count, and writes nothing.
	Change = 1, // It reads and writes the records 0 ..< count. The count stays.
	// It writes the records count ..< capacity and reads none before count.
	// The count is the count of the full answer, across calls: the callee
	// adds the records of its answer, also those that did not fit. A count
	// larger than the capacity means "the answer did not fit"; on entry it
	// means that earlier calls did not fit, and the callee then writes
	// nothing. It never writes a record at an index >= capacity.
	Append = 2,
}

What the callee does with the memory of a Table or Bytes parameter . 0 is the direction with the least power.

See: Module contract: Tables and bytes as parameters

Kind
enum
Package
src/library/modus/contract/module
Size
1 byte
Alignment
1 byte
Base type
Source
src/library/modus/contract/module/format.odin:305
MemberValueHexadecimal
Read00x0
Change10x1
Append20x2

Table_Place

Table_Place :: struct {
	address:  u64, // The first record.
	count:    u64, // The records of the table: see `Direction` for who changes it.
	capacity: u64, // The records that fit at `address`.
}

The table place: the record that names the memory of a Table or Bytes parameter in a direct call. The register of the parameter has its address. address is aligned on the alignment of the record. count and capacity are in records (in bytes for Bytes).

Kind
struct
Package
src/library/modus/contract/module
Size
24 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/format.odin:338
FieldTypeOffsetSize
address08
count88
capacity168

24 bytes of fields and 0 bytes of padding: 24 bytes.

Function

Function :: struct {
	name_offset:           u32, // In the string table.
	name_count:            u32, // The bytes of the name.
	about_offset:          u32, // One line of help, in the string table.
	about_count:           u32, // The bytes of the line of help.
	parameter_names:       [PARAMETER_CAPACITY]u32, // The name of each parameter, in the string table.
	parameter_count:       u8, // At most PARAMETER_CAPACITY, and call_argument_count at most PARAMETER_CAPACITY.
	result:                u8, // The type of the result, the byte of a Type (function_result_type): None, Integer, Text, Record or Table.
	parameters:            [PARAMETER_CAPACITY]u8, // The type of each parameter, the byte of a Type (function_parameter_type), in the order of the arguments.
	parameter_name_counts: [PARAMETER_CAPACITY]u8, // The bytes of the name of each parameter.
	// The direction of each Table or Bytes parameter, the byte of a
	// Direction (function_parameter_direction), 0 (Read) for each other
	// parameter.
	parameter_directions:  [PARAMETER_CAPACITY]u8,
	// Bit n: a call may leave out the parameter n, an Enum. The other
	// bits are 0 (function_enums_check).
	optional_parameters:   u16,
	text_offset:           u32, // The documentation text of the export, in the string table.
	text_count:            u32, // The bytes of the documentation text.
	// What the type of each parameter needs: Type says what it is. An
	// Integer: what it counts, 0 for a plain number
	// (value_kinds.integer_unit_detail).
	parameter_details:     [PARAMETER_CAPACITY]u32,
	result_detail:         u32, // A Record or Table result: the index of the description of the record. An Enum result: the index of the description of the enum.
	// Not 0: the export gives an error record (src/library/modus/contract/errors), and this is
	// the index of its description in the record table. The caller gives one
	// more argument after all the others, after the buffer of a result too:
	// the address of the record. The export writes it when it fails, and only
	// then: it fails when its integer result is negative.
	error_record:          u32,
}

The description of one export. It is sufficient to call the export: the console reads it. The loader does not.

Kind
struct
Package
src/library/modus/contract/module
Size
168 bytes
Alignment
4 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/format.odin:354
FieldTypeOffsetSize
name_offset04
name_count44
about_offset84
about_count124
parameter_names[12]u321648
parameter_count641
result651
parameters[12]u86612
parameter_name_counts[12]u87812
parameter_directions[12]u89012
optional_parameters1022
text_offset1044
text_count1084
parameter_details[12]u3211248
result_detail1604
error_record1644

168 bytes of fields and 0 bytes of padding: 168 bytes.

Record

Record :: struct {
	name_offset: u32, // In the string table.
	name_count:  u32, // The bytes of the name.
	size:        u32, // In bytes: at most RECORD_SIZE_LIMIT.
	first_field: u32, // An index in the field table. The fields of a record follow each other.
	field_count: u32, // The fields of the record.
	reserved:    u32, // 0.
}

The description of a record: a parameter or a result of the type Record. Record 0 of the record table is the empty record.

Example: the description of is the record "Error_Record" of 56 bytes, with seven Integer fields of 8 bytes.

Kind
struct
Package
src/library/modus/contract/module
Size
24 bytes
Alignment
4 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/format.odin:410
FieldTypeOffsetSize
name_offset04
name_count44
size84
first_field124
field_count164
reserved204

24 bytes of fields and 0 bytes of padding: 24 bytes.

Field

Field :: struct {
	name_offset:   u32, // In the string table.
	name_count:    u32, // The bytes of the name.
	offset:        u32, // From the start of the record, in bytes.
	type:          u8, // The byte of a Type (field_type): Integer, Handle, Text or Bytes.
	unsigned:      bool, // An Integer: true for an unsigned integer, false for a signed one.
	integer_unit:  value_kinds.Integer_Unit, // An Integer: what it counts, {} for a plain number. {} for a Handle, a Text and Bytes, and beside a field kind.
	detail:        u32, // An Integer: its size in bytes, 0 for 8. A Handle: the rights that the callee needs. A Text or Bytes: its size in bytes.
	kind:          u8, // The byte of a value_kinds.Field_Kind (field_kind): how a reader writes the value. 0 is Plain.
	contract_enum: u8, // A Status: the byte of a value_kinds.Contract_Enum (field_contract_enum). 0 (None) for each other field.
	reserved:      [2]u8, // 0.
}

One field of a record. A field is an Integer (1, 2, 4 or 8 bytes), a Handle (4 bytes), a Text (detail bytes) or Bytes (detail bytes, a hash). An Integer is little-endian, at an offset that is a multiple of its size. A Text field holds its bytes in the record: UTF-8, and zero bytes after the text; the text ends at the first zero byte or at the end of the field. It holds no address, so a record still means the same in each process. The fields are in the order of their offsets, and no two fields share a byte.

An Integer field can state what it counts, as an Integer parameter does: a size or a time, in one unit. A reader shows the value in the color of that kind, with its unit.

A field can state its field kind: how a reader writes its value . field_kind_valid says which kind each type takes.

Example: the field time of the record Process of the monitor is an Integer of 8 bytes with the integer unit {.Time, Milliseconds}; a field level: operation. is an unsigned Integer of 1 byte with the kind Status and the contract enum Log_Level.

See: Module contract: The unit of an Integer field, Module contract: The kind of a field

Kind
struct
Package
src/library/modus/contract/module
Size
24 bytes
Alignment
4 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/format.odin:442
FieldTypeOffsetSize
name_offset04
name_count44
offset84
type121
unsigned131
integer_unitInteger_Unit142
detail164
kind201
contract_enum211
reserved[2]u8222

24 bytes of fields and 0 bytes of padding: 24 bytes.

Documentation

Documentation :: struct {
	about_offset: u32, // One line, in the string table: what the module is.
	about_count:  u32, // The bytes of the line.
	text_offset:  u32, // The documentation text, in the string table.
	text_count:   u32, // The bytes of the text.
}

The documentation of the module, for a reader. Record 1 of the documentation table is the documentation of the module. No loader reads it.

The line that says what the module is, and the line of help of an export, are plain text: the first sentence of the comment, with no mark.

A documentation text is UTF-8 bytes: the comment of the source, as its author wrote it, in a small part of Markdown. Lines that follow each other are one paragraph: the reader breaks it at the width that it has. An empty line separates two blocks. A line that starts with "- " or with a number and a period is a list item. A line that starts with a space, outside a list, and a line between two fences of three backticks, are kept as they are. A reader in the system reads it with src/library/internal/manual/source_comment_markdown.

See: Developer tools: The form of a documented comment

Kind
struct
Package
src/library/modus/contract/module
Size
16 bytes
Alignment
4 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/format.odin:484
FieldTypeOffsetSize
about_offset04
about_count44
text_offset84
text_count124

16 bytes of fields and 0 bytes of padding: 16 bytes.

Budget_Request

Budget_Request :: struct {
	pages:    u64, // Pages of memory: its modules, its stacks, its pictures and its working memory.
	processes: u64, // Process slots: the process itself, and each child that runs at one time.
	threads:  u64, // Thread slots: each thread that runs at one time, the first one included, and the threads of its children.
}

The budget that a module asks for: record 1 of the table Budget . It is a request, never a grant: the starter of the process accepts it, limits it or widens it. A part that is 0 asks for the least budget of that part, and a file with no table Budget asks for the least budget. No loader reads it. The build writes it: the parts that the source states (system.Stated_Budget) and the pages that the tool counts, of the modules, the threads and the pictures of the window.

The record can gain fields at its end: a reader reads a part that a shorter record does not have as 0, the least.

Example: {pages = 4096, processes = 1, threads = 2} asks for 16 MiB, the process itself and no child, and two threads.

See: Module contract: The budget that a module asks for

Kind
struct
Package
src/library/modus/contract/module
Size
24 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/format.odin:506
FieldTypeOffsetSize
pages08
processes88
threads168

24 bytes of fields and 0 bytes of padding: 24 bytes.

Fact

Fact :: struct {
	key:             u64, // The fact key: the typeid of the record type, SipHash-2-4 of "<package>::<type>". Never 0.
	record:          u32, // The index of the description of the record type in the table Records, from 1.
	template_offset: u32, // The fact template, in the string table.
	template_count:  u32, // Its bytes: 1 to FACT_TEMPLATE_BYTES_MOST.
	package_offset:  u32, // The name of the package that declares the record type, in the string table.
	package_count:   u32, // Its bytes: at least 1.
	reserved:        u32, // 0.
}

One row of the table Facts: one fact type that the module writes. The rows are sorted by key, and no two rows have one key.

Example: the fact type storage.Bad_Block is the key 18017458693634389201, the record "Bad_Block", the template "storage: the block {block} has a wrong check {check}, expected {expected}" and the package name "storage".

Kind
struct
Package
src/library/modus/contract/module
Size
32 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/facts.odin:24
FieldTypeOffsetSize
key08
record84
template_offset124
template_count164
package_offset204
package_count244
reserved284

32 bytes of fields and 0 bytes of padding: 32 bytes.

Own_Hash_Place

Own_Hash_Place :: struct {
	memory_offset: u64, // From the base of the module: HASH_SIZE bytes inside one segment with Write and no Execute.
}

Record 1 of the table Own_Hash: the place of HASH_SIZE bytes in the writable data of the module where each loader writes the hash of the module file. A file with no such record has no place: it writes no fact.

Kind
struct
Package
src/library/modus/contract/module
Size
8 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/facts.odin:48
FieldTypeOffsetSize
memory_offset08

8 bytes of fields and 0 bytes of padding: 8 bytes.

Fact_Template_Fault

Fact_Template_Fault :: enum u8 {
	None               = 0, // The template keeps each rule.
	Too_Long           = 1, // It has more than FACT_TEMPLATE_BYTES_MOST bytes.
	Not_Text           = 2, // It is not UTF-8 with no control character.
	Unclosed_Brace     = 3, // A "{" has no "}" after it.
	Lone_Closing_Brace = 4, // A "}" is not "}}" and closes no "{".
	Not_A_Field_Name   = 5, // The text in braces is not a name of a field: a letter or "_", then letters, digits and "_". A format, a width or an expression is not one.
	Unknown_Field      = 6, // The name in braces names no field of the record.
	Field_Twice        = 7, // The template names one field two times.
	Field_Not_Named    = 8, // A field of the record has no name in braces.
	Too_Many_Fields    = 9, // The record has more than FACT_FIELD_CAPACITY fields.
}

Why a fact template breaks the rules of its language .

See: Log facts: typed records in place of formatted lines: The fact template in the repository

Kind
enum
Package
src/library/modus/contract/module
Size
1 byte
Alignment
1 byte
Base type
Source
src/library/modus/contract/module/facts.odin:171
MemberValueHexadecimal
None00x0
Too_Long10x1
Not_Text20x2
Unclosed_Brace30x3
Lone_Closing_Brace40x4
Not_A_Field_Name50x5
Unknown_Field60x6
Field_Twice70x7
Field_Not_Named80x8
Too_Many_Fields90x9

Record_Output_Pairing

Record_Output_Pairing :: enum u8 {
	Unpaired = 0, // One type for the record output: its own record, or the one type of the generic record input.
	Paired   = 1, // One ring for each wiring of the generic record input, of the type of that wiring: the record output `forward` of the collector.
}

Whether a generic record output has one ring for each wiring of the generic record input of its module, of the type of that wiring. A record output that is not generic is always Unpaired.

Kind
enum
Package
src/library/modus/contract/module
Size
1 byte
Alignment
1 byte
Base type
Source
src/library/modus/contract/module/record_streams.odin:29
MemberValueHexadecimal
Unpaired00x0
Paired10x1

Wiring_Count

Wiring_Count :: enum u8 {
	One        = 0, // One wiring at a time.
	Many       = 1, // Several wirings of one type. For a generic record input, the first wiring fixes it.
	Many_Types = 2, // Several wirings, each of its own type: a generic record input only.
}

How many wirings a record input takes, and of which types.

Kind
enum
Package
src/library/modus/contract/module
Size
1 byte
Alignment
1 byte
Base type
Source
src/library/modus/contract/module/record_streams.odin:35
MemberValueHexadecimal
One00x0
Many10x1
Many_Types20x2

Record_Output

Record_Output :: struct {
	name_offset:  u32, // The name of the package variable, in the string table.
	name_count:   u32, // Its bytes: at least 1.
	about_offset: u32, // One line of help, in the string table.
	about_count:  u32, // Its bytes.
	text_offset:  u32, // The documentation text: the comment of the declaration, in its Markdown.
	text_count:   u32, // Its bytes.
	record:       u32, // The index of the description of its record in the table Records; 0: a generic record output.
	pairing:      u8, // The byte of a Record_Output_Pairing (record_output_pairing_of_word).
	reserved:     [3]u8, // 0.
	place:        u64, // The memory offset of its package variable, where each loader writes the index of the row (record_stream_indexes_write); 0: the link kept no variable, as no code uses it.
}

One row of the table Record_Outputs: one record output that the module declares. The rows are sorted by name, and no two rows have one name.

Example: requests: system.Record_Output(Access_Record) is the row with the name "requests", the line of help of its comment, and the index of the record "Access_Record" in the table Records.

Kind
struct
Package
src/library/modus/contract/module
Size
40 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/record_streams.odin:47
FieldTypeOffsetSize
name_offset04
name_count44
about_offset84
about_count124
text_offset164
text_count204
record244
pairing281
reserved[3]u8293
place328

40 bytes of fields and 0 bytes of padding: 40 bytes.

Record_Input

Record_Input :: struct {
	name_offset:  u32, // The name of the package variable, in the string table.
	name_count:   u32, // Its bytes: at least 1.
	about_offset: u32, // One line of help, in the string table.
	about_count:  u32, // Its bytes.
	text_offset:  u32, // The documentation text: the comment of the declaration, in its Markdown.
	text_count:   u32, // Its bytes.
	record:       u32, // The index of the description of its record in the table Records; 0: a generic record input.
	terms:        u32, // The index of the description of its wiring terms in the table Records; 0: it takes no terms.
	wirings:      u8, // The byte of a Wiring_Count (wiring_count_of_word).
	reserved:     [7]u8, // 0.
	place:        u64, // The memory offset of its package variable, as for a record output; 0: none.
}

One row of the table Record_Inputs: one record input that the module declares. The rows are sorted by name, no two rows have one name, and no row has the name of a record output.

Example: sources: system.Record_Input_With_Terms(system.Any_Record, Space_Terms, .Many_Types) is the row with the name "sources", the record 0, the terms the index of "Space_Terms", and the count Many_Types.

Kind
struct
Package
src/library/modus/contract/module
Size
48 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/record_streams.odin:68
FieldTypeOffsetSize
name_offset04
name_count44
about_offset84
about_count124
text_offset164
text_count204
record244
terms284
wirings321
reserved[7]u8337
place408

48 bytes of fields and 0 bytes of padding: 48 bytes.

Record_Stream_Fault

Record_Stream_Fault :: enum u8 {
	None                  = 0, // The tables keep each rule.
	Too_Many_Outputs      = 1, // The table Record_Outputs has more than RECORD_STREAM_INDEX_MOST rows.
	Too_Many_Inputs       = 2, // The table Record_Inputs has more than RECORD_STREAM_INDEX_MOST rows.
	Bad_Output            = 3, // record_output refuses a row.
	Bad_Input             = 4, // record_input refuses a row.
	Outputs_Out_Of_Order  = 5, // A name of a record output is not after the name of the row before: the rows are not sorted, or two have one name.
	Inputs_Out_Of_Order   = 6, // The same for a record input.
	Name_Of_Both          = 7, // A record output and a record input have one name: `server.name` would name two streams.
	Generic_Output_Alone  = 8, // A generic record output in a module with no generic record input, or with two: it takes its type from the one generic record input.
}

Why the tables Record_Outputs and Record_Inputs of a file break a rule (record_streams_check).

Kind
enum
Package
src/library/modus/contract/module
Size
1 byte
Alignment
1 byte
Base type
Source
src/library/modus/contract/module/record_streams.odin:395
MemberValueHexadecimal
None00x0
Too_Many_Outputs10x1
Too_Many_Inputs20x2
Bad_Output30x3
Bad_Input40x4
Outputs_Out_Of_Order50x5
Inputs_Out_Of_Order60x6
Name_Of_Both70x7
Generic_Output_Alone80x8

Enum_Type

Enum_Type :: struct {
	name_offset:  u32, // In the string table: the name of the type in its source.
	name_count:   u32, // The bytes of the name.
	first_member: u32, // An index in the member table. The members of an enum follow each other.
	member_count: u32, // From 1 to ENUM_MEMBER_CAPACITY.
	size:         u8, // The bytes of a value: 1, 2, 4 or 8, the backing type of the source.
	unsigned:     bool, // The backing type has no sign.
	reserved:     [6]u8, // 0.
}

The description of one enum.

Example: settings.Keyboard_Layout is the enum "Keyboard_Layout" of 4 unsigned bytes, with the members united_states = 0 and french = 1.

Kind
struct
Package
src/library/modus/contract/module
Size
24 bytes
Alignment
4 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/enums.odin:25
FieldTypeOffsetSize
name_offset04
name_count44
first_member84
member_count124
size161
unsigned171
reserved[6]u8186

24 bytes of fields and 0 bytes of padding: 24 bytes.

Member

Member :: struct {
	name_offset: u32, // In the string table.
	name_count:  u32, // From 1 to ENUM_MEMBER_NAME_CAPACITY bytes: a lower case letter, then lower case letters, digits and "_".
	value:       i64, // Fits the size and the sign of its enum. An unsigned value of 8 bytes is its bits.
}

One member of an enum: its name, as a line names it after a ".", and its value, the word that a call carries.

Kind
struct
Package
src/library/modus/contract/module
Size
16 bytes
Alignment
8 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/enums.odin:38
FieldTypeOffsetSize
name_offset04
name_count44
value88

16 bytes of fields and 0 bytes of padding: 16 bytes.

Enum_Problem

Enum_Problem :: enum u8 {
	None             = 0, // The enums of the function keep each rule.
	No_Enum          = 1, // The detail names no enum of the table Enums, or an enum result has bits of a getter.
	Bad_Size         = 2, // The size is not 1, 2, 4 or 8, or a reserved byte is not 0.
	Bad_Member_Count = 3, // No member, more than ENUM_MEMBER_CAPACITY, or members outside the table Members.
	Bad_Member_Name  = 4, // A name that is empty, too long, not a name of Lex in lower case, outside the string table, or given twice.
	Bad_Member_Value = 5, // A value that the size and the sign do not hold, the absent word, or a value given twice.
	No_Getter        = 6, // The getter names no export of the module.
	Bad_Getter       = 7, // The getter takes a parameter, gives an error record, or gives no Enum.
	Getter_Type      = 8, // The getter gives another enum than its parameter takes.
	Bad_Optional     = 9, // An optional bit on a parameter that is no Enum, or past the parameters.
}

What enum_type and function_enums_check refuse.

Kind
enum
Package
src/library/modus/contract/module
Size
1 byte
Alignment
1 byte
Base type
Source
src/library/modus/contract/module/enums.odin:50
MemberValueHexadecimal
None00x0
No_Enum10x1
Bad_Size20x2
Bad_Member_Count30x3
Bad_Member_Name40x4
Bad_Member_Value50x5
No_Getter60x6
Bad_Getter70x7
Getter_Type80x8
Bad_Optional90x9

Member_Text

Member_Text :: struct {
	enum_index:    u32, // An index in the table Enums, from 1.
	member_number: u32, // The member in its enum, from 0.
	text_offset:   u32, // In the string table.
	text_count:    u32, // From 1 to MEMBER_TEXT_CAPACITY bytes of a display text (text_encoding.display_text_valid).
	tag_offset:    u32, // In the string table.
	tag_count:     u32, // From 1 to language_tag.TAG_CAPACITY bytes of a well-formed language tag in its canonical case (language_tag.canonical_check).
}

One display text: a member of an enum in a language.

Example: the scale .fourteen_eighths of the module settings has the text "1.75" for the tag en.

Kind
struct
Package
src/library/modus/contract/module
Size
24 bytes
Alignment
4 bytes
Padding
0 bytes
Source
src/library/modus/contract/module/member_texts.odin:23
FieldTypeOffsetSize
enum_index04
member_number44
text_offset84
text_count124
tag_offset164
tag_count204

24 bytes of fields and 0 bytes of padding: 24 bytes.

Member_Text_Problem

Member_Text_Problem :: enum u8 {
	None         = 0, // The row keeps each rule.
	No_Enum      = 1, // The enum index names no valid enum of the table Enums.
	No_Member    = 2, // The member number is past the members of its enum.
	Bad_Text     = 3, // The text is empty, past MEMBER_TEXT_CAPACITY, outside the string table, or no display text: not UTF-8 with no control character, a hidden character, or spaces only (text_encoding.display_text_valid).
	Bad_Tag      = 4, // The tag is outside the string table, not well-formed, or not in its canonical case (language_tag.canonical_check).
	Twice        = 5, // The row has the enum, the member and the tag of the row before it.
	Out_Of_Order = 6, // The row comes before the row before it, in the order of the enum, the member and the bytes of the tag.
}

What member_texts_check refuses in a row.

Kind
enum
Package
src/library/modus/contract/module
Size
1 byte
Alignment
1 byte
Base type
Source
src/library/modus/contract/module/member_texts.odin:34
MemberValueHexadecimal
None00x0
No_Enum10x1
No_Member20x2
Bad_Text30x3
Bad_Tag40x4
Twice50x5
Out_Of_Order60x6

Fact_Render_Refusal

Fact_Render_Refusal :: enum u8 {
	None         = 0, // The sentence is written.
	No_Fact_Type = 1, // The file has no valid row of the table Facts with the key.
	Value_Count  = 2, // The count of the value bytes is not the size of the record of the fact type.
	Template     = 3, // The fact template breaks a rule of its language (fact_template_valid).
	Too_Long     = 4, // The sentence does not fit in the buffer of the reader.
	Text_View    = 5, // A text view of the fact is not one that value_kinds.text_view_read takes: a byte past a short text, or a long text past the out-of-line area.
}

Why a reader writes the raw form of a fact in place of its sentence .

See: Log facts: typed records in place of formatted lines: The reader path in the repository

Kind
enum
Package
src/library/modus/contract/module
Size
1 byte
Alignment
1 byte
Base type
Source
src/library/modus/contract/module/facts.odin:314
MemberValueHexadecimal
None00x0
No_Fact_Type10x1
Value_Count20x2
Template30x3
Too_Long40x4
Text_View50x5

Error

Error :: enum u32 {
	None            = 0, // The file is valid for this check.
	Too_Small       = 1, // The file is shorter than a `Header`.
	Bad_Magic       = 2, // The file does not start with `MAGIC`: it is not a module.
	Unknown_Version = 3, // The version is not `VERSION`.
	Unknown_Feature = 4, // `must_understand` has a bit outside `UNDERSTOOD_FEATURES`.
	Unknown_Machine = 5, // The machine is not `X86_64`.
	Bad_Table       = 6, // A table is not inside the file, has records of no byte, or is the rebase table with records that are not words of 8 bytes.
	// A segment is not on pages, is outside `memory_size`, has more bytes in the file than in memory, is not
	// inside the file, or is executable and written by the loader.
	Bad_Segment     = 7,
	Bad_Rebase      = 8, // A location of the rebase table is not in a segment that the loader can write.
	Bad_Import_Slot        = 9, // No check gives it today: `bind` reports an import slot that is not valid at the stage Bind.
	Bad_Import      = 10, // No check gives it today.
	Bad_Export      = 11, // `entry_export` is not an index of the export table.
	Bad_Own_Hash_Place = 12, // The own-hash place is not `HASH_SIZE` bytes inside one segment that the loader can write.
	Bad_Record_Stream_Place = 13, // The place of a record output or a record input is not 0, nor `RECORD_STREAM_PLACE_SIZE` aligned bytes inside one segment that the loader can write and that is not `Read_Only_After_Load`; or it meets the own-hash place, a rebase location, an import slot or the place of another row.
	Too_Many_Record_Streams = 14, // The table `Record_Outputs` or `Record_Inputs` has more than `RECORD_STREAM_INDEX_MOST` rows after the entry 0.
	Unknown_Category = 15, // The category of the header names no member of `Module_Category`, a tag bit names no member of `Module_Tag`, or the reserved byte is not 0.
}

What is not valid in a module file: the result of header, validate and rebase, and Load_Error.file_error at the stage Read. A loader maps no byte of a file that gives another value than None.

Kind
enum
Package
src/library/modus/contract/module
Size
4 bytes
Alignment
4 bytes
Base type
Source
src/library/modus/contract/module/load.odin:9
MemberValueHexadecimal
None00x0
Too_Small10x1
Bad_Magic20x2
Unknown_Version30x3
Unknown_Feature40x4
Unknown_Machine50x5
Bad_Table60x6
Bad_Segment70x7
Bad_Rebase80x8
Bad_Import_Slot90x9
Bad_Import100xA
Bad_Export110xB
Bad_Own_Hash_Place120xC
Bad_Record_Stream_Place130xD
Too_Many_Record_Streams140xE
Unknown_Category150xF

Bound_Import

Bound_Import :: struct {
	file:  []u8, // The file of the module that is loaded for the import.
	base:  uintptr, // Its address in the process that runs it.
	named: []u8, // nil: `file` is the module that the import names.
}

An import as a loader resolved it: the module that is loaded for it, and where. When a replacement applies, named is the file of the module that the import names: an import slot names an export by its index in that file.

Kind
struct
Package
src/library/modus/contract/module
Size
40 bytes
Alignment
8 bytes
Padding
0 bytes
On the target
[]u8 has the size of an address of the target: the sizes here are those of linux amd64, where the page was made
Source
src/library/modus/contract/module/load.odin:299
FieldTypeOffsetSize
file016
base168
named2416

40 bytes of fields and 0 bytes of padding: 40 bytes.

Replacement

Replacement :: struct {
	from: [HASH_SIZE]u8, // The hash that an import names.
	to:   [HASH_SIZE]u8, // The hash of the module that the loader loads in its place.
}

A replacement: where a module imports the module from, the loader loads the module to.

The party that starts a process gives the replacements; the loader checks that each export that an import slot uses has the same description in to (functions_compare). 64 bytes. See replacement.

See: Module contract: Replacement of an import

Kind
struct
Package
src/library/modus/contract/module
Size
64 bytes
Alignment
1 byte
Padding
0 bytes
Source
src/library/modus/contract/module/load.odin:311
FieldTypeOffsetSize
from[32]u8032
to[32]u83232

64 bytes of fields and 0 bytes of padding: 64 bytes.

The package start_grant

Grant

Grant :: enum i64 {
	Root_Ring          = 0, // Start and stop processes.
	Inspect            = 1, // The machine, with the right Inspect.
	Stop               = 2, // The machine, with the right Stop.
	Image              = 3, // Read the boot image.
	Log_Records        = 4, // Read the records of the log.
	Serve              = 5, // A service: other processes call its exports through connections.
	Terminal           = 6, // The process has no surface: it writes records to a terminal, and reads keys from it.
	Store              = 7, // A private store in the storage service: a connection to it names the process, with a limit of blocks.
	Acts_For_Principal = 8, // The process acts for the principal of its session: a service shows it what it holds for all callers.
	Data_Disk          = 9, // A block service of the data disk, with the right Read, and its block ring.
	Scratch_Disk       = 10, // A block service of the disk of the measures, with the right Read, and its block ring.
	Replacements       = 11, // Read the replacement table of the machine.
	Replace            = 12, // Change the replacement table of the machine (Root_Command.Replace).
	Network            = 13, // An endpoint in the network service, with the grant of endpoint_of: datagrams, or segments of TCP.
	Network_Device     = 14, // The frame service of the network device, with the right Read, and its frame ring, and a control ring from the root service.
	Connect            = 15, // A ring to the root service that serves Connect and Disconnect only, to the services of its start grant set (start_grant_sets in src/modules/system/root/start_grant_sets.odin).
	Schedule           = 16, // The machine, with the right Schedule: change the scheduling strategy of the machine.
	Settings           = 17, // The settings page with Write (modus:contract/settings): the one writer of the settings of the machine.
	Clock              = 18, // The date page with Write and the two ports of the real-time clock (modus:contract/date): the one writer of the date.
	History_Store      = 19, // A store of its own in the storage service for the line history of the process, apart from its private store (Root_Command.Connect_History).
	Events             = 20, // The machine, with the right Events: give the event table of the machine (kernel events of every process).
	Principals         = 21, // A ring to the root service for Principal_Record, Principal_Unlock and Machine_Key only: the process that keeps the records of the named principals (docs/PRINCIPALS.md).
	Debug_Image        = 22, // The debug image, read-only: the names of the procedures and the source lines of a stop report (src/modules/system/root/debug_image.odin).
	Debugger           = 23, // A ring to the root service for Debug only: the service that debugs a process on behalf of a caller of its connections (Root_Command.Debug).
	Palette            = 24, // The palette provider of the desktop: the entry table with Write and the ring to the compositor (Root_Command.Palette_Provide).
	System_Part        = 25, // A part of the system that the root service starts by itself, with handles that no other grant names: the screen and the input ring (the compositor), a device (a device service), the text of another process (a terminal). No process asks for it and no caller holds it.
	Tpm                = 26, // The ring and the region of the TPM service (modus:contract/tpm_service): seal a key to the measure of the system, and unseal it. The process that keeps the machine key (docs/PRINCIPALS.md).
	Versions_Erase     = 27, // End the versions of an object of its private store, with zeros over their blocks (isolated.CALLER_ERASES_VERSIONS): the process that keeps a secret that an earlier version must not keep (docs/STORAGE.md, "4.8 The erase of versions").
	Counters           = 28, // The machine, with the right Counters: count the events of the processor for the code of its own threads (docs/ARCHITECTURE.md, "The counters of a thread").
	Remote_Clients     = 29, // The client table, read-only (modus:contract/remote, Client_Table), and a Connect for one of its rows that acts for the principal of that row: the process that takes calls from another machine (docs/PRINCIPALS.md, "The client keys of remote").
	Sound_Device       = 30, // The sound service of the sound device, with the right Read, and its stream ring (modus:contract/timed_stream): the one process that plays sound (docs/SOUND.md).
	Start_Policy       = 31, // A root ring for Start, Stop, Machine_Usable and Wire (the wiring rows of a start list only), and the machine parts page, read-only: the one process that starts the machine (src/md/features/start_policy.md). It has no window and nothing else.
	Screen_Capture     = 32, // The capture face and the input face of the compositor on the ring of its window: a copy of the screen, and keys and a pointer that go to the desktop, while the bar shows the mark of a viewer (src/md/features/remote_display.md).
	Plans              = 33, // A root ring for Plan_Roles only, and Connect to the services of its start grant set: the holder of the role Plans, which gives the core the roles of the plan of principal 0 that the principal accepted (src/md/features/declarations.md).
}

What a process receives, by name. A process that is not here receives a ring to the compositor and nothing else.

Kind
enum
Package
src/library/modus/contract/start_grant
Size
8 bytes
Alignment
8 bytes
Base type
Source
src/library/modus/contract/start_grant/start_grant.odin:34
MemberValueHexadecimal
Root_Ring00x0
Inspect10x1
Stop20x2
Image30x3
Log_Records40x4
Serve50x5
Terminal60x6
Store70x7
Acts_For_Principal80x8
Data_Disk90x9
Scratch_Disk100xA
Replacements110xB
Replace120xC
Network130xD
Network_Device140xE
Connect150xF
Schedule160x10
Settings170x11
Clock180x12
History_Store190x13
Events200x14
Principals210x15
Debug_Image220x16
Debugger230x17
Palette240x18
System_Part250x19
Tpm260x1A
Versions_Erase270x1B
Counters280x1C
Remote_Clients290x1D
Sound_Device300x1E
Start_Policy310x1F
Screen_Capture320x20
Plans330x21

The wire forms of the module contract

How a call between modules carries a parameter or a result: the members of Type of the package module. The text of each one is its comment in the contract.

Integer

A signed integer of 64 bits, in a register.

Kind
wire form
In a call
one word of the call form for a parameter, a register or a word of the stack: an export has at most 12 arguments (module.PARAMETER_CAPACITY)
The contract
Module contract: The call form
Named by
Source
src/library/modus/contract/module/format.odin:225

Text

The address of a slice record {address, count} of UTF-8 bytes. A Text result: the caller gives one more argument after the parameters, the address of a buffer record {address, capacity}. The callee writes the text in the buffer, and its integer result is the count of bytes of the full text. A count larger than the capacity means "the text did not fit": the caller owns all memory, and the callee allocates no larger buffer.

Kind
wire form
In a call
one word of the call form for a parameter, a register or a word of the stack: an export has at most 12 arguments (module.PARAMETER_CAPACITY)
The contract
Module contract: The call form
Named by
Source
src/library/modus/contract/module/format.odin:226

Record

The address of a record: bytes with a fixed size and described fields (Record). A record holds values only, and no address: its bytes mean the same in each process. The detail of the parameter is the index of the description of the record, in the record table. A Record result: the caller gives one more argument after the parameters, the address of the memory of the record. The callee writes the record there. The export has no integer result.

Kind
wire form
In a call
one word of the call form for a parameter, a register or a word of the stack: an export has at most 12 arguments (module.PARAMETER_CAPACITY)
Types that its text names
The contract
Module contract: The call form
Named by
Source
src/library/modus/contract/module/format.odin:233

Handle

A handle that the caller lends for the time of the call, in a register. The detail of the parameter is the rights that the callee needs: a bit set of rights (the kernel operations name the bits). The caller keeps its handle. In an isolated call, the receiver has a copy of the handle with these rights only, and closes it when the export returns.

Kind
wire form
In a call
one word of the call form for a parameter, a register or a word of the stack: an export has at most 12 arguments (module.PARAMETER_CAPACITY)
In a record
: 4 bytes
The contract
Module contract: The call form
Named by
Source
src/library/modus/contract/module/format.odin:240

Table

Records of one description that follow each other (a table). The detail is the index of the description of the record, in the record table. A record of a table has no Handle field. A Table parameter: the address of a Table_Place in memory of the caller, with a Direction (Function.parameter_directions). A Table result: the caller gives one more argument after the parameters, the address of a buffer record {address, capacity}: the capacity is a count of records. The callee writes the records that fit, and its integer result is the count of records of the full table. A count larger than the capacity means "the table did not fit". It is the case of an Append table from a count of 0 whose new count is the integer result.

Kind
wire form
In a call
one word of the call form for a parameter, a register or a word of the stack: an export has at most 12 arguments (module.PARAMETER_CAPACITY)
Types that its text names
The contract
Module contract: The call form
Named by
Source
src/library/modus/contract/module/format.odin:245

Bytes

Bytes with no description. A parameter: with a Direction. The address of a Table_Place in memory of the caller, where the count and the capacity are in bytes. The detail is 0. A field of a record: detail bytes in the record, of the field kind Hash only (Field.kind): a reader has no form for other bytes.

Kind
wire form
In a call
one word of the call form for a parameter, a register or a word of the stack: an export has at most 12 arguments (module.PARAMETER_CAPACITY)
Types that its text names
The contract
Module contract: The call form
Named by
Source
src/library/modus/contract/module/format.odin:257

Enum

One member of a closed set, as its value, in a register (enums.odin). A parameter: the detail names the description of the enum in the table Enums and the export that gives the value in use (enum_detail_of). An optional parameter that a call leaves out gets the absent word (enum_absent_word). A result: the detail is the index of the description of the enum, and the callee gives the value in the low bytes of its integer result. A field of a record is never an Enum.

Kind
wire form
In a call
one word of the call form for a parameter, a register or a word of the stack: an export has at most 12 arguments (module.PARAMETER_CAPACITY)
The contract
Module contract: The call form
Named by
Source
src/library/modus/contract/module/format.odin:262

The records of the modules

The records that the exports of each module take or give, as the build describes them in the module: the size and the offsets of the description, the size of each field from its wire form.

Error_Record

Kind
record of a module
Module
drawing
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Draw_Record

Kind
record of a module
Module
drawing
Size
48 bytes
Alignment
4 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind01
reserved13
element44
left84
top124
right164
bottom204
fields2424

48 bytes of fields and 0 bytes of padding: 48 bytes.

Damage_Rectangle

Kind
record of a module
Module
drawing
Size
32 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
left08
top88
right168
bottom248

32 bytes of fields and 0 bytes of padding: 32 bytes.

Canvas_Shape

Kind
record of a module
Module
drawing
Size
48 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
width08
height88
stride168
fill_background248
background328
scale408

48 bytes of fields and 0 bytes of padding: 48 bytes.

Venus_Target

Kind
record of a module
Module
drawing
Size
128 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
width08
height88
format168
start248
clear_color328
command_buffer408
queue488
fence568
pipeline_layout648
render_pass_base728
framebuffer_base808
buffer_base888
image_base968
pipeline_base1048
vertex_buffer_bytes1128
index_buffer_bytes1208

128 bytes of fields and 0 bytes of padding: 128 bytes.

Error_Record

Kind
record of a module
Module
compositor
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Pointer

Kind
record of a module
Module
compositor
Size
120 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
x08
y88
buttons168
moves248
keys328
keys_waiting408
keys_refused488
menu5616
palette728
shape8032
form1128

120 bytes of fields and 0 bytes of padding: 120 bytes.

Window

Kind
record of a module
Module
compositor
Size
168 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
title032
x328
y408
width488
height568
order648
focus728
keyboard808
presents888
waits968
events_sent1048
events_unread1128
events_waiting1208
keys_refused1288
frames1368
pictures_drawn_again1448
presents_refused1528
due1608

168 bytes of fields and 0 bytes of padding: 168 bytes.

Screen

Kind
record of a module
Module
compositor
Size
48 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
frames08
presents88
damage168
desktop248
page_flips328
frames_on_the_shown_page408

48 bytes of fields and 0 bytes of padding: 48 bytes.

Gpu_Info

Kind
record of a module
Module
compositor
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
present08
attached88
width168
height248
venus328
venus_max_version408
presents488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Window_Grant_Row

Kind
record of a module
Module
compositor
Size
136 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
grant08
window832
resource4096

136 bytes of fields and 0 bytes of padding: 136 bytes.

Assistive_Holder_Row

Kind
record of a module
Module
compositor
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
holder08
kind816
nickname2432

56 bytes of fields and 0 bytes of padding: 56 bytes.

Error_Record

Kind
record of a module
Module
monitor
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Process

Kind
record of a module
Module
monitor
Size
256 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
slot08
name832
state408
cause4840
outcome8824
resident1128
mapped1208
handles1288
handles_peak1368
mappings1448
mappings_peak1528
threads1608
time1688
entries1768
started1848
hash19264

256 bytes of fields and 0 bytes of padding: 256 bytes.

Count

Kind
record of a module
Module
monitor
Size
48 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
name024
value248
unit3216

48 bytes of fields and 0 bytes of padding: 48 bytes.

Count_Name

Kind
record of a module
Module
monitor
Size
24 bytes
Alignment
1 byte
Padding
0 bytes
Named by
FieldTypeOffsetSize
name024

24 bytes of fields and 0 bytes of padding: 24 bytes.

Served

Kind
record of a module
Module
monitor
Size
24 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
calls08
callers88
pictures168

24 bytes of fields and 0 bytes of padding: 24 bytes.

Error_Record

Kind
record of a module
Module
life
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Error_Record

Kind
record of a module
Module
paint
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Error_Record

Kind
record of a module
Module
heron
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Animation_Row

Kind
record of a module
Module
heron
Size
40 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
name016
frames168
duration248
moves328

40 bytes of fields and 0 bytes of padding: 40 bytes.

Error_Record

Kind
record of a module
Module
tally
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Module

Kind
record of a module
Module
manual
Size
224 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
name032
hash3264
file968
code1048
constants1128
data1208
zero1288
entry1368
exports1448
imports1528
records1608
problem16824
place19216
index2088
offset2168

224 bytes of fields and 0 bytes of padding: 224 bytes.

Error_Record

Kind
record of a module
Module
manual
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Export

Kind
record of a module
Module
manual
Size
240 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
module032
name3232
number648
parameters728
result808
rights8840
signature128112

240 bytes of fields and 0 bytes of padding: 240 bytes.

Import

Kind
record of a module
Module
manual
Size
176 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
module032
number328
hash4064
name10432
import_slots1368
replacement14432

176 bytes of fields and 0 bytes of padding: 176 bytes.

Import_Slot

Kind
record of a module
Module
manual
Size
120 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
module032
number328
import_index408
export_index488
target5632
name8832

120 bytes of fields and 0 bytes of padding: 120 bytes.

Segment

Kind
record of a module
Module
manual
Size
96 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
module032
number328
kind4024
memory_offset648
memory_size728
file_offset808
file_size888

96 bytes of fields and 0 bytes of padding: 96 bytes.

Running

Kind
record of a module
Module
manual
Size
224 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
process032
slot328
module4032
hash7264
replaces13664
base2008
size2088
writer2168

224 bytes of fields and 0 bytes of padding: 224 bytes.

Edge

Kind
record of a module
Module
manual
Size
200 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
process032
slot328
module4032
hash7264
imported_by13632
replaces16832

200 bytes of fields and 0 bytes of padding: 200 bytes.

Replacement

Kind
record of a module
Module
manual
Size
192 bytes
Alignment
1 byte
Padding
0 bytes
Named by
FieldTypeOffsetSize
from032
from_hash3264
to9632
to_hash12864

192 bytes of fields and 0 bytes of padding: 192 bytes.

Error_Record

Kind
record of a module
Module
debugger
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Attached

Kind
record of a module
Module
debugger
Size
64 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
process032
slot328
threads408
modules488
described568

64 bytes of fields and 0 bytes of padding: 64 bytes.

Detached

Kind
record of a module
Module
debugger
Size
48 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
process032
breakpoints328
threads408

48 bytes of fields and 0 bytes of padding: 48 bytes.

Thread_Row

Kind
record of a module
Module
debugger
Size
256 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
thread08
state812
instruction2020
module4032
procedure7280
offset1528
file16080
line2408
pending2488

256 bytes of fields and 0 bytes of padding: 256 bytes.

Register_Row

Kind
record of a module
Module
debugger
Size
156 bytes
Alignment
1 byte
Padding
0 bytes
Named by
FieldTypeOffsetSize
name08
value820
about28128

156 bytes of fields and 0 bytes of padding: 156 bytes.

Frame_Row

Kind
record of a module
Module
debugger
Size
256 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
frame08
module832
procedure4080
offset1208
file12880
line2088
frame_pointer21620
return_address23620

256 bytes of fields and 0 bytes of padding: 256 bytes.

Variable_Row

Kind
record of a module
Module
debugger
Size
232 bytes
Alignment
1 byte
Padding
0 bytes
Named by
FieldTypeOffsetSize
name048
role4812
type6048
value10896
location20428

232 bytes of fields and 0 bytes of padding: 232 bytes.

Value_Row

Kind
record of a module
Module
debugger
Size
212 bytes
Alignment
1 byte
Padding
0 bytes
Named by
FieldTypeOffsetSize
name048
type4848
value9696
address19220

212 bytes of fields and 0 bytes of padding: 212 bytes.

Source_Row

Kind
record of a module
Module
debugger
Size
240 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
line08
mark84
text1280
path9280
hash17268

240 bytes of fields and 0 bytes of padding: 240 bytes.

Break_Row

Kind
record of a module
Module
debugger
Size
208 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
number08
kind812
address2020
length408
place48160

208 bytes of fields and 0 bytes of padding: 208 bytes.

Memory_Row

Kind
record of a module
Module
debugger
Size
88 bytes
Alignment
1 byte
Padding
0 bytes
Named by
FieldTypeOffsetSize
address020
bytes2048
text6820

88 bytes of fields and 0 bytes of padding: 88 bytes.

Event_Row

Kind
record of a module
Module
debugger
Size
256 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
thread08
kind820
instruction2820
module4832
procedure8080
offset1608
file16880
line2488

256 bytes of fields and 0 bytes of padding: 256 bytes.

Record_Row

Kind
record of a module
Module
debugger
Size
152 bytes
Alignment
8 bytes
Padding
8 bytes
Named by
FieldTypeOffsetSize
state012
padding124
points168
bytes248
capacity328
end4020
padding604
checkpoints648
divergence728
differed8012
expected9220
actual11220
recorded_at13220

144 bytes of fields and 8 bytes of padding: 152 bytes.

Checkpoint_Row

Kind
record of a module
Module
debugger
Size
64 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
checkpoint08
point88
offset168
instruction2420
stack4420

64 bytes of fields and 0 bytes of padding: 64 bytes.

Step_Back_Row

Kind
record of a module
Module
debugger
Size
80 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
checkpoint08
start88
target168
points248
offset328
instruction4020
stack6020

80 bytes of fields and 0 bytes of padding: 80 bytes.

Watch_Back_Row

Kind
record of a module
Module
debugger
Size
136 bytes
Alignment
8 bytes
Padding
8 bytes
Named by
FieldTypeOffsetSize
point08
offset88
source1616
address3220
padding524
written568
bytes6424
instruction8820
padding1084
checkpoint1128
start1208
points1288

128 bytes of fields and 8 bytes of padding: 136 bytes.

Stop_Frame_Row

Kind
record of a module
Module
debugger
Size
256 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
frame08
module832
procedure4080
offset1208
file12880
line2088
stop21640

256 bytes of fields and 0 bytes of padding: 256 bytes.

Error_Record

Kind
record of a module
Module
settings_stand_in
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Error_Record

Kind
record of a module
Module
scheduler
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Record

Kind
record of a module
Module
log
Size
256 bytes
Alignment
8 bytes
Padding
6 bytes
Named by
FieldTypeOffsetSize
number08
time88
process1632
slot488
level561
form571
padding586
lost648
continues728
runs808
text88168

250 bytes of fields and 6 bytes of padding: 256 bytes.

Error_Record

Kind
record of a module
Module
log
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Value_Run

Kind
record of a module
Module
log
Size
40 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
number08
start88
length168
kind2416

40 bytes of fields and 0 bytes of padding: 40 bytes.

Fact_Row

Kind
record of a module
Module
log
Size
224 bytes
Alignment
8 bytes
Padding
7 bytes
Named by
FieldTypeOffsetSize
number08
form81
padding97
continues168
key248
module_hash3232
value_count648
part724
part_count764
values80144

217 bytes of fields and 7 bytes of padding: 224 bytes.

Error_Record

Kind
record of a module
Module
server
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Page_Row

Kind
record of a module
Module
server
Size
88 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
name040
bytes408
served488
type5632

88 bytes of fields and 0 bytes of padding: 88 bytes.

Served

Kind
record of a module
Module
server
Size
80 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
requests08
answers_2xx88
answers_4xx168
answers_5xx248
connections_accepted328
connections_open408
bytes_in488
bytes_out568
pages648
calls728

80 bytes of fields and 0 bytes of padding: 80 bytes.

Error_Record

Kind
record of a module
Module
module_files
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Module_File_Row

Kind
record of a module
Module
module_files
Size
144 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
name064
bytes648
hash7272

144 bytes of fields and 0 bytes of padding: 144 bytes.

Error_Record

Kind
record of a module
Module
inspect
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Mapping

Kind
record of a module
Module
inspect
Size
104 bytes
Alignment
8 bytes
Padding
4 bytes
Named by
FieldTypeOffsetSize
address08
module832
offset408
pages488
present568
kind6416
rights804
padding844
object888
names968

100 bytes of fields and 4 bytes of padding: 104 bytes.

Thread

Kind
record of a module
Module
inspect
Size
88 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
number08
state88
processor168
home248
weight328
request408
virtual488
lag568
time648
words728
deadline808

88 bytes of fields and 0 bytes of padding: 88 bytes.

Module

Kind
record of a module
Module
inspect
Size
120 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
name032
hash3264
base968
size1048
writer1128

120 bytes of fields and 0 bytes of padding: 120 bytes.

Error_Record

Kind
record of a module
Module
storage
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Tree_Entry_Row

Kind
record of a module
Module
storage
Size
40 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
hash832

40 bytes of fields and 0 bytes of padding: 40 bytes.

Garbage_Root_Row

Kind
record of a module
Module
storage
Size
40 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
hash832

40 bytes of fields and 0 bytes of padding: 40 bytes.

Garbage_Measure

Kind
record of a module
Module
storage
Size
24 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
marked08
swept88
trees_traversed168

24 bytes of fields and 0 bytes of padding: 24 bytes.

Add_Row_Export

Kind
record of a module
Module
storage
Size
24 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
name_offset08
name_count88
kind168

24 bytes of fields and 0 bytes of padding: 24 bytes.

Listed

Kind
record of a module
Module
storage
Size
40 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
name_offset08
name_count88
kind168
size248
generation328

40 bytes of fields and 0 bytes of padding: 40 bytes.

Shared

Kind
record of a module
Module
storage
Size
24 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
share08
ring88
region168

24 bytes of fields and 0 bytes of padding: 24 bytes.

Usage

Kind
record of a module
Module
storage
Size
48 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
objects08
trees88
versions168
blocks248
limit328
removing408

48 bytes of fields and 0 bytes of padding: 48 bytes.

Version

Kind
record of a module
Module
storage
Size
48 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
generation08
time88
date168
bytes248
own_blocks328
current408

48 bytes of fields and 0 bytes of padding: 48 bytes.

Byte_Range

Kind
record of a module
Module
storage
Size
16 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
first08
count88

16 bytes of fields and 0 bytes of padding: 16 bytes.

Erase_Measure

Kind
record of a module
Module
storage
Size
40 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
generation08
versions88
zeroed168
kept248
damaged328

40 bytes of fields and 0 bytes of padding: 40 bytes.

Commit_Measure

Kind
record of a module
Module
storage
Size
72 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
generation08
object_blocks88
held_blocks168
changed248
hashed_blocks328
hashed_nodes408
object_written488
written568
milliseconds648

72 bytes of fields and 0 bytes of padding: 72 bytes.

Error_Record

Kind
record of a module
Module
assistant
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Act_Table_Column

Kind
record of a module
Module
assistant
Size
48 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
name032
kind328
unit408

48 bytes of fields and 0 bytes of padding: 48 bytes.

Act_Table_Cell

Kind
record of a module
Module
assistant
Size
72 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
text064
integer648

72 bytes of fields and 0 bytes of padding: 72 bytes.

Error_Record

Kind
record of a module
Module
assemble
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Error_Record

Kind
record of a module
Module
c_compiler
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Error_Record

Kind
record of a module
Module
declaration_eval
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Error_Record

Kind
record of a module
Module
math
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Error_Record

Kind
record of a module
Module
cryptography
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Argon2id_Cost

Kind
record of a module
Module
cryptography
Size
32 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
memory_kibibytes08
passes88
lanes168
tag_bytes248

32 bytes of fields and 0 bytes of padding: 32 bytes.

Error_Record

Kind
record of a module
Module
tls_tcp
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Record_Header

Kind
record of a module
Module
tls_tcp
Size
6 bytes
Alignment
2 bytes
Padding
1 byte
Named by
FieldTypeOffsetSize
content_type01
padding11
legacy_version22
length42

5 bytes of fields and 1 byte of padding: 6 bytes.

Variable_Length_Integer

Kind
record of a module
Module
tls_tcp
Size
16 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
value08
size88

16 bytes of fields and 0 bytes of padding: 16 bytes.

Quic_Header_Probe

Kind
record of a module
Module
tls_tcp
Size
8 bytes
Alignment
4 bytes
Padding
3 bytes
Named by
FieldTypeOffsetSize
form01
padding13
version44

5 bytes of fields and 3 bytes of padding: 8 bytes.

Error_Record

Kind
record of a module
Module
ssh_client
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Error_Record

Kind
record of a module
Module
ghostty_vt
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Error_Record

Kind
record of a module
Module
web_engine
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Rectangle

Kind
record of a module
Module
sample
Size
32 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
x08
y88
width168
height248

32 bytes of fields and 0 bytes of padding: 32 bytes.

Error_Record

Kind
record of a module
Module
sample
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Span

Kind
record of a module
Module
sample
Size
24 bytes
Alignment
8 bytes
Padding
4 bytes
Named by
FieldTypeOffsetSize
memory04
padding44
first88
count168

20 bytes of fields and 4 bytes of padding: 24 bytes.

Reading

Kind
record of a module
Module
sample
Size
40 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
sensor08
time88
value168
minimum248
maximum328

40 bytes of fields and 0 bytes of padding: 40 bytes.

Word

Kind
record of a module
Module
sample
Size
16 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
start04
count44
sum88

16 bytes of fields and 0 bytes of padding: 16 bytes.

Error_Record

Kind
record of a module
Module
hostile_exports
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Reading

Kind
record of a module
Module
hostile_exports
Size
40 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
sensor08
time88
value168
minimum248
maximum328

40 bytes of fields and 0 bytes of padding: 40 bytes.

Error_Record

Kind
record of a module
Module
interface_module
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Draw_Record

Kind
record of a module
Module
interface_module
Size
48 bytes
Alignment
4 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind01
reserved13
element44
left84
top124
right164
bottom204
fields2424

48 bytes of fields and 0 bytes of padding: 48 bytes.

Area

Kind
record of a module
Module
interface_module
Size
32 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
x08
y88
width168
height248

32 bytes of fields and 0 bytes of padding: 32 bytes.

Label_Value

Kind
record of a module
Module
interface_module
Size
48 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
x08
y88
width168
height248
value_x328
color408

48 bytes of fields and 0 bytes of padding: 48 bytes.

Bar_Value

Kind
record of a module
Module
interface_module
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
x08
y88
width168
height248
value328
maximum408
color488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Error_Record

Kind
record of a module
Module
text_rendering
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Placed_Glyph

Kind
record of a module
Module
text_rendering
Size
16 bytes
Alignment
4 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
glyph04
x44
advance84
cluster124

16 bytes of fields and 0 bytes of padding: 16 bytes.

Text_Range

Kind
record of a module
Module
text_rendering
Size
16 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
start04
count44
width88

16 bytes of fields and 0 bytes of padding: 16 bytes.

Error_Record

Kind
record of a module
Module
settings
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Locale

Kind
record of a module
Module
settings
Size
48 bytes
Alignment
4 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
language08
script84
region124
variant_first168
variant_second248
calendar321
numbering_system331
first_day341
hour_cycle351
measurement_system361
collation371
region_override386
reserved444

48 bytes of fields and 0 bytes of padding: 48 bytes.

Language_Row

Kind
record of a module
Module
settings
Size
144 bytes
Alignment
1 byte
Padding
0 bytes
Named by
FieldTypeOffsetSize
tag0128
language1288
script1364
region1404

144 bytes of fields and 0 bytes of padding: 144 bytes.

Date

Kind
record of a module
Module
date
Size
64 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
milliseconds08
year88
month168
day248
hour328
minute408
second488
weekday568

64 bytes of fields and 0 bytes of padding: 64 bytes.

Error_Record

Kind
record of a module
Module
powerbox
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Powerbox_Status

Kind
record of a module
Module
powerbox
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
pending_dialogs08
total_requests88
total_dialogs_shown168
total_items_granted248
total_items_refused328
total_refused_requests408
total_expired_dialogs488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Error_Record

Kind
record of a module
Module
plans
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Plan_Entry_Row

Kind
record of a module
Module
plans
Size
192 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind_word08
role_word88
start_grants_mask168
store_rights_word248
module_hash3232
interposed_over_hash6432
recipe_hash9632
name12864

192 bytes of fields and 0 bytes of padding: 192 bytes.

Plan_Difference_Summary

Kind
record of a module
Module
plans
Size
168 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
change_count08
added_roles88
removed_roles168
changed_roles248
added_modules328
removed_modules408
changed_modules488
added_stores568
removed_stores648
changed_stores728
added_grants808
removed_grants888
consent_word968
current_plan_hash10432
proposed_plan_hash13632

168 bytes of fields and 0 bytes of padding: 168 bytes.

Plan_Diff_Row

Kind
record of a module
Module
plans
Size
184 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
change_word08
entry_kind_word88
role_word168
added_grants_mask248
removed_grants_mask328
old_store_rights_word408
new_store_rights_word488
old_module_hash5632
new_module_hash8832
name12064

184 bytes of fields and 0 bytes of padding: 184 bytes.

Plan_Expected

Kind
record of a module
Module
plans
Size
32 bytes
Alignment
1 byte
Padding
0 bytes
Named by
FieldTypeOffsetSize
current_plan_hash032

32 bytes of fields and 0 bytes of padding: 32 bytes.

Plan_Generation_Row

Kind
record of a module
Module
plans
Size
88 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
generation08
timestamp_ms88
standing_word168
plan_hash2432
previous_plan_hash5632

88 bytes of fields and 0 bytes of padding: 88 bytes.

Plans_Status

Kind
record of a module
Module
plans
Size
32 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
total_diffs08
total_applies88
total_rollbacks168
total_refusals248

32 bytes of fields and 0 bytes of padding: 32 bytes.

Error_Record

Kind
record of a module
Module
recipes
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Recipe_Head

Kind
record of a module
Module
recipes
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
output_kind_word08
source_date_unix88
output_block_limit168
builder_hash2432

56 bytes of fields and 0 bytes of padding: 56 bytes.

Recipe_Input_Row

Kind
record of a module
Module
recipes
Size
104 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind_word08
hash832
name4064

104 bytes of fields and 0 bytes of padding: 104 bytes.

Recipe_Reference

Kind
record of a module
Module
recipes
Size
32 bytes
Alignment
1 byte
Padding
0 bytes
Named by
FieldTypeOffsetSize
recipe_hash032

32 bytes of fields and 0 bytes of padding: 32 bytes.

Recipe_Build_Row

Kind
record of a module
Module
recipes
Size
96 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
outcome_word08
refusal_word88
output_kind_word168
mode_word248
recipe_hash3232
output_hash6432

96 bytes of fields and 0 bytes of padding: 96 bytes.

Realisation_Row

Kind
record of a module
Module
recipes
Size
112 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
origin_word08
output_kind_word88
recipe_hash1632
output_hash4832
signer_public_key8032

112 bytes of fields and 0 bytes of padding: 112 bytes.

Recipes_Status

Kind
record of a module
Module
recipes
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
total_builds08
cache_hits_local88
cache_hits_remote168
local_builds248
verify_agreements328
verify_disagreements408
total_refusals488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Error_Record

Kind
record of a module
Module
projects
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Pin_Target

Kind
record of a module
Module
projects
Size
32 bytes
Alignment
1 byte
Padding
0 bytes
Named by
FieldTypeOffsetSize
tree_hash032

32 bytes of fields and 0 bytes of padding: 32 bytes.

Pin_Update_Row

Kind
record of a module
Module
projects
Size
80 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
changed_lines08
line_number88
old_tree_hash1632
new_tree_hash4832

80 bytes of fields and 0 bytes of padding: 80 bytes.

Pin_Row

Kind
record of a module
Module
projects
Size
256 bytes
Alignment
1 byte
Padding
0 bytes
Named by
FieldTypeOffsetSize
tree_hash032
source_module_hash3232
name6464
upstream_ref128128

256 bytes of fields and 0 bytes of padding: 256 bytes.

Recipe_Head

Kind
record of a module
Module
projects
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
output_kind_word08
source_date_unix88
output_block_limit168
builder_hash2432

56 bytes of fields and 0 bytes of padding: 56 bytes.

Recipe_Input_Row

Kind
record of a module
Module
projects
Size
104 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind_word08
hash832
name4064

104 bytes of fields and 0 bytes of padding: 104 bytes.

Projects_Status

Kind
record of a module
Module
projects
Size
48 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
total_inputs_queries08
total_updates88
total_enters168
total_exits248
active_consoles328
total_refusals408

48 bytes of fields and 0 bytes of padding: 48 bytes.

Error_Record

Kind
record of a module
Module
work_accounting_probe
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Error_Record

Kind
record of a module
Module
collector
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Collector_Status

Kind
record of a module
Module
collector
Size
64 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
active_grants08
total_grants_created88
total_grants_revoked168
total_grants_expired248
total_acts_permitted328
total_acts_blocked408
recorded_acts488
refused_full_count568

64 bytes of fields and 0 bytes of padding: 64 bytes.

Chain_Verification_Report

Kind
record of a module
Module
collector
Size
32 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
refusal_code08
failing_index88
record_count168
verify_calls248

32 bytes of fields and 0 bytes of padding: 32 bytes.

Act_Record

Kind
record of a module
Module
collector
Size
120 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
sequence_number08
grant_serial88
timestamp_ms168
act_kind_word248
target_window_id328
detail_word_0408
detail_word_1488
previous_hash5632
record_hash8832

120 bytes of fields and 0 bytes of padding: 120 bytes.

Space_Terms

Kind
record of a module
Module
collector
Size
32 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind_word08
bound_records88
forwarding_word168
record_size248

32 bytes of fields and 0 bytes of padding: 32 bytes.

Kept_Record_Head

Kind
record of a module
Module
collector
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
serial08
time_ms88
size168
chain_hash2432

56 bytes of fields and 0 bytes of padding: 56 bytes.

Space_Row

Kind
record of a module
Module
collector
Size
176 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
space08
kind_word88
forwarding_word168
bound_records248
record_size328
kept408
removed488
refused_full568
forwarded648
next_serial728
source8032
output11232
last_hash14432

176 bytes of fields and 0 bytes of padding: 176 bytes.

Error_Record

Kind
record of a module
Module
guest_builder
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Guest_Build_Report

Kind
record of a module
Module
guest_builder
Size
128 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
state08
refusal88
guest_exit_code168
guest_exits248
sandbox_violations328
tree_bytes_written408
machine_failure488
console_bytes568
output_tree_hash6432
output_disk_hash9632

128 bytes of fields and 0 bytes of padding: 128 bytes.

Guest_Builder_Status

Kind
record of a module
Module
guest_builder
Size
96 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
builds08
succeeded88
refused168
failed248
timed_out328
last_state408
last_refusal488
last_tree_bytes568
last_output_tree_hash6432

96 bytes of fields and 0 bytes of padding: 96 bytes.

Error_Record

Kind
record of a module
Module
disk_processes
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Disk_Processes_Status

Kind
record of a module
Module
disk_processes
Size
32 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
loads08
starts_requested88
refusals168
commands_refused248

32 bytes of fields and 0 bytes of padding: 32 bytes.

Error_Record

Kind
record of a module
Module
devices
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Devices_Status

Kind
record of a module
Module
devices
Size
40 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
identity_count08
active_bindings88
total_binds168
total_releases248
total_refusals328

40 bytes of fields and 0 bytes of padding: 40 bytes.

Error_Record

Kind
record of a module
Module
principals
Size
56 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
kind08
unit88
operation168
argument248
value328
limit408
found488

56 bytes of fields and 0 bytes of padding: 56 bytes.

Principals_Status

Kind
record of a module
Module
principals
Size
48 bytes
Alignment
8 bytes
Padding
0 bytes
Named by
FieldTypeOffsetSize
principal_count08
active_sessions88
disk_rows_applied168
active_client_keys248
start_policy_updates328
total_refusals408

48 bytes of fields and 0 bytes of padding: 48 bytes.

The basic types

u8

An unsigned integer of 8 bits.

Kind
basic
Size
1 byte
Alignment
1 byte
Named by

u16

An unsigned integer of 16 bits, little-endian.

Kind
basic
Size
2 bytes
Alignment
2 bytes
Named by

u32

An unsigned integer of 32 bits, little-endian.

Kind
basic
Size
4 bytes
Alignment
4 bytes
Named by

u64

An unsigned integer of 64 bits, little-endian.

Kind
basic
Size
8 bytes
Alignment
8 bytes
Named by

i8

A signed integer of 8 bits, in two's complement.

Kind
basic
Size
1 byte
Alignment
1 byte

i16

A signed integer of 16 bits, in two's complement, little-endian.

Kind
basic
Size
2 bytes
Alignment
2 bytes

i32

A signed integer of 32 bits, in two's complement, little-endian.

Kind
basic
Size
4 bytes
Alignment
4 bytes

i64

A signed integer of 64 bits, in two's complement, little-endian.

Kind
basic
Size
8 bytes
Alignment
8 bytes
Named by

int

A signed integer of the size of an address of the target.

Kind
basic
Size
8 bytes
Alignment
8 bytes
On the target
int has the size of an address of the target: the sizes here are those of linux amd64, where the page was made
Named by

bool

A boolean of one byte: 0 is false, 1 is true.

Kind
basic
Size
1 byte
Alignment
1 byte
Named by

rawptr

An address with no type.

Kind
basic
Size
8 bytes
Alignment
8 bytes
On the target
rawptr has the size of an address of the target: the sizes here are those of linux amd64, where the page was made

uintptr

An unsigned integer of the size of an address of the target.

Kind
basic
Size
8 bytes
Alignment
8 bytes
On the target
uintptr has the size of an address of the target: the sizes here are those of linux amd64, where the page was made
Named by

string

UTF-8 bytes that the process does not own: their address, then their count.

Kind
basic
Size
16 bytes
Alignment
8 bytes
On the target
string has the size of an address of the target: the sizes here are those of linux amd64, where the page was made
Named by

[]u8

Bytes that the process does not own: their address, then their count.

Kind
basic
Size
16 bytes
Alignment
8 bytes
On the target
[]u8 has the size of an address of the target: the sizes here are those of linux amd64, where the page was made
Named by

u8 basic

A basic type: 1 bytes, aligned on 1 bytes. An unsigned integer of 8 bits.

Form enum

An enum of the package operation on u8: 1 bytes, 9 members. The form of one parameter of a kernel operation: what the kernel checks on it before the operation, and how a sentence names its value.

  • None0
  • Value1
  • Handle2
  • Handle_Or_Zero3
  • Address4
  • Count5
  • Flags6
  • Choice7

and 1 more

Object_Kind enum

An enum of the package operation on u8: 1 bytes, 9 members. The kind of the object that a handle names.

  • None0
  • Memory1
  • Process2
  • Interrupt3
  • Ports4
  • Machine5
  • Thread6
  • Budget7

and 1 more

Rights bit set

A bit set of the package operation of Right: 4 bytes, 15 bits. An alias of bit_set[Right; u32]. The rights of one handle, as a set: bit n is the Right n.

  • Givebit 0
  • Readbit 1
  • Writebit 2
  • Executebit 3
  • Controlbit 4
  • Inspectbit 5
  • Devicesbit 6
  • Stopbit 7

and 7 more

string basic

A basic type: 16 bytes, aligned on 8 bytes. UTF-8 bytes that the process does not own: their address, then their count.

Holds string: its size follows the size of an address of the target.

u64 basic

A basic type: 8 bytes, aligned on 8 bytes. An unsigned integer of 64 bits, little-endian.

Parameter_Form struct

A struct of the package operation: 32 bytes, aligned on 8 bytes, 2 bytes of padding. One parameter of a kernel operation, as OPERATIONS describes it.

  • namestring016 bytes
  • formForm161 bytes
  • kindObject_Kind171 bytes
  • padding182 bytes
  • rightsbit_set[Right; u32]204 bytes
  • limitu64248 bytes

Holds string: its size follows the size of an address of the target.

Error_Record struct

A struct of the package errors: 56 bytes, aligned on 8 bytes, 0 bytes of padding. The error record: what a call that failed says about why, as seven integers.

  • kindi6408 bytes
  • uniti6488 bytes
  • operationi64168 bytes
  • argumenti64248 bytes
  • valuei64328 bytes
  • limiti64408 bytes
  • foundi64488 bytes

u32 basic

A basic type: 4 bytes, aligned on 4 bytes. An unsigned integer of 32 bits, little-endian.

Right enum

An enum of the package operation on u32: 4 bytes, 15 members. A right: one kind of operation that a handle permits on its object.

  • Give0
  • Read1
  • Write2
  • Execute3
  • Control4
  • Inspect5
  • Devices6
  • Stop7

and 7 more

Module_Report struct

A struct of the package operation: 1424 bytes, aligned on 8 bytes, 0 bytes of padding. The module records of one process, in the order of their addresses.

  • countu6408 bytes
  • modules[16]Module_Record81408 bytes
  • process_serialu6414168 bytes

Stop_Report struct

A struct of the package operation: 960 bytes, aligned on 8 bytes, 0 bytes of padding. Where a process stopped on a fault (Process_State).

  • causeu3204 bytes
  • vectoru3244 bytes
  • instructionu6488 bytes
  • addressu64168 bytes
  • moduleModule_Record2488 bytes
  • frame_countu641128 bytes
  • frames[16]Stop_Frame120768 bytes
  • process_serialu648888 bytes

and 2 more

Stop_Frame struct

A struct of the package operation: 48 bytes, aligned on 8 bytes, 0 bytes of padding. One frame of a stack trace.

  • addressu6408 bytes
  • baseu6488 bytes
  • hash[32]u81632 bytes

Module_Record struct

A struct of the package operation: 88 bytes, aligned on 8 bytes, 0 bytes of padding. A module record: one module that a loader put in a process (Process_Module).

  • baseu6408 bytes
  • sizeu6488 bytes
  • hash[32]u81632 bytes
  • replaces[32]u84832 bytes
  • writeru64808 bytes

Module_Writer enum

An enum of the package operation on u64: 8 bytes, 2 members. Who wrote a module record (Module_Record.writer).

  • Process0
  • Starter1

Fault_Record struct

A struct of the package operation: 64 bytes, aligned on 8 bytes, 0 bytes of padding. One fault that the kernel gave to the fault handler of a process, in the fault ring of the thread record of the handler.

  • threadu6408 bytes
  • serialu6488 bytes
  • addressu64168 bytes
  • accessu64248 bytes
  • instructionu64328 bytes
  • kindu64408 bytes
  • error_codeu64488 bytes
  • reservedu64568 bytes

Fault_Access_Bit enum

An enum of the package operation on u64: 8 bytes, 3 members. What a faulting access was: the bits of the error code of the processor.

  • Present0
  • Write1
  • Execute4

Fault_Kind enum

An enum of the package operation on u64: 8 bytes, 11 members. The kind of a fault: the processor exception, named by its vector.

  • Divide_Error0
  • Debug1
  • Breakpoint3
  • Invalid_Opcode6
  • Segment_Not_Present11
  • Stack_Fault12
  • General_Protection13
  • Page_Fault14

and 3 more

Processor_Report struct

A struct of the package operation: 120 bytes, aligned on 8 bytes, 0 bytes of padding. The state of one processor: what it runs, its scheduler and its frame cache.

  • processu6408 bytes
  • busy_timeu6488 bytes
  • sameu64168 bytes
  • apic_idu64248 bytes
  • strategyStrategy324 bytes
  • queuedu32364 bytes
  • picksu64408 bytes
  • preemptionsu64488 bytes

and 8 more

Thread_Schedule struct

A struct of the package operation: 16 bytes, aligned on 4 bytes, 0 bytes of padding. The schedule of a thread: the two values that a process sets for the scheduling strategies.

  • weightu3204 bytes
  • requestu3244 bytes
  • weight_limitu3284 bytes
  • new_thread_weight_limitu32124 bytes

Thread_Breakpoint_Kind enum

An enum of the package operation on u32: 4 bytes, 4 members. What a breakpoint of a thread stops on.

  • None0
  • Execute1
  • Write2
  • Read_Or_Write3

Thread_Breakpoint struct

A struct of the package operation: 16 bytes, aligned on 8 bytes, 0 bytes of padding. One breakpoint of a thread: an address of its process, and what stops there.

  • addressu6408 bytes
  • kindThread_Breakpoint_Kind84 bytes
  • lengthu32124 bytes

Event_Rule_Flag enum

An enum of the package operation on u32: 4 bytes, 1 members. A flag of an event rule.

  • Match_Detail0

Event_Rule struct

A struct of the package operation: 64 bytes, aligned on 8 bytes, 0 bytes of padding. One rule of the event table.

  • kindu3204 bytes
  • flagsbit_set[Event_Rule_Flag; u32]44 bytes
  • processu6488 bytes
  • detailu64168 bytes
  • least_nanosecondsu64248 bytes
  • one_inu64328 bytes
  • reserved[3]u644024 bytes

Event_Rule_Flags bit set

A bit set of the package operation of Event_Rule_Flag: 4 bytes, 1 bits. An alias of bit_set[Event_Rule_Flag; u32]. The flags of one Event_Rule.

  • Match_Detailbit 0

u16 basic

A basic type: 2 bytes, aligned on 2 bytes. An unsigned integer of 16 bits, little-endian.

Guest_Mode_Load enum

An enum of the package operation on u8: 1 bytes, 4 members. The state of a mode that Guest_Run loads in the guest processor before its entry: the segments, the descriptor tables and the privilege level.

  • Keep0
  • Real_161
  • Protected_322
  • Long_643

Guest_Inject_Kind enum

An enum of the package operation on u8: 1 bytes, 5 members. An event that Guest_Run delivers to the guest at its entry: an interrupt of a device that the process models, or an exception of an instruction that the process ran in place of the guest.

  • None0
  • External_Interrupt1
  • Non_Maskable_Interrupt2
  • Exception3
  • Software_Interrupt4

Memory_Flag enum

An enum of the package operation on u64: 8 bytes, 4 members. A flag of Memory_Create: how the pages of a new memory object get their page frames and who pays them.

  • Frames_Now0
  • Contiguous1
  • Uncommitted2
  • Large_Pages3

Page_Range struct

A struct of the package operation: 16 bytes, aligned on 8 bytes, 0 bytes of padding. A range of pages of a memory object (Memory_Commit).

  • firstu6408 bytes
  • page_countu6488 bytes

Commit_Flag enum

An enum of the package operation on u64: 8 bytes, 1 members. A flag of Memory_Commit.

  • Decommit0

Map_Flag enum

An enum of the package operation on u64: 8 bytes, 6 members. A flag of Memory_Map and of Memory_Protect: the access that a mapping gives.

  • Write0
  • Execute1
  • No_Access2
  • Receive_Handles3
  • At_Address_Zero4
  • Write_Combining5

Device_Memory_Fact enum

An enum of the package operation on u64: 8 bytes, 2 members. What Device_Create of the kind Memory says of the device whose registers the range holds, in its second result.

  • Domain0
  • Windows1

Process_Mapping_Flag enum

An enum of the package operation on u32: 4 bytes, 12 members. A fact about one mapping of a process, in Process_Mapping.flags.

  • Write0
  • Execute1
  • Uncached2
  • Device3
  • Contiguous4
  • Shared5
  • Thread_Area6
  • Uncommitted7

and 4 more

Process_Mapping struct

A struct of the package operation: 64 bytes, aligned on 8 bytes, 0 bytes of padding. One mapping of a process: Process_Mapping_Report.

  • addressu6408 bytes
  • page_countu6488 bytes
  • firstu64168 bytes
  • presentu64248 bytes
  • region_pagesu64328 bytes
  • region_serialu64408 bytes
  • flagsbit_set[Process_Mapping_Flag; u32]484 bytes
  • referencesu32524 bytes

and 1 more

Process_State enum

An enum of the package operation on u32: 4 bytes, 5 members. The state of a process or of a thread.

  • None0
  • Created1
  • Ready2
  • Waiting3
  • Stopped4

i64 basic

A basic type: 8 bytes, aligned on 8 bytes. A signed integer of 64 bits, in two's complement, little-endian.

Thread_Report struct

A struct of the package operation: 80 bytes, aligned on 8 bytes, 0 bytes of padding. One thread of a process: Thread_Table_Report.

  • machine_numberu6408 bytes
  • numberu3284 bytes
  • stateProcess_State124 bytes
  • processoru32164 bytes
  • homeu32204 bytes
  • weightu32244 bytes
  • requestu32284 bytes
  • wordsu32324 bytes

and 6 more

Lock_Count struct

A struct of the package operation: 16 bytes, aligned on 8 bytes, 0 bytes of padding. What the kernel counts for one kind of lock, on all the processors.

  • takesu6408 bytes
  • waitsu6488 bytes

Strategy enum

An enum of the package operation on u32: 4 bytes, 4 members. The scheduling strategy of the machine: the rule that orders the ready threads of each run queue.

  • None0
  • Round_Robin1
  • Fair2
  • Eevdf3

Lock_Kind enum

An enum of the package operation on u64: 8 bytes, 9 members. The locks of the kernel, by the data that each one protects.

  • Control0
  • Process1
  • Origin2
  • Region3
  • Frame4
  • Cache5
  • Log6
  • Wait7

and 1 more

Log_Level enum

An enum of the package operation on u8: 1 bytes, 4 members. The log: records of text, each with its process and its level.

  • Info0
  • Debug1
  • Warning2
  • Error3

int basic

A basic type: 8 bytes, aligned on 8 bytes. A signed integer of the size of an address of the target.

Holds int: its size follows the size of an address of the target.

[]u8 basic

A basic type: 16 bytes, aligned on 8 bytes. Bytes that the process does not own: their address, then their count.

Holds []u8: its size follows the size of an address of the target.

bool basic

A basic type: 1 bytes, aligned on 1 bytes. A boolean of one byte: 0 is false, 1 is true.

Mapping_Flag enum

An enum of the package operation on u64: 8 bytes, 4 members. A run of pages that a page table gives, with one protection.

  • Write0
  • Execute1
  • Process2
  • Large3

Mapping_Report struct

A struct of the package operation: 2376 bytes, aligned on 8 bytes, 0 bytes of padding. What the page table says, as the kernel reads it from the table itself.

  • run_countu6408 bytes
  • runs[96]Mapping_Run82304 bytes
  • pagesu6423128 bytes
  • write_pagesu6423208 bytes
  • execute_pagesu6423288 bytes
  • write_execute_pagesu6423368 bytes
  • guard_pagesu6423448 bytes
  • guards_expectedu6423528 bytes

and 2 more

Mapping_Run struct

A struct of the package operation: 24 bytes, aligned on 8 bytes, 0 bytes of padding. One run of a Mapping_Report: pages that follow each other in the addresses, with the same flags.

  • startu6408 bytes
  • page_countu6488 bytes
  • flagsbit_set[Mapping_Flag; u64]168 bytes

Boot_Stage struct

A struct of the package operation: 64 bytes, aligned on 8 bytes, 0 bytes of padding. One stage of the start of the machine: the boot program or the kernel timed it.

  • name[48]u8048 bytes
  • startu64488 bytes
  • durationu64568 bytes

Boot_Range struct

A struct of the package operation: 24 bytes, aligned on 8 bytes, 0 bytes of padding. A run of physical memory, as the firmware gave it.

  • startu6408 bytes
  • page_countu6488 bytes
  • kindu64168 bytes

Budget_Amounts struct

A struct of the package operation: 40 bytes, aligned on 8 bytes, 0 bytes of padding. A budget: what its holders can still create.

  • pagesu6408 bytes
  • processesu6488 bytes
  • threadsu64168 bytes
  • processoru64248 bytes
  • log_recordsu64328 bytes

Handle distinct

A distinct type of the package operation on u32: 4 bytes, aligned on 4 bytes. A handle: the number by which one process names one kernel object, with the rights that it holds on it.

Kind_Word distinct

A distinct type of the package errors on u64: 8 bytes, aligned on 8 bytes. The word of a Kind as the record of another party holds it: a field of a log fact copies it with no cast to Kind, and a reader writes the name of its member, or its number when it names none.

Unit_Word distinct

A distinct type of the package errors on u64: 8 bytes, aligned on 8 bytes. The word of a Unit as the record of another party holds it, as Kind_Word.

Error_Record_Fact_Fields struct

A struct of the package errors: 56 bytes, aligned on 8 bytes, 0 bytes of padding. The fields of an error record in a log fact: the seven values of the record, with the kind and the unit as the words of their contract enums, so that a reader writes their names and a condition reads them by name (where(kind = Too_Long)).

  • kindKind_Word08 bytes
  • unitUnit_Word88 bytes
  • operationi64168 bytes
  • argumenti64248 bytes
  • valuei64328 bytes
  • limiti64408 bytes
  • foundi64488 bytes

Fixed_Range enum

An enum of the package fixed_addresses on u8: 1 bytes, 12 members. The table of the fixed ranges: a new range is a new member, and its address is its slot.

  • Module_Files0
  • Pointer_Themes1
  • Settings_Page2
  • Date_Page6
  • Storage_File7
  • Module_Tables8
  • Debug_Image11
  • Disk_Process_Page12

and 4 more

Named struct

A struct of the package module: 64 bytes, aligned on 1 bytes, 0 bytes of padding. A module, as the load source names it.

  • hash[32]u8032 bytes
  • name[32]u83232 bytes

Described struct

A struct of the package module: 40 bytes, aligned on 4 bytes, 0 bytes of padding.

  • typeu801 bytes
  • directionu811 bytes
  • _[2]u822 bytes
  • detailu3244 bytes
  • record[32]u8832 bytes

Error_Word distinct

A distinct type of the package module on u64: 8 bytes, aligned on 8 bytes.

Difference_Word distinct

A distinct type of the package module on u64: 8 bytes, aligned on 8 bytes.

Status_Word distinct

A distinct type of the package operation on u64: 8 bytes, aligned on 8 bytes. The word of a Status: a Status has 4 bytes.

Machine enum

An enum of the package module on u32: 4 bytes, 2 members. The processor whose instructions the segments hold.

  • None0
  • X86_641

Module_Category enum

An enum of the package module on u8: 1 bytes, 8 members. The module category: what a module is to a reader, one word for each module.

  • None0
  • Application1
  • System_Tool2
  • Developer_Tool3
  • Service4
  • Library5
  • Demonstration6
  • Test7

Module_Tags bit set

A bit set of the package module of Module_Tag: 2 bytes, 12 bits. An alias of bit_set[Module_Tag; u16].

  • Graphicsbit 0
  • Textbit 1
  • Networkbit 2
  • Storagebit 3
  • Securitybit 4
  • Processesbit 5
  • Memorybit 6
  • Timebit 7

and 4 more

Module_Tag enum

An enum of the package module on u8: 1 bytes, 12 members. A module tag: one word of what a module is about.

  • Graphics0
  • Text1
  • Network2
  • Storage3
  • Security4
  • Processes5
  • Memory6
  • Time7

and 4 more

Segment_Flag enum

An enum of the package module on u32: 4 bytes, 4 members. The access of a segment once loaded.

  • Read0
  • Write1
  • Execute2
  • Read_Only_After_Load3

Segment_Flags bit set

A bit set of the package module of Segment_Flag: 4 bytes, 4 bits. An alias of bit_set[Segment_Flag; u32]. The flags of one Segment.

  • Readbit 0
  • Writebit 1
  • Executebit 2
  • Read_Only_After_Loadbit 3

uintptr basic

A basic type: 8 bytes, aligned on 8 bytes. An unsigned integer of the size of an address of the target.

Holds uintptr: its size follows the size of an address of the target.

Record struct

A struct of the package module: 24 bytes, aligned on 4 bytes, 0 bytes of padding. The description of a record: a parameter or a result of the type Record.

  • name_offsetu3204 bytes
  • name_countu3244 bytes
  • sizeu3284 bytes
  • first_fieldu32124 bytes
  • field_countu32164 bytes
  • reservedu32204 bytes

Direction enum

An enum of the package module on u8: 1 bytes, 3 members. What the callee does with the memory of a Table or Bytes parameter.

  • Read0
  • Change1
  • Append2

Table_Place struct

A struct of the package module: 24 bytes, aligned on 8 bytes, 0 bytes of padding. The table place: the record that names the memory of a Table or Bytes parameter in a direct call.

  • addressu6408 bytes
  • countu6488 bytes
  • capacityu64168 bytes

Function struct

A struct of the package module: 168 bytes, aligned on 4 bytes, 0 bytes of padding. The description of one export.

  • name_offsetu3204 bytes
  • name_countu3244 bytes
  • about_offsetu3284 bytes
  • about_countu32124 bytes
  • parameter_names[12]u321648 bytes
  • parameter_countu8641 bytes
  • resultu8651 bytes
  • parameters[12]u86612 bytes

and 8 more

Field struct

A struct of the package module: 24 bytes, aligned on 4 bytes, 0 bytes of padding. One field of a record.

  • name_offsetu3204 bytes
  • name_countu3244 bytes
  • offsetu3284 bytes
  • typeu8121 bytes
  • unsignedbool131 bytes
  • integer_unitInteger_Unit142 bytes
  • detailu32164 bytes
  • kindu8201 bytes

and 2 more

Integer wire form

A wire form of the module contract: one word of a call. A signed integer of 64 bits, in a register.

Text wire form

A wire form of the module contract: one word of a call. The address of a slice record {address, count} of UTF-8 bytes.

Bytes wire form

A wire form of the module contract: one word of a call. Bytes with no description.

Handle wire form

A wire form of the module contract: one word of a call. A handle that the caller lends for the time of the call, in a register.

Load_Error struct

A struct of the package module: 392 bytes, aligned on 4 bytes, 0 bytes of padding. Why a load failed: the stage, the module, the import, and the fact that the stage found.

  • stageu3204 bytes
  • statusu3244 bytes
  • file_erroru3284 bytes
  • differenceu32124 bytes
  • moduleNamed1664 bytes
  • importedNamed8064 bytes
  • replacedNamed14464 bytes
  • replacementNamed20864 bytes

and 5 more

OPERATIONS global variable of the package operation

OPERATIONS := [Operation]Operation_Form {...}

The form of each kernel operation, by its number.

src/library/modus/contract/operation/forms.odin:50

Error_Details constant of the package system

Error_Details :: Table_To_Append(errors.)

The table of error details.

src/library/modus/system/error_details.odin:17

time procedure of the package system

time :: proc "contextless" () -> u64

time gives the milliseconds since boot.

src/library/modus/system/system.odin:267

Write type of the package storage_service

Write :: struct {...}

A type with no comment in its source.

src/modules/system/storage/engine.odin:590

COMMAND_NAMES_ERROR_DETAILS constant of the package operation

COMMAND_NAMES_ERROR_DETAILS :: u32(1) << 31

The table of error details of a kernel command (Module contract,.

src/library/modus/contract/operation/error_details.odin:17

memory_create procedure of the package system

memory_create :: proc "contextless" (page_count: u64, budget: Handle = 0, flags: op.Memory_Flags = {}, error: ^errors. = nil) -> (memory: Handle, status: Status)

memory_create makes a memory object.

src/library/modus/system/system.odin:449

call procedure of the package system

call :: proc "contextless" (operation: op.Operation, values: ..u64) -> (results: [7]u64, status: Status)

call executes one kernel operation and gives its results and its status.

src/library/modus/system/system.odin:115

PROCESS_MODULE_CAPACITY constant of the package operation

PROCESS_MODULE_CAPACITY :: 16

The module records of one process: its own module, the modules that.

src/library/modus/contract/operation/operation.odin:1749

budget_create procedure of the package system

budget_create :: proc "contextless" (amounts: Budget_Amounts, from: Handle = 0, error: ^errors. = nil) -> (budget: Handle, status: Status)

budget_create moves amounts from a budget (0: the budget of this process).

src/library/modus/system/system.odin:406

fault_read procedure of the package iommu

fault_read :: proc "contextless" (low: u64, high: u64) -> (fault: Fault, recorded: bool)

fault_read reads a fault recording register from its first 8 bytes and.

src/modulus/iommu/iommu.odin:817

fault_kinds_of_argument procedure of the package operation

fault_kinds_of_argument :: proc "contextless" (argument: u64) -> (mask: u64, ok: bool)

fault_kinds_of_argument gives the kinds that the argument of.

src/library/modus/contract/operation/operation.odin:2068

thread_control_rights procedure of the package operation

thread_control_rights :: proc "contextless" (command: Thread_Control_Command) -> Rights

thread_control_rights gives the rights that a thread handle needs for a.

src/library/modus/contract/operation/operation.odin:2338

Operation_In_Progress type of the package kernel

Operation_In_Progress :: struct {...}

The facts of the kernel operation that runs on a processor, in one.

src/modulus/enter.odin:155

thread_control_state_error procedure of the package operation

thread_control_state_error :: proc "contextless" (refusal: Thread_Control_State_Refusal, argument: i64, value: u64, limit: u64, found: u64) -> (record: errors., ok: bool)

thread_control_state_error builds the error record for a Bad_State.

src/library/modus/contract/operation/thread_control_state.odin:40

thread_registers_refusal procedure of the package operation

thread_registers_refusal :: proc "contextless" (registers: ^Thread_Registers) -> (refusal: Thread_Write_Refusal, value: u64)

thread_registers_refusal says what a write of the registers of a thread.

src/library/modus/contract/operation/operation.odin:2614

WEIGHT_FULL constant of the package operation

WEIGHT_FULL :: 1024

The weight of a thread created with the weight 0: the most.

src/library/modus/contract/operation/operation.odin:1394

REQUEST_DEFAULT constant of the package operation

REQUEST_DEFAULT :: 3000

Microseconds: the request of a thread created with the request 0.

src/library/modus/contract/operation/operation.odin:1395

thread_schedule_after_machine_write procedure of the package operation

thread_schedule_after_machine_write :: proc "contextless" (written: Thread_Schedule) -> Thread_Schedule

thread_schedule_after_machine_write gives the schedule that a thread has.

src/library/modus/contract/operation/operation.odin:1453

thread_schedule_of_new_thread procedure of the package operation

thread_schedule_of_new_thread :: proc "contextless" (new_thread_weight_limit: u32, weight, request: u64) -> (schedule: Thread_Schedule, ok: bool)

thread_schedule_of_new_thread gives the schedule of a thread that.

src/library/modus/contract/operation/operation.odin:1517

thread_placement_after_write procedure of the package operation

thread_placement_after_write :: proc "contextless" (written, held: Thread_Placement, machine_processors: u64, by_machine: bool) -> (after: Thread_Placement, refusal: Thread_Write_Refusal, most: u64)

thread_placement_after_write gives the placement that a thread has after.

src/library/modus/contract/operation/operation.odin:1609

DEBUG_STATUS_BREAKPOINTS constant of the package operation

DEBUG_STATUS_BREAKPOINTS :: u64(0b1111)

The debug status: the error code of a fault record of the kind Debug.

src/library/modus/contract/operation/operation.odin:2028

thread_breakpoints_refusal procedure of the package operation

thread_breakpoints_refusal :: proc "contextless" (breakpoints: ^Thread_Breakpoints) -> (refusal: Thread_Write_Refusal, value: u64)

thread_breakpoints_refusal says what a write of the breakpoints of a.

src/library/modus/contract/operation/operation.odin:2455

EVENT_LEAST_NANOSECONDS_MOST constant of the package operation

EVENT_LEAST_NANOSECONDS_MOST :: 1_000_000_000

The longest least duration of a rule: one second.

src/library/modus/contract/operation/operation.odin:2812

Status type of the package system

Status :: op.Status

The status of a kernel operation: op.Status.

src/library/modus/system/system.odin:41

MEMORY_PAGE_LIMIT constant of the package operation

MEMORY_PAGE_LIMIT :: MEMORY_LIST_ENTRIES * MEMORY_LIST_ENTRIES

The pages of one memory object: 1 GiB.

src/library/modus/contract/operation/operation.odin:2942

stop_of_words procedure of the package operation

stop_of_words :: proc "contextless" (state_word: u64, cause_word: u64, outcome_word: u64) -> (state: Process_State, cause: Stop_Cause, outcome: Stop_Outcome, ok: bool)

stop_of_words is the one border of the first three results of.

src/library/modus/contract/operation/stop_cause.odin:62

stop_cause_of_word procedure of the package operation

stop_cause_of_word :: proc "contextless" (word: u64) -> (cause: Stop_Cause, ok: bool)

stop_cause_of_word is the border of the word of a stop cause in a record.

src/library/modus/contract/operation/stop_cause.odin:46

stop_outcome_of_word procedure of the package operation

stop_outcome_of_word :: proc "contextless" (word: u64) -> (outcome: Stop_Outcome, ok: bool)

stop_outcome_of_word is the border of the word of a stop outcome in a.

src/library/modus/contract/operation/stop_outcome.odin:42

Pages type of the package manual_pages

Pages :: struct {...}

A valid file: the reads below take it.

src/library/modus/contract/manual_pages/manual_pages.odin:78

log_first_kept procedure of the package operation

log_first_kept :: proc "contextless" (after: u64, written: u64) -> (next: u64, lost: u64)

log_first_kept gives the first record from the number after on that a.

src/library/modus/contract/operation/log_ring.odin:27

log_copy_kept procedure of the package operation

log_copy_kept :: proc "contextless" (number: u64, written_after_copy: u64) -> bool

log_copy_kept says if the copy of the record number is whole: the.

src/library/modus/contract/operation/log_ring.odin:39

ROOT_LOG_RECORDS constant of the package operation

ROOT_LOG_RECORDS :: 3

The handle 3: the memory of the records of the log of the kernel, with.

src/library/modus/contract/operation/operation.odin:3972

log_record_form procedure of the package operation

log_record_form :: proc "contextless" (record: ^Log_Record) -> (form: Log_Record_Form, ok: bool)

log_record_form reads the form of a record through the border: false for.

src/library/modus/contract/operation/log_ring.odin:122

LOG_FACT_VALUES_MOST constant of the package operation

LOG_FACT_VALUES_MOST :: LOG_FACT_VALUE_CAPACITY + LOG_FACT_TEXT_AREA_BYTES_MOST

The bytes of the values of one log fact, at most: its fixed record, which.

src/library/modus/contract/operation/operation.odin:3503

CONTEXT_ADDRESS constant of the package operation

CONTEXT_ADDRESS :: 0x0000_7FFF_FFF0_0000

The address of the context of the process (Context): the starter maps one.

src/library/modus/contract/operation/operation.odin:97

context_record procedure of the package system

context_record :: #force_inline proc "contextless" () -> ^Context

context_record gives the context of this process: it is at a fixed address.

src/library/modus/system/system.odin:385

fill_for_a_key procedure of the package random

fill_for_a_key :: proc "contextless" (generator: ^Generator, output: []u8, least_strength: Seed_Strength, error: ^errors.) -> bool

fill_for_a_key writes random bytes in output for a key, a nonce or.

src/library/modus/random/generator.odin:162

memory_cost procedure of the package operation

memory_cost :: proc "contextless" (page_count: u64) -> u64

memory_cost gives the pages that Memory_Create takes from a budget for an.

src/library/modus/contract/operation/operation.odin:2972

UNIT_NAMES global variable of the package errors

UNIT_NAMES := [Unit]string {...}

The words of each unit in a sentence: "the budget holds 10 pages".

src/library/modus/contract/errors/errors.odin:521

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

functions_compare procedure of the package module

functions_compare :: proc "contextless" (file: []u8, index: u32, other_file: []u8, other_index: u32) -> (difference: Difference, parameter: u32, expected, found: Described)

functions_compare compares the description of two exports in two.

src/library/modus/contract/module/error.odin:128

Check type of the package system_description

Check :: struct {...}

The result of a check: zero when each entry agrees.

src/library/modus/contract/system_description/system_description.odin:130

Module_Space type of the package system

Module_Space :: struct {...}

The modules that a loader put in one process.

src/library/modus/system/load.odin:246

load_error_text procedure of the package system

load_error_text :: proc "contextless" (writer: ^Writer, error: ^module.)

load_error_text writes a load error for a reader: one line or more, each.

src/library/modus/system/load.odin:1178

record_size procedure of the package isolated

record_size :: proc "contextless" (function: module.) -> (size: u64, ok: bool)

record_size gives the size of the argument record of an export.

src/library/modus/contract/isolated/isolated.odin:303

Keyboard_Layout type of the package settings

Keyboard_Layout :: enum u32 {...}

The layout of the keyboard: the character that the input service gives.

src/library/modus/contract/settings/settings.odin:177