Sheet 2/10 — Operating System
mzOS2
A minimal, multi-architecture operating system with one unified build.
| Layer | Operating System |
|---|---|
| Language | C · x86 asm · ARM asm |
| Targets | i386 · x86_64 · arm · arm64 |
| Depends on | mzBoot · mzBIOS · mzDTB |
| Organization | microZeus |
| Source | Private alpha — opens with a change order on this site’s log |
General notes
mzOS2 is a from-the-ground-up operating system built around a small kernel and a deliberately simple build-and-run workflow. One CMake invocation targets i386, x86_64, ARM, or ARM64 — and all four architectures boot the full kernel lifecycle. The project exists to prove that cross-architecture OS development does not require four different toolchains and four different mental models.
The kernel has grown well past hello-serial: virtual memory with guarded per-process page tables, SMP bring-up with per-CPU state, process management with atomic PID/TID allocation, and userspace programs with their own libc and linker — running with full parity on all four architectures, after arm64 gained a paged kernel on the real long-descriptor MMU, EL0 entry with SVC dispatch, and fork()/clone() to match its siblings. Drivers load dynamically — .ko modules relocated at runtime from disk, through a loader that bounds-checks every on-disk offset and verifies each module against a manifest before loading it — and the running kernel is queryable through /proc (cpuinfo, processes, stat).
The firmware story is vertically integrated: mzBoot, mzBIOS, and mzDTB ship as nested submodules, so the kernel boots on hardware paths that microZeus also drew. Configure, build, and boot into QEMU with three commands — on Ubuntu or macOS, with cross-compilation handled per-architecture by explicit LLVM target triples.
Bill of materials — what’s in the box
- All four architectures — i386, x86_64, ARM, ARM64 — boot the kernel and run userspace with full parity
- SMP with per-CPU state and concurrent scheduling on application processors by default; virtual memory with guarded per-process page tables
- Dynamic drivers: on-disk .ko modules, manifest-verified and relocated at runtime by a hardened, bounds-checked loader
- Userspace programs with their own libc and linker; fork/clone and syscalls on every arch
- Multi-threaded userspace on all four architectures: thread_create over clone(CLONE_VM), per-process fd/thread locking
- mmap/mprotect/munmap with per-thread FP/SIMD state — userspace programs can JIT code and use floats
- /proc introspection: cpuinfo, processes, stat
- mz IPC: cross-process shared memory, named ports, and message channels
- mzwm compositor + client APIs: multi-window compositing (z-order, focus), per-window coexisting OS personalities, Win32 (mzwin) and Cocoa (mzmac) shims, and the ecosystem’s own mzWin library ported onto the protocol — all over kernel IPC
- Runs mzVolk (software Vulkan) freestanding at boot and renders pixels to a compositor window — GFX Phase 4, the mz graphics stack on its own OS (interpreter-only for now)
- Hardened by audit: ext4 geometry and dirent bounds, fail-closed user-pointer validation
- Boots via its own bootloader (mzBoot), BIOS (mzBIOS), and device trees (mzDTB)
- Kernel-native virtio-blk block driver on ARM/ARM64 — disk I/O via mzBIOS services, or the native driver on direct -kernel boot
- Single CMake build; QEMU run, debug, and headless targets built in
- Cross-compiles from macOS with Homebrew LLVM — no PATH surgery