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
src/library/modus/contract/operation1 byte1 byte- Named by
src/library/modus/contract/operation/forms.odin:14
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Value | 1 | 0x1 |
Handle | 2 | 0x2 |
Handle_Or_Zero | 3 | 0x3 |
Address | 4 | 0x4 |
Count | 5 | 0x5 |
Flags | 6 | 0x6 |
Choice | 7 | 0x7 |
Bounded | 8 | 0x8 |
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
src/library/modus/contract/operation32 bytes8 bytes2 bytes- On the target
stringhas the size of an address of the target: the sizes here are those of linux amd64, where the page was madesrc/library/modus/contract/operation/forms.odin:30
| Field | Type | Offset | Size |
|---|---|---|---|
name | 0 | 16 | |
form | 16 | 1 | |
kind | 17 | 1 | |
| padding | 18 | 2 | |
rights | 20 | 4 | |
limit | 24 | 8 |
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
src/library/modus/contract/operation240 bytes8 bytes0 bytes- On the target
stringhas the size of an address of the target: the sizes here are those of linux amd64, where the page was madesrc/library/modus/contract/operation/forms.odin:41
| Field | Type | Offset | Size |
|---|---|---|---|
name | 0 | 16 | |
parameters | [7]Parameter_Form | 16 | 224 |
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
src/library/modus/contract/operation24 bytes8 bytes0 bytessrc/library/modus/contract/operation/error_details.odin:32
| Field | Type | Offset | Size |
|---|---|---|---|
address | 0 | 8 | |
count | 8 | 8 | |
capacity | 16 | 8 |
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
src/library/modus/contract/operation24 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:129
| Field | Type | Offset | Size |
|---|---|---|---|
milliseconds | 0 | 8 | |
cycle_frequency | 8 | 8 | |
cycle_start | 16 | 8 |
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
src/library/modus/contract/operation4 bytes4 bytessrc/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
src/library/modus/contract/operation4 bytes4 bytes- Named by
src/library/modus/contract/operation/operation.odin:175
| Member | Value | Hexadecimal |
|---|---|---|
Give | 0 | 0x0 |
Read | 1 | 0x1 |
Write | 2 | 0x2 |
Execute | 3 | 0x3 |
Control | 4 | 0x4 |
Inspect | 5 | 0x5 |
Devices | 6 | 0x6 |
Stop | 7 | 0x7 |
Spend | 8 | 0x8 |
Physical | 9 | 0x9 |
Schedule | 10 | 0xA |
Commit | 11 | 0xB |
Events | 12 | 0xC |
Debug | 13 | 0xD |
Counters | 14 | 0xE |
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
bit_set[Right; u32]src/library/modus/contract/operation4 bytes4 bytes- Named by
src/library/modus/contract/operation/operation.odin:214
| Bit | Member | Mask |
|---|---|---|
| 0 | Give | 0x1 |
| 1 | Read | 0x2 |
| 2 | Write | 0x4 |
| 3 | Execute | 0x8 |
| 4 | Control | 0x10 |
| 5 | Inspect | 0x20 |
| 6 | Devices | 0x40 |
| 7 | Stop | 0x80 |
| 8 | Spend | 0x100 |
| 9 | Physical | 0x200 |
| 10 | Schedule | 0x400 |
| 11 | Commit | 0x800 |
| 12 | Events | 0x1000 |
| 13 | Debug | 0x2000 |
| 14 | Counters | 0x4000 |
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
src/library/modus/contract/operation1 byte1 byte- Named by
src/library/modus/contract/operation/operation.odin:218
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Memory | 1 | 0x1 |
Process | 2 | 0x2 |
Interrupt | 3 | 0x3 |
Ports | 4 | 0x4 |
Machine | 5 | 0x5 |
Thread | 6 | 0x6 |
Budget | 7 | 0x7 |
Log | 8 | 0x8 |
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, ®isters)
// ```
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
src/library/modus/contract/operation4 bytes4 bytessrc/library/modus/contract/operation/operation.odin:256
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Log | 1 | 0x1 |
Memory_Create | 2 | 0x2 |
Memory_Map | 3 | 0x3 |
Memory_Unmap | 4 | 0x4 |
Memory_Size | 5 | 0x5 |
Process_Create | 6 | 0x6 |
Process_Start | 7 | 0x7 |
Process_Stop | 8 | 0x8 |
Process_State | 9 | 0x9 |
Handle_Give | 10 | 0xA |
Handle_Close | 11 | 0xB |
Interrupt_Read | 12 | 0xC |
Device_Create | 13 | 0xD |
Inspect | 14 | 0xE |
Machine_Stop | 15 | 0xF |
Thread_Create | 16 | 0x10 |
Thread_Stop | 17 | 0x11 |
Thread_State | 18 | 0x12 |
Word_Wait | 19 | 0x13 |
Word_Wake | 20 | 0x14 |
Budget_Create | 21 | 0x15 |
Budget_Read | 22 | 0x16 |
Handle_State | 23 | 0x17 |
Handle_Revoke | 24 | 0x18 |
Memory_Physical | 25 | 0x19 |
Process_Module | 26 | 0x1A |
Strategy_Set | 27 | 0x1B |
Memory_Commit | 28 | 0x1C |
Memory_Protect | 29 | 0x1D |
Fault_Handler_Set | 30 | 0x1E |
Fault_Answer | 31 | 0x1F |
Events_Set | 32 | 0x20 |
Thread_Control | 33 | 0x21 |
Guest_Run | 34 | 0x22 |
Log_Read | 35 | 0x23 |
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
src/library/modus/contract/operation4 bytes4 bytes- Named by
src/library/modus/contract/operation/operation.odin:1369
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Round_Robin | 1 | 0x1 |
Fair | 2 | 0x2 |
Eevdf | 3 | 0x3 |
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
src/library/modus/contract/operation88 bytes8 bytes0 bytes- Named by
src/library/modus/contract/operation/operation.odin:1692
| Field | Type | Offset | Size |
|---|---|---|---|
base | 0 | 8 | |
size | 8 | 8 | |
hash | [32]u8 | 16 | 32 |
replaces | [32]u8 | 48 | 32 |
writer | 80 | 8 |
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
src/library/modus/contract/operation8 bytes8 bytessrc/library/modus/contract/operation/operation.odin:1709
| Member | Value | Hexadecimal |
|---|---|---|
Process | 0 | 0x0 |
Starter | 1 | 0x1 |
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
src/library/modus/contract/operation960 bytes8 bytes0 bytes- Named by
src/library/modus/contract/operation/operation.odin:1763
| Field | Type | Offset | Size |
|---|---|---|---|
cause | 0 | 4 | |
vector | 4 | 4 | |
instruction | 8 | 8 | |
address | 16 | 8 | |
module | 24 | 88 | |
frame_count | 112 | 8 | |
frames | [16]Stop_Frame | 120 | 768 |
process_serial | 888 | 8 | |
hidden_value_count | 896 | 8 | |
error | 904 | 56 |
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
src/library/modus/contract/operation48 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:1802
| Field | Type | Offset | Size |
|---|---|---|---|
address | 0 | 8 | |
base | 8 | 8 | |
hash | [32]u8 | 16 | 32 |
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
src/library/modus/contract/operation1424 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:1811
| Field | Type | Offset | Size |
|---|---|---|---|
count | 0 | 8 | |
modules | [16]Module_Record | 8 | 1408 |
process_serial | 1416 | 8 |
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
src/library/modus/contract/operation40 bytes8 bytes0 bytes- Named by
src/library/modus/contract/operation/operation.odin:1849
| Field | Type | Offset | Size |
|---|---|---|---|
pages | 0 | 8 | |
processes | 8 | 8 | |
threads | 16 | 8 | |
processor | 24 | 8 | |
log_records | 32 | 8 |
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
src/library/modus/contract/operation16 bytes8 bytes0 bytes- Named by
src/library/modus/contract/operation/operation.odin:1865
| Field | Type | Offset | Size |
|---|---|---|---|
address | 0 | 8 | |
value | 8 | 8 |
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
src/library/modus/contract/operation1072 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:1895
| Field | Type | Offset | Size |
|---|---|---|---|
self | 0 | 8 | |
parameter | 8 | 8 | |
number | 16 | 8 | |
events | 24 | 4 | |
processors | 28 | 4 | |
fault_written | 32 | 4 | |
fault_read | 36 | 4 | |
fault_full | 40 | 4 | |
fault_reserved | 44 | 4 | |
fault_records | [16]Fault_Record | 48 | 1024 |
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
src/library/modus/contract/operation64 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:1941
| Field | Type | Offset | Size |
|---|---|---|---|
thread | 0 | 8 | |
serial | 8 | 8 | |
address | 16 | 8 | |
access | 24 | 8 | |
instruction | 32 | 8 | |
kind | 40 | 8 | |
error_code | 48 | 8 | |
reserved | 56 | 8 |
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
src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:2099
| Member | Value | Hexadecimal |
|---|---|---|
Present | 0 | 0x0 |
Write | 1 | 0x1 |
Execute | 4 | 0x4 |
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
bit_set[Fault_Access_Bit; u64]src/library/modus/contract/operation8 bytes8 bytessrc/library/modus/contract/operation/operation.odin:2106
| Bit | Member | Mask |
|---|---|---|
| 0 | Present | 0x1 |
| 1 | Write | 0x2 |
| 4 | Execute | 0x10 |
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
src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:1974
| Member | Value | Hexadecimal |
|---|---|---|
Divide_Error | 0 | 0x0 |
Debug | 1 | 0x1 |
Breakpoint | 3 | 0x3 |
Invalid_Opcode | 6 | 0x6 |
Segment_Not_Present | 11 | 0xB |
Stack_Fault | 12 | 0xC |
General_Protection | 13 | 0xD |
Page_Fault | 14 | 0xE |
X87_Floating_Point | 16 | 0x10 |
Alignment_Check | 17 | 0x11 |
Simd_Floating_Point | 19 | 0x13 |
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
bit_set[Fault_Kind; u64]src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:2002
| Bit | Member | Mask |
|---|---|---|
| 0 | Divide_Error | 0x1 |
| 1 | Debug | 0x2 |
| 3 | Breakpoint | 0x8 |
| 6 | Invalid_Opcode | 0x40 |
| 11 | Segment_Not_Present | 0x800 |
| 12 | Stack_Fault | 0x1000 |
| 13 | General_Protection | 0x2000 |
| 14 | Page_Fault | 0x4000 |
| 16 | X87_Floating_Point | 0x10000 |
| 17 | Alignment_Check | 0x20000 |
| 19 | Simd_Floating_Point | 0x80000 |
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
src/library/modus/contract/operation1 byte1 bytesrc/library/modus/contract/operation/operation.odin:2041
| Member | Value | Hexadecimal |
|---|---|---|
Never_Delivered | 0 | 0x0 |
Fault | 1 | 0x1 |
Trap | 2 | 0x2 |
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
src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:2112
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Resume | 1 | 0x1 |
Stop | 2 | 0x2 |
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
src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:2133
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Stop | 1 | 0x1 |
Resume | 2 | 0x2 |
Read_Registers | 3 | 0x3 |
Write_Registers | 4 | 0x4 |
Read_Extended_State | 5 | 0x5 |
Write_Extended_State | 6 | 0x6 |
Read_Schedule | 7 | 0x7 |
Write_Schedule | 8 | 0x8 |
Read_Breakpoints | 9 | 0x9 |
Write_Breakpoints | 10 | 0xA |
Read_Memory | 11 | 0xB |
Read_Placement | 12 | 0xC |
Write_Placement | 13 | 0xD |
Read_Process_Schedule | 14 | 0xE |
Write_Process_Schedule | 15 | 0xF |
Start_Counters | 16 | 0x10 |
Read_Counters | 17 | 0x11 |
Stop_Counters | 18 | 0x12 |
Record_Start | 19 | 0x13 |
Record_End | 20 | 0x14 |
Replay_Start | 21 | 0x15 |
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
src/library/modus/contract/operation1 byte1 bytesrc/library/modus/contract/operation/thread_control_state.odin:11
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Thread_Absent | 1 | 0x1 |
Process_Absent | 2 | 0x2 |
Thread_Ended | 3 | 0x3 |
Process_Stopped | 4 | 0x4 |
Not_Debugger | 5 | 0x5 |
Stop_Count_Limit | 6 | 0x6 |
Not_Stopped | 7 | 0x7 |
Not_Held | 8 | 0x8 |
Counters_Not_Started | 9 | 0x9 |
Thread_Recording | 10 | 0xA |
Process_Recording | 11 | 0xB |
Process_Not_Created | 12 | 0xC |
Process_Disqualified | 13 | 0xD |
History_In_Use | 14 | 0xE |
No_Pinned_Processor | 15 | 0xF |
Not_Recording | 16 | 0x10 |
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
src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:2093
| Member | Value | Hexadecimal |
|---|---|---|
Set | 0 | 0x0 |
End | 1 | 0x1 |
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
src/library/modus/contract/operation8 bytes8 bytessrc/library/modus/contract/operation/operation.odin:2639
| Member | Value | Hexadecimal |
|---|---|---|
Legacy | 0 | 0x0 |
With_Header | 1 | 0x1 |
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
src/library/modus/contract/operation176 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:2546
| Field | Type | Offset | Size |
|---|---|---|---|
rax | 0 | 8 | |
rbx | 8 | 8 | |
rcx | 16 | 8 | |
rdx | 24 | 8 | |
rsi | 32 | 8 | |
rdi | 40 | 8 | |
rbp | 48 | 8 | |
rsp | 56 | 8 | |
r8 | 64 | 8 | |
r9 | 72 | 8 | |
r10 | 80 | 8 | |
r11 | 88 | 8 | |
r12 | 96 | 8 | |
r13 | 104 | 8 | |
r14 | 112 | 8 | |
r15 | 120 | 8 | |
rip | 128 | 8 | |
rflags | 136 | 8 | |
cs | 144 | 8 | |
ss | 152 | 8 | |
in_kernel_entry | 160 | 8 | |
reserved | 168 | 8 |
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
src/library/modus/contract/operation8 bytes8 bytessrc/library/modus/contract/operation/operation.odin:2589
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Code_Selector | 1 | 0x1 |
Stack_Selector | 2 | 0x2 |
Flags | 3 | 0x3 |
Instruction_Address | 4 | 0x4 |
Stack_Address | 5 | 0x5 |
Mxcsr | 6 | 0x6 |
Header_Components | 7 | 0x7 |
Header_Reserved | 8 | 0x8 |
Weight | 9 | 0x9 |
Request | 10 | 0xA |
Weight_Limit | 11 | 0xB |
Breakpoint_Kind | 12 | 0xC |
Breakpoint_Length | 13 | 0xD |
Breakpoint_Address | 14 | 0xE |
Processors | 15 | 0xF |
Processors_Limit | 16 | 0x10 |
New_Thread_Weight_Limit | 17 | 0x11 |
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_limitandnew_thread_weight_limitare 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_FULLfor the limit, the limit for the weight and for the new-thread weight limit,REQUEST_DEFAULTfor 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
src/library/modus/contract/operation16 bytes4 bytes0 bytessrc/library/modus/contract/operation/operation.odin:1438
| Field | Type | Offset | Size |
|---|---|---|---|
weight | 0 | 4 | |
request | 4 | 4 | |
weight_limit | 8 | 4 | |
new_thread_weight_limit | 12 | 4 |
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
src/library/modus/contract/operation4 bytes4 bytes0 bytessrc/library/modus/contract/operation/operation.odin:1474
| Field | Type | Offset | Size |
|---|---|---|---|
new_thread_weight_limit | 0 | 4 |
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_limitis 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
src/library/modus/contract/operation16 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:1587
| Field | Type | Offset | Size |
|---|---|---|---|
processors | 0 | 8 | |
processors_limit | 8 | 8 |
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
src/library/modus/contract/operation32 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:2304
| Field | Type | Offset | Size |
|---|---|---|---|
instructions_retired | 0 | 8 | |
cycles | 8 | 8 | |
cache_misses | 16 | 8 | |
branch_misses | 24 | 8 |
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
src/library/modus/contract/operation4 bytes4 bytes- Named by
src/library/modus/contract/operation/operation.odin:2417
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Execute | 1 | 0x1 |
Write | 2 | 0x2 |
Read_Or_Write | 3 | 0x3 |
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
src/library/modus/contract/operation16 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:2431
| Field | Type | Offset | Size |
|---|---|---|---|
address | 0 | 8 | |
kind | 8 | 4 | |
length | 12 | 4 |
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
src/library/modus/contract/operation64 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:2445
| Field | Type | Offset | Size |
|---|---|---|---|
breakpoints | [4]Thread_Breakpoint | 0 | 64 |
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
src/library/modus/contract/operation4 bytes4 bytessrc/library/modus/contract/operation/operation.odin:2706
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Operation | 1 | 0x1 |
Switch | 2 | 0x2 |
Fault | 3 | 0x3 |
Lock_Wait | 4 | 0x4 |
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
src/library/modus/contract/operation8 bytes8 bytessrc/library/modus/contract/operation/operation.odin:2729
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
First_Use | 1 | 0x1 |
Fault_Ring | 2 | 0x2 |
Stopped | 3 | 0x3 |
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
src/library/modus/contract/operation4 bytes4 bytes- Named by
src/library/modus/contract/operation/operation.odin:2738
| Member | Value | Hexadecimal |
|---|---|---|
Match_Detail | 0 | 0x0 |
Event_Rule_Flags
Event_Rule_Flags :: bit_set[;u32]
The flags of one .
- Kind
- bit set
bit_set[Event_Rule_Flag; u32]src/library/modus/contract/operation4 bytes4 bytes- Named by
src/library/modus/contract/operation/operation.odin:2742
| Bit | Member | Mask |
|---|---|---|
| 0 | Match_Detail | 0x1 |
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
src/library/modus/contract/operation64 bytes8 bytes0 bytes- Named by
src/library/modus/contract/operation/operation.odin:2762
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 4 | |
flags | 4 | 4 | |
process | 8 | 8 | |
detail | 16 | 8 | |
least_nanoseconds | 24 | 8 | |
one_in | 32 | 8 | |
reserved | [3]u64 | 40 | 24 |
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
src/library/modus/contract/operation64 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:2835
| Field | Type | Offset | Size |
|---|---|---|---|
time | 0 | 8 | |
kind | 8 | 4 | |
processor | 12 | 4 | |
process | 16 | 4 | |
thread | 20 | 4 | |
process_serial | 24 | 8 | |
detail | 32 | 8 | |
value_0 | 40 | 8 | |
value_1 | 48 | 8 | |
reserved | 56 | 8 |
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
src/library/modus/contract/operation128 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:2864
| Field | Type | Offset | Size |
|---|---|---|---|
written | 0 | 8 | |
lost | 8 | 8 | |
records | 16 | 8 | |
processor | 24 | 8 | |
reserved_kernel | [4]u64 | 32 | 32 |
read | 64 | 8 | |
reserved_process | [7]u64 | 72 | 56 |
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.
- Kind
- struct
src/library/modus/contract/operation240 bytes8 bytes0 bytes- Named by
src/library/modus/contract/operation/guest_registers.odin:90
| Field | Type | Offset | Size |
|---|---|---|---|
rax | 0 | 8 | |
rbx | 8 | 8 | |
rcx | 16 | 8 | |
rdx | 24 | 8 | |
rsi | 32 | 8 | |
rdi | 40 | 8 | |
rbp | 48 | 8 | |
rsp | 56 | 8 | |
r8 | 64 | 8 | |
r9 | 72 | 8 | |
r10 | 80 | 8 | |
r11 | 88 | 8 | |
r12 | 96 | 8 | |
r13 | 104 | 8 | |
r14 | 112 | 8 | |
r15 | 120 | 8 | |
rip | 128 | 8 | |
rflags | 136 | 8 | |
cr0 | 144 | 8 | |
cr3 | 152 | 8 | |
cr4 | 160 | 8 | |
efer | 168 | 8 | |
inject_error_code | 176 | 4 | |
inject_vector | 180 | 1 | |
inject_kind | 181 | 1 | |
inject_error_code_valid | 182 | 1 | |
mode_load | 183 | 1 | |
code_selector | 184 | 2 | |
data_selector | 186 | 2 | |
interrupt_shadow | 188 | 1 | |
event_pending | 189 | 1 | |
reserved | [2]u8 | 190 | 2 |
star | 192 | 8 | |
lstar | 200 | 8 | |
sfmask | 208 | 8 | |
fs_base | 216 | 8 | |
gs_base | 224 | 8 | |
kernel_gs_base | 232 | 8 |
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
src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:1653
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Port_Write | 1 | 0x1 |
Port_Read | 2 | 0x2 |
Halt | 3 | 0x3 |
Cpuid | 4 | 0x4 |
Memory | 5 | 0x5 |
Interrupted | 6 | 0x6 |
Shutdown | 7 | 0x7 |
Refused_State | 8 | 0x8 |
Other | 9 | 0x9 |
Interrupt_Window | 10 | 0xA |
Writes_Own_Page | 11 | 0xB |
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
src/library/modus/contract/operation1 byte1 byte- Named by
src/library/modus/contract/operation/guest_registers.odin:29
| Member | Value | Hexadecimal |
|---|---|---|
Keep | 0 | 0x0 |
Real_16 | 1 | 0x1 |
Protected_32 | 2 | 0x2 |
Long_64 | 3 | 0x3 |
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
src/library/modus/contract/operation1 byte1 byte- Named by
src/library/modus/contract/operation/guest_registers.odin:52
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
External_Interrupt | 1 | 0x1 |
Non_Maskable_Interrupt | 2 | 0x2 |
Exception | 3 | 0x3 |
Software_Interrupt | 4 | 0x4 |
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
src/library/modus/contract/operation1 byte1 bytesrc/library/modus/contract/operation/guest_registers.odin:177
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Flags | 1 | 0x1 |
Control_0 | 2 | 0x2 |
Control_3 | 3 | 0x3 |
Control_4 | 4 | 0x4 |
Efer | 5 | 0x5 |
Long_Mode | 6 | 0x6 |
Instruction_Address | 7 | 0x7 |
Mode_Load | 8 | 0x8 |
Inject_Kind | 9 | 0x9 |
Inject_Vector | 10 | 0xA |
Inject_Error_Code | 11 | 0xB |
Reserved | 12 | 0xC |
System_Call_Address | 13 | 0xD |
System_Call_Mask | 14 | 0xE |
Segment_Base | 15 | 0xF |
Interrupt_Shadow | 16 | 0x10 |
Inject_In_Interrupt_Shadow | 17 | 0x11 |
Event_Pending | 18 | 0x12 |
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
src/library/modus/contract/operation2 bytes1 byte0 bytessrc/library/modus/contract/operation/guest_registers.odin:219
| Field | Type | Offset | Size |
|---|---|---|---|
mode_load | 0 | 1 | |
inject_kind | 1 | 1 |
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
src/library/modus/contract/operation4 bytes4 bytessrc/library/modus/contract/operation/operation.odin:2894
| Member | Value | Hexadecimal |
|---|---|---|
Ok | 0 | 0x0 |
Bad_Operation | 1 | 0x1 |
Bad_Handle | 2 | 0x2 |
Bad_Address | 3 | 0x3 |
No_Memory | 4 | 0x4 |
No_Slot | 5 | 0x5 |
Bad_State | 6 | 0x6 |
No_Right | 7 | 0x7 |
No_Budget | 8 | 0x8 |
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
src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:2983
| Member | Value | Hexadecimal |
|---|---|---|
Frames_Now | 0 | 0x0 |
Contiguous | 1 | 0x1 |
Uncommitted | 2 | 0x2 |
Large_Pages | 3 | 0x3 |
Memory_Flags
Memory_Flags :: bit_set[;u64]
The flags of one Memory_Create. Example: {.Frames_Now}.
- Kind
- bit set
bit_set[Memory_Flag; u64]src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:2999
| Bit | Member | Mask |
|---|---|---|
| 0 | Frames_Now | 0x1 |
| 1 | Contiguous | 0x2 |
| 2 | Uncommitted | 0x4 |
| 3 | Large_Pages | 0x8 |
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
src/library/modus/contract/operation16 bytes8 bytes0 bytes- Named by
src/library/modus/contract/operation/operation.odin:3017
| Field | Type | Offset | Size |
|---|---|---|---|
first | 0 | 8 | |
page_count | 8 | 8 |
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
src/library/modus/contract/operation16 bytes8 bytes0 bytes- Named by
src/library/modus/contract/operation/operation.odin:3027
| Field | Type | Offset | Size |
|---|---|---|---|
address | 0 | 8 | |
page_count | 8 | 8 |
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
src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:3033
| Member | Value | Hexadecimal |
|---|---|---|
Decommit | 0 | 0x0 |
Commit_Flags
Commit_Flags :: bit_set[;u64]
The flags of one Memory_Commit: {} commits, {.Decommit} decommits.
- Kind
- bit set
bit_set[Commit_Flag; u64]src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:3037
| Bit | Member | Mask |
|---|---|---|
| 0 | Decommit | 0x1 |
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
src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:3043
| Member | Value | Hexadecimal |
|---|---|---|
Write | 0 | 0x0 |
Execute | 1 | 0x1 |
No_Access | 2 | 0x2 |
Receive_Handles | 3 | 0x3 |
At_Address_Zero | 4 | 0x4 |
Write_Combining | 5 | 0x5 |
Map_Flags
Map_Flags :: bit_set[;u64]
The flags of one Memory_Map or Memory_Protect. Example: {.Write}.
- Kind
- bit set
bit_set[Map_Flag; u64]src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:3059
| Bit | Member | Mask |
|---|---|---|
| 0 | Write | 0x1 |
| 1 | Execute | 0x2 |
| 2 | No_Access | 0x4 |
| 3 | Receive_Handles | 0x8 |
| 4 | At_Address_Zero | 0x10 |
| 5 | Write_Combining | 0x20 |
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
src/library/modus/contract/operation4 bytes4 bytes- Named by
src/library/modus/contract/operation/operation.odin:3092
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Created | 1 | 0x1 |
Ready | 2 | 0x2 |
Waiting | 3 | 0x3 |
Stopped | 4 | 0x4 |
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
src/library/modus/contract/operation4 bytes4 bytes- Named by
src/library/modus/contract/operation/stop_cause.odin:16
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Itself | 1 | 0x1 |
Holder | 2 | 0x2 |
Last_Thread_Ended | 3 | 0x3 |
Handles_Closed | 4 | 0x4 |
Fault | 5 | 0x5 |
Not_Committed | 6 | 0x6 |
Cannot_Return | 7 | 0x7 |
Fault_Unanswered | 8 | 0x8 |
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
src/library/modus/contract/operation4 bytes4 bytes- Named by
src/library/modus/contract/operation/stop_outcome.odin:20
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Done | 1 | 0x1 |
Failed | 2 | 0x2 |
Refused | 3 | 0x3 |
Stopped_On_Request | 4 | 0x4 |
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
src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:3105
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Ports | 1 | 0x1 |
Interrupt | 2 | 0x2 |
Memory | 3 | 0x3 |
Message | 4 | 0x4 |
Display_Memory | 5 | 0x5 |
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
src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:3126
| Member | Value | Hexadecimal |
|---|---|---|
Domain | 0 | 0x0 |
Windows | 1 | 0x1 |
Device_Memory_Facts
Device_Memory_Facts :: bit_set[; u64]
- Kind
- bit set
bit_set[Device_Memory_Fact; u64]src/library/modus/contract/operation8 bytes8 bytessrc/library/modus/contract/operation/operation.odin:3130
| Bit | Member | Mask |
|---|---|---|
| 0 | Domain | 0x1 |
| 1 | Windows | 0x2 |
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
src/library/modus/contract/operation8 bytes8 bytes- Named by
src/library/modus/contract/operation/operation.odin:3140
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
System | 1 | 0x1 |
Process | 2 | 0x2 |
Processor | 3 | 0x3 |
Boot | 4 | 0x4 |
Mappings | 5 | 0x5 |
Modules | 6 | 0x6 |
Process_Mappings | 7 | 0x7 |
Threads | 8 | 0x8 |
Stop | 9 | 0x9 |
Pages | 10 | 0xA |
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
src/library/modus/contract/operation4 bytes4 bytessrc/library/modus/contract/operation/operation.odin:3173
| Member | Value | Hexadecimal |
|---|---|---|
Write | 0 | 0x0 |
Execute | 1 | 0x1 |
Uncached | 2 | 0x2 |
Device | 3 | 0x3 |
Contiguous | 4 | 0x4 |
Shared | 5 | 0x5 |
Thread_Area | 6 | 0x6 |
Uncommitted | 7 | 0x7 |
Large | 8 | 0x8 |
Protected | 9 | 0x9 |
No_Access | 10 | 0xA |
Write_Combining | 11 | 0xB |
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
src/library/modus/contract/operation64 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3194
| Field | Type | Offset | Size |
|---|---|---|---|
address | 0 | 8 | |
page_count | 8 | 8 | |
first | 16 | 8 | |
present | 24 | 8 | |
region_pages | 32 | 8 | |
region_serial | 40 | 8 | |
flags | bit_set[Process_Mapping_Flag; u32] | 48 | 4 |
references | 52 | 4 | |
committed | 56 | 8 |
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
src/library/modus/contract/operation8208 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3216
| Field | Type | Offset | Size |
|---|---|---|---|
process_serial | 0 | 8 | |
count | 8 | 8 | |
mappings | [128]Process_Mapping | 16 | 8192 |
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
src/library/modus/contract/operation80 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3225
| Field | Type | Offset | Size |
|---|---|---|---|
machine_number | 0 | 8 | |
number | 8 | 4 | |
state | 12 | 4 | |
processor | 16 | 4 | |
home | 20 | 4 | |
weight | 24 | 4 | |
request | 28 | 4 | |
words | 32 | 4 | |
queued | 36 | 4 | |
virtual | 40 | 8 | |
virtual_deadline | 48 | 8 | |
lag | 56 | 8 | |
run_time | 64 | 8 | |
deadline | 72 | 8 |
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
src/library/modus/contract/operation2576 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3249
| Field | Type | Offset | Size |
|---|---|---|---|
process_serial | 0 | 8 | |
count | 8 | 8 | |
threads | [32]Thread_Report | 16 | 2560 |
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
src/library/modus/contract/operation24 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3269
| Field | Type | Offset | Size |
|---|---|---|---|
address | 0 | 8 | |
present | 8 | 8 | |
mapped | 16 | 8 |
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
src/library/modus/contract/operation288 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3277
| Field | Type | Offset | Size |
|---|---|---|---|
time | 0 | 8 | |
page_count | 8 | 8 | |
free_pages | 16 | 8 | |
process_slots | 24 | 8 | |
region_count | 32 | 8 | |
entries | 40 | 8 | |
interrupts | 48 | 8 | |
budget_pages | 56 | 8 | |
processors | 64 | 8 | |
reserved_pages | 72 | 8 | |
first_use_faults | 80 | 8 | |
locks | [12]Lock_Count | 88 | 192 |
strategy | 280 | 4 | |
strategy_changes | 284 | 4 |
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
src/library/modus/contract/operation8 bytes8 bytessrc/library/modus/contract/operation/operation.odin:3300
| Member | Value | Hexadecimal |
|---|---|---|
Control | 0 | 0x0 |
Process | 1 | 0x1 |
Origin | 2 | 0x2 |
Region | 3 | 0x3 |
Frame | 4 | 0x4 |
Cache | 5 | 0x5 |
Log | 6 | 0x6 |
Wait | 7 | 0x7 |
Run | 8 | 0x8 |
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
src/library/modus/contract/operation16 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3331
| Field | Type | Offset | Size |
|---|---|---|---|
takes | 0 | 8 | |
waits | 8 | 8 |
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
src/library/modus/contract/operation120 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3338
| Field | Type | Offset | Size |
|---|---|---|---|
process | 0 | 8 | |
busy_time | 8 | 8 | |
same | 16 | 8 | |
apic_id | 24 | 8 | |
strategy | 32 | 4 | |
queued | 36 | 4 | |
picks | 40 | 8 | |
preemptions | 48 | 8 | |
moves | 56 | 8 | |
pick_cycles | 64 | 8 | |
interrupt_preemptions | 72 | 8 | |
preempt_cycles | 80 | 8 | |
cache_frames | 88 | 8 | |
cache_batches_taken | 96 | 8 | |
cache_batches_given | 104 | 8 | |
cache_drains | 112 | 8 |
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
src/library/modus/contract/operation1 byte1 byte- Named by
src/library/modus/contract/operation/operation.odin:3377
| Member | Value | Hexadecimal |
|---|---|---|
Info | 0 | 0x0 |
Debug | 1 | 0x1 |
Warning | 2 | 0x2 |
Error | 3 | 0x3 |
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
src/library/modus/contract/operation256 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3436
| Field | Type | Offset | Size |
|---|---|---|---|
written | 0 | 8 | |
capacity | 8 | 8 | |
reserved | [30]u64 | 16 | 240 |
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
src/library/modus/contract/operation256 bytes8 bytes0 bytes- Named by
src/library/modus/contract/operation/operation.odin:3460
| Field | Type | Offset | Size |
|---|---|---|---|
sequence | 0 | 8 | |
time | 8 | 8 | |
process | 16 | 1 | |
thread | 17 | 1 | |
level | 18 | 1 | |
more | 19 | 1 | |
process_serial | 20 | 4 | |
own_number | 24 | 4 | |
text_count | 28 | 2 | |
run_count | 30 | 1 | |
form | 31 | 1 | |
name | [32]u8 | 32 | 32 |
runs | [8]Value_Run | 64 | 24 |
text | [168]u8 | 88 | 168 |
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
src/library/modus/contract/operation1 byte1 byte- Named by
src/library/modus/contract/operation/operation.odin:3485
| Member | Value | Hexadecimal |
|---|---|---|
Text | 0 | 0x0 |
Fact | 1 | 0x1 |
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
src/library/modus/contract/operation192 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3518
| Field | Type | Offset | Size |
|---|---|---|---|
module_hash | [32]u8 | 0 | 32 |
key | 32 | 8 | |
value_count | 40 | 2 | |
part | 42 | 1 | |
part_count | 43 | 1 | |
reserved | [4]u8 | 44 | 4 |
values | [144]u8 | 48 | 144 |
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
src/library/modus/contract/operation1216 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3535
| Field | Type | Offset | Size |
|---|---|---|---|
module_hash | [32]u8 | 0 | 32 |
key | 32 | 8 | |
value_count | 40 | 2 | |
part | 42 | 1 | |
part_count | 43 | 1 | |
reserved | [4]u8 | 44 | 4 |
values | [1168]u8 | 48 | 1168 |
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
src/library/modus/contract/operation88 bytes8 bytes0 bytes- On the target
inthas the size of an address of the target: the sizes here are those of linux amd64, where the page was madesrc/library/modus/contract/operation/log_fact_join.odin:42
| Field | Type | Offset | Size |
|---|---|---|---|
number | 0 | 8 | |
writer | 8 | 8 | |
module_hash | [32]u8 | 16 | 32 |
key | 48 | 8 | |
part | 56 | 8 | |
part_count | 64 | 8 | |
values | 72 | 16 |
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
src/library/modus/contract/operation1256 bytes8 bytes7 bytes- On the target
inthas the size of an address of the target: the sizes here are those of linux amd64, where the page was madesrc/library/modus/contract/operation/log_fact_join.odin:54
| Field | Type | Offset | Size |
|---|---|---|---|
open | 0 | 1 | |
| padding | 1 | 7 | |
number | 8 | 8 | |
writer | 16 | 8 | |
module_hash | [32]u8 | 24 | 32 |
key | 56 | 8 | |
part_count | 64 | 8 | |
next_part | 72 | 8 | |
value_count | 80 | 8 | |
values | [1168]u8 | 88 | 1168 |
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
src/library/modus/contract/operation1 byte1 bytesrc/library/modus/contract/operation/log_fact_join.odin:31
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Part_Without_First | 1 | 0x1 |
Missing_Part | 2 | 0x2 |
Other_Process | 3 | 0x3 |
Other_Fact | 4 | 0x4 |
Part_Count | 5 | 0x5 |
Value_Count | 6 | 0x6 |
Status_Word
Status_Word :: distinct u64
The word of a Status: a Status has 4 bytes.
- Kind
- distinct
src/library/modus/contract/operation8 bytes8 bytes- Named by
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
src/library/modus/contract/operation8 bytes8 bytessrc/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
src/library/modus/contract/operation8 bytes8 bytessrc/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
src/library/modus/contract/operation8 bytes8 bytessrc/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
src/library/modus/contract/operation8 bytes8 bytessrc/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
src/library/modus/contract/operation8 bytes8 bytessrc/library/modus/contract/operation/operation.odin:3580
| Member | Value | Hexadecimal |
|---|---|---|
Write | 0 | 0x0 |
Execute | 1 | 0x1 |
Process | 2 | 0x2 |
Large | 3 | 0x3 |
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
src/library/modus/contract/operation24 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3589
| Field | Type | Offset | Size |
|---|---|---|---|
start | 0 | 8 | |
page_count | 8 | 8 | |
flags | bit_set[Mapping_Flag; u64] | 16 | 8 |
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
src/library/modus/contract/operation2376 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3606
| Field | Type | Offset | Size |
|---|---|---|---|
run_count | 0 | 8 | |
runs | [96]Mapping_Run | 8 | 2304 |
pages | 2312 | 8 | |
write_pages | 2320 | 8 | |
execute_pages | 2328 | 8 | |
write_execute_pages | 2336 | 8 | |
guard_pages | 2344 | 8 | |
guards_expected | 2352 | 8 | |
kernel_guard | 2360 | 8 | |
kernel_no_execute | 2368 | 8 |
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
src/library/modus/contract/operation64 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3626
| Field | Type | Offset | Size |
|---|---|---|---|
name | [48]u8 | 0 | 48 |
start | 48 | 8 | |
duration | 56 | 8 |
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
src/library/modus/contract/operation24 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3634
| Field | Type | Offset | Size |
|---|---|---|---|
start | 0 | 8 | |
page_count | 8 | 8 | |
kind | 16 | 8 |
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
src/library/modus/contract/operation2720 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3674
| Field | Type | Offset | Size |
|---|---|---|---|
time | 0 | 8 | |
stage_count | 8 | 8 | |
stages | [12]Boot_Stage | 16 | 768 |
range_count | 784 | 8 | |
ranges | [64]Boot_Range | 792 | 1536 |
firmware_ranges | 2328 | 8 | |
firmware_vendor | [32]u8 | 2336 | 32 |
firmware_revision | 2368 | 8 | |
framebuffer_address | 2376 | 8 | |
framebuffer_width | 2384 | 8 | |
framebuffer_height | 2392 | 8 | |
framebuffer_line | 2400 | 8 | |
framebuffer_format | 2408 | 8 | |
kernel_size | 2416 | 8 | |
kernel_file_size | 2424 | 8 | |
boot_image_size | 2432 | 8 | |
direct_map_size | 2440 | 8 | |
acpi_root | 2448 | 8 | |
cycle_frequency | 2456 | 8 | |
timer_frequency | 2464 | 8 | |
trust | Boot_Trust | 2472 | 224 |
iommu_unit_count | 2696 | 8 | |
start_request | 2704 | 8 | |
start_request_source | 2712 | 8 |
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
src/library/modus/contract/operation176 bytes8 bytes4 bytessrc/library/modus/contract/operation/operation.odin:3711
| Field | Type | Offset | Size |
|---|---|---|---|
state | 0 | 4 | |
stop_cause | 4 | 4 | |
stop_outcome | 8 | 4 | |
name | [32]u8 | 12 | 32 |
| padding | 44 | 4 | |
mapped_pages | 48 | 8 | |
handle_count | 56 | 8 | |
run_time | 64 | 8 | |
entries | 72 | 8 | |
thread_count | 80 | 8 | |
start_time | 88 | 8 | |
budget | 96 | 40 | |
present_pages | 136 | 8 | |
process_serial | 144 | 8 | |
handles_peak | 152 | 8 | |
mapping_count | 160 | 8 | |
mappings_peak | 168 | 8 |
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
src/library/modus/contract/operation272 bytes8 bytes0 bytessrc/library/modus/contract/operation/operation.odin:3790
| Field | Type | Offset | Size |
|---|---|---|---|
handles | [20]Handle | 0 | 80 |
values | [24]u64 | 80 | 192 |
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
src/library/modus/contract/operation1 byte1 bytesrc/library/modus/contract/operation/operation.odin:3830
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Weak | 1 | 0x1 |
Processor | 2 | 0x2 |
Entropy | 3 | 0x3 |
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
src/library/modus/contract/errors56 bytes8 bytes0 bytes- Named by
src/library/modus/contract/errors/errors.odin:47
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
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
src/library/modus/contract/errors8 bytes8 bytessrc/library/modus/contract/errors/errors.odin:65
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Empty | 1 | 0x1 |
Too_Long | 2 | 0x2 |
Too_Small | 3 | 0x3 |
Bad_Value | 4 | 0x4 |
Bad_Flags | 5 | 0x5 |
Bad_Byte | 6 | 0x6 |
Bad_Address | 7 | 0x7 |
Handle_Absent | 8 | 0x8 |
Handle_Ended | 9 | 0x9 |
Handle_Kind | 10 | 0xA |
Handle_Rights | 11 | 0xB |
Budget | 12 | 0xC |
Budget_Hidden | 13 | 0xD |
Over_Limit | 14 | 0xE |
Full | 15 | 0xF |
State | 16 | 0x10 |
Absent | 17 | 0x11 |
Damaged | 18 | 0x12 |
Device | 19 | 0x13 |
No_Grant | 20 | 0x14 |
Malformed | 21 | 0x15 |
No_Target | 22 | 0x16 |
Overlap | 23 | 0x17 |
Unknown_Operation | 24 | 0x18 |
Refused | 25 | 0x19 |
No_Answer | 26 | 0x1A |
Unsupported | 27 | 0x1B |
Link_Down | 28 | 0x1C |
Busy | 29 | 0x1D |
Out_Of_Range | 30 | 0x1E |
Reserved | 31 | 0x1F |
Not_Payer | 32 | 0x20 |
Object_Shared | 33 | 0x21 |
Object_Marked | 34 | 0x22 |
Whole_Only | 35 | 0x23 |
Not_Multiple | 36 | 0x24 |
Not_Authentic | 37 | 0x25 |
Seed_Too_Weak | 38 | 0x26 |
Exists | 39 | 0x27 |
Starter_Module | 40 | 0x28 |
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
src/library/modus/contract/errors8 bytes8 bytessrc/library/modus/contract/errors/errors.odin:243
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Bytes | 1 | 0x1 |
Pages | 2 | 0x2 |
Blocks | 3 | 0x3 |
Objects | 4 | 0x4 |
Stores | 5 | 0x5 |
Processes | 6 | 0x6 |
Threads | 7 | 0x7 |
Handles | 8 | 0x8 |
Mappings | 9 | 0x9 |
Modules | 10 | 0xA |
Words | 11 | 0xB |
Log_Records | 12 | 0xC |
Processor | 13 | 0xD |
Budgets | 14 | 0xE |
Interrupts | 15 | 0xF |
Memory | 16 | 0x10 |
Store | 17 | 0x11 |
Acts_For_Principal | 18 | 0x12 |
Records | 19 | 0x13 |
Connection | 20 | 0x14 |
Milliseconds | 21 | 0x15 |
Connections | 22 | 0x16 |
Tcp_Ports | 23 | 0x17 |
Requests | 24 | 0x18 |
Endpoint | 25 | 0x19 |
Region | 26 | 0x1A |
Root_Commands | 27 | 0x1B |
Services | 28 | 0x1C |
Grants | 29 | 0x1D |
Display | 30 | 0x1E |
Terminal | 31 | 0x1F |
Lent_Handles | 32 | 0x20 |
Versions | 33 | 0x21 |
Counts | 34 | 0x22 |
References | 35 | 0x23 |
Commit_Blocks | 36 | 0x24 |
Principals | 37 | 0x25 |
Places | 38 | 0x26 |
Trees | 39 | 0x27 |
Changes | 40 | 0x28 |
Pending | 41 | 0x29 |
Debug_Objects | 42 | 0x2A |
Breakpoints | 43 | 0x2B |
Held_Threads | 44 | 0x2C |
Debugged_Processes | 45 | 0x2D |
Readable_Variables | 46 | 0x2E |
Debug_Access | 47 | 0x2F |
Stack_Frames | 48 | 0x30 |
Source_Places | 49 | 0x31 |
Stop_Reports | 50 | 0x32 |
Versions_Erase | 51 | 0x33 |
Dropped_Writes | 52 | 0x34 |
Nanoseconds | 53 | 0x35 |
Frames | 54 | 0x36 |
Record_Types | 55 | 0x37 |
Wiring_Rows | 56 | 0x38 |
Wiring_Terms | 57 | 0x39 |
Wirings | 58 | 0x3A |
Input_Histories | 59 | 0x3B |
Checkpoints | 60 | 0x3C |
Recorded_Writes | 61 | 0x3D |
Kernel_Status | 62 | 0x3E |
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
src/library/modus/contract/errors8 bytes8 bytessrc/library/modus/contract/errors/errors.odin:484
| Member | Value | Hexadecimal |
|---|---|---|
Unknown | 0 | 0x0 |
Closed | 1 | 0x1 |
Revoked | 2 | 0x2 |
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
src/library/modus/contract/errors8 bytes8 bytessrc/library/modus/contract/errors/errors.odin:190
| Member | Value | Hexadecimal |
|---|---|---|
Not_Said | 0 | 0x0 |
Hardware_Address | 1 | 0x1 |
Echo | 2 | 0x2 |
Device | 3 | 0x3 |
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
src/library/modus/contract/errors56 bytes8 bytes0 bytessrc/library/modus/contract/errors/errors.odin:449
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
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
src/library/modus/contract/errors8 bytes8 bytes- Named by
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
src/library/modus/contract/errors8 bytes8 bytes- Named by
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
src/library/modus/contract/fixed_addresses1 byte1 byte- Named by
src/library/modus/contract/fixed_addresses/fixed_addresses.odin:69
| Member | Value | Hexadecimal |
|---|---|---|
Module_Files | 0 | 0x0 |
Pointer_Themes | 1 | 0x1 |
Settings_Page | 2 | 0x2 |
Date_Page | 6 | 0x6 |
Storage_File | 7 | 0x7 |
Module_Tables | 8 | 0x8 |
Debug_Image | 11 | 0xB |
Disk_Process_Page | 12 | 0xC |
Font_Outlines | 14 | 0xE |
Fresh_Bytes_Page | 15 | 0xF |
Start_Policy_Pages | 16 | 0x10 |
Edit_Target_Page | 17 | 0x11 |
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
bit_set[Fixed_Range; u64]src/library/modus/contract/fixed_addresses8 bytes8 bytessrc/library/modus/contract/fixed_addresses/fixed_addresses.odin:132
| Bit | Member | Mask |
|---|---|---|
| 0 | Module_Files | 0x1 |
| 1 | Pointer_Themes | 0x2 |
| 2 | Settings_Page | 0x4 |
| 6 | Date_Page | 0x40 |
| 7 | Storage_File | 0x80 |
| 8 | Module_Tables | 0x100 |
| 11 | Debug_Image | 0x800 |
| 12 | Disk_Process_Page | 0x1000 |
| 14 | Font_Outlines | 0x4000 |
| 15 | Fresh_Bytes_Page | 0x8000 |
| 16 | Start_Policy_Pages | 0x10000 |
| 17 | Edit_Target_Page | 0x20000 |
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
src/library/modus/contract/fixed_addresses16 bytes8 bytes0 bytessrc/library/modus/contract/fixed_addresses/fixed_addresses.odin:184
| Field | Type | Offset | Size |
|---|---|---|---|
address | 0 | 8 | |
span | 8 | 8 |
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
src/library/modus/contract/module4 bytes4 bytessrc/library/modus/contract/module/error.odin:13
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Find | 1 | 0x1 |
Read | 2 | 0x2 |
Cycle | 3 | 0x3 |
Check | 4 | 0x4 |
Bind | 5 | 0x5 |
Map | 6 | 0x6 |
Room | 7 | 0x7 |
Unmap | 8 | 0x8 |
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
src/library/modus/contract/module4 bytes4 bytessrc/library/modus/contract/module/error.odin:30
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Missing_Export | 1 | 0x1 |
Parameter_Count | 2 | 0x2 |
Parameter_Type | 3 | 0x3 |
Parameter_Detail | 4 | 0x4 |
Result_Type | 5 | 0x5 |
Result_Detail | 6 | 0x6 |
Error_Record | 7 | 0x7 |
Parameter_Direction | 8 | 0x8 |
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
src/library/modus/contract/module40 bytes4 bytes0 bytes- Named by
src/library/modus/contract/module/error.odin:63
| Field | Type | Offset | Size |
|---|---|---|---|
type | 0 | 1 | |
direction | 1 | 1 | |
_ | [2]u8 | 2 | 2 |
detail | 4 | 4 | |
record | [32]u8 | 8 | 32 |
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
src/library/modus/contract/module64 bytes1 byte0 bytes- Named by
src/library/modus/contract/module/error.odin:72
| Field | Type | Offset | Size |
|---|---|---|---|
hash | [32]u8 | 0 | 32 |
name | [32]u8 | 32 | 32 |
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
src/library/modus/contract/module392 bytes4 bytes0 bytessrc/library/modus/contract/module/error.odin:85
| Field | Type | Offset | Size |
|---|---|---|---|
stage | 0 | 4 | |
status | 4 | 4 | |
file_error | 8 | 4 | |
difference | 12 | 4 | |
module | 16 | 64 | |
imported | 80 | 64 | |
replaced | 144 | 64 | |
replacement | 208 | 64 | |
export | [32]u8 | 272 | 32 |
import_slot | 304 | 4 | |
parameter | 308 | 4 | |
expected | 312 | 40 | |
found | 352 | 40 |
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
src/library/modus/contract/module8 bytes8 bytessrc/library/modus/contract/module/contract_enums.odin:71
Error_Word
Error_Word :: distinct u64
- Kind
- distinct
src/library/modus/contract/module8 bytes8 bytes- Named by
src/library/modus/contract/module/contract_enums.odin:72
Difference_Word
Difference_Word :: distinct u64
- Kind
- distinct
src/library/modus/contract/module8 bytes8 bytes- Named by
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
src/library/modus/contract/module144 bytes1 byte0 bytessrc/library/modus/contract/module/load_facts.odin:38
| Field | Type | Offset | Size |
|---|---|---|---|
module_hash | Hash_Head_Field | 0 | 32 |
imported_hash | Hash_Head_Field | 32 | 32 |
module_name | [40]u8 | 64 | 40 |
imported_name | [40]u8 | 104 | 40 |
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
src/library/modus/contract/module80 bytes8 bytes0 bytessrc/library/modus/contract/module/load_facts.odin:47
| Field | Type | Offset | Size |
|---|---|---|---|
file_error | 0 | 8 | |
subject_hash | Hash_Head_Field | 8 | 32 |
subject_name | [40]u8 | 40 | 40 |
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
src/library/modus/contract/module120 bytes1 byte0 bytessrc/library/modus/contract/module/load_facts.odin:54
| Field | Type | Offset | Size |
|---|---|---|---|
module_name | [40]u8 | 0 | 40 |
imported_name | [40]u8 | 40 | 40 |
replacement_name | [40]u8 | 80 | 40 |
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
src/library/modus/contract/module136 bytes8 bytes0 bytessrc/library/modus/contract/module/load_facts.odin:62
| Field | Type | Offset | Size |
|---|---|---|---|
difference | 0 | 8 | |
parameter | 8 | 8 | |
module_name | [40]u8 | 16 | 40 |
imported_name | [40]u8 | 56 | 40 |
export | [40]u8 | 96 | 40 |
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
src/library/modus/contract/module124 bytes4 bytes0 bytessrc/library/modus/contract/module/load_facts.odin:71
| Field | Type | Offset | Size |
|---|---|---|---|
import_slot | 0 | 4 | |
module_name | [40]u8 | 4 | 40 |
imported_name | [40]u8 | 44 | 40 |
export | [40]u8 | 84 | 40 |
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
src/library/modus/contract/module80 bytes8 bytes0 bytessrc/library/modus/contract/module/load_facts.odin:79
| Field | Type | Offset | Size |
|---|---|---|---|
status | 0 | 8 | |
module_hash | Hash_Head_Field | 8 | 32 |
module_name | [40]u8 | 40 | 40 |
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
src/library/modus/contract/module72 bytes1 byte0 bytessrc/library/modus/contract/module/load_facts.odin:87
| Field | Type | Offset | Size |
|---|---|---|---|
module_hash | Hash_Head_Field | 0 | 32 |
module_name | [40]u8 | 32 | 40 |
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
src/library/modus/contract/module4 bytes4 bytes- Named by
src/library/modus/contract/module/format.odin:54
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
X86_64 | 1 | 0x1 |
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
src/library/modus/contract/module48 bytes8 bytes0 bytessrc/library/modus/contract/module/format.odin:65
| Field | Type | Offset | Size |
|---|---|---|---|
magic | 0 | 8 | |
version | 8 | 4 | |
header_size | 12 | 4 | |
must_understand | 16 | 8 | |
machine | 24 | 4 | |
table_count | 28 | 4 | |
memory_size | 32 | 8 | |
entry_export | 40 | 4 | |
category | 44 | 1 | |
reserved | 45 | 1 | |
tags | 46 | 2 |
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
src/library/modus/contract/module1 byte1 byte- Named by
src/library/modus/contract/module/format.odin:88
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Application | 1 | 0x1 |
System_Tool | 2 | 0x2 |
Developer_Tool | 3 | 0x3 |
Service | 4 | 0x4 |
Library | 5 | 0x5 |
Demonstration | 6 | 0x6 |
Test | 7 | 0x7 |
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
src/library/modus/contract/module1 byte1 byte- Named by
src/library/modus/contract/module/format.odin:102
| Member | Value | Hexadecimal |
|---|---|---|
Graphics | 0 | 0x0 |
Text | 1 | 0x1 |
Network | 2 | 0x2 |
Storage | 3 | 0x3 |
Security | 4 | 0x4 |
Processes | 5 | 0x5 |
Memory | 6 | 0x6 |
Time | 7 | 0x7 |
Sound | 8 | 0x8 |
Input | 9 | 0x9 |
Faults | 10 | 0xA |
Kernel | 11 | 0xB |
Module_Tags
Module_Tags :: bit_set[; u16]
- Kind
- bit set
bit_set[Module_Tag; u16]src/library/modus/contract/module2 bytes2 bytes- Named by
src/library/modus/contract/module/format.odin:116
| Bit | Member | Mask |
|---|---|---|
| 0 | Graphics | 0x1 |
| 1 | Text | 0x2 |
| 2 | Network | 0x4 |
| 3 | Storage | 0x8 |
| 4 | Security | 0x10 |
| 5 | Processes | 0x20 |
| 6 | Memory | 0x40 |
| 7 | Time | 0x80 |
| 8 | Sound | 0x100 |
| 9 | Input | 0x200 |
| 10 | Faults | 0x400 |
| 11 | Kernel | 0x800 |
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
src/library/modus/contract/module4 bytes4 bytessrc/library/modus/contract/module/format.odin:125
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Segments | 1 | 0x1 |
Imports | 2 | 0x2 |
Import_Slots | 3 | 0x3 |
Exports | 4 | 0x4 |
Rebases | 5 | 0x5 |
Functions | 6 | 0x6 |
Strings | 7 | 0x7 |
Documentation | 8 | 0x8 |
Records | 9 | 0x9 |
Fields | 10 | 0xA |
Budget | 11 | 0xB |
Facts | 12 | 0xC |
Own_Hash | 13 | 0xD |
Record_Outputs | 14 | 0xE |
Record_Inputs | 15 | 0xF |
Enums | 16 | 0x10 |
Members | 17 | 0x11 |
Member_Texts | 18 | 0x12 |
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
src/library/modus/contract/module16 bytes8 bytes0 bytessrc/library/modus/contract/module/format.odin:152
| Field | Type | Offset | Size |
|---|---|---|---|
offset | 0 | 8 | |
count | 8 | 4 | |
record_size | 12 | 4 |
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
src/library/modus/contract/module4 bytes4 bytes- Named by
src/library/modus/contract/module/format.odin:161
| Member | Value | Hexadecimal |
|---|---|---|
Read | 0 | 0x0 |
Write | 1 | 0x1 |
Execute | 2 | 0x2 |
Read_Only_After_Load | 3 | 0x3 |
Segment_Flags
Segment_Flags :: bit_set[;u32]
The flags of one Segment.
- Kind
- bit set
bit_set[Segment_Flag; u32]src/library/modus/contract/module4 bytes4 bytes- Named by
src/library/modus/contract/module/format.odin:168
| Bit | Member | Mask |
|---|---|---|
| 0 | Read | 0x1 |
| 1 | Write | 0x2 |
| 2 | Execute | 0x4 |
| 3 | Read_Only_After_Load | 0x8 |
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
src/library/modus/contract/module40 bytes8 bytes0 bytessrc/library/modus/contract/module/format.odin:177
| Field | Type | Offset | Size |
|---|---|---|---|
file_offset | 0 | 8 | |
file_size | 8 | 8 | |
memory_offset | 16 | 8 | |
memory_size | 24 | 8 | |
flags | 32 | 4 | |
reserved | 36 | 4 |
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
src/library/modus/contract/module32 bytes1 byte0 bytessrc/library/modus/contract/module/format.odin:192
| Field | Type | Offset | Size |
|---|---|---|---|
hash | [32]u8 | 0 | 32 |
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
src/library/modus/contract/module16 bytes8 bytes0 bytessrc/library/modus/contract/module/format.odin:201
| Field | Type | Offset | Size |
|---|---|---|---|
memory_offset | 0 | 8 | |
import_index | 8 | 4 | |
export_index | 12 | 4 |
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
src/library/modus/contract/module16 bytes8 bytes0 bytessrc/library/modus/contract/module/format.odin:211
| Field | Type | Offset | Size |
|---|---|---|---|
code_offset | 0 | 8 | |
function | 8 | 4 | |
reserved | 12 | 4 |
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
src/library/modus/contract/module1 byte1 bytesrc/library/modus/contract/module/format.odin:223
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Integer | 1 | 0x1 |
Text | 2 | 0x2 |
Record | 3 | 0x3 |
Handle | 4 | 0x4 |
Table | 5 | 0x5 |
Bytes | 6 | 0x6 |
Enum | 7 | 0x7 |
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
src/library/modus/contract/module1 byte1 bytesrc/library/modus/contract/module/format.odin:305
| Member | Value | Hexadecimal |
|---|---|---|
Read | 0 | 0x0 |
Change | 1 | 0x1 |
Append | 2 | 0x2 |
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
src/library/modus/contract/module24 bytes8 bytes0 bytessrc/library/modus/contract/module/format.odin:338
| Field | Type | Offset | Size |
|---|---|---|---|
address | 0 | 8 | |
count | 8 | 8 | |
capacity | 16 | 8 |
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
src/library/modus/contract/module168 bytes4 bytes0 bytessrc/library/modus/contract/module/format.odin:354
| Field | Type | Offset | Size |
|---|---|---|---|
name_offset | 0 | 4 | |
name_count | 4 | 4 | |
about_offset | 8 | 4 | |
about_count | 12 | 4 | |
parameter_names | [12]u32 | 16 | 48 |
parameter_count | 64 | 1 | |
result | 65 | 1 | |
parameters | [12]u8 | 66 | 12 |
parameter_name_counts | [12]u8 | 78 | 12 |
parameter_directions | [12]u8 | 90 | 12 |
optional_parameters | 102 | 2 | |
text_offset | 104 | 4 | |
text_count | 108 | 4 | |
parameter_details | [12]u32 | 112 | 48 |
result_detail | 160 | 4 | |
error_record | 164 | 4 |
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
src/library/modus/contract/module24 bytes4 bytes0 bytessrc/library/modus/contract/module/format.odin:410
| Field | Type | Offset | Size |
|---|---|---|---|
name_offset | 0 | 4 | |
name_count | 4 | 4 | |
size | 8 | 4 | |
first_field | 12 | 4 | |
field_count | 16 | 4 | |
reserved | 20 | 4 |
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
src/library/modus/contract/module24 bytes4 bytes0 bytessrc/library/modus/contract/module/format.odin:442
| Field | Type | Offset | Size |
|---|---|---|---|
name_offset | 0 | 4 | |
name_count | 4 | 4 | |
offset | 8 | 4 | |
type | 12 | 1 | |
unsigned | 13 | 1 | |
integer_unit | Integer_Unit | 14 | 2 |
detail | 16 | 4 | |
kind | 20 | 1 | |
contract_enum | 21 | 1 | |
reserved | [2]u8 | 22 | 2 |
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
src/library/modus/contract/module16 bytes4 bytes0 bytessrc/library/modus/contract/module/format.odin:484
| Field | Type | Offset | Size |
|---|---|---|---|
about_offset | 0 | 4 | |
about_count | 4 | 4 | |
text_offset | 8 | 4 | |
text_count | 12 | 4 |
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
src/library/modus/contract/module24 bytes8 bytes0 bytessrc/library/modus/contract/module/format.odin:506
| Field | Type | Offset | Size |
|---|---|---|---|
pages | 0 | 8 | |
processes | 8 | 8 | |
threads | 16 | 8 |
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
src/library/modus/contract/module32 bytes8 bytes0 bytessrc/library/modus/contract/module/facts.odin:24
| Field | Type | Offset | Size |
|---|---|---|---|
key | 0 | 8 | |
record | 8 | 4 | |
template_offset | 12 | 4 | |
template_count | 16 | 4 | |
package_offset | 20 | 4 | |
package_count | 24 | 4 | |
reserved | 28 | 4 |
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
src/library/modus/contract/module8 bytes8 bytes0 bytessrc/library/modus/contract/module/facts.odin:48
| Field | Type | Offset | Size |
|---|---|---|---|
memory_offset | 0 | 8 |
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
src/library/modus/contract/module1 byte1 bytesrc/library/modus/contract/module/facts.odin:171
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Too_Long | 1 | 0x1 |
Not_Text | 2 | 0x2 |
Unclosed_Brace | 3 | 0x3 |
Lone_Closing_Brace | 4 | 0x4 |
Not_A_Field_Name | 5 | 0x5 |
Unknown_Field | 6 | 0x6 |
Field_Twice | 7 | 0x7 |
Field_Not_Named | 8 | 0x8 |
Too_Many_Fields | 9 | 0x9 |
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
src/library/modus/contract/module1 byte1 bytesrc/library/modus/contract/module/record_streams.odin:29
| Member | Value | Hexadecimal |
|---|---|---|
Unpaired | 0 | 0x0 |
Paired | 1 | 0x1 |
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
src/library/modus/contract/module1 byte1 bytesrc/library/modus/contract/module/record_streams.odin:35
| Member | Value | Hexadecimal |
|---|---|---|
One | 0 | 0x0 |
Many | 1 | 0x1 |
Many_Types | 2 | 0x2 |
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
src/library/modus/contract/module40 bytes8 bytes0 bytessrc/library/modus/contract/module/record_streams.odin:47
| Field | Type | Offset | Size |
|---|---|---|---|
name_offset | 0 | 4 | |
name_count | 4 | 4 | |
about_offset | 8 | 4 | |
about_count | 12 | 4 | |
text_offset | 16 | 4 | |
text_count | 20 | 4 | |
record | 24 | 4 | |
pairing | 28 | 1 | |
reserved | [3]u8 | 29 | 3 |
place | 32 | 8 |
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
src/library/modus/contract/module48 bytes8 bytes0 bytessrc/library/modus/contract/module/record_streams.odin:68
| Field | Type | Offset | Size |
|---|---|---|---|
name_offset | 0 | 4 | |
name_count | 4 | 4 | |
about_offset | 8 | 4 | |
about_count | 12 | 4 | |
text_offset | 16 | 4 | |
text_count | 20 | 4 | |
record | 24 | 4 | |
terms | 28 | 4 | |
wirings | 32 | 1 | |
reserved | [7]u8 | 33 | 7 |
place | 40 | 8 |
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
src/library/modus/contract/module1 byte1 bytesrc/library/modus/contract/module/record_streams.odin:395
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Too_Many_Outputs | 1 | 0x1 |
Too_Many_Inputs | 2 | 0x2 |
Bad_Output | 3 | 0x3 |
Bad_Input | 4 | 0x4 |
Outputs_Out_Of_Order | 5 | 0x5 |
Inputs_Out_Of_Order | 6 | 0x6 |
Name_Of_Both | 7 | 0x7 |
Generic_Output_Alone | 8 | 0x8 |
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
src/library/modus/contract/module24 bytes4 bytes0 bytessrc/library/modus/contract/module/enums.odin:25
| Field | Type | Offset | Size |
|---|---|---|---|
name_offset | 0 | 4 | |
name_count | 4 | 4 | |
first_member | 8 | 4 | |
member_count | 12 | 4 | |
size | 16 | 1 | |
unsigned | 17 | 1 | |
reserved | [6]u8 | 18 | 6 |
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
src/library/modus/contract/module16 bytes8 bytes0 bytessrc/library/modus/contract/module/enums.odin:38
| Field | Type | Offset | Size |
|---|---|---|---|
name_offset | 0 | 4 | |
name_count | 4 | 4 | |
value | 8 | 8 |
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
src/library/modus/contract/module1 byte1 bytesrc/library/modus/contract/module/enums.odin:50
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
No_Enum | 1 | 0x1 |
Bad_Size | 2 | 0x2 |
Bad_Member_Count | 3 | 0x3 |
Bad_Member_Name | 4 | 0x4 |
Bad_Member_Value | 5 | 0x5 |
No_Getter | 6 | 0x6 |
Bad_Getter | 7 | 0x7 |
Getter_Type | 8 | 0x8 |
Bad_Optional | 9 | 0x9 |
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
src/library/modus/contract/module24 bytes4 bytes0 bytessrc/library/modus/contract/module/member_texts.odin:23
| Field | Type | Offset | Size |
|---|---|---|---|
enum_index | 0 | 4 | |
member_number | 4 | 4 | |
text_offset | 8 | 4 | |
text_count | 12 | 4 | |
tag_offset | 16 | 4 | |
tag_count | 20 | 4 |
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
src/library/modus/contract/module1 byte1 bytesrc/library/modus/contract/module/member_texts.odin:34
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
No_Enum | 1 | 0x1 |
No_Member | 2 | 0x2 |
Bad_Text | 3 | 0x3 |
Bad_Tag | 4 | 0x4 |
Twice | 5 | 0x5 |
Out_Of_Order | 6 | 0x6 |
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
src/library/modus/contract/module1 byte1 bytesrc/library/modus/contract/module/facts.odin:314
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
No_Fact_Type | 1 | 0x1 |
Value_Count | 2 | 0x2 |
Template | 3 | 0x3 |
Too_Long | 4 | 0x4 |
Text_View | 5 | 0x5 |
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
src/library/modus/contract/module4 bytes4 bytessrc/library/modus/contract/module/load.odin:9
| Member | Value | Hexadecimal |
|---|---|---|
None | 0 | 0x0 |
Too_Small | 1 | 0x1 |
Bad_Magic | 2 | 0x2 |
Unknown_Version | 3 | 0x3 |
Unknown_Feature | 4 | 0x4 |
Unknown_Machine | 5 | 0x5 |
Bad_Table | 6 | 0x6 |
Bad_Segment | 7 | 0x7 |
Bad_Rebase | 8 | 0x8 |
Bad_Import_Slot | 9 | 0x9 |
Bad_Import | 10 | 0xA |
Bad_Export | 11 | 0xB |
Bad_Own_Hash_Place | 12 | 0xC |
Bad_Record_Stream_Place | 13 | 0xD |
Too_Many_Record_Streams | 14 | 0xE |
Unknown_Category | 15 | 0xF |
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
src/library/modus/contract/module40 bytes8 bytes0 bytes- On the target
[]u8has the size of an address of the target: the sizes here are those of linux amd64, where the page was madesrc/library/modus/contract/module/load.odin:299
| Field | Type | Offset | Size |
|---|---|---|---|
file | 0 | 16 | |
base | 16 | 8 | |
named | 24 | 16 |
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
src/library/modus/contract/module64 bytes1 byte0 bytessrc/library/modus/contract/module/load.odin:311
| Field | Type | Offset | Size |
|---|---|---|---|
from | [32]u8 | 0 | 32 |
to | [32]u8 | 32 | 32 |
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
src/library/modus/contract/start_grant8 bytes8 bytessrc/library/modus/contract/start_grant/start_grant.odin:34
| Member | Value | Hexadecimal |
|---|---|---|
Root_Ring | 0 | 0x0 |
Inspect | 1 | 0x1 |
Stop | 2 | 0x2 |
Image | 3 | 0x3 |
Log_Records | 4 | 0x4 |
Serve | 5 | 0x5 |
Terminal | 6 | 0x6 |
Store | 7 | 0x7 |
Acts_For_Principal | 8 | 0x8 |
Data_Disk | 9 | 0x9 |
Scratch_Disk | 10 | 0xA |
Replacements | 11 | 0xB |
Replace | 12 | 0xC |
Network | 13 | 0xD |
Network_Device | 14 | 0xE |
Connect | 15 | 0xF |
Schedule | 16 | 0x10 |
Settings | 17 | 0x11 |
Clock | 18 | 0x12 |
History_Store | 19 | 0x13 |
Events | 20 | 0x14 |
Principals | 21 | 0x15 |
Debug_Image | 22 | 0x16 |
Debugger | 23 | 0x17 |
Palette | 24 | 0x18 |
System_Part | 25 | 0x19 |
Tpm | 26 | 0x1A |
Versions_Erase | 27 | 0x1B |
Counters | 28 | 0x1C |
Remote_Clients | 29 | 0x1D |
Sound_Device | 30 | 0x1E |
Start_Policy | 31 | 0x1F |
Screen_Capture | 32 | 0x20 |
Plans | 33 | 0x21 |
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
Error_RecordDraw_RecordDamage_RectangleCanvas_ShapeVenus_TargetError_RecordPointerWindowScreenGpu_InfoWindow_Grant_RowAssistive_Holder_RowError_RecordProcessCountServedError_RecordError_RecordError_RecordAnimation_RowError_RecordModuleError_RecordExportImportImport_SlotSegmentRunningEdgeError_RecordAttachedDetachedThread_RowFrame_RowSource_RowBreak_RowEvent_RowRecord_RowCheckpoint_RowStep_Back_RowWatch_Back_RowStop_Frame_RowError_RecordError_RecordRecordError_RecordValue_RunFact_RowError_RecordPage_RowServedError_RecordModule_File_RowError_RecordMappingThreadModuleError_RecordTree_Entry_RowGarbage_Root_RowGarbage_MeasureAdd_Row_ExportListedSharedUsageVersionByte_RangeErase_MeasureCommit_MeasureError_RecordAct_Table_ColumnAct_Table_CellError_RecordError_RecordError_RecordError_RecordError_RecordArgon2id_CostError_RecordRecord_HeaderVariable_Length_IntegerQuic_Header_ProbeError_RecordError_RecordError_RecordRectangleError_RecordSpanReadingWordError_RecordReadingError_RecordDraw_RecordAreaLabel_ValueBar_ValueError_RecordPlaced_GlyphText_RangeError_RecordLocaleDateError_RecordPowerbox_StatusError_RecordPlan_Entry_RowPlan_Difference_SummaryPlan_Diff_RowPlan_Generation_RowPlans_StatusError_RecordRecipe_HeadRecipe_Input_RowRecipe_Build_RowRealisation_RowRecipes_StatusError_RecordPin_Update_RowRecipe_HeadRecipe_Input_RowProjects_StatusError_RecordError_RecordCollector_StatusChain_Verification_ReportAct_RecordSpace_TermsKept_Record_HeadSpace_RowError_RecordGuest_Build_ReportGuest_Builder_StatusError_RecordDisk_Processes_StatusError_RecordDevices_StatusError_RecordPrincipals_Statustest_calleedrawingcompositormonitorlifepaintherontallymanualdebuggersettings_stand_inschedulerlogserverstorageassistantassemblec_compilerdeclaration_evalprobemathcryptographytls_tcpghostty_vtweb_enginesamplehostile_exportscalendarcalendar_fixedcalendar_changedagendalonelyinterface_moduletext_renderingsettingsstore_librarydisplay_conformancepowerboxplansrecipesprojectswork_accounting_probecollectorguest_builderdisk_processesdevicesprincipalsisolate_memoryrevokelocktimelengthtextcharacterrepeatbufferbytebyteshistory_clearholdresumeregistersstacklocalsvaluesourcebreak_removewatchstepstep_linestep_overdebug_memorywait_stopreplay_checkpointreplay_step_backwatch_backfirstskiprowsrow
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
Draw_RecordPointerWindowWindow_Grant_RowAssistive_Holder_RowProcessCountCount_NameAnimation_RowModuleExportImportImport_SlotSegmentRunningEdgeReplacementAttachedDetachedThread_RowRegister_RowFrame_RowVariable_RowValue_RowSource_RowBreak_RowMemory_RowEvent_RowRecord_RowCheckpoint_RowStep_Back_RowWatch_Back_RowStop_Frame_RowRecordValue_RunPage_RowModule_File_RowMappingThreadModuleAct_Table_ColumnAct_Table_CellDraw_RecordLocaleLanguage_RowPlan_Entry_RowPlan_Diff_RowRecipe_Input_RowPin_RowRecipe_Input_RowAct_RecordSpace_Rowcompositormonitorpaintherontallymanualdebuggersettings_stand_inschedulerservermodule_filesinspectstorageassistantc_compilerprobemathcryptographyssh_clientweb_enginesampleinterface_modulesettingsplansprojectscollectordescribeloadisolateisolate_memoryunloadconnectstarteditstart_from_diskallowdisallowremote_allowremote_display_allowremote_disallownickname_movedisk_persistencestopgrantsrevokeprincipal_createstart_policy_choosepassphrase_changerecovery_key_changereplacehashlengthtextcharacterrepeatlocalelanguageworktree_hashcompile_cdebugvaluebreak_atwatchdebug_memorystop_reportrecordsortjoinrecord_outputsaudit
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) - The contract
- Module contract: The call form
- Named by
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) - : 4 bytes
- The contract
- Module contract: The call form
- Named by
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) - The contract
- Module contract: The call form
- Named by
drawingcompositormonitorheronmanualdebuggerlogservermodule_filesinspectstorageassistanttls_tcpsamplehostile_exportsinterface_moduletext_renderingsettingsplansrecipesprojectscollectorguest_builderhelpprocessesprocess_moduleslocksmodulesloadedstartremote_clientsgrantsprincipalsreplacementsvariablesmeasure_completionworkrolesdelegated_servicesdebugdetachthreadsholdresumecontinue_allregistersstacklocalsvaluesourcebreak_atbreaksbreak_removewatchstepstep_linestep_overdebug_memoryeventswait_stopstop_reportrecordrecord_startrecord_endreplay_startreplay_statusreplay_checkpointreplay_step_backwatch_backwheresortjoincolumnsfirstskiprowsrowtablerecord_outputswirekeepauditmergefacts
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) - The contract
- Module contract: The call form
- Named by
Fact_RowTree_Entry_RowGarbage_Root_RowPlan_Entry_RowPlan_Difference_SummaryPlan_Diff_RowPlan_ExpectedPlan_Generation_RowRecipe_HeadRecipe_Input_RowRecipe_ReferenceRecipe_Build_RowRealisation_RowPin_TargetPin_Update_RowPin_RowRecipe_HeadRecipe_Input_RowKept_Record_HeadSpace_RowGuest_Build_ReportGuest_Builder_Statusdrawingstorageassemblec_compilerdeclaration_evalcryptographytls_tcpsampleinterface_moduletext_renderingrecipesprojectscollectorguest_builderbytes
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
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
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Draw_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 1 | |
reserved | 1 | 3 | |
element | 4 | 4 | |
left | 8 | 4 | |
top | 12 | 4 | |
right | 16 | 4 | |
bottom | 20 | 4 | |
fields | 24 | 24 |
48 bytes of fields and 0 bytes of padding: 48 bytes.
Damage_Rectangle
| Field | Type | Offset | Size |
|---|---|---|---|
left | 0 | 8 | |
top | 8 | 8 | |
right | 16 | 8 | |
bottom | 24 | 8 |
32 bytes of fields and 0 bytes of padding: 32 bytes.
Canvas_Shape
| Field | Type | Offset | Size |
|---|---|---|---|
width | 0 | 8 | |
height | 8 | 8 | |
stride | 16 | 8 | |
fill_background | 24 | 8 | |
background | 32 | 8 | |
scale | 40 | 8 |
48 bytes of fields and 0 bytes of padding: 48 bytes.
Venus_Target
| Field | Type | Offset | Size |
|---|---|---|---|
width | 0 | 8 | |
height | 8 | 8 | |
format | 16 | 8 | |
start | 24 | 8 | |
clear_color | 32 | 8 | |
command_buffer | 40 | 8 | |
queue | 48 | 8 | |
fence | 56 | 8 | |
pipeline_layout | 64 | 8 | |
render_pass_base | 72 | 8 | |
framebuffer_base | 80 | 8 | |
buffer_base | 88 | 8 | |
image_base | 96 | 8 | |
pipeline_base | 104 | 8 | |
vertex_buffer_bytes | 112 | 8 | |
index_buffer_bytes | 120 | 8 |
128 bytes of fields and 0 bytes of padding: 128 bytes.
Error_Record
- Kind
- record of a module
compositor56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Pointer
- Kind
- record of a module
compositor120 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
x | 0 | 8 | |
y | 8 | 8 | |
buttons | 16 | 8 | |
moves | 24 | 8 | |
keys | 32 | 8 | |
keys_waiting | 40 | 8 | |
keys_refused | 48 | 8 | |
menu | 56 | 16 | |
palette | 72 | 8 | |
shape | 80 | 32 | |
form | 112 | 8 |
120 bytes of fields and 0 bytes of padding: 120 bytes.
Window
- Kind
- record of a module
compositor168 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
title | 0 | 32 | |
x | 32 | 8 | |
y | 40 | 8 | |
width | 48 | 8 | |
height | 56 | 8 | |
order | 64 | 8 | |
focus | 72 | 8 | |
keyboard | 80 | 8 | |
presents | 88 | 8 | |
waits | 96 | 8 | |
events_sent | 104 | 8 | |
events_unread | 112 | 8 | |
events_waiting | 120 | 8 | |
keys_refused | 128 | 8 | |
frames | 136 | 8 | |
pictures_drawn_again | 144 | 8 | |
presents_refused | 152 | 8 | |
due | 160 | 8 |
168 bytes of fields and 0 bytes of padding: 168 bytes.
Screen
- Kind
- record of a module
compositor48 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
frames | 0 | 8 | |
presents | 8 | 8 | |
damage | 16 | 8 | |
desktop | 24 | 8 | |
page_flips | 32 | 8 | |
frames_on_the_shown_page | 40 | 8 |
48 bytes of fields and 0 bytes of padding: 48 bytes.
Gpu_Info
- Kind
- record of a module
compositor56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
present | 0 | 8 | |
attached | 8 | 8 | |
width | 16 | 8 | |
height | 24 | 8 | |
venus | 32 | 8 | |
venus_max_version | 40 | 8 | |
presents | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Window_Grant_Row
- Kind
- record of a module
compositor136 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
grant | 0 | 8 | |
window | 8 | 32 | |
resource | 40 | 96 |
136 bytes of fields and 0 bytes of padding: 136 bytes.
Assistive_Holder_Row
- Kind
- record of a module
compositor56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
holder | 0 | 8 | |
kind | 8 | 16 | |
nickname | 24 | 32 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Process
| Field | Type | Offset | Size |
|---|---|---|---|
slot | 0 | 8 | |
name | 8 | 32 | |
state | 40 | 8 | |
cause | 48 | 40 | |
outcome | 88 | 24 | |
resident | 112 | 8 | |
mapped | 120 | 8 | |
handles | 128 | 8 | |
handles_peak | 136 | 8 | |
mappings | 144 | 8 | |
mappings_peak | 152 | 8 | |
threads | 160 | 8 | |
time | 168 | 8 | |
entries | 176 | 8 | |
started | 184 | 8 | |
hash | 192 | 64 |
256 bytes of fields and 0 bytes of padding: 256 bytes.
Count
| Field | Type | Offset | Size |
|---|---|---|---|
name | 0 | 24 | |
value | 24 | 8 | |
unit | 32 | 16 |
48 bytes of fields and 0 bytes of padding: 48 bytes.
Count_Name
| Field | Type | Offset | Size |
|---|---|---|---|
name | 0 | 24 |
24 bytes of fields and 0 bytes of padding: 24 bytes.
Served
| Field | Type | Offset | Size |
|---|---|---|---|
calls | 0 | 8 | |
callers | 8 | 8 | |
pictures | 16 | 8 |
24 bytes of fields and 0 bytes of padding: 24 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Animation_Row
| Field | Type | Offset | Size |
|---|---|---|---|
name | 0 | 16 | |
frames | 16 | 8 | |
duration | 24 | 8 | |
moves | 32 | 8 |
40 bytes of fields and 0 bytes of padding: 40 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Module
| Field | Type | Offset | Size |
|---|---|---|---|
name | 0 | 32 | |
hash | 32 | 64 | |
file | 96 | 8 | |
code | 104 | 8 | |
constants | 112 | 8 | |
data | 120 | 8 | |
zero | 128 | 8 | |
entry | 136 | 8 | |
exports | 144 | 8 | |
imports | 152 | 8 | |
records | 160 | 8 | |
problem | 168 | 24 | |
place | 192 | 16 | |
index | 208 | 8 | |
offset | 216 | 8 |
224 bytes of fields and 0 bytes of padding: 224 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Export
| Field | Type | Offset | Size |
|---|---|---|---|
module | 0 | 32 | |
name | 32 | 32 | |
number | 64 | 8 | |
parameters | 72 | 8 | |
result | 80 | 8 | |
rights | 88 | 40 | |
signature | 128 | 112 |
240 bytes of fields and 0 bytes of padding: 240 bytes.
Import
| Field | Type | Offset | Size |
|---|---|---|---|
module | 0 | 32 | |
number | 32 | 8 | |
hash | 40 | 64 | |
name | 104 | 32 | |
import_slots | 136 | 8 | |
replacement | 144 | 32 |
176 bytes of fields and 0 bytes of padding: 176 bytes.
Import_Slot
| Field | Type | Offset | Size |
|---|---|---|---|
module | 0 | 32 | |
number | 32 | 8 | |
import_index | 40 | 8 | |
export_index | 48 | 8 | |
target | 56 | 32 | |
name | 88 | 32 |
120 bytes of fields and 0 bytes of padding: 120 bytes.
Segment
| Field | Type | Offset | Size |
|---|---|---|---|
module | 0 | 32 | |
number | 32 | 8 | |
kind | 40 | 24 | |
memory_offset | 64 | 8 | |
memory_size | 72 | 8 | |
file_offset | 80 | 8 | |
file_size | 88 | 8 |
96 bytes of fields and 0 bytes of padding: 96 bytes.
Running
| Field | Type | Offset | Size |
|---|---|---|---|
process | 0 | 32 | |
slot | 32 | 8 | |
module | 40 | 32 | |
hash | 72 | 64 | |
replaces | 136 | 64 | |
base | 200 | 8 | |
size | 208 | 8 | |
writer | 216 | 8 |
224 bytes of fields and 0 bytes of padding: 224 bytes.
Edge
| Field | Type | Offset | Size |
|---|---|---|---|
process | 0 | 32 | |
slot | 32 | 8 | |
module | 40 | 32 | |
hash | 72 | 64 | |
imported_by | 136 | 32 | |
replaces | 168 | 32 |
200 bytes of fields and 0 bytes of padding: 200 bytes.
Replacement
| Field | Type | Offset | Size |
|---|---|---|---|
from | 0 | 32 | |
from_hash | 32 | 64 | |
to | 96 | 32 | |
to_hash | 128 | 64 |
192 bytes of fields and 0 bytes of padding: 192 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Attached
| Field | Type | Offset | Size |
|---|---|---|---|
process | 0 | 32 | |
slot | 32 | 8 | |
threads | 40 | 8 | |
modules | 48 | 8 | |
described | 56 | 8 |
64 bytes of fields and 0 bytes of padding: 64 bytes.
Detached
| Field | Type | Offset | Size |
|---|---|---|---|
process | 0 | 32 | |
breakpoints | 32 | 8 | |
threads | 40 | 8 |
48 bytes of fields and 0 bytes of padding: 48 bytes.
Thread_Row
| Field | Type | Offset | Size |
|---|---|---|---|
thread | 0 | 8 | |
state | 8 | 12 | |
instruction | 20 | 20 | |
module | 40 | 32 | |
procedure | 72 | 80 | |
offset | 152 | 8 | |
file | 160 | 80 | |
line | 240 | 8 | |
pending | 248 | 8 |
256 bytes of fields and 0 bytes of padding: 256 bytes.
Register_Row
| Field | Type | Offset | Size |
|---|---|---|---|
name | 0 | 8 | |
value | 8 | 20 | |
about | 28 | 128 |
156 bytes of fields and 0 bytes of padding: 156 bytes.
Frame_Row
| Field | Type | Offset | Size |
|---|---|---|---|
frame | 0 | 8 | |
module | 8 | 32 | |
procedure | 40 | 80 | |
offset | 120 | 8 | |
file | 128 | 80 | |
line | 208 | 8 | |
frame_pointer | 216 | 20 | |
return_address | 236 | 20 |
256 bytes of fields and 0 bytes of padding: 256 bytes.
Variable_Row
| Field | Type | Offset | Size |
|---|---|---|---|
name | 0 | 48 | |
role | 48 | 12 | |
type | 60 | 48 | |
value | 108 | 96 | |
location | 204 | 28 |
232 bytes of fields and 0 bytes of padding: 232 bytes.
Value_Row
| Field | Type | Offset | Size |
|---|---|---|---|
name | 0 | 48 | |
type | 48 | 48 | |
value | 96 | 96 | |
address | 192 | 20 |
212 bytes of fields and 0 bytes of padding: 212 bytes.
Source_Row
| Field | Type | Offset | Size |
|---|---|---|---|
line | 0 | 8 | |
mark | 8 | 4 | |
text | 12 | 80 | |
path | 92 | 80 | |
hash | 172 | 68 |
240 bytes of fields and 0 bytes of padding: 240 bytes.
Break_Row
| Field | Type | Offset | Size |
|---|---|---|---|
number | 0 | 8 | |
kind | 8 | 12 | |
address | 20 | 20 | |
length | 40 | 8 | |
place | 48 | 160 |
208 bytes of fields and 0 bytes of padding: 208 bytes.
Memory_Row
| Field | Type | Offset | Size |
|---|---|---|---|
address | 0 | 20 | |
bytes | 20 | 48 | |
text | 68 | 20 |
88 bytes of fields and 0 bytes of padding: 88 bytes.
Event_Row
| Field | Type | Offset | Size |
|---|---|---|---|
thread | 0 | 8 | |
kind | 8 | 20 | |
instruction | 28 | 20 | |
module | 48 | 32 | |
procedure | 80 | 80 | |
offset | 160 | 8 | |
file | 168 | 80 | |
line | 248 | 8 |
256 bytes of fields and 0 bytes of padding: 256 bytes.
Record_Row
| Field | Type | Offset | Size |
|---|---|---|---|
state | 0 | 12 | |
| padding | 12 | 4 | |
points | 16 | 8 | |
bytes | 24 | 8 | |
capacity | 32 | 8 | |
end | 40 | 20 | |
| padding | 60 | 4 | |
checkpoints | 64 | 8 | |
divergence | 72 | 8 | |
differed | 80 | 12 | |
expected | 92 | 20 | |
actual | 112 | 20 | |
recorded_at | 132 | 20 |
144 bytes of fields and 8 bytes of padding: 152 bytes.
Checkpoint_Row
| Field | Type | Offset | Size |
|---|---|---|---|
checkpoint | 0 | 8 | |
point | 8 | 8 | |
offset | 16 | 8 | |
instruction | 24 | 20 | |
stack | 44 | 20 |
64 bytes of fields and 0 bytes of padding: 64 bytes.
Step_Back_Row
| Field | Type | Offset | Size |
|---|---|---|---|
checkpoint | 0 | 8 | |
start | 8 | 8 | |
target | 16 | 8 | |
points | 24 | 8 | |
offset | 32 | 8 | |
instruction | 40 | 20 | |
stack | 60 | 20 |
80 bytes of fields and 0 bytes of padding: 80 bytes.
Watch_Back_Row
| Field | Type | Offset | Size |
|---|---|---|---|
point | 0 | 8 | |
offset | 8 | 8 | |
source | 16 | 16 | |
address | 32 | 20 | |
| padding | 52 | 4 | |
written | 56 | 8 | |
bytes | 64 | 24 | |
instruction | 88 | 20 | |
| padding | 108 | 4 | |
checkpoint | 112 | 8 | |
start | 120 | 8 | |
points | 128 | 8 |
128 bytes of fields and 8 bytes of padding: 136 bytes.
Stop_Frame_Row
| Field | Type | Offset | Size |
|---|---|---|---|
frame | 0 | 8 | |
module | 8 | 32 | |
procedure | 40 | 80 | |
offset | 120 | 8 | |
file | 128 | 80 | |
line | 208 | 8 | |
stop | 216 | 40 |
256 bytes of fields and 0 bytes of padding: 256 bytes.
Error_Record
- Kind
- record of a module
settings_stand_in56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Record
| Field | Type | Offset | Size |
|---|---|---|---|
number | 0 | 8 | |
time | 8 | 8 | |
process | 16 | 32 | |
slot | 48 | 8 | |
level | 56 | 1 | |
form | 57 | 1 | |
| padding | 58 | 6 | |
lost | 64 | 8 | |
continues | 72 | 8 | |
runs | 80 | 8 | |
text | 88 | 168 |
250 bytes of fields and 6 bytes of padding: 256 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Value_Run
| Field | Type | Offset | Size |
|---|---|---|---|
number | 0 | 8 | |
start | 8 | 8 | |
length | 16 | 8 | |
kind | 24 | 16 |
40 bytes of fields and 0 bytes of padding: 40 bytes.
Fact_Row
| Field | Type | Offset | Size |
|---|---|---|---|
number | 0 | 8 | |
form | 8 | 1 | |
| padding | 9 | 7 | |
continues | 16 | 8 | |
key | 24 | 8 | |
module_hash | 32 | 32 | |
value_count | 64 | 8 | |
part | 72 | 4 | |
part_count | 76 | 4 | |
values | 80 | 144 |
217 bytes of fields and 7 bytes of padding: 224 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Page_Row
| Field | Type | Offset | Size |
|---|---|---|---|
name | 0 | 40 | |
bytes | 40 | 8 | |
served | 48 | 8 | |
type | 56 | 32 |
88 bytes of fields and 0 bytes of padding: 88 bytes.
Served
| Field | Type | Offset | Size |
|---|---|---|---|
requests | 0 | 8 | |
answers_2xx | 8 | 8 | |
answers_4xx | 16 | 8 | |
answers_5xx | 24 | 8 | |
connections_accepted | 32 | 8 | |
connections_open | 40 | 8 | |
bytes_in | 48 | 8 | |
bytes_out | 56 | 8 | |
pages | 64 | 8 | |
calls | 72 | 8 |
80 bytes of fields and 0 bytes of padding: 80 bytes.
Error_Record
- Kind
- record of a module
module_files56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Module_File_Row
- Kind
- record of a module
module_files144 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
name | 0 | 64 | |
bytes | 64 | 8 | |
hash | 72 | 72 |
144 bytes of fields and 0 bytes of padding: 144 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Mapping
| Field | Type | Offset | Size |
|---|---|---|---|
address | 0 | 8 | |
module | 8 | 32 | |
offset | 40 | 8 | |
pages | 48 | 8 | |
present | 56 | 8 | |
kind | 64 | 16 | |
rights | 80 | 4 | |
| padding | 84 | 4 | |
object | 88 | 8 | |
names | 96 | 8 |
100 bytes of fields and 4 bytes of padding: 104 bytes.
Thread
| Field | Type | Offset | Size |
|---|---|---|---|
number | 0 | 8 | |
state | 8 | 8 | |
processor | 16 | 8 | |
home | 24 | 8 | |
weight | 32 | 8 | |
request | 40 | 8 | |
virtual | 48 | 8 | |
lag | 56 | 8 | |
time | 64 | 8 | |
words | 72 | 8 | |
deadline | 80 | 8 |
88 bytes of fields and 0 bytes of padding: 88 bytes.
Module
| Field | Type | Offset | Size |
|---|---|---|---|
name | 0 | 32 | |
hash | 32 | 64 | |
base | 96 | 8 | |
size | 104 | 8 | |
writer | 112 | 8 |
120 bytes of fields and 0 bytes of padding: 120 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Tree_Entry_Row
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
hash | 8 | 32 |
40 bytes of fields and 0 bytes of padding: 40 bytes.
Garbage_Root_Row
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
hash | 8 | 32 |
40 bytes of fields and 0 bytes of padding: 40 bytes.
Garbage_Measure
| Field | Type | Offset | Size |
|---|---|---|---|
marked | 0 | 8 | |
swept | 8 | 8 | |
trees_traversed | 16 | 8 |
24 bytes of fields and 0 bytes of padding: 24 bytes.
Add_Row_Export
| Field | Type | Offset | Size |
|---|---|---|---|
name_offset | 0 | 8 | |
name_count | 8 | 8 | |
kind | 16 | 8 |
24 bytes of fields and 0 bytes of padding: 24 bytes.
Listed
| Field | Type | Offset | Size |
|---|---|---|---|
name_offset | 0 | 8 | |
name_count | 8 | 8 | |
kind | 16 | 8 | |
size | 24 | 8 | |
generation | 32 | 8 |
40 bytes of fields and 0 bytes of padding: 40 bytes.
Shared
| Field | Type | Offset | Size |
|---|---|---|---|
share | 0 | 8 | |
ring | 8 | 8 | |
region | 16 | 8 |
24 bytes of fields and 0 bytes of padding: 24 bytes.
Usage
| Field | Type | Offset | Size |
|---|---|---|---|
objects | 0 | 8 | |
trees | 8 | 8 | |
versions | 16 | 8 | |
blocks | 24 | 8 | |
limit | 32 | 8 | |
removing | 40 | 8 |
48 bytes of fields and 0 bytes of padding: 48 bytes.
Version
| Field | Type | Offset | Size |
|---|---|---|---|
generation | 0 | 8 | |
time | 8 | 8 | |
date | 16 | 8 | |
bytes | 24 | 8 | |
own_blocks | 32 | 8 | |
current | 40 | 8 |
48 bytes of fields and 0 bytes of padding: 48 bytes.
Byte_Range
| Field | Type | Offset | Size |
|---|---|---|---|
first | 0 | 8 | |
count | 8 | 8 |
16 bytes of fields and 0 bytes of padding: 16 bytes.
Erase_Measure
| Field | Type | Offset | Size |
|---|---|---|---|
generation | 0 | 8 | |
versions | 8 | 8 | |
zeroed | 16 | 8 | |
kept | 24 | 8 | |
damaged | 32 | 8 |
40 bytes of fields and 0 bytes of padding: 40 bytes.
Commit_Measure
| Field | Type | Offset | Size |
|---|---|---|---|
generation | 0 | 8 | |
object_blocks | 8 | 8 | |
held_blocks | 16 | 8 | |
changed | 24 | 8 | |
hashed_blocks | 32 | 8 | |
hashed_nodes | 40 | 8 | |
object_written | 48 | 8 | |
written | 56 | 8 | |
milliseconds | 64 | 8 |
72 bytes of fields and 0 bytes of padding: 72 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Act_Table_Column
| Field | Type | Offset | Size |
|---|---|---|---|
name | 0 | 32 | |
kind | 32 | 8 | |
unit | 40 | 8 |
48 bytes of fields and 0 bytes of padding: 48 bytes.
Act_Table_Cell
| Field | Type | Offset | Size |
|---|---|---|---|
text | 0 | 64 | |
integer | 64 | 8 |
72 bytes of fields and 0 bytes of padding: 72 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Error_Record
- Kind
- record of a module
c_compiler56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Error_Record
- Kind
- record of a module
declaration_eval56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Error_Record
- Kind
- record of a module
cryptography56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Argon2id_Cost
- Kind
- record of a module
cryptography32 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
memory_kibibytes | 0 | 8 | |
passes | 8 | 8 | |
lanes | 16 | 8 | |
tag_bytes | 24 | 8 |
32 bytes of fields and 0 bytes of padding: 32 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Record_Header
| Field | Type | Offset | Size |
|---|---|---|---|
content_type | 0 | 1 | |
| padding | 1 | 1 | |
legacy_version | 2 | 2 | |
length | 4 | 2 |
5 bytes of fields and 1 byte of padding: 6 bytes.
Variable_Length_Integer
| Field | Type | Offset | Size |
|---|---|---|---|
value | 0 | 8 | |
size | 8 | 8 |
16 bytes of fields and 0 bytes of padding: 16 bytes.
Quic_Header_Probe
| Field | Type | Offset | Size |
|---|---|---|---|
form | 0 | 1 | |
| padding | 1 | 3 | |
version | 4 | 4 |
5 bytes of fields and 3 bytes of padding: 8 bytes.
Error_Record
- Kind
- record of a module
ssh_client56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Error_Record
- Kind
- record of a module
ghostty_vt56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Error_Record
- Kind
- record of a module
web_engine56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Rectangle
| Field | Type | Offset | Size |
|---|---|---|---|
x | 0 | 8 | |
y | 8 | 8 | |
width | 16 | 8 | |
height | 24 | 8 |
32 bytes of fields and 0 bytes of padding: 32 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Span
| Field | Type | Offset | Size |
|---|---|---|---|
memory | 0 | 4 | |
| padding | 4 | 4 | |
first | 8 | 8 | |
count | 16 | 8 |
20 bytes of fields and 4 bytes of padding: 24 bytes.
Reading
| Field | Type | Offset | Size |
|---|---|---|---|
sensor | 0 | 8 | |
time | 8 | 8 | |
value | 16 | 8 | |
minimum | 24 | 8 | |
maximum | 32 | 8 |
40 bytes of fields and 0 bytes of padding: 40 bytes.
Word
| Field | Type | Offset | Size |
|---|---|---|---|
start | 0 | 4 | |
count | 4 | 4 | |
sum | 8 | 8 |
16 bytes of fields and 0 bytes of padding: 16 bytes.
Error_Record
- Kind
- record of a module
hostile_exports56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Reading
- Kind
- record of a module
hostile_exports40 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
sensor | 0 | 8 | |
time | 8 | 8 | |
value | 16 | 8 | |
minimum | 24 | 8 | |
maximum | 32 | 8 |
40 bytes of fields and 0 bytes of padding: 40 bytes.
Error_Record
- Kind
- record of a module
interface_module56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Draw_Record
- Kind
- record of a module
interface_module48 bytes4 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 1 | |
reserved | 1 | 3 | |
element | 4 | 4 | |
left | 8 | 4 | |
top | 12 | 4 | |
right | 16 | 4 | |
bottom | 20 | 4 | |
fields | 24 | 24 |
48 bytes of fields and 0 bytes of padding: 48 bytes.
Area
- Kind
- record of a module
interface_module32 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
x | 0 | 8 | |
y | 8 | 8 | |
width | 16 | 8 | |
height | 24 | 8 |
32 bytes of fields and 0 bytes of padding: 32 bytes.
Label_Value
- Kind
- record of a module
interface_module48 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
x | 0 | 8 | |
y | 8 | 8 | |
width | 16 | 8 | |
height | 24 | 8 | |
value_x | 32 | 8 | |
color | 40 | 8 |
48 bytes of fields and 0 bytes of padding: 48 bytes.
Bar_Value
- Kind
- record of a module
interface_module56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
x | 0 | 8 | |
y | 8 | 8 | |
width | 16 | 8 | |
height | 24 | 8 | |
value | 32 | 8 | |
maximum | 40 | 8 | |
color | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Error_Record
- Kind
- record of a module
text_rendering56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Placed_Glyph
- Kind
- record of a module
text_rendering16 bytes4 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
glyph | 0 | 4 | |
x | 4 | 4 | |
advance | 8 | 4 | |
cluster | 12 | 4 |
16 bytes of fields and 0 bytes of padding: 16 bytes.
Text_Range
- Kind
- record of a module
text_rendering16 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
start | 0 | 4 | |
count | 4 | 4 | |
width | 8 | 8 |
16 bytes of fields and 0 bytes of padding: 16 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Locale
| Field | Type | Offset | Size |
|---|---|---|---|
language | 0 | 8 | |
script | 8 | 4 | |
region | 12 | 4 | |
variant_first | 16 | 8 | |
variant_second | 24 | 8 | |
calendar | 32 | 1 | |
numbering_system | 33 | 1 | |
first_day | 34 | 1 | |
hour_cycle | 35 | 1 | |
measurement_system | 36 | 1 | |
collation | 37 | 1 | |
region_override | 38 | 6 | |
reserved | 44 | 4 |
48 bytes of fields and 0 bytes of padding: 48 bytes.
Language_Row
| Field | Type | Offset | Size |
|---|---|---|---|
tag | 0 | 128 | |
language | 128 | 8 | |
script | 136 | 4 | |
region | 140 | 4 |
144 bytes of fields and 0 bytes of padding: 144 bytes.
Date
| Field | Type | Offset | Size |
|---|---|---|---|
milliseconds | 0 | 8 | |
year | 8 | 8 | |
month | 16 | 8 | |
day | 24 | 8 | |
hour | 32 | 8 | |
minute | 40 | 8 | |
second | 48 | 8 | |
weekday | 56 | 8 |
64 bytes of fields and 0 bytes of padding: 64 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Powerbox_Status
| Field | Type | Offset | Size |
|---|---|---|---|
pending_dialogs | 0 | 8 | |
total_requests | 8 | 8 | |
total_dialogs_shown | 16 | 8 | |
total_items_granted | 24 | 8 | |
total_items_refused | 32 | 8 | |
total_refused_requests | 40 | 8 | |
total_expired_dialogs | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Plan_Entry_Row
| Field | Type | Offset | Size |
|---|---|---|---|
kind_word | 0 | 8 | |
role_word | 8 | 8 | |
start_grants_mask | 16 | 8 | |
store_rights_word | 24 | 8 | |
module_hash | 32 | 32 | |
interposed_over_hash | 64 | 32 | |
recipe_hash | 96 | 32 | |
name | 128 | 64 |
192 bytes of fields and 0 bytes of padding: 192 bytes.
Plan_Difference_Summary
| Field | Type | Offset | Size |
|---|---|---|---|
change_count | 0 | 8 | |
added_roles | 8 | 8 | |
removed_roles | 16 | 8 | |
changed_roles | 24 | 8 | |
added_modules | 32 | 8 | |
removed_modules | 40 | 8 | |
changed_modules | 48 | 8 | |
added_stores | 56 | 8 | |
removed_stores | 64 | 8 | |
changed_stores | 72 | 8 | |
added_grants | 80 | 8 | |
removed_grants | 88 | 8 | |
consent_word | 96 | 8 | |
current_plan_hash | 104 | 32 | |
proposed_plan_hash | 136 | 32 |
168 bytes of fields and 0 bytes of padding: 168 bytes.
Plan_Diff_Row
| Field | Type | Offset | Size |
|---|---|---|---|
change_word | 0 | 8 | |
entry_kind_word | 8 | 8 | |
role_word | 16 | 8 | |
added_grants_mask | 24 | 8 | |
removed_grants_mask | 32 | 8 | |
old_store_rights_word | 40 | 8 | |
new_store_rights_word | 48 | 8 | |
old_module_hash | 56 | 32 | |
new_module_hash | 88 | 32 | |
name | 120 | 64 |
184 bytes of fields and 0 bytes of padding: 184 bytes.
Plan_Expected
| Field | Type | Offset | Size |
|---|---|---|---|
current_plan_hash | 0 | 32 |
32 bytes of fields and 0 bytes of padding: 32 bytes.
Plan_Generation_Row
| Field | Type | Offset | Size |
|---|---|---|---|
generation | 0 | 8 | |
timestamp_ms | 8 | 8 | |
standing_word | 16 | 8 | |
plan_hash | 24 | 32 | |
previous_plan_hash | 56 | 32 |
88 bytes of fields and 0 bytes of padding: 88 bytes.
Plans_Status
| Field | Type | Offset | Size |
|---|---|---|---|
total_diffs | 0 | 8 | |
total_applies | 8 | 8 | |
total_rollbacks | 16 | 8 | |
total_refusals | 24 | 8 |
32 bytes of fields and 0 bytes of padding: 32 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Recipe_Head
| Field | Type | Offset | Size |
|---|---|---|---|
output_kind_word | 0 | 8 | |
source_date_unix | 8 | 8 | |
output_block_limit | 16 | 8 | |
builder_hash | 24 | 32 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Recipe_Input_Row
| Field | Type | Offset | Size |
|---|---|---|---|
kind_word | 0 | 8 | |
hash | 8 | 32 | |
name | 40 | 64 |
104 bytes of fields and 0 bytes of padding: 104 bytes.
Recipe_Reference
| Field | Type | Offset | Size |
|---|---|---|---|
recipe_hash | 0 | 32 |
32 bytes of fields and 0 bytes of padding: 32 bytes.
Recipe_Build_Row
| Field | Type | Offset | Size |
|---|---|---|---|
outcome_word | 0 | 8 | |
refusal_word | 8 | 8 | |
output_kind_word | 16 | 8 | |
mode_word | 24 | 8 | |
recipe_hash | 32 | 32 | |
output_hash | 64 | 32 |
96 bytes of fields and 0 bytes of padding: 96 bytes.
Realisation_Row
| Field | Type | Offset | Size |
|---|---|---|---|
origin_word | 0 | 8 | |
output_kind_word | 8 | 8 | |
recipe_hash | 16 | 32 | |
output_hash | 48 | 32 | |
signer_public_key | 80 | 32 |
112 bytes of fields and 0 bytes of padding: 112 bytes.
Recipes_Status
| Field | Type | Offset | Size |
|---|---|---|---|
total_builds | 0 | 8 | |
cache_hits_local | 8 | 8 | |
cache_hits_remote | 16 | 8 | |
local_builds | 24 | 8 | |
verify_agreements | 32 | 8 | |
verify_disagreements | 40 | 8 | |
total_refusals | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Pin_Target
| Field | Type | Offset | Size |
|---|---|---|---|
tree_hash | 0 | 32 |
32 bytes of fields and 0 bytes of padding: 32 bytes.
Pin_Update_Row
| Field | Type | Offset | Size |
|---|---|---|---|
changed_lines | 0 | 8 | |
line_number | 8 | 8 | |
old_tree_hash | 16 | 32 | |
new_tree_hash | 48 | 32 |
80 bytes of fields and 0 bytes of padding: 80 bytes.
Pin_Row
| Field | Type | Offset | Size |
|---|---|---|---|
tree_hash | 0 | 32 | |
source_module_hash | 32 | 32 | |
name | 64 | 64 | |
upstream_ref | 128 | 128 |
256 bytes of fields and 0 bytes of padding: 256 bytes.
Recipe_Head
| Field | Type | Offset | Size |
|---|---|---|---|
output_kind_word | 0 | 8 | |
source_date_unix | 8 | 8 | |
output_block_limit | 16 | 8 | |
builder_hash | 24 | 32 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Recipe_Input_Row
| Field | Type | Offset | Size |
|---|---|---|---|
kind_word | 0 | 8 | |
hash | 8 | 32 | |
name | 40 | 64 |
104 bytes of fields and 0 bytes of padding: 104 bytes.
Projects_Status
| Field | Type | Offset | Size |
|---|---|---|---|
total_inputs_queries | 0 | 8 | |
total_updates | 8 | 8 | |
total_enters | 16 | 8 | |
total_exits | 24 | 8 | |
active_consoles | 32 | 8 | |
total_refusals | 40 | 8 |
48 bytes of fields and 0 bytes of padding: 48 bytes.
Error_Record
- Kind
- record of a module
work_accounting_probe56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Collector_Status
| Field | Type | Offset | Size |
|---|---|---|---|
active_grants | 0 | 8 | |
total_grants_created | 8 | 8 | |
total_grants_revoked | 16 | 8 | |
total_grants_expired | 24 | 8 | |
total_acts_permitted | 32 | 8 | |
total_acts_blocked | 40 | 8 | |
recorded_acts | 48 | 8 | |
refused_full_count | 56 | 8 |
64 bytes of fields and 0 bytes of padding: 64 bytes.
Chain_Verification_Report
| Field | Type | Offset | Size |
|---|---|---|---|
refusal_code | 0 | 8 | |
failing_index | 8 | 8 | |
record_count | 16 | 8 | |
verify_calls | 24 | 8 |
32 bytes of fields and 0 bytes of padding: 32 bytes.
Act_Record
| Field | Type | Offset | Size |
|---|---|---|---|
sequence_number | 0 | 8 | |
grant_serial | 8 | 8 | |
timestamp_ms | 16 | 8 | |
act_kind_word | 24 | 8 | |
target_window_id | 32 | 8 | |
detail_word_0 | 40 | 8 | |
detail_word_1 | 48 | 8 | |
previous_hash | 56 | 32 | |
record_hash | 88 | 32 |
120 bytes of fields and 0 bytes of padding: 120 bytes.
Space_Terms
| Field | Type | Offset | Size |
|---|---|---|---|
kind_word | 0 | 8 | |
bound_records | 8 | 8 | |
forwarding_word | 16 | 8 | |
record_size | 24 | 8 |
32 bytes of fields and 0 bytes of padding: 32 bytes.
Kept_Record_Head
| Field | Type | Offset | Size |
|---|---|---|---|
serial | 0 | 8 | |
time_ms | 8 | 8 | |
size | 16 | 8 | |
chain_hash | 24 | 32 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Space_Row
| Field | Type | Offset | Size |
|---|---|---|---|
space | 0 | 8 | |
kind_word | 8 | 8 | |
forwarding_word | 16 | 8 | |
bound_records | 24 | 8 | |
record_size | 32 | 8 | |
kept | 40 | 8 | |
removed | 48 | 8 | |
refused_full | 56 | 8 | |
forwarded | 64 | 8 | |
next_serial | 72 | 8 | |
source | 80 | 32 | |
output | 112 | 32 | |
last_hash | 144 | 32 |
176 bytes of fields and 0 bytes of padding: 176 bytes.
Error_Record
- Kind
- record of a module
guest_builder56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Guest_Build_Report
- Kind
- record of a module
guest_builder128 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
state | 0 | 8 | |
refusal | 8 | 8 | |
guest_exit_code | 16 | 8 | |
guest_exits | 24 | 8 | |
sandbox_violations | 32 | 8 | |
tree_bytes_written | 40 | 8 | |
machine_failure | 48 | 8 | |
console_bytes | 56 | 8 | |
output_tree_hash | 64 | 32 | |
output_disk_hash | 96 | 32 |
128 bytes of fields and 0 bytes of padding: 128 bytes.
Guest_Builder_Status
- Kind
- record of a module
guest_builder96 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
builds | 0 | 8 | |
succeeded | 8 | 8 | |
refused | 16 | 8 | |
failed | 24 | 8 | |
timed_out | 32 | 8 | |
last_state | 40 | 8 | |
last_refusal | 48 | 8 | |
last_tree_bytes | 56 | 8 | |
last_output_tree_hash | 64 | 32 |
96 bytes of fields and 0 bytes of padding: 96 bytes.
Error_Record
- Kind
- record of a module
disk_processes56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Disk_Processes_Status
- Kind
- record of a module
disk_processes32 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
loads | 0 | 8 | |
starts_requested | 8 | 8 | |
refusals | 16 | 8 | |
commands_refused | 24 | 8 |
32 bytes of fields and 0 bytes of padding: 32 bytes.
Error_Record
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Devices_Status
| Field | Type | Offset | Size |
|---|---|---|---|
identity_count | 0 | 8 | |
active_bindings | 8 | 8 | |
total_binds | 16 | 8 | |
total_releases | 24 | 8 | |
total_refusals | 32 | 8 |
40 bytes of fields and 0 bytes of padding: 40 bytes.
Error_Record
- Kind
- record of a module
principals56 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
kind | 0 | 8 | |
unit | 8 | 8 | |
operation | 16 | 8 | |
argument | 24 | 8 | |
value | 32 | 8 | |
limit | 40 | 8 | |
found | 48 | 8 |
56 bytes of fields and 0 bytes of padding: 56 bytes.
Principals_Status
- Kind
- record of a module
principals48 bytes8 bytes0 bytes- Named by
| Field | Type | Offset | Size |
|---|---|---|---|
principal_count | 0 | 8 | |
active_sessions | 8 | 8 | |
disk_rows_applied | 16 | 8 | |
active_client_keys | 24 | 8 | |
start_policy_updates | 32 | 8 | |
total_refusals | 40 | 8 |
48 bytes of fields and 0 bytes of padding: 48 bytes.
The basic types
u8
An unsigned integer of 8 bits.
- Kind
- basic
1 byte1 byte- Named by
FormObject_KindFault_ClassThread_Control_State_RefusalGuest_RegistersGuest_Mode_LoadGuest_Inject_KindGuest_Registers_RefusalLog_LevelLog_RecordLog_Record_FormLog_FactLog_Fact_CallLog_Fact_Join_FaultSeed_StrengthFixed_RangeDescribedHeaderModule_CategoryModule_TagTypeDirectionFunctionFieldFact_Template_FaultRecord_Output_PairingWiring_CountRecord_OutputRecord_InputRecord_Stream_FaultEnum_TypeEnum_ProblemMember_Text_ProblemFact_Render_Refusal
u16
An unsigned integer of 16 bits, little-endian.
- Kind
- basic
2 bytes2 bytes- Named by
u32
An unsigned integer of 32 bits, little-endian.
- Kind
- basic
4 bytes4 bytes- Named by
HandleRightRightsOperationStrategyStop_ReportThread_RecordThread_ScheduleProcess_ScheduleThread_Breakpoint_KindThread_BreakpointEvent_KindEvent_Rule_FlagEvent_Rule_FlagsEvent_RuleEvent_RecordGuest_RegistersStatusProcess_StateStop_CauseStop_OutcomeProcess_Mapping_FlagProcess_MappingThread_ReportSystem_ReportProcessor_ReportLog_RecordProcess_ReportLoad_StageDifferenceDescribedLoad_ErrorLoad_Bind_FieldsMachineHeaderTable_KindTable_EntrySegment_FlagSegment_FlagsSegmentImport_SlotExportFunctionRecordFieldDocumentationFactRecord_OutputRecord_InputEnum_TypeMemberMember_TextError
u64
An unsigned integer of 64 bits, little-endian.
- Kind
- basic
8 bytes8 bytes- Named by
Parameter_FormError_Details_PlaceTime_RecordModule_RecordModule_WriterStop_ReportStop_FrameModule_ReportBudget_AmountsWordThread_RecordFault_RecordFault_Access_BitFault_AccessFault_KindFault_KindsFault_Answer_KindThread_Control_CommandFault_Handler_ActionExtended_State_LayoutThread_RegistersThread_Write_RefusalThread_PlacementThread_CountersThread_BreakpointEvent_Fault_OutcomeEvent_RuleEvent_RecordEvent_RingGuest_RegistersGuest_Exit_KindMemory_FlagMemory_FlagsPage_RangeAddress_RangeCommit_FlagCommit_FlagsMap_FlagMap_FlagsDevice_KindDevice_Memory_FactDevice_Memory_FactsInspect_KindProcess_MappingProcess_Mapping_ReportThread_ReportThread_Table_ReportPage_ReportSystem_ReportLock_KindLock_CountProcessor_ReportLog_HeadLog_RecordLog_FactLog_Fact_CallLog_Fact_PartLog_Fact_JoinStatus_WordLog_Record_Form_WordStop_Cause_WordStop_Outcome_WordObject_Kind_WordMapping_FlagMapping_RunMapping_ReportBoot_StageBoot_RangeBoot_ReportProcess_ReportKind_WordUnit_WordFixed_RangesAddress_RangeLoad_Stage_WordError_WordDifference_WordLoad_Check_FieldsHeaderTable_EntrySegmentImport_SlotExportTable_PlaceBudget_RequestFactOwn_Hash_PlaceRecord_OutputRecord_Input
i8
A signed integer of 8 bits, in two's complement.
- Kind
- basic
1 byte1 byte
i16
A signed integer of 16 bits, in two's complement, little-endian.
- Kind
- basic
2 bytes2 bytes
i32
A signed integer of 32 bits, in two's complement, little-endian.
- Kind
- basic
4 bytes4 bytes
i64
A signed integer of 64 bits, in two's complement, little-endian.
- Kind
- basic
8 bytes8 bytes- Named by
int
A signed integer of the size of an address of the target.
- Kind
- basic
8 bytes8 bytes- On the target
inthas 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
1 byte1 byte- Named by
rawptr
An address with no type.
- Kind
- basic
8 bytes8 bytes- On the target
rawptrhas 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
8 bytes8 bytes- On the target
uintptrhas 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
16 bytes8 bytes- On the target
stringhas 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
16 bytes8 bytes- On the target
[]u8has 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.
None0Value1Handle2Handle_Or_Zero3Address4Count5Flags6Choice7
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.
None0Memory1Process2Interrupt3Ports4Machine5Thread6Budget7
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 0Readbit 1Writebit 2Executebit 3Controlbit 4Inspectbit 5Devicesbit 6Stopbit 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 bytesformForm161 byteskindObject_Kind171 bytes- padding182 bytes
rightsbit_set[Right; u32]204 byteslimitu64248 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 bytesuniti6488 bytesoperationi64168 bytesargumenti64248 bytesvaluei64328 byteslimiti64408 bytesfoundi64488 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.
Give0Read1Write2Execute3Control4Inspect5Devices6Stop7
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 bytesmodules[16]Module_Record81408 bytesprocess_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 bytesvectoru3244 bytesinstructionu6488 bytesaddressu64168 bytesmoduleModule_Record2488 bytesframe_countu641128 bytesframes[16]Stop_Frame120768 bytesprocess_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 bytesbaseu6488 byteshash[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 bytessizeu6488 byteshash[32]u81632 bytesreplaces[32]u84832 byteswriteru64808 bytes
Module_Writer enum
An enum of the package operation on u64: 8 bytes, 2 members. Who wrote a module record (Module_Record.writer).
Process0Starter1
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 bytesserialu6488 bytesaddressu64168 bytesaccessu64248 bytesinstructionu64328 byteskindu64408 byteserror_codeu64488 bytesreservedu64568 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.
Present0Write1Execute4
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_Error0Debug1Breakpoint3Invalid_Opcode6Segment_Not_Present11Stack_Fault12General_Protection13Page_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 bytesbusy_timeu6488 bytessameu64168 bytesapic_idu64248 bytesstrategyStrategy324 bytesqueuedu32364 bytespicksu64408 bytespreemptionsu64488 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 bytesrequestu3244 bytesweight_limitu3284 bytesnew_thread_weight_limitu32124 bytes
An enum of the package operation on u32: 4 bytes, 4 members. What a breakpoint of a thread stops on.
None0Execute1Write2Read_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 byteskindThread_Breakpoint_Kind84 byteslengthu32124 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 bytesflagsbit_set[Event_Rule_Flag; u32]44 bytesprocessu6488 bytesdetailu64168 bytesleast_nanosecondsu64248 bytesone_inu64328 bytesreserved[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.
Keep0Real_161Protected_322Long_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.
None0External_Interrupt1Non_Maskable_Interrupt2Exception3Software_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_Now0Contiguous1Uncommitted2Large_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 bytespage_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.
Write0Execute1No_Access2Receive_Handles3At_Address_Zero4Write_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.
Domain0Windows1
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.
Write0Execute1Uncached2Device3Contiguous4Shared5Thread_Area6Uncommitted7
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 bytespage_countu6488 bytesfirstu64168 bytespresentu64248 bytesregion_pagesu64328 bytesregion_serialu64408 bytesflagsbit_set[Process_Mapping_Flag; u32]484 bytesreferencesu32524 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.
None0Created1Ready2Waiting3Stopped4
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 bytesnumberu3284 bytesstateProcess_State124 bytesprocessoru32164 byteshomeu32204 bytesweightu32244 bytesrequestu32284 byteswordsu32324 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 byteswaitsu6488 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.
None0Round_Robin1Fair2Eevdf3
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.
Control0Process1Origin2Region3Frame4Cache5Log6Wait7
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.
Info0Debug1Warning2Error3
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.
Write0Execute1Process2Large3
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 bytesruns[96]Mapping_Run82304 bytespagesu6423128 byteswrite_pagesu6423208 bytesexecute_pagesu6423288 byteswrite_execute_pagesu6423368 bytesguard_pagesu6423448 bytesguards_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 bytespage_countu6488 bytesflagsbit_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 bytesstartu64488 bytesdurationu64568 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 bytespage_countu6488 byteskindu64168 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 bytesprocessesu6488 bytesthreadsu64168 bytesprocessoru64248 byteslog_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 bytesunitUnit_Word88 bytesoperationi64168 bytesargumenti64248 bytesvaluei64328 byteslimiti64408 bytesfoundi64488 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_Files0Pointer_Themes1Settings_Page2Date_Page6Storage_File7Module_Tables8Debug_Image11Disk_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 bytesname[32]u83232 bytes
Described struct
A struct of the package module: 40 bytes, aligned on 4 bytes, 0 bytes of padding.
typeu801 bytesdirectionu811 bytes_[2]u822 bytesdetailu3244 bytesrecord[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.
None0X86_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.
None0Application1System_Tool2Developer_Tool3Service4Library5Demonstration6Test7
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 0Textbit 1Networkbit 2Storagebit 3Securitybit 4Processesbit 5Memorybit 6Timebit 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.
Graphics0Text1Network2Storage3Security4Processes5Memory6Time7
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.
Read0Write1Execute2Read_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 0Writebit 1Executebit 2Read_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 bytesname_countu3244 bytessizeu3284 bytesfirst_fieldu32124 bytesfield_countu32164 bytesreservedu32204 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.
Read0Change1Append2
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 bytescountu6488 bytescapacityu64168 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 bytesname_countu3244 bytesabout_offsetu3284 bytesabout_countu32124 bytesparameter_names[12]u321648 bytesparameter_countu8641 bytesresultu8651 bytesparameters[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 bytesname_countu3244 bytesoffsetu3284 bytestypeu8121 bytesunsignedbool131 bytesinteger_unitInteger_Unit142 bytesdetailu32164 byteskindu8201 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 bytesstatusu3244 bytesfile_erroru3284 bytesdifferenceu32124 bytesmoduleNamed1664 bytesimportedNamed8064 bytesreplacedNamed14464 bytesreplacementNamed20864 bytes
and 5 more
OPERATIONS global variable of the package operation
OPERATIONS := [Operation]Operation_Form {...}
The form of each kernel operation, by its number.
Error_Details constant of the package system
Error_Details :: Table_To_Append(errors.)
The table of error details.
time procedure of the package system
time :: proc "contextless" () -> u64
time gives the milliseconds since boot.
Write type of the package storage_service
Write :: struct {...}
A type with no comment in its source.
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,.
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.
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.
PROCESS_MODULE_CAPACITY constant of the package operation
PROCESS_MODULE_CAPACITY :: 16
The module records of one process: its own module, the modules that.
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).
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.
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.
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.
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.
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.
WEIGHT_FULL constant of the package operation
WEIGHT_FULL :: 1024
The weight of a thread created with the weight 0: the most.
REQUEST_DEFAULT constant of the package operation
REQUEST_DEFAULT :: 3000
Microseconds: the request of a thread created with the request 0.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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".
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.
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.
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.
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.
Keyboard_Layout type of the package settings
Keyboard_Layout :: enum u32 {...}
The layout of the keyboard: the character that the input service gives.
