Ardux is an independent, general-purpose operating system kernel built from scratch for the x86-64 architecture.
- Architecture: x86-64 (AMD64) Long Mode.
- Boot Protocol: Multiboot-compliant bootloader (GRUB2 ISO boot).
- Console Output: Dual early console drivers supporting both VGA text mode buffer (
0xB8000) and 16550 UART serial port COM1 (0x3F8). - Memory: Ardux-owned 4-level 4 KiB virtual memory manager over a Multiboot-parsed bitmap physical page manager, plus demand-backed 256 MiB kernel heap with 16-byte aligned
kmalloc, zeroedkcalloc, validatedkfree, splitting, coalescing, trailing-page reclamation, and deterministic self-tests. Early 2 MiB boot mappings are replaced at runtime. - Interrupts & Exceptions: 256-entry IDT with 64-bit interrupt gates, assembly ISR stubs for vectors 0–31, hardware/synthetic error-code normalization, dynamic System V ABI stack alignment, centralized C exception dispatcher with diagnostic dumps, plus Local APIC and I/O APIC hardware IRQ infrastructure with vector 32–48 dispatch, registered handlers, EOI, and 100 Hz Local APIC timer calibration.
- Multitasking: Kernel threads with 16 KiB stacks, callee-saved context switching, round-robin scheduler, idle task, cooperative yield, timer preemption, trampoline bootstrap, exit with deferred reaping, and deterministic self-tests.
- User-Kernel Boundary: Ring-3 tasks with private address spaces, SYSCALL and SYSRETQ entry, ABI with exit, write, gettid, open, read, close, lseek, fstat, exec, wait, waitpid and fork, user pointer validation, fault isolation and cleanup.
- Processes and ELF: Process abstraction with distinct PID and TID, ELF64 loader for ET_EXEC with PT_LOAD mapping, permission enforcement, BSS zero fill, argv stack setup and filesystem-backed test executables.
- Filesystem and VFS: RAM block device with 512-byte sectors, read-only ArduxFS with superblock, inodes and directories, kernel VFS with open, read, seek, stat and close, plus file-backed ELF execution.
- Process Lifecycle: Per-process file descriptor tables with console descriptors, open, read, close, lseek, fstat, exec with argv, parent and child processes, zombies, blocking wait and waitpid, orphan reaping and leak-free cleanup.
- Fork and Copy On Write: Native fork with shared physical pages, per page reference counting, software COW bit 9, writable to read only conversion, write fault private copy, TLB invalidation, stack and data isolation, FD inheritance with shared offsets, exec and wait integration, recursive and multi process sharing, rollback and PMM stability across 64M through 1G with user tests forktest cowtest fdinherit forkexec and kernel T1 through T42 self test.
- Demand Paging and VM Regions: Centralized fault management with VM maps, demand zero anonymous pages, lazy ELF loading with retained images and partial zero fill, lazy stack growth with guard enforcement and bounded growth, protection handling, COW first routing, transactional faults, fork and exec VM support, reference counted cleanup and user tests demandzero stackgrow lazyelf cowfault protfault with kernel M13 T1 through T59 self test.
- Environment: Freestanding C and x86-64 assembly with zero host
libcdependencies. - License: MIT.
ardux/
├── Makefile
├── README.md
├── LICENSE
├── docs/
│ ├── architecture.md
│ ├── boot.md
│ ├── memory.md
│ ├── virtual-memory.md
│ ├── kernel-heap.md
│ ├── interrupts.md
│ └── development.md
│
├── kernel/
│ ├── arch/
│ │ └── x86_64/
│ │ ├── boot/
│ │ │ ├── boot.S
│ │ │ └── linker.ld
│ │ ├── cpu/
│ │ ├── interrupts/
│ │ │ ├── isr.S
│ │ │ ├── irq.S
│ │ │ ├── idt.c
│ │ │ ├── exception.c
│ │ │ ├── irq.c
│ │ │ ├── apic.c
│ │ │ ├── ioapic.c
│ │ │ └── timer.c
│ │ ├── task/
│ │ │ └── context.S
│ │ ├── memory/
│ │ │ ├── boot_memory.c
│ │ │ └── paging.c
│ │
│ ├── sched/
│ │ ├── task.c
│ │ └── scheduler.c
│ ├── core/
│ │ ├── kernel.c
│ │ ├── panic.c
│ │ └── printk.c
│ │
│ ├── mm/
│ │ ├── heap.c
│ │ ├── pmm.c
│ │ └── vmm.c
│ ├── sched/
│ ├── process/
│ ├── syscall/
│ ├── ipc/
│ ├── fs/
│ ├── drivers/
│ │ ├── vga.c
│ │ └── serial.c
│ └── lib/
│ └── string.c
│
├── include/
│ ├── kernel/
│ │ ├── kernel.h
│ │ ├── memory.h
│ │ ├── panic.h
│ │ ├── pmm.h
│ │ ├── printk.h
│ │ ├── irq.h
│ │ ├── timer.h
│ │ ├── task.h
│ │ ├── scheduler.h
│ │ ├── serial.h
│ │ ├── string.h
│ │ ├── heap.h
│ │ ├── trap.h
│ │ ├── types.h
│ │ ├── vga.h
│ │ └── vmm.h
│ └── arch/
│ └── x86_64/
│ ├── boot_memory.h
│ ├── idt.h
│ ├── apic.h
│ ├── ioapic.h
│ ├── context.h
│ ├── io.h
│ └── paging.h
│
├── user/
├── tools/
│ └── grub.cfg
├── tests/
└── third_party/
├── README.md
└── licenses/
make isomake runTo run with graphical VGA display enabled:
qemu-system-x86_64 -cdrom build/ardux.iso -serial stdioDetailed documentation is available in the docs/ directory:
- Architecture Overview
- Boot Protocol & Control Flow
- Memory Layout, Early Paging, and Physical Memory Manager
- Virtual Memory Manager
- Kernel Heap
- Interrupt & Exception Architecture
- Hardware Interrupts, APIC, and Timer
- Scheduler and Kernel Multitasking
- System Calls and User-Kernel Boundary
- Processes
- ELF Loader
- Filesystem
- VFS
- File Descriptors
- Process Lifecycle
- Fork
- Copy On Write
- Demand Paging
- Virtual Memory Regions
- Development & Debugging Guide
- Third-Party Code Registry