# How Pinnacle fits together ## The kernel Boot, memory, interrupts, the scheduler on every core, and programs in address spaces of their own (README.md has the detail). On top of those, the kernel offers programs a small set of objects, reached through **handles** (numbers in a per-program table, like file descriptors): | Object | What it is | |---|---| | Channel | Two ends; a message (up to 4 KiB of bytes and up to 8 handles) sent on one arrives on the other. Receiving waits, on any of several channels at once, with a timeout. Closing one end tells the other. | | Memory | Pages that can be mapped into several programs: a window's pixels, shared between an app and the display server. | | Process | A program, as the one that started it holds it (SPAWN answers one): what can end it (KILL). It does not keep the program alive. | A program that serves others **registers** a name (`display`); a client **connects** by name and gets a channel to it, while the server receives the other end as a message on the channel it registered with. The kernel has no window system, no file formats beyond ELF, and no policy: those are programs. ## Programs | Program | Role | |---|---| | `display` | The display server: owns the framebuffer and the input devices, gives each app a window (shared memory), composites the foreground app and the status bar, and sends input to the app it belongs to; it also keeps the clipboard every app shares, shows notifications as banners, and locks the screen behind the password that opens the data. | | `launcher` | The home screen: the installed apps, and starting them. | | `store` | Installs software from a package source. | | `updates` | In the background: looks for new versions of the installed apps, and tells of them or installs them, as Settings chose (`docs/store.md`). | | `settings` | The device's name, its screen, network and Wi-Fi (the networks nearby, joined with a password), disks and system; it may write `/settings`, which apps cannot. | | `terminal` | Starts commands and draws what they send: typed records (`records`), not bytes; stops them with KILL (`docs/terminal-and-agent.md`). | | apps | Draw into their window and tell `display` what changed. | They are written against `rt` (system calls, a heap, channels) and `gfx` (drawing: shapes, images, and text from the TrueType font on the system disk, each glyph traced by `ttf`, rasterised once a size by `vector`). No screen has a fixed size. The kernel learns the screen's size from the device; the display server gives each app a window the size of the area between its status bar and home bar; and every app lays itself out from its window's size through `layout`, pure functions from a size to rectangles: a window is compact, medium or expanded by its width, content sits in a column of at most a comfortable width, grids take as many columns as fit, and Messages shows its contact list and a conversation side by side when there is room. `cargo xtask` taps by the same functions, so its demos run on any screen size.