mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-25 16:52:29 +00:00
c43e4199dbde20cd1a791ead24a20cb057a52b42
- Implement MBR and GPT partition table parser in pure memory-safe Rust - Implement NetFilter packet filter rule evaluator and metrics in Rust - Implement in-kernel cryptographic throughput benchmark in Rust - Add 'cryptobench', 'fdisk', and 'rfilter' LazyBox userland applets - Update C-FFI header and cross-architecture fallbacks
SUB-OS: Modular Monolithic Linux-Compatible Operating System
_____ _ _ ____ ____ _____
/ ____| | | | _ \ / __ \ / ____|
| (___ | | | | |_) |______| | | | (___
\___ \| | | | _ <|______| | | |\___ \
____) | |__| | |_) | | |__| |____) |
|_____/ \____/|____/ \____/|_____/
SUB-OS is a multi-architecture, production-grade modular monolithic operating system kernel engineered in C and Assembly. Built for high performance, modularity, and Unix/Linux compatibility, SUB-OS supports 64-bit x86 (x86_64), 64-bit ARM (aarch64), and 32-bit ARM (armv8i / AArch32) targets.
🌟 Key Architecture & Capabilities
- 🎯 Multi-Architecture HAL:
x86_64(AMD64 / Intel 64): Custom 2-stage MBR bootloader, E820 BIOS memory mapping, 4-level PML4 48-bit paging, GDT, 256-entry IDT, 8259 PIC, 8254 PIT timer.aarch64(ARMv8-A 64-Bit): Exception levels (EL1), 16-entry vector table, ARM Generic Interrupt Controller (GICv2), ARM Generic Arch Timer (100 Hz), Stage-1 39-bit VA MMU, PL011 UART.armv8i(ARM32 / AArch32): Banked exception mode stacks (IRQ, ABT, UND, SVC), VMSAv7 1MB Section MMU, GICv2 distributor, CP15 Generic Timer, VFP/NEON FPU, PL011 UART.
- 🎛️ Linux-Style Kconfig TUI Configurator (
make configure):- Full interactive
lxdialogGUI interface (Royal Blue backdrop, floating modal windows, drop shadows, and menu hierarchy). - Dynamic Kbuild-style selective compilation based on
.configandinclude/config/autoconf.h.
- Full interactive
- 📁 Storage & Filesystem Layer:
- FAT32 (VFAT) storage driver with directory traversal and
/mnt/fat32auto-mounting. - Second Extended (EXT2) Linux filesystem driver.
- Virtual File System (VFS): POSIX
open,read,write,close,seek,mountinterface. - Synthetic DevFS (
/dev), ProcFS (/proc), and Sysfs KObject Hierarchy (/sys). - Dynamic in-memory RAM disk (
/dev/ram0).
- FAT32 (VFAT) storage driver with directory traversal and
- 🖧 Hardware Device Drivers:
- Storage Controllers: NVMe PCIe SSD, AHCI SATA 6Gb/s, IDE/ATA Hard Disks, VirtIO-Block.
- Network Adapters: Intel 82540EM Gigabit Ethernet, Realtek RTL8139 Fast Ethernet, VirtIO-Net 10GbE.
- Multimedia & Display: Bochs/VBE dynamic resolution video adapter, 2D TrueColor Canvas Rasterizer, Intel High Definition Audio (Azalia HDA), AC'97 sound codec, Formant TTS synthesizer, 8-Bit Melody player.
- Bus & Sensors: PCI bus enumerator, USB 3.0 Extensible Host Controller (xHCI), HWMON CPU temperature and fan tachometer sensors, VirtIO-RNG hardware entropy generator, Unix98 PTY subsystem.
- 🌐 Networking, Firewalls & Daemons:
- Full L2–L4 IPv4 protocol stack with dynamic ARP, ICMP Echo (
ping), UDP, and full 3-way handshake TCP state machine. - NetFilter stateful packet inspection firewall (iptables).
- Built-in OpenSSH 2.0 Daemon (
sshd) on port 2222. - Built-in Micro HTTP REST API Server (
httpd) on port 8080.
- Full L2–L4 IPv4 protocol stack with dynamic ARP, ICMP Echo (
- 🔒 Kernel Security & Async Engine:
- Linux Security Module (LSM) enforcing POSIX capabilities and DAC.
- X.509 Cryptographic Keyring with signature verification.
- In-Kernel eBPF Register Virtual Machine and verifier.
- io_uring lockless asynchronous Submission/Completion ring buffers.
- Preemptive multi-tasking scheduler with Round-Robin quantum and spinlock synchronization.
- Systemd-style unit manager (
systemctl), cron background scheduler (crond), and RFC 5424 Syslog engine.
- 🧰 LazyBox Userland Suite (70+ Linux Applets):
- Interactive shell with history, tab autocompletion, ANSI cursor editing, and script runner (
sh). - GNU-compatible Nano visual text editor.
- Full utilities:
ls,cat,touch,mkdir,rm,cp,pwd,cd,grep,wc,head,tail,stat,df,mkfs.vfat,hexdump,neofetch,uname,free,uptime,top,ps,dmesg,netstat,ifconfig,ping,curl,ssh,tts,alsamixer,sensors,lsdev,lsmod, and more.
- Interactive shell with history, tab autocompletion, ANSI cursor editing, and script runner (
🏛️ Comprehensive Architecture
+------------------------------------------------------------------------------------+
| USERLAND & SYSTEM SUITE |
| Interactive Shell | GNU Nano | Script Runner (sh) | LazyBox Suite (70+ Tools) |
| Micro HTTP Server | SSH 2.0 Daemon | Service Manager (systemctl) | Syslog Engine |
+------------------------------------------------------------------------------------+
| VIRTUAL FILE SYSTEM LAYER (VFS) |
| vfs_namei | RAMFS (/) | /dev (devfs) | /proc (procfs) | /sys (sysfs) | FAT32 | ext2|
+------------------------------------------------------------------------------------+
| NAMESPACES, INTER-PROCESS COMMUNICATION & ASYNC I/O ENGINE |
| PID/UTS Isolation | Pipes | Message Queues | Shared Memory | Semaphores | io_uring|
+------------------------------------------------------------------------------------+
| CORE KERNEL SERVICES, SECURITY & TRACING |
| Preemptive Scheduler | Fast Syscalls | Dynamic Modules | eBPF Virtual Machine |
| LSM POSIX Capabilities | X.509 Keyring | Workqueues | Telemetry & Kernel Tracer |
+------------------------------------------------------------------------------------+
| NETWORKING, NETFILTER FIREWALL & SOUND ARCHITECTURE |
| Ethernet | ARP | IPv4 | ICMP | UDP | TCP | DHCP | DNS | Sockets | NetFilter FW |
| Embedded HTTP Server (8080) | SSH Server (2222) | Intel HDA | AC'97 | Formant TTS |
+------------------------------------------------------------------------------------+
| DEVICE DRIVER TREE |
| NVMe PCIe SSD | AHCI SATA | ATA IDE | VirtIO-Blk | Ramdisk (/dev/ram0) |
| Intel E1000 NIC | RTL8139 NIC | VirtIO-Net | USB 3.0 xHCI | HWMON Sensors |
| Bochs VBE Display | 2D Canvas | VGA / TTY1-4 | 16550 Serial | PL011 UART |
+------------------------------------------------------------------------------------+
| HARDWARE ABSTRACTION LAYER (HAL) |
| x86_64 (AMD64/PML4) | aarch64 (ARMv8-A/GICv2/MMU) | armv8i (AArch32/Section MMU) |
+------------------------------------------------------------------------------------+
🚀 Quick Start Guide
1. Prerequisites
Install the standard build essentials and cross-compilers:
# Ubuntu / Debian
sudo apt update
sudo apt install build-essential nasm qemu-system-x86 qemu-system-arm \
gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu \
gcc-arm-linux-gnueabihf binutils-arm-linux-gnueabihf \
dialog python3
2. Linux-Style TUI Configuration
Launch the interactive Kconfig configurator:
make configure
(Also available via make menuconfig)
Fast Architecture Presets:
make x86_64_defconfig # Configure for x86_64 (Intel / AMD 64-Bit)
make aarch64_defconfig # Configure for 64-bit ARM (Cortex-A57)
make armv8i_defconfig # Configure for 32-bit ARM (Cortex-A15)
3. Compilation & Live Emulation
Target: x86_64 (Default)
make x86_64_defconfig
make
make run
Port forwardings automatically configured in QEMU:
- SSH Server:
ssh root@localhost -p 2222(Password:root) - HTTP REST API:
http://localhost:8080/api/status
Target: aarch64 (ARMv8-A 64-Bit)
make aarch64_defconfig
make ARCH=aarch64
make run ARCH=aarch64
Target: armv8i (ARM32 / AArch32)
make armv8i_defconfig
make ARCH=armv8i
make run ARCH=armv8i
Graphical Window Emulation (Optional SDL/GTK GUI)
make run-gui
🧰 LazyBox Command Matrix (70+ Utilities)
| Category | Commands Included |
|---|---|
| Core & Shell | lazybox, sh, echo, env, export, whoami, id, date, cal |
| Filesystem & Edit | nano, ls, cat, touch, mkdir, rm, cp, pwd, cd, wc, head, tail, stat, df, mkfs.vfat, grep, hexdump |
| Networking & Servers | ifconfig, ping, arp, dhclient, nslookup, netstat, iptables, httpd, sshd, curl, wget, ssh |
| Hardware & Devices | lspci, lsdev, lsblk, hdparm, sensors, speaker, mouse, alsamixer, tts, virtinfo |
| Security & SysAdmin | su, passwd, useradd, certcheck, capsh, ipcs, logger, logread, systemctl, service, crontab |
| Kernel & Tracing | lsmod, insmod, rmmod, slabinfo, trace, unshare, io_uring_test |
| Diagnostics & Metrics | neofetch, uname, free, uptime, top, htop, ps, dmesg, vmstat, iostat, calc, matrix |
| System Control | clear, help, sleep, reboot, shutdown, poweroff, tty |
📦 Official Release
Download precompiled kernel binaries and bootable disk images from GitHub: 👉 SUB-OS v0.0.1-beta Release
📄 License
SUB-OS is distributed under the open-source MIT License. See LICENSE for details.
Languages
C
86.7%
Rust
4.2%
Python
2.9%
C++
2.6%
Assembly
1.8%
Other
1.8%