Have you ever wondered how an x86 machine boots? It's actually pretty straightforward — and now you can see it for yourself.
This project is a minimal kernel written from scratch in C, showing the bare essentials of how to boot, clear the screen, and print text — all without any OS.
- 🖥 Prints a message directly to the screen (via VGA text buffer).
- ⚙️ Boots on real hardware using
GRUB2(via Multiboot). - 🔧 Runs perfectly inside QEMU (and probably other VMs too).
- 💡 Clean, beginner-friendly code for learning low-level OS dev.
- Create object files from
kernel.asmandkernel.c:
nasm -f elf32 kernel.asm -o kasm.o
gcc -m32 -c kernel.c -o kc.o- Link the object files:
ld -m elf_i386 -T link.ld -o iso/boot/kernel kasm.o kc.o- Edit the grub.cfg file if you want to use one:
set timeout=15
set default=0
menuentry "Kernel 420" {
multiboot /boot/kernel ro
boot
}- If you want to create the ISO:
grub-mkrescue -o kernel.iso iso/Then to boot using qemu you can either :
1- Use the ISO:
qemu-system-i386 -cdrom kernel.iso2- Use the binary directly:
qemu-system-i386 -kernel iso/boot/kernel- An x86 computer.
- Packages:
sudo pacman -S qemu-full grub xorriso nasm ld gccnote: you can also use
qemu-baseinstead ofqemu-fullbut you will need a VNC viewer of some kind to see the results.
- Packages (alt):
sudo pacman -S qemu-base grub xorriso nasm ld gcc tigervnc