New to WayOS? Start with QUICK_START.md.
A custom operating system built from scratch with a microkernel architecture, higher-half kernel mapping, SMP support, and an integrated AI subsystem with kernel-managed tensors.
WayOS is an educational/research OS featuring:
- Multi-architecture kernel (
x86_64+aarch64) with shared core subsystems - Direct physical map at
0xFFFF800000000000for zero-copy kernel access - User-mode servers (console, AI daemon, network daemon) communicating via IPC ports
- AI subsystem with kernel tensors, compute graphs, model loading, and inference scheduling
- SMP support with per-CPU data (
GSon x86_64,TPIDR_EL1on aarch64) - Security via capabilities, syscall filtering, and SMEP
| Subsystem | Description |
|---|---|
| PMM | Buddy allocator with per-tier allocation (DDR4 + VRAM-sim) |
| VMM | VMA-based virtual memory with demand paging and Copy-on-Write |
| Scheduler | 6-priority multi-queue scheduler (RT inference to idle) |
| IPC | Port-based message passing with RPC call/reply pattern |
| tmpfs | Writable in-memory filesystem (512 inodes, 1MB/file max) |
| Security | Process capabilities, syscall filter bitmask, SMEP |
| Unified Memory | 2-tier memory with placement hints and migration daemon |
| AI | Kernel tensors, compute graphs, model files (.waymodel), inference queue |
| Networking | VirtIO-net legacy driver, user-mode netd (ARP/ICMP/UDP) |
| SMP | ACPI MADT parsing, LAPIC timer, IOAPIC routing, AP boot |
| Architecture | Status | Notes |
|---|---|---|
x86_64 |
Primary / fully tested | ISO boot flow, full userland test suite |
aarch64 |
Functional | Boots to shell, core userland/process lifecycle functional, raw-kernel boot flow |
- GCC (x86_64 cross-compilation capable)
gcc-aarch64-linux-gnu(forARCH=aarch64)- NASM
- GNU LD
- GRUB (
grub-mkrescue) - xorriso
- QEMU (
qemu-system-x86_64,qemu-system-aarch64)
make # Build x86_64 (default)
make ARCH=x86_64 # Build x86_64
make ARCH=aarch64 # Build aarch64
make clean ARCH=x86_64 # Clean x86_64 build artifacts
make clean ARCH=aarch64 # Clean aarch64 build artifactsmake run ARCH=x86_64 # Boot x86_64 in QEMU
make run ARCH=aarch64 # Boot aarch64 in QEMU
make debug # Boot x86_64 with GDB stub
make test ARCH=x86_64 # Run x86_64 automated test suite
make test ARCH=aarch64 # Run aarch64 automated test suite
./scripts/test_all_arches.sh # Run both architecturesmake test ARCH=x86_64
make test ARCH=aarch64Runs all test suites in QEMU and reports pass/fail counts.
Run these from the WayOS shell:
| Command | Tests | Expected |
|---|---|---|
hardtest |
Hardening + trust-boundary validation | 21/21 pass |
sectest |
Security + capability/filter matrix | 16/16 pass |
fstest |
Filesystem operations | 13/13 pass |
vmtest |
Virtual memory & CoW | 7/7 pass |
smptest |
SMP & multi-CPU | 7/7 pass |
ainfer all |
AI inference (Phase 3) | all pass |
ainfer4 all |
AI real compute (Phase 4) | all pass |
ainfer5 all |
AI hardening/lifecycle/ownership | all pass |
umemtest |
Unified memory integration | all pass |
ps, uname, clear, uptime, smpinfo, kstats, lspci, memtier
ls, cat, touch, write, rm, mkdir, cp, mv
grep, wc, head, tail, echo, yes
ping, netstat, nettest, fetch
ainfer, ainfer4, mkmodel
hardtest, sectest, fstest, vmtest, smptest, shelltest, nettest
klog, diagdump, version
virtio_blk, virtio_gpu
wayos/
├── kernel/
│ ├── arch/x86_64/ # x86_64 architecture code
│ │ ├── boot/ # Multiboot2 header, boot.S, linker script
│ │ ├── cpu/ # GDT, IDT, TSS, ACPI, LAPIC, IOAPIC, SMP, per-CPU
│ │ ├── io/ # Serial, VGA, keyboard, PCI
│ │ ├── mm/ # Paging, early map
│ │ └── syscall/ # SYSCALL entry (assembly)
│ ├── arch/aarch64/ # aarch64 architecture code
│ │ ├── boot/ # EL2->EL1 setup, linker script
│ │ ├── cpu/ # Exceptions, GIC, timer, SMP, per-CPU
│ │ ├── io/ # UART, PCI stubs
│ │ ├── mm/ # Paging, early map
│ │ └── syscall/ # SVC entry (assembly)
│ ├── core/ # PMM, VMM, process, thread, scheduler, IPC, tmpfs, syscall
│ ├── lib/ # String, printf, panic, bitmap, rbtree
│ ├── mm/ # Unified memory (topology, placement, migration)
│ ├── net/ # VirtIO-net driver
│ └── ai/ # Tensor, accelerator, compute graph, model, inference
├── userland/
│ ├── init/ # Init process
│ ├── waysh/ # Shell
│ ├── servers/ # Console, AI daemon, netd
│ ├── libc/ # Minimal C library (stdio, stdlib, string, malloc)
│ └── coreutils/ # User commands
├── drivers/
│ ├── storage/ # VirtIO block (stub)
│ └── gpu/ # VirtIO GPU (stub)
├── tools/ # Host tools (mkramfs)
├── scripts/ # QEMU run/debug/test scripts
└── iso/ # GRUB config
- Phase 1: Kernel foundation — boot, PMM, VMM, process/thread, scheduler, IPC, ramfs, ELF loading, shell, fork/exec, signals
- Phase 2: Unified memory — topology discovery, per-tier PMM, placement policy, page migration daemon, 2-tier simulation
- Phase 3: AI foundation — kernel tensors, simulated accelerators, compute graphs, model registry, inference scheduler, AI daemon, IPC-based inference
- Phase 4: Writable FS + networking — tmpfs (create/write/delete), CoW fork, MAP_SHARED, PCI enumeration, VirtIO-net driver, user-mode netd
- Phase AI-4: Real compute — tensor math (matmul/relu/softmax), graph execution, .waymodel file format, kernel inference queue, daemon scheduler
- Phase 5: User experience — FD rework, pipes, dup2, shell pipes & redirection, env vars, libc (malloc, FILE, snprintf), expanded coreutils
- Phase 6: SMP — ACPI/LAPIC/IOAPIC, per-CPU data, AP startup, SMP-safe kernel, spinlocks, schedule_finish pattern
- Phase 7: Security — capabilities, syscall filter, IPC access control, SMEP, user pointer validation
- Phase 7b: Hardening — 10 bug fixes from code review (buffer overflows, locks, page table teardown, scheduler cleanup)
- Phase 7c: Correctness — VMM overlap/partial unmap, parent-child wait, ELF/fork cleanup, TLB shootdown, copy_from/to_user, tensor overflow checks
- Phase 7d: Quality — .gitignore, MAX_CPUS warning, VirtIO stubs in build, kernel metrics (kstats), test infrastructure, documentation
qemu-system-x86_64 \
-cdrom build/x86_64/wayos.iso \
-m 256M \
-serial stdio \
-display none \
-no-reboot \
-smp 2 \
-netdev user,id=net0 \
-device virtio-net-pci,netdev=net0
# Recommended for AArch64 (includes DTB handoff setup for current ELF boot mode):
./scripts/qemu-run.sh aarch64
# Equivalent manual AArch64 flow:
qemu-system-aarch64 -M virt,dumpdtb=build/aarch64/qemu-virt.dtb -cpu cortex-a72 -m 256M -display none -S
qemu-system-aarch64 \
-M virt \
-cpu cortex-a72 \
-m 256M \
-serial stdio \
-display none \
-no-reboot \
-smp 2 \
-kernel build/aarch64/wayos.kernel \
-device loader,file=build/aarch64/qemu-virt.dtb,addr=0x48000000,force-raw=on