Skip to content
/ ZenOS Public

The ZenOS Operating System: x86_64 Hobby OS

Notifications You must be signed in to change notification settings

Z-Proj/ZenOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZenOS  ZenOS Build Check

ZenOS Logo

Warning

There might be dragons and bugs.

Overview

ZenOS is a modern 64-bit SMP Preemptive custom operating system, developed entirely from scratch using C and x86_64 assembly, and bootstrapped with the Limine bootloader.

The project focuses on clean design, correctness, and practical experimentation with real hardware concepts, while remaining lightweight and understandable. ZenOS is not a fork of an existing OS, nor is it POSIX-complete by design - it is a ground-up system built to explore kernel architecture, hardware interaction, and userspace execution in a controlled and extensible way. (Note: This is not a Unix / *nix like OS. My goal is to have the cleanest and well structured OS, while remaining optimized and providing userspace plenty.)


Key Features

Kernel

  • 64-bit x86_64 monolithic kernel
  • Symmetric Multiprocessing (SMP) with full AP startup
  • Pre-emptive round-robin scheduler
  • Kernel ↔ userspace context switching
  • Custom syscall ABI with assembly entry path
  • ELF64 executable loading
  • Userspace process support
  • CPU feature detection via CPUID
  • SSE and FPU initialization and management
  • Spinlock-based synchronization primitives
  • High-resolution timing via HPET
  • ACPI-based hardware discovery and power handling

Hardware & Drivers

  • VGA output
  • PC speaker support
  • Serial output for debugging and logging
  • Local APIC and IOAPIC interrupt handling
  • ATA disk driver (PIO, 28-bit LBA)
  • Socket read/write
  • PCI bus enumeration
  • Intel e1000 Ethernet driver (early-stage networking)
  • Others include RTC, HPET, Keyboard (PS/2), Mouse (PS/2)

Filesystem

  • FAT32 (FatFs) port of FatFs made by CHAN
  • Native host-side file management tooling (fat_man)
  • Used as the primary medium for userspace ELF binaries

Userspace

  • ELF64 userspace programs
  • Custom syscall interface (Currently 49 present.)

Current Apps (Subject to change, this might be outdated):

  • Calculator with +,-,*,/,%,^ (calc.c)
  • C4 : C in 4 functions compiler. (cc.c)
  • Clock - Live clock (clock.c)
  • Counter program (counter.c)
  • Fibonacci sequence (fibonacci.c)
  • Figlet - Graphical figlet style thingy (figlet.c)
  • GFX Server - Graphics server for Unicode text / shapes (gfxserver.c)
  • GFX Test - Program to test the above server (gfxtest.c)
  • Hello, world! (hello.c)
  • Init (init.c)
  • Memory functions test (memtest.c)
  • Prime numbers till 100 (primes.c)
  • Shell - Simple Shell (shell.c)
  • SmallerC compiler to Assembly (smlrc.c)
  • Snake (snake.c)
  • Sysinfo - Graphical + More detailed system info (sysinfo.c)
  • Template program (test.c)
  • Uname - System info (uname.c)
  • Word counter (wc.c)
  • Yes - Spam whatever you say (yes.c)

The ZenOS.vhd file in the repository already usually has these programs in it.

Graphics & I/O

  • Flanterm terminal rendering
  • Unicode and scalable fonts support via SSFN.
  • Clean logging system

Building

  • Run : make all at the root of the cloned git repo.
  • Any issues will be reported, to which you can take necessary action, such as missing dependencies.
  • For convenience, (make funcs) has been provided, running it will generate funcs.txt with all functions defined in the OS.

Contributions

All good contributions are gladly welcome! It is suggested to fix an issue in the ISSUES.md, or you can add a feature, fix another unlisted bug, make ZenOS overall better!


Design Goals

  • Maintain a clean, minimal, and readable codebase

  • Provide a solid foundation for experimentation with:

  • Kernel subsystems

  • Filesystems

  • Scheduling

  • SMP

  • Userspace ABI design

  • Support simple dual-boot usage and lightweight utilities such as a Calculator, Text editor, simple apps, File Manager, System Info, etc. (Now in progress)

ZenOS is intended as a learning-oriented operating system project, prioritizing understanding the machine over chasing checklists.


Toolchain / Prerequisites

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

Third party sources


ZenOS

About

The ZenOS Operating System: x86_64 Hobby OS

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages