A pure microkernel written in Zig, targeting Apple Silicon (ARM64).
A minimal, event-driven microkernel where everything is a service communicating through message passing. Inspired by the elegance of Minix and seL4, but with a modern twist using Zig's safety features and clean syntax.
┌─────────────────────────────────────────────────────────────────┐
│ User Space Services │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ VFS │ │ Network │ │ Block │ │ Console │ │ Init │ │
│ │ Service │ │ Service │ │ Driver │ │ Driver │ │ Service │ │
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ │
│ │ │ │ │ │ │
│ └──────────┴──────────┴────┬─────┴──────────┘ │
│ │ │
│ ┌───────▼───────┐ │
│ │ IPC Messages │ │
├──────────────────────────┴───────────────┴──────────────────────┤
│ MyLittleKernel (Microkernel) │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌───────────┐ │
│ │ IPC │ │ Scheduler │ │ Memory │ │ Interrupt │ │
│ │ (message │ │ (simple │ │ (virtual │ │ Router │ │
│ │ passing) │ │ priority) │ │ memory) │ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ └───────────┘ │
└─────────────────────────────────────────────────────────────────┘
│
┌───────────▼───────────┐
│ Apple Silicon M1+ │
│ (ARM64) │
└───────────────────────┘
-
Minimal Kernel - Only four things live in the kernel:
- IPC (Inter-Process Communication) via message passing
- Process/Thread scheduling
- Virtual memory management
- Interrupt handling and routing
-
Everything is a Service - Drivers, filesystems, networking — all run in user space as isolated services.
-
Message-Driven Architecture - Services communicate exclusively through typed messages. No shared state.
-
Capability-Based Security - Access to resources is controlled through unforgeable capability tokens.
-
Written in Zig - Memory safety without garbage collection, C interop when needed, comptime magic.
- Architecture: ARM64 (AArch64)
- Primary Target: Apple Silicon Macs (M1/M2/M3)
- Boot Method: UEFI via Asahi Linux bootloader or QEMU for development
mylittlekernel/
├── src/
│ ├── kernel/
│ │ ├── main.zig # Kernel entry point
│ │ ├── ipc.zig # Message passing system
│ │ ├── scheduler.zig # Process/thread scheduler
│ │ ├── memory.zig # Virtual memory manager
│ │ └── interrupt.zig # Interrupt handling
│ ├── arch/
│ │ └── aarch64/
│ │ ├── boot.zig # ARM64 boot code
│ │ ├── mmu.zig # Memory management unit
│ │ ├── exceptions.zig # Exception vectors
│ │ └── timer.zig # ARM timer
│ └── lib/
│ └── std.zig # Freestanding stdlib subset
├── services/
│ ├── init/ # First userspace service
│ ├── console/ # Console/UART driver
│ └── vfs/ # Virtual filesystem
├── build.zig # Zig build configuration
├── linker.ld # Kernel linker script
└── README.md
- Zig 0.13+ (master recommended for ARM64 freestanding)
- QEMU with ARM64 support (
qemu-system-aarch64) - Optional: Cross-compilation toolchain for debugging
# Build the kernel
zig build
# Build and run in QEMU
zig build run
# Build in release mode
zig build -Doptimize=ReleaseSafe- Project setup
- Basic ARM64 boot code
- UART output (serial console)
- "Hello from MyLittleKernel!"
- Physical memory allocator
- Page table setup (ARM64 4KB pages)
- Virtual memory regions
- Kernel heap
- Process/Thread structures
- Context switching (ARM64)
- Simple round-robin scheduler
- Timer interrupts
- Message structures
- Synchronous send/receive
- Asynchronous notifications
- Capability system basics
- User-mode execution
- System call interface
- Init service
- Console service
- VFS service
- RAM disk
- More drivers
- Shell?
Running on actual Apple Silicon requires the Asahi Linux boot infrastructure. For development, we'll primarily use QEMU:
qemu-system-aarch64 \
-M virt \
-cpu cortex-a72 \
-m 1G \
-nographic \
-kernel zig-out/bin/kernel.elf- OSDev Wiki - Essential OS development resource
- Minix 3 - The microkernel that inspired this
- seL4 - Formally verified microkernel
- Writing an OS in Rust - Great tutorial (Rust, but concepts apply)
- Zig Bare Bones - Zig OS starting point
- ARM Architecture Reference Manual
MIT License - See LICENSE
This is a learning project! Contributions, suggestions, and discussions are welcome.
"Because the world needs another hobby OS project" 🦎