NexaKernel
An x86 operating system kernel written from scratch, with a different data structure behind each core subsystem.
- Kind
- Operating system kernel
- Year
- 2025
- Area
- Machines
- Built with
- C
- NASM
- x86
- GRUB
- QEMU
The question
What does an operating system look like when every part is chosen to show off a different data structure?
NexaKernel builds the kernel from the first instruction up, and pairs each subsystem with the structure a textbook would pick for it.
Why it exists
Built as an OS lab project and a data structures lab project at once: each core subsystem is built on the data structure that fits it.
How it works
From power-on to the console
- 1
Boot
GRUB loads the kernel, and the bootloader code sets up the descriptor tables and protected mode.
- 2
Memory
The frame allocator and then the 16 MB heap are initialised.
- 3
Interrupts and drivers
The interrupt table, hardware IRQs and system calls are set up, then the screen, timer, keyboard and serial drivers.
- 4
Scheduler
The scheduler starts with a circular queue for round-robin, or a heap for priority.
- 5
Console
An interactive console runs as a kernel task under the status bar.
Decisions
One data structure per subsystem
A circular queue for round-robin, a binary heap for priorities, a bitmap for physical frames and a trie for file paths. Each is chosen for the job it does, and the course material maps onto the kernel directly.
Round-robin by default, priority as a build option
The simpler policy is the default. The heap-based priority scheduler is switched on when the kernel is built.
Preemption on a timer
A 100 Hz timer drives the scheduler with ten-tick slices, so tasks share the processor without cooperating.
Not built yet
- A user mode with a shell outside the kernel
- The file system and message queues started at boot
- Multi-level feedback scheduling and the AI-driven scheduler
Built with
Languages
- C
- NASM
Infrastructure and services
- GRUB
- QEMU
Systems and hardware
- x86