Skip to content

Latest commit

Β 

History

705 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧬 CryptixOS

CryptixOS is a modern, modular, Unix-like operating system for x86_64 and aarch64, written entirely in C++. It features its own kernel, and standard library (Prism). Designed for clarity, extensibility, and education, CryptixOS serves as a powerful base for learning OS development or building your own custom system from scratch.

License Architecture Build-Sysroot Build Check-Typos

πŸ”₯ Motivation & Goals

CryptixOS was created out of curiosity and a desire to understand how modern operating systems workβ€”from kernel bootstrapping and memory management to user-facing system calls. The goal is to build a modular, maintainable, and educational operating system from scratch, with clean C++ abstractions, not just C.

This project is ideal for:

  • Learning OS design (kernel, memory, file systems, drivers, scheduling, etc.)
  • Experimenting with low-level C++ in a systems context
  • Building an actual custom OS on real or emulated hardware

βš™οΈ Architecture Overview

CryptixOS is a monolithic kernel designed for the x86_64 architecture. It features:

  • Physical & virtual memory manager with paging and kernel heap allocation
  • Custom C++ STL-like containers (vector, string, intrusive list, unordered map)
  • Virtual filesystem layer with support for ext2 and shmem
  • ELF loading and execution for userland programs
  • Syscall interface for user-kernel communication
  • Multithreading and scheduling with future plans for SMP
  • Basic device drivers: PS/2, serial, VGA, RTC, PCI, etc.
  • It uses its own standard library (Prism) and custom build tools.

πŸš€ Build & Run Instructions

πŸ›  Prerequisites

Make sure the following tools are installed on your system:

  • C++20 compiler (GCC or Clang)
  • NASM (for low-level assembly)
  • QEMU (or Bochs) for emulation
  • Meson + Ninja (build system)
  • xbstrap + Python 3 (for sysroot management)
  • python-guestfs (for creating and formatting the root filesystem image)
  • xorriso (for ISO image creation)

πŸ“¦ Setting Up the Sysroot

Before building the kernel, you need to build the system root (toolchain and base packages). Here's how:

mkdir build-sysroot       # Create a directory for the sysroot
cd build-sysroot          # Enter it
xbstrap init ..           # Initialize xbstrap using the main repo
xbstrap install base      # Build and install base packages

This step ensures you have the tools and libraries needed for building the OS.

🧱 Building the Kernel & Image

Once the sysroot is ready:

./Meta/run.py --target-arch x86_64 --compiler clang --build-type release setup # Configure for your target architecture
./Meta/run.py --target-arch x86_64 --compiler clang --build-type release build # Build the kernel and generate a bootable .iso

πŸ’» Running in an Emulator

To run CryptixOS in QEMU:

./Meta/run.py --target-arch x86_64 --compiler clang --build-type release <run_uefi|run_bios>
  • Use run_uefi to boot via UEFI.
  • Use run_bios for BIOS boot (x86_64 only).

✨ Features

  • βœ… Fully custom C++ kernel with standard containers
  • βœ… ELF loading and userland support
  • βœ… PCI / ACPI / APIC / HPET / NVMe / PS/2
  • βœ… Multiple filesystems: ext2, tmpfs, procfs, fat32
  • βœ… Basic userland shell
  • βœ… Lazy Loading the pages
  • ⏳ Signals, AHCI, and full networking coming soon
  • ⏳ Networking
  • ⏳ Module support

πŸ“š References & Credits

Tools & Docs

  • Meson - Meson is an open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible.
  • Limine Boot Protocol
  • OSDev Wiki – A comprehensive resource for operating system development.
  • mlibc - mlibc is a fully featured C standard library designed with portability in mind.

