k is a simple kernel for the x86 architecture.

The project was started by the LSE, by setting up the bootloader and the build system.

The project was obviously done in C and assembly language.

Protected mode

The kernel had to be set up to be running in protected mode.

Events handling

The event handling, like the keyboard, or the timer was one of the most interesting part.

I created interrupts and exception handlers, set up the PIC and export some syscalls for the keyboard and the timer.


The filesystem used by k is called the kfs.

Each file is represented by an inode, and the data is split in blocks.

For more information, the KFS.

Binary loader

k is a mono-task kernel. It can load one ELF at a time, and execute it.

Jump to userland

This is the part where the actual execution of a program starts.

After loading the ELF, we have to setup an userland environment for the execution. This consists in setting up a stack, a heap and jump to an unprivilegied mode of the OS.

For more information, the k project.