modus

The program paint

A demonstration: drawing with the pointer.

left button: draw right button: erase click a color at the top c: clear

This program is also a service: it serves its exports while it runs. Another program draws on the paper with isolated calls. The calls execute in the one thread of this program, between two input events.

FactValue
Sourceprograms/paint
Boot imagein the boot image; the image is not built, so its size is not known
Importsnone
Imported bynone

Exports

ExportWhat it does
line(from_x: Integer, from_y: Integer, to_x: Integer, to_y: Integer, color: Integer) -> Integerdraws a line on the paper, with a color of the palette (0 to 5)
write(x: Integer, y: Integer, text: Text, color: Integer) -> Integerdraws a text on the paper, with a color of the palette (0 to 5)
clear()erases the paper
lines() -> Integergives the count of lines that calls drew since the last clear
entry()

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

What the root service gives it

WhatValueAs the root service says
Grants{.Serve}sample: the module of the tables, started as a program when a caller connects.
Budget: pages, programs, threads{pages = 2048, programs = 1, threads = 1}Not named in things_of: the budget of each other program.

Read from grants_of and things_of in programs/root/main.odin; budget_of in the same file adds the limits of processor time and of log records.