mojezhasan24/ZironOS
This zig based operating system is in its initial stages of developement. stay tuned for future updates.
๐ท ZironOS โ A Tiny 32-bit Kernel in Zig
ZironOS is a minimalistic multiboot-compliant kernel written in Zig and x86 assembly. It boots with a boot animation using GRUB, prints to the screen using VGA text mode, and captures real-time keyboard input using raw scancodes.
https://github.com/user-attachments/assets/b72d2211-24b0-430e-97fb-9e2410b250c9
๐ฒ Project Structure
ZironOS/
โ โโโ main.zig # Kernel logic (VGA + Keyboard input)
โ โโโ boot.s # Entry point (_start) & stack setup
โโโ iso_root/
โ โโโ boot/
โ โโโ grub/
โ โโโ grub.cfg # GRUB bootloader config
โโโ build.zig # Zig build system
โโโ linker.ld # Linker script with multiboot header
โโโ Makefile # Build + run automation
โโโ README.md # This file
๐งฐ Requirements
Zig 0.11.0
GRUB Tools: grub-mkrescue, xorriso, etc.
QEMU (for testing without physical hardware)
๐ฆ Install on Ubuntu/Debian
sudo apt update sudo apt install grub-pc-bin xorriso qemu-system-x86
๐ฆ Install on Arch
sudo pacman -S grub xorriso qemu
๐ Build and Run ๐ One-Command Boot Test
make run
๐งฑ Full Lifecycle
make check # Ensure dependencies exist make clean # Remove old build/cache make iso # Build & generate ISO image make run # Launch QEMU and boot ZironOS
๐ฅ๏ธ What ZironOS Does
โ Boots via GRUB (Multiboot 1) โ Sets up a clean stack and calls main โ Initializes a VGA buffer (80x25, 16 colors) โ Prints text in color using low-level memory writes โ Captures keyboard input and prints each character in real time
ZironOS>
Then you can start typing โ and it responds instantly! ๐งช Testing on QEMU
make run
make debug
๐ป Testing on Real Hardware (โ ๏ธ Expert-Only)
sudo dd if=zironos.iso of=/dev/sdX bs=4M status=progress
Then reboot and boot from the USB. ๐ง What's Inside
boot.s sets up the multiboot header, entry point, and stack
main.zig initializes the terminal and enters a keyboard input loop
linker.ld ensures .multiboot is placed early and sections are aligned properly
grub.cfg makes GRUB load the kernel via multiboot /zironos
๐งฑ Future Plans
โจ๏ธ Basic shell with built-in commands
๐ฆ Memory paging
๐ FAT32/EXT2 read-only FS support
๐งต Task switching & cooperative multitasking
๐ Basic driver support (timer, serial)
โ Troubleshooting ๐ป GRUB: No Multiboot Header Found?
Ensure .multiboot is the first section in linker.ld
Check objdump -h zig-out/bin/zironos โ .multiboot must be near 0x100000
๐ป "Permission denied" or PAT issues with git push?
Use a Personal Access Token instead of password
Example:
Username: your-github-username
Password: <paste your token here>
๐ฌ Credits
Built with ๐ using:
Zig 0.11.0
x86 assembly
GRUB bootloader
QEMU for testing