Welcome to KFS¶
KFS (Kernel From Scratch) is a long-term educational project developed at 42 Wolfsburg that explores the foundations of operating system design by building a kernel step by step, starting from nothing. Rather than relying on existing kernels or high-level abstractions, this project focuses on understanding how things actually work at the lowest level of a computer system.
The project is divided into multiple stages (kfs-1 to kfs-x), each introducing new core concepts such as booting, memory management, interrupts, multitasking, and hardware interaction. Every stage builds upon the previous one, gradually transforming a minimal bootable binary into a functional and extensible kernel.
KFS currently features:
- GDT setup
- Framebuffer output
- Paging
- Preemptive multitasking
- Reentrancy
- ATA disk support
- FPU (Lazy context switching)
- VFS
- Ext2 filesystem support
- Device files
- Procfs, Sysfs
- Userspace programs
- TTY subsystem
- VT Parsing
- Kernel modules
- Standard POSIX Signals
- IPC with socketpairs and Unix pipes.
Commands¶
make- Compile the projectmake qemu- Compile and run the projectmake clean- Remove the kernel binary.make fclean- Remove the kernel binary, iso and all other compilation generated files.
Project layout¶
docs/ # Documentation
kfs/
docs
iso # ISO configuration files
boot/
grub/
src/ # Source code
arch/
x86/
boot/
mm/
system/
debug/
drivers/
kernel/
irq/
mm/
sched/
syscalls/
time/
userspace/
utils/
mm/
userspace/
userspace # Zig userspace programs
src
zig-out # Kernel binary output directory
bin