modus
Menu
On this page

The entry linux

The process linux: a shell of Linux in a terminal window .

It reads a Linux kernel and an initial archive from its private store, boots the kernel in a guest with the machine of modus:contract/guest_os, and joins the serial port of the guest to its terminal: the lines of the guest are the lines of the terminal, and the keys of the terminal are the bytes that the guest reads. An idle guest waits for a key, or for the next tick of its timer in the time of the machine.

Start: from the start menu, or start("linux") in the console. The root service starts its terminal with it.

Grants: Terminal, the console of the guest; Store, the private store linux with the objects kernel and initial_archive.

What a reader sees: a terminal window with the messages of Linux, then a shell. On the log: "linux: boots the kernel of ...", one line "linux: guest: <line>" for each line of the guest, and at the end "linux: the guest halted after N exits: the process ends" when the guest runs poweroff.

See: A Linux shell in a window in the repository

linux module with an entry

Hash
0df078aced9b4fa9ec266c6217c53827b4440bd7cfef74cee32d0f27ccc62d1d
Size
147456 bytes
Exports
0
Imports
0
Imported by
0
License
MIT

The process linux: a shell of Linux in a terminal window

FactValue
KindModules with an entry
Sourcesrc/modules/system/linux
Boot imageyes: in the boot image, 147456 bytes in this build
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()

entry

entry()
Form
The entry of the module: one parameter, an address, fixed by the contract.
Source
src/modules/system/linux/main.odin:221

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
Grants

A shell of Linux in a guest:

  • Terminal: the serial console of the guest, both ways.
  • Store: its private store holds the guest image: a kernel of 13 MB and an initial archive. The blocks hold both, with room for a newer kernel beside them.
See: A Linux shell in a window in the repository
Other terms of its start grant setstore_blocks = 8192
Budget that it asks for
  • working memory pages 34816
  • pages of its threads 72
  • pages of the pictures of its window 0
  • pages of the module and its imports from the files of the build
  • processes 2
  • threads 1
The memory of the guest, the nested page table of the guest and the buffers of this process; this process and its guest process, and one 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).