Skip to content

Latest commit

Β 

History

History
65 lines (50 loc) Β· 1.64 KB

File metadata and controls

65 lines (50 loc) Β· 1.64 KB

🧠 Minimal x86 Kernel in C

πŸš€ Introduction

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.


πŸ“¦ What This Kernel Does

  • πŸ–₯ 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.

πŸ›  How to Build & Run

  • Building is easy and requires typing only one command:
make

This will create object files from kernel.asm and kernel.c then link them to get the raw kernel binary.

  • You can also use this command after making the kernel binary to get a bootable ISO:
make iso
  • 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
}

Then to boot using qemu you can either :

1- Use the ISO:

qemu-system-i386 -cdrom kernel.iso

2- Use the binary directly:

qemu-system-i386 -kernel iso/boot/kernel

πŸ”§ Requirements (on Arch Linux)

  • An x86 capable computer.
  • Packages:
sudo pacman -S qemu-full grub xorriso nasm ld gcc

note: you can also use qemu-base instead of qemu-full but 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