Third-Party Projects

  • Limine - Modern, advanced, portable, multiprotocol bootloader and boot manager, also used as the reference implementation for the Limine boot protocol.
  • compiler-rt builtins – Low-level runtime library for compiler support.
  • demangler - C++, Microsoft C++, Rust and DLang name demangler
  • fmt – Fast, type-safe formatting library (used instead of stdio or iostreams).
  • freestnd-cxx-hdrs - Headers from GCC's libstdc++ that can be used in a freestanding environment.
  • magic_enum - Header-only C++17 library provides static reflection for enums, work with any enum type without any macro or boilerplate code.
  • OVMF binaries - Unofficial EDK2 nightly build
  • uACPI - A portable and easy-to-integrate implementation of the Advanced Configuration and Power Interface (ACPI).

🀝 Contributing

CryptixOS welcomes contributions in the following areas:

  • New drivers (network, USB, GPU)
  • Scheduler enhancements (preemption, SMP support)
  • Filesystem additions (FAT, ISO9660)
  • Kernel modules
  • Unit tests & test harness
  • Documentation (inline + developer guides)

🧹 Code Style

  • Use PascalCase for types and functions
  • Use m_PascalCase for private members
  • Follow Prism conventions and RAII principles
  • Prefer Ref over raw pointers

βœ… To-Do Tracker

Subsystems

Scheduler

  • βœ… Per-CPU Wait, Ready, Blocked Queues using IntrusiveLists
  • βœ… Multi-threading
  • βœ… SMP
  • βœ… WaitPid
  • βœ… Events

Memory Manager

  • βœ… Physical Bitmap Allocator
  • ⬜ Physical Buddy Allocator
  • βœ… Virtual Memory Allocator, using Red-Black Tree
  • βœ… Heap Slab Allocator
  • ⬜ Heap Slob Allocator

πŸ”Œ Drivers

🧱 Base

  • βœ… Kernel Module Loader

πŸ’Ύ Storage

  • βœ… MBR
  • ⬜ EBR
  • βœ… GPT
  • βœ… NVMe
  • ⬜ AHCI
  • ⬜ SCSI
  • ⬜ Virtio

⏱ Timekeeping

  • βœ… PIT
  • βœ… Local APIC Timer
  • βœ… RTC
  • ⬜ KVM Clock
  • βœ… HPET

⚑ IRQ Controllers

  • βœ… PIC
  • βœ… I/O APIC

🧩 Hardware Abstraction & Buses

  • βœ… PCI
  • βœ… PCIe
  • βœ… Device Tree
  • βœ… ACPI
  • βœ… Basic Power Management (Reboot, Shutdown)
  • ⬜ USB
  • ⬜ Embedded Controller

πŸ“Ÿ Character Devices

  • βœ… TTY
  • ⬜ PTY
  • βœ… Serial
  • βœ… I8042 Controller
  • βœ… PS/2 Keyboard
  • βœ… PC Speaker
  • ⬜ Virtio Console

🌐 Network Stack

πŸ“‘ Protocols

  • ⬜ ARP
  • ⬜ TCP
  • ⬜ UDP

πŸ”Œ Network Interface Cards (NICs)

  • βœ… Rtl8139
  • ⬜ Virtio NIC

πŸ“ Virtual File System

  • ⬜ Named Pipes

πŸ“‚ File Systems

  • βœ… DevTmpFs
  • βœ… Ext2Fs
  • βœ… Fat32Fs
  • βœ… ProcFs
  • βœ… TmpFs
  • βœ… Initrd
  • ⬜ SysFs
  • ⬜ DevPtsFs
  • ⬜ Plan9Fs
  • ⬜ DevLoopFs
  • ⬜ Iso9660Fs
  • ⬜ EfiVarsFs

🧠 Syscall & Core

  • ⬜ Signals
  • ⬜ Thread API
  • βœ… VFS
  • βœ… Session Management
  • ⬜ Networking

πŸ“Έ Screenshots / Output

πŸ“š License

CryptixOS is licensed under the GPL-3.0. See LICENSE for details.

About

CryptixOS is a modern, modular, Unix-like operating system for x86_64 and aarch64, written entirely in C++. It features its own kernel, and standard library (Prism).

Topics

Resources

Stars

22 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages