modus
Menu
On this page

The entry visitor

A module that is not in the boot image: the test of a disk process .

What it is for. The root service starts a process from a module file that the storage service holds, when the hash of the bytes is the hash that the principal named. Such a process has no row in the tables by name of the root service, so it receives no grant but the grants of its nickname in the disk grant table. This process says what it received, and uses the store of its nickname when it has one.

Start: start_from_disk("visitor", hash) in the console, on a machine whose data disk holds the store module_files with its file. The modus tool writes that disk for the test part disk_processes, and prints the hash. start("visitor") is refused: the boot image has no such module.

Grants: none by its name. It has no row in start_grant_sets. After allow("visitor", "store"), its next start has the store of its nickname, disk-visitor.

What a reader sees. Three lines on the log: "visitor: ok", the handles of its context, and the refusal of a ring to the root service. With a store, one line more: the count of its starts with that store, which it keeps there. It opens no window. The copy that the test builds with FAULTS_AFTER_THE_START writes one line more, then stops on a page fault: stop_report("outsider_fault") names its frames.

See: Module contract: A module from a disk

visitor module with an entry

Hash
d826abc88fb4e8f0b543e094e13779faf60780f1299092c6e2805de60590e149
Size
61440 bytes
Exports
0
Imports
0
Imported by
0
License
MIT

A module that is not in the boot image: the test of a disk process

FactValue
KindModules with an entry
Sourcesrc/modules/tests/visitor
Boot imageno: not in the boot image
Build settingsnone: the defaults of the source
Importsnone
Imported bynone

Neighbours

It imports no module, and no module imports it. The module graph shows it with the other modules that have no edge.

Exports

ExportWhat it does
entry()The entry of visitor: it writes what its context holds, then sleeps until it is stopped

entry

entry()

The entry of visitor: it writes what its context holds, then sleeps until it is stopped.

  1. 1. It counts the handles of its context that are not the ring to the compositor, the log, its budget or a store: each one would be a grant that no command gives. The count must be 0.
  2. 2. It opens the handle of the root ring. The handle is 0, so the open gives Bad_Handle: the process can ask the root service for nothing.
  3. 3. With a store: it reads the count of its starts, adds one, writes it, and reads it again.
  4. 4. In the copy built with FAULTS_AFTER_THE_START: it writes to the address 0, three calls deep (fault_one).
Form
The entry of the module: one parameter, an address, fixed by the contract.
Source
src/modules/tests/visitor/main.odin:59

Read from the source of the module, as the build reads it to describe the exports (tools/modustool/build/describe.odin).

What the root service gives it

WhatValueAs the root service says
GrantsnoneNo row: the kernel starts the root service, and a disk process has the start grant set of its row in the disk grant table of its principal.
Other terms of its start grant setnone
Budget that it asks for
  • the least budget
No MODULE_BUDGET in its source: it asks for the least budget.

The start grant set is read from start_grant_sets in src/modules/system/root/start_grant_sets.odin. The stated budget is read from the constant MODULE_BUDGET of the source of the module; the build adds the counted parts and writes the sum in the module (tools/modustool/build/budget_count.odin); the root service accepts it up to the largest budget of a process, and adds the limits of processor time and of log records (src/modules/system/root/budgets.odin).

start_grant_sets global variable of the package root

start_grant_sets := [?]Start_Grant_Set_Row {...}

The start grant set of each module of the boot image, with the reason of each.

src/modules/system/root/start_grant_sets.odin:73