← Infinity Tech Stack
🛡️

PROJECT FREEDOM

BARE-METAL x86_64 UEFI OPERATING SYSTEM

A complete operating system built from scratch in Rust — zero external dependencies

Project Freedom is an x86_64 bare-metal operating system that boots via UEFI, initializes its own GDT, IDT, page tables, and heap, then presents a full graphical desktop environment with a window compositor, NexusCode IDE, file browser, terminal shell, and task manager. Written entirely in Rust #![no_std] with zero crate dependencies — every line of code, from the SHA-256 hash to the framebuffer font renderer, is hand-written.

#![no_std]Zero Dependencies30 Modules8,777 LOCUEFI BootGUI Desktop
BARE METAL#![NO_STD]ZERO DEPENDENCIESUEFI BOOTGDT/IDTPAGE TABLESWINDOW COMPOSITORNEXUSCODE IDESHA-256 LOGINMATRIX BOOT ANIMPS/2 KEYBOARDFRAMEBUFFERVIRTUAL FS30 MODULES8,777 LOCTASK MANAGERFILE BROWSERBARE METAL#![NO_STD]ZERO DEPENDENCIESUEFI BOOTGDT/IDTPAGE TABLESWINDOW COMPOSITORNEXUSCODE IDESHA-256 LOGINMATRIX BOOT ANIMPS/2 KEYBOARDFRAMEBUFFERVIRTUAL FS30 MODULES8,777 LOCTASK MANAGERFILE BROWSER
Project Freedom — Your Computer. Your Rules. Your AI. Three pillars: VitalisOS (The OS), NexusCode (The Editor), Local LLM (The AI). Zero Cloud, Zero Cost, Total Privacy.
⚠️

Zero External Dependencies

Project Freedom uses no crates, no libc, no LLVM runtime, no allocator crate. The kernel implements its own heap allocator, SHA-256, PS/2 drivers, font renderer, window compositor, and filesystem. Everything runs on bare hardware with only UEFI firmware below. This is a privately developed component of the VitalisOS ecosystem.

30
Kernel Modules
pure Rust
8,777
Lines of Code
#![no_std]
0
Dependencies
zero crates
14
Boot Time
steps to desktop
64 KB
Kernel Stack
BSS-allocated
1 KHz
Timer Rate
PIT IRQ0
0
Lines of Kernel Code
0
Kernel Modules
0
External Dependencies
🔌

14-Step Boot Sequence

UEFI → BARE-METAL → DESKTOP

The kernel boots through a precisely ordered initialization sequence. After UEFI firmware loads the binary, efi_main() takes control, sets up hardware, exits Boot Services, switches to a dedicated kernel stack via assembly trampoline, and launches the graphical desktop.

1
Serial Init
COM1 at 115200 baud 8N1
2
GOP Framebuffer
Locate UEFI Graphics Output Protocol
3
ACPI RSDP
Search configuration tables for RSDP
4
Memory Map
Get UEFI memory descriptors
5
Exit Boot Services
Transition from UEFI to bare-metal
6
GDT + TSS
Kernel/user segments, task state segment
7
IDT
32 exceptions + 16 IRQs, PIC remapping
8
PMM
Physical memory bitmap from UEFI map
9
Heap
16 MiB kernel heap allocator
10
Stack Switch
64 KiB kernel stack via trampoline
11
VMM
4-level page tables, identity mapping
12
Timer + Input
PIT 1000 Hz, PS/2 keyboard + mouse
13
Filesystem
ramfs + VFS mount
14
Login → Desktop
Graphical login, then desktop GUI
🏗️

System Architecture

8 LAYERS

From raw UEFI firmware to a fully interactive graphical desktop — each layer builds on the previous.

L0
UEFI Firmwarex86_64 host boot
L1
Boot Loader (efi_main)GOP + memory map + exit BS
L2
GDT / IDT / PMMSegments, interrupts, phys memory
L3
Heap + VMM16 MiB heap, 4-level page tables
L4
Drivers (Timer/KB/Mouse)PIT 1 KHz, PS/2 IRQ1/IRQ12
L5
Filesystem (ramfs + VFS)In-memory tree + mount layer
L6
Desktop + CompositorGUI desktop, z-ordered windows
L7
ApplicationsNexusCode, Editor, Shell, File Browser
🖥️

