Skip to content

Kernel Internals

The kernel boots through GRUB and Multiboot2 into x86-64 long mode. It schedules ring-0 tasks and ring-3 ELF programs, dispatches syscalls through int 0x7f, and provides hardware access and filesystem mounts. TCP/IP stacks, the desktop and application runtimes live in userland.

Applications and userland network stacks call SDK libraries and the kernel ABI; the kernel provides tasks, memory, filesystems and hardware access.

Kernel and userland responsibilities. TCP/IP connection state stays in userland; the kernel routes frames and exposes device access.

Start with Boot and Initialization, then follow the subsystem that owns the behavior you are investigating. For application development, use the SDK and ABI Specification.

Subsystem Guides Source directory
Boot and initialization Boot sequence, Subsystem setup, Build and Run src/init/, iso/boot/boot.asm
Tasks and IPC Scheduler, Processes, IPC src/task/
Memory Memory map and paging, Allocators src/mem/, linker.ld
Filesystems VFS, RAM disk and boot archive, FAT12/FAT16, ISO9660 src/fs/
Networking Routing and delivery, NICs and serial, Protocol helpers, WireGuard src/net/
Video Framebuffer and capture, VGA src/video/
Audio HD Audio PCM, Speaker and MIDI syscalls src/audio/
Input Input routing, Keyboard, Mouse, USB firmware handoff src/input/, src/usb/

Current Interfaces

There are 32 scheduler slots. Each ELF process has a private 2 MiB image and a slot-specific initial stack; the shared user heap can grow beyond its initial 4 MiB. The writable RAM disk at /mnt/tmp and the read-only boot archive at /mnt/tar allow application loading on machines without a floppy or CD driver.

The graphics session's init_rc task supervises Memento. A cooperative desktop relaunch replaces it after a Jug update while keeping the RAM disk and background services. An ordinary session exit retains the reboot policy described in Build and Run.

Networking supports RTL8139 and selected Intel NICs, loopback, and a userland WireGuard daemon. Network monitoring exposes physical NIC traffic totals and TCP port owners through syscalls 0x45 and 0x46.

Debugging and Validation

Use the text kernel's rescue shell for task, heap, mount, NIC, ACPI and USB diagnostics. On either video path, /mnt/tmp/KERNDBG.LOG contains the boot debug log. See Tests for host unit tests, publisher tests and the QEMU kernel self-test.

Related documentation: Documentation home, SDK Overview, ABI Specification.