How ginnOS works¶
This part is for people who work on ginnOS itself: the boot, the kernel, the drivers, the libraries and the desktop, and how to build and test them.
- The architecture: from the power button to the desktop, and how the parts talk.
- The boot: the disk image, Limine, the two kernels and
boot_info_t. - Memory: the address space, frames, the kernel heap, page faults, copy on write and shared memory.
- Processes, threads and the scheduler: the process
table,
fork,clone,execve, the time slices, and the locks. - Several cores: the data of each core, and the steps to run on all cores.
- Signals: how a signal goes to a process, the defaults, and who sends them.
- The file systems: the VFS, open files, ext2 and the block cache, devfs, tmpfs and procfs.
- The network stack: the layers, the routes, the sockets and Unix sockets.
- The package manager: the package file, the database, the transactions, upgrades and settings files, and the signed repository.
- Random numbers: the pool, the generator, and
getrandom. - The desktop stack: the display, heimdalld, its protocol, idunn, asgard and Bifrost.
- The drivers: the list of drivers, interrupts, ACPI, and what a real PC needs.
- Testing: kernel tests, host tests and test programs, and how to write each.
- Build ginnOS: the build, the tests and the debugger.
- The code style:
STYLE.md.
The source tree¶
| Folder | What it contains |
|---|---|
src/arch/x86/ |
the code for i686 and x86_64: the boot entry, the GDT, the IDT, the paging, the context switch, the system call entry. The other folders in src/arch/ are empty |
src/bootloader/ |
the old two-stage BIOS bootloader (BOOTLOADER=custom) |
src/common/ |
code that the kernel and the old bootloader share: strings, memory, printf, the boot information |
src/kernel/ |
the kernel: memory, processes, the scheduler, signals, the VFS, the system calls, the network stack, randomness, the TTY, sound |
src/drivers/ |
the device drivers: disks, keyboard, mouse, PCI, USB, sound, video, virtio, the timers, the serial port |
src/fs/ext2/ |
the ext2 filesystem |
src/test/ |
the kernel tests for make test |
src/libc/ |
the C library, with its headers in src/libc/include/ and its tests in src/libc/test/ |
src/lib/ |
the libraries for programs: gfx, bragi, idunn, heimdall, conf, apps, mime, icon, image, vt, rat |
src/user/ |
the programs: init, the shell, the desktop and its apps, the network tools, the test programs |
ports/ |
the build scripts for programs from other projects |
linker/ |
the linker scripts |
mk/ |
the parts of the build |
tools/ |
the tools for the build: the disk image, Limine, the toolchain, the fonts, the icons, the wallpaper, gdb |