Desktop Environment

GUI ON BARE METAL

A complete graphical desktop rendered directly to the GOP framebuffer. No X11, no Wayland, no display server — the kernel itself manages windows, compositing, input routing, and rendering.

💻

NexusCode IDE

Full-featured code editor with multi-tab support, .sl syntax highlighting, AI chat panel, command palette, and split view. 1,121 LOC — the largest kernel module.

🪟

Window Compositor

Z-ordered rendering pipeline: desktop background → application windows → taskbar → mouse cursor. Proper layering with transparency support.

⌨️

Virtual Terminals

8 virtual terminals (F1–F8) each with independent shell instances. Switch between graphical desktop and terminal sessions instantly.

📁

File Browser

Two-pane directory navigator with file preview, keyboard navigation, and support for the VFS/ramfs filesystem. Create, rename, and delete files.

📝

Modal Text Editor

Vim-inspired modal editor with normal and insert modes. Syntax highlighting for .sl files, clipboard operations, line numbering.

🔐

Graphical Login

SHA-256 password authentication with a graphical login screen. Secure session management — no plaintext passwords stored anywhere.

📊

Task Manager

Real-time system monitoring: memory usage, CPU load, running process list, kill capability. All rendered directly to framebuffer.

🎬

Matrix Boot Animation

Cinematic Matrix-style digital rain during boot, followed by Linux-style system initialization messages showing each subsystem coming online.

💻

Kernel Code Samples

REAL SOURCE
main.rs (UEFI entry point)
// UEFI application — boots the OS from firmware
#![no_std]
#![no_main]

#[export_name = "efi_main"]
pub extern "efiapi" fn efi_main(
    handle: EfiHandle,
    st: *mut EfiSystemTable,
) -> EfiStatus {
    serial::init();
    // Locate GOP, get memory map, exit Boot Services
    // Switch to 64KB kernel stack via trampoline
    // Enter kernel_stage2() — now bare-metal
}
compositor.rs (z-ordered rendering)
// Compositor rendering pipeline
pub fn render_frame(
    fb: &mut Framebuffer,
    desktop: &Desktop,
    wm: &WindowManager,
    taskbar: &Taskbar,
    mouse: (i32, i32),
) {
    desktop.draw_background(fb);   // Layer 0
    wm.draw_windows(fb);           // Layer 1
    taskbar.draw(fb);              // Layer 2
    draw_cursor(fb, mouse);        // Layer 3
}
login.rs (SHA-256 authentication)
// Graphical login with SHA-256 password hashing
pub fn verify_password(
    input: &[u8],
    stored_hash: &[u8; 32],
) -> bool {
    let hash = crypto_hash::sha256(input);
    // Constant-time comparison
    let mut diff = 0u8;
    for i in 0..32 {
        diff |= hash[i] ^ stored_hash[i];
    }
    diff == 0
}
vmm.rs (page table setup)
// 4-level x86_64 page tables
pub fn map_page(
    pml4: &mut PageTable,
    virt: u64,
    phys: u64,
    flags: PageFlags,
) {
    let p4 = (virt >> 39) & 0x1FF;
    let p3 = (virt >> 30) & 0x1FF;
    let p2 = (virt >> 21) & 0x1FF;
    let p1 = (virt >> 12) & 0x1FF;
    // Walk/create PDP → PD → PT entries
}
📦

Full Module Inventory

