Skip to content

Z-Proj/ZenOS

Repository files navigation

ZenOS  ZenOS Build Check

ZenOS Logo

Warning

There might be dragons and bugs.

Overview

ZenOS is a 64-bit SMP preemptive operating system built from scratch in C and x86_64 assembly, bootstrapped with the Limine bootloader.

The project focuses on clean design, correctness, and real hardware interaction.


Key Features

Kernel

  • 64-bit x86_64 monolithic kernel
  • Symmetric Multiprocessing (SMP)
  • Preemptive round-robin SMP scheduler
  • ELF64 userspace execution
  • Dynamic loader
  • Unix-style process model
  • High-resolution timing via HPET
  • ACPI-based hardware discovery and power management

Syscalls

75+ POSIX-compatible / custom syscalls covering major app and C library needs.

Hardware & Drivers

  • Framebuffer output
  • PS/2 keyboard and mouse
  • PC speaker
  • Serial port for debugging and logging
  • Local APIC and IOAPIC interrupt handling
  • ATA disk driver (DMA/PIO, 28-bit LBA)
  • PCI bus
  • Intel e1000 Ethernet driver
  • RTC, HPET

Networking

  • TCP/IP stack
  • DNS resolution
  • zen — a package manager that fetches and installs packages over HTTP
  • wget — downloads files over HTTP/1.0

Filesystem

  • VFS layer with support for multiple mountpoints
  • FAT32 via a port of FatFs by CHAN
  • Native host-side disk image tooling (fat_man)

Userspace & Libc

  • mlibc C library.
  • ELF64 userspace programs.
  • Dynamic ELF loader : ld.so.

Applications

  • Shell & Core Utils — shell, echo, yes, sleep, cat, ls, touch, rm, stat, wc, mkdir, rmdir, pwd, mv, cp, rename
  • Process Utils — ps, kill
  • System Info — uname, time
  • Math — calc, primes, fibonacci, counter
  • Text & UIHarp (Custom compositor and server for Zen), terminal (PTY terminal emulator), edit (non-harp text editor), clock, beep, mouse, FIGlet, Kilo, DOOM.
  • CompilersTinyCC, SmallerC
  • ScriptingLua 5.5.0
  • Networking — wget, zen package manager
  • Misc — hello, init

The ZenOS.vhd in the repository usually already has these compiled and ready. A separate Storage.vhd is present for storage.

I/O & Display

  • Flanterm for early kernel output
  • Scalable font rendering via SSFN
  • Structured kernel logging with log levels and serial output

Building

Run make help first to see available build commands.

  • Build everything: make all from the repo root
  • Missing dependencies will be reported with clear errors
  • make funcs generates funcs.txt listing all defined functions in the codebase

Contributions

All good contributions are welcome. Check ISSUES.md for open problems, or add a feature, fix a bug, or improve the codebase.


Design Goals

  • Clean, minimal, readable codebase
  • Solid foundation for experimenting with:
    • Kernel subsystems
    • Filesystems
    • Scheduling and SMP
    • Userspace ABI design
    • Unix-compatible process model (fork/exec/signals/pipes/PTY)
    • Networking (TCP/IP, DNS, HTTP)
    • Native C compilation on the OS itself
    • Lightweight everyday utilities
    • Dual-boot support

ZenOS is a learning-oriented project. Understanding the machine comes first for me.


Toolchain / Prerequisites

clang
ld.lld
nasm
basename
ninja
meson
xorriso
qemu-system-x86_64
gdb
socat

Third Party

  • Check CREDITS.md for the list of third party apps and libraries.

Showcase (may be outdated)

1 2
3 4

ZenOS