https://rxosdev.github.io/SleepyOS/
A hobby OS in C + NASM. Boots via GRUB2 (Multiboot2) as a .iso.
Works in VirtualBox, VMware, QEMU, and on real hardware.
- GRUB2 bootloader (Multiboot2 compliant)
- 32-bit protected mode kernel
- VGA text driver — 16 colors, scrolling
- PS/2 keyboard driver (shift, caps lock)
- Interactive shell with:
help— list commandsclear— clear screenabout— about the OScolors— color palette democpuinfo— CPU vendor + feature flags via CPUIDmeminfo— memory map from Multiboot2reboot— reboothalt— halt CPU
SleepyOS/
├── kernel/
│ ├── multiboot.asm # Multiboot2 header + entry point
│ ├── kernel.c # VGA, keyboard, shell
│ └── linker.ld # Linker script (loads at 1MB)
├── iso/
│ └── boot/
│ └── grub/
│ └── grub.cfg # GRUB menu config
├── build/ # Build output (generated)
│ └── sleepyos.iso # Bootable ISO
├── build.sh # Build script (run in WSL)
└── run.sh # Launch in QEMU (run in WSL)
sudo apt update
sudo apt install nasm gcc-multilib binutils \
grub-pc-bin grub-common xorriso mtools \
qemu-system-x86cd /mnt/c/Users/diddy/Desktop/SleepyOS
chmod +x build.sh run.sh
./build.shOutput: build/sleepyos.iso
./run.sh
# or manually:
qemu-system-x86_64 -cdrom build/sleepyos.iso -m 128M- New VM → Type: Other, Version: Other/Unknown (32-bit)
- Skip hard disk
- Settings → Storage → Add optical drive → choose
build/sleepyos.iso - Start
- New VM → Other → Other
- Use ISO image:
build/sleepyos.iso - Start
# Replace /dev/sdX with your USB drive - double check with lsblk!
sudo dd if=build/sleepyos.iso of=/dev/sdX bs=4M status=progress
sudo syncBoot your machine from USB (spam F12/F2/Del at POST to get boot menu).
- GRUB reads the ISO, finds
sleepyos.elf, validates the Multiboot2 header - GRUB loads the ELF into memory at 1MB and switches to 32-bit protected mode
_startinmultiboot.asmsets up a stack and callskernel_main(magic, mb2_info)- Kernel clears VGA, draws the banner, and enters the shell input loop