The entry flood
A process that writes lines to its terminal as fast as it can.
Each line has four runs of text with four styles: a number, a level, a name, a text. The process sends no escape sequence: the style of a run is a field of its record. The status has the count of lines.
The process has no surface. It reads the keys of the input from its terminal: the key Space stops the lines, and starts them again. While the lines do not move, the process waits for a key and uses no processor.
What it is for. It shows that a process needs no standard output: it writes typed records to a terminal that the root service gave it, each with its runs and their styles, and the terminal draws them. A process that writes as fast as it can shows how the terminal keeps up, and that the process waits with no processor use when it has nothing to do.
What a reader sees. Start it from the start menu, or with start("flood") in the console. The root service starts its terminal with it: a window whose lines scroll fast, with the count of lines in its status. Space stops the lines and starts them again; the log gets flood: Space: no more lines after <count> and flood: Space: the lines continue.
Its grant: Terminal: the terminal ring and the text region that it shares with its terminal. Nothing else.
flood module with an entry
- Hash
35eb70f2507fc8a0ed6014ceab8012d4d7915da343f4e9b3f58e4c54971fc47f- Size
40960 bytes- Exports
0- Imports
0- Imported by
0- License
- MIT
A process that writes lines to its terminal as fast as it can
| Fact | Value |
|---|---|
| Kind | Modules with an entry |
| Source | src/modules/tests/flood |
| Boot image | yes: in the boot image, 40960 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() | opens the terminal, writes flood: ok, then writes numbered lines with no end |
entry
entry()
entry opens the terminal, writes flood: ok, then writes numbered lines with no end. Each 256 lines it reads the keys: Space pauses, and while paused it waits for a key with no processor use. With no terminal, it writes flood: no terminal and stops with Refused.
- Form
- The entry of the module: one parameter, an address, fixed by the contract.
src/modules/tests/flood/main.odin:71
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 | It writes its lines to a terminal and reads the key Space from it: it has no surface and needs nothing else. It shows the rates of the process in a terminal of a fixed size, so that its measures compare from one run to the next. | |
| Other terms of its start grant set | terminal_columns = FLOOD_TERMINAL_COLUMNS, terminal_rows = FLOOD_TERMINAL_ROWS, terminal_measure = true | |
| Budget that it asks for |
| The working memory: the rest of the pages that the root service gave it by its name, once the tool counts its module and its thread. |
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 (its line); 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).
