modus
Menu
On this page

The entry clock

The source src/modules/demonstrations/clock built with the setting DRAWING_THROUGH_MODULE=true. The text after this paragraph is the comment of that source.

The clock of the desktop: the local time, the date, a calendar of a month, a stopwatch with laps and a countdown timer.

What it is for. It is the clock that a principal opens from the bar or from the menu of the desktop. The design is in The clock application in the repository.

What a reader sees. Start it from the start menu, from the menu of the desktop ("open clock"), or with start("clock") in the console. Three tabs at the top choose a section; the keys 1, 2 and 3 do the same.

  • clock: the local time in large digits, the date with its time zone, and the calendar of a month. Page Up and Page Down change the month, Home comes back to the month of today.
  • stopwatch: Space starts and stops, L takes a lap, R resets a stopped stopwatch. The laps show the newest first.
  • timer: + and - change the duration by one minute, Space starts and pauses, R resets. At the end the window shows 00:00 in the warning color, and the process asks the compositor for a desktop notification.

The local time is the date page and its time zone (the setting time_zone of the settings): no kernel entry.

Its grants: Connect to the compositor only, for the notification at the end of the timer, and Image, for the description of the exports of the compositor.

clock module with an entry

Hash
d950a99ebba95b202dab9c0ea9dc2d155a167bfe70533681aa8a61616c07fc5e
Size
194663 bytes
Exports
0
Imports
1
Imported by
0
License
MIT

The clock of the desktop: the local time, the date, a calendar of a month, a stopwatch with laps and a countdown timer

FactValue
KindModules with an entry
Sourcesrc/modules/demonstrations/clock
Boot imageyes: in the boot image, 194663 bytes in this build
Build settings
  • DRAWING_THROUGH_MODULE=true
Imports
Imported bynone

Neighbours

What it imports, at its left, and what imports it, at its right: the part of the module graph that touches it.

clock drawing

Exports

ExportWhat it does
entry()The entry of clock: it opens its window, then draws a frame at each event and at each wake of next_wake

entry

entry()

The entry of clock: it opens its window, then draws a frame at each event and at each wake of next_wake. It never returns; with no window, it stops with Failed.

Form
The entry of the module: one parameter, an address, fixed by the contract.
Source
src/modules/demonstrations/clock/main.odin:568

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
GrantsThe clock of the desktop: a connection to the compositor only, for the notification at the end of its timer, and the boot image for the description of the exports of the compositor . See: The clock application: The grants in the repository
Other terms of its start grant setcallable = {0 = "compositor"}
Budget that it asks for
  • working memory pages 6200
  • pages of its threads 91
  • pages of the pictures of its window 4050
  • pages of the module and its imports from the files of the build
  • processes 1
  • threads 2
The tool counts the two pictures of the window at its largest size. A resize holds the old surface and the new one together until the compositor shows the new one, so the working memory holds a second surface at the largest size: 1536 x 864 logical pixels at the largest scale, cut on each axis to the reference screen as the tool counts it , are 1920 x 1080 pixels, 4 bytes each, two pictures: 4050 pages. It also holds the least budget of 2048 pages less a window of 480 x 320 (300 pages): 1748 pages for its stack, its tables and the glyphs that it draws itself. And the glyph memory of the copy of the text rendering of the drawing module: 354 pages (display.TEXT_MEMORY_PAGES). 4050 + 1748 + 354 = 6152. The worker thread of the notification has a stack of 64 pages, 48 more than the tool counts for a thread. 6152 + 48 = 6200. The tool reads the literal; the check below ties it to these parts. See: From the desktop of today to a light web browser: The budgets in the repository

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).