The entry hostile_terminal
A test module that writes to its terminal three records whose kind names no record, then one line, and stops.
The three words are None, the word one past the last kind, and the largest word of the field. The terminal decides each one at its border, which a host test gives the same words (terminal.kind_of_ring_word). This process shows that the terminal answers what its border decided: it counts each refused record, writes one line at the first one, and the count when the process stops. It sends no answer on the ring, so this process checks what it can see: the terminal read the three records and the line after them.
What it is for. A record of the terminal ring comes from another process. A word that names no record must not stop the terminal, nor become a record that the process did not write.
Start: start("hostile_terminal") in the console. The machine test starts it after flood.
Its grant: Terminal: the terminal ring and the text region that it shares with its terminal. Nothing else.
What a reader sees: a terminal with one line. The log has hostile_terminal: the terminal read the kind words 0, 9 and 4294967295, and the line after them: as it must, then the two lines of the terminal: terminal: hostile_terminal sent a record of the kind 0, which names no record: it is refused and, at the stop, terminal: hostile_terminal stopped after 3 records whose kind names no record.
hostile_terminal module with an entry
- Hash
de1fb8614241a67456490378bde1377d7d0df5acf00a0193d56c125c7abcf435- Size
36864 bytes- Exports
0- Imports
0- Imported by
0- License
- MIT
A test module that writes to its terminal three records whose kind names no record, then one line, and stops
| Fact | Value |
|---|---|
| Kind | Modules with an entry |
| Source | src/modules/tests/hostile_terminal |
| Boot image | yes: in the boot image, 36864 bytes in this build |
| Build settings | none: the defaults of the source |
| Imports | none |
| Imported by | none |
Neighbours
It imports no module, and no module imports it. The module graph shows it with the other modules that have no edge.
Exports
| Export | What it does |
|---|---|
entry() | writes the three records and the line, waits until the terminal read them, writes the result on the log, and stops with Done, or with Failed when the terminal did not read them |
entry
entry()
entry writes the three records and the line, waits until the terminal read them, writes the result on the log, and stops with Done, or with Failed when the terminal did not read them. With no terminal it writes hostile_terminal: no terminal and stops with Refused.
- Form
- The entry of the module: one parameter, an address, fixed by the contract.
src/modules/tests/hostile_terminal/main.odin:47
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
| What | Value | As the root service says |
|---|---|---|
| Grants | The test of the records of a terminal ring whose kind names no record: it writes them to its terminal, as flood writes lines. | |
| Other terms of its start grant set | none | |
| Budget that it asks for |
| 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).