30 MODULES • 8,777 LOC
ModuleLOCPurpose
nexus_code.rs1,121NexusCode IDE — multi-tab editor, syntax highlighting, AI chat panel, command palette
editor.rs624Modal text editor — normal/insert modes, .sl syntax highlighting, clipboard
shell.rs600Terminal shell — command parsing, history, pipe support, built-in commands
framebuffer.rs501GOP framebuffer — pixel rendering, font rasterizer, double buffering
main.rs501UEFI entry point — 14-step boot sequence, GDT/IDT/PMM init, stage2 trampoline
idt.rs443Interrupt descriptor table — 32 exceptions + 16 IRQs, PIC remapping, handlers
window.rs420Window manager — z-ordering, drag, resize, maximize/minimize, focus tracking
file_browser.rs361Two-pane file navigator — directory tree, file preview, keyboard shortcuts
uefi.rs307UEFI protocol handling — GOP locate, memory map, boot services exit
desktop.rs295Desktop environment — virtual terminals (F1–F8), wallpaper, Project Freedom branding
vmm.rs256Virtual memory manager — 4-level page tables, identity mapping, page fault handling
vfs.rs252Virtual filesystem layer — mount points, path resolution, unified API
boot_anim.rs242Boot animation — Matrix-style rain effect, Linux-style system status checks
ramfs.rs239RAM filesystem — in-memory inode tree, read/write/mkdir/delete operations
keyboard.rs238PS/2 keyboard driver — IRQ1 handler, scancode decoding, US layout, modifiers
arch.rs227x86_64 architecture — port I/O, MSR access, CPUID, control registers
login.rs225Graphical login screen — SHA-256 password verification, user session management
mouse.rs224PS/2 mouse driver — IRQ12 handler, packet decoding, cursor tracking
task_manager.rs197Task manager — real-time memory/CPU display, process list, kill support
pmm.rs179Physical memory manager — bitmap allocator, UEFI memory map integration
compositor.rs176Window compositor — z-ordered rendering: desktop → windows → taskbar → cursor
gdt.rs172Global descriptor table — kernel/user code+data segments, TSS for ring transitions
sysinfo.rs156System information — CPUID brand string, memory stats, uptime tracking
input.rs139Unified input layer — key event queue, mouse state aggregation
crypto_hash.rs135SHA-256 implementation — pure Rust, no dependencies, used for login auth
heap.rs131Heap allocator — 16 MiB arena, GlobalAlloc trait, bump + free-list
serial.rs127Serial COM1 driver — 115200 baud, 8N1, debug output over UART
timer.rs108PIT timer — 1000 Hz tick, IRQ0 handler, uptime counter
taskbar.rs95Taskbar UI — window buttons, clock display, system tray
start_menu.rs86Start menu — application launcher, system shortcuts
nexus_code.rs (1,121)
Largest Module
start_menu.rs (86)
Smallest Module
293 LOC/module
Average
📊

Code Distribution

BY MODULE SIZE
nexus_code.rs
1,121
editor.rs
624
shell.rs
600
framebuffer.rs
501
main.rs
501
idt.rs
443
window.rs
420
file_browser.rs
361
uefi.rs
307
desktop.rs
295
vmm.rs
256
vfs.rs
252
boot_anim.rs
242
ramfs.rs
239
keyboard.rs
238
🌟

Why This Matters

An OS with zero dependencies?

Every byte of code is hand-written. The heap allocator, SHA-256 hash, PS/2 keyboard driver, PIT timer, framebuffer renderer, and even the font data — all implemented from scratch in Rust with #![no_std]. No libc, no alloc crate, no external anything.

How does a GUI work on bare metal?

The kernel takes over the UEFI GOP framebuffer, then implements its own pixel-level rendering, font rasterizer, window manager, and compositor. Windows are z-ordered and drawn layer by layer: desktop → application windows → taskbar → cursor.

What is NexusCode?

A full code editor running inside the kernel — not as a user-space application, but as a kernel module. Multi-tab editing, syntax highlighting for Vitalis .sl files, an AI chat panel, command palette, and split view. All at ring 0.

Built by one person?

Yes. From the UEFI boot loader to the window compositor to the SHA-256 authentication — every module, every interrupt handler, every pixel rendered. 30 modules, 8,777 lines. One engineer, zero dependencies.

🛠️

Project Freedom Summary

BARE-METAL OS

Kernel

  • 30 Rust kernel modules
  • 8,777 lines of code
  • Zero external dependencies
  • x86_64 UEFI boot chain
  • 4-level virtual memory
  • SHA-256 authentication

Desktop

  • NexusCode IDE (1,121 LOC)
  • Z-ordered window compositor
  • 8 virtual terminals (F1–F8)
  • Two-pane file browser
  • Modal text editor
  • Matrix-style boot animation

Project Freedom — Created by Bart Ch

Part of the Vitalis ecosystem • Privately developed

30 modules • 8,777 LOC • 0 dependencies • x86_64 UEFI • #![no_std] Rust