A high-performance x86_64 monolithic operating system kernel built from scratch in C and Assembly, featuring 64-bit Long Mode, hybrid UEFI & Legacy BIOS boot, 4-level paging, FAT32 filesystem support, APIC interrupt management, preemptive task scheduling, and an interactive shell.
- Features & System Capabilities
- Architecture Overview
- Prerequisites & Dependencies
- Building & Running Locally
- Running on Real Hardware (USB Boot)
- Interactive Shell Commands
- Directory Structure
- Documentation & Learning
- β‘ 64-bit Long Mode Execution: Full x86_64 architecture support with 64-bit register set (RAX-R15), 64-bit GDT/IDT descriptors, and 48-bit canonical virtual address translation.
- π Hybrid UEFI & BIOS Boot: GRUB Multiboot2 / Multiboot1 hybrid ISO supporting seamless boot on modern UEFI machines as well as legacy BIOS systems.
- πΊοΈ 4-Level Paging (VMM): PML4 β PDPT β PD β PT virtual memory hierarchy mapping higher-half kernel space and physical RAM.
- π§ Physical Memory Manager (PMM): Page frame allocation via bitmap manager supporting up to multi-gigabyte RAM configurations.
- πΎ Kernel Heap Allocator (
kmalloc/kfree): Dynamic kernel heap allocation supporting scaling for kernel data structures and dynamic objects. - π FAT32 Filesystem & ATA PIO Driver: Native IDE/ATA hard disk driver with a full FAT32 filesystem implementation.
- π οΈ Embedded 64MB FAT32 RAM Disk: Boot-loaded RAM filesystem (
JARVISFS) populated at startup for zero-hardware disk dependencies. - βοΈ Interrupts & Timer: Advanced APIC / IO-APIC logic and 8259 PIC fallback routing with PIT-driven preemptive multitasking.
- π» Interactive Kernel Shell: Colorized shell with TAB auto-completion, filesystem commands, and CPU/system diagnostic tools.
+----------------------------------------------------------------+
| Jarvis OS Shell |
| (ls, cd, cat, touch, write, rm, mkdir, ps, sysinfo, cpuid) |
+----------------------------------------------------------------+
| Kernel Core Subsystems |
| +--------------------+ +------------------+ +-------------+ |
| | Task Scheduler | | FAT32 Filesystem | | Heap Alloc | |
| | (Round-Robin) | | & ATA Driver | | (kmalloc) | |
| +--------------------+ +------------------+ +-------------+ |
| +-----------------------------------------------------------+ |
| | Virtual Memory (VMM) & Physical Memory Manager (PMM) | |
| +-----------------------------------------------------------+ |
| | GDT / IDT / APIC Interrupt Routing & Exception Handling | |
+----------------------------------------------------------------+
| Hardware Layer / QEMU Emulator |
| x86_64 CPU | 4-Level Paging | GOP / VGA | ATA/RAMDisk |
+----------------------------------------------------------------+
To build and run Jarvis OS on a Linux machine (Ubuntu, Debian, Kali, Fedora, Arch), install the following tools:
sudo apt update
sudo apt install -y \
build-essential \
gcc \
nasm \
grub-pc-bin \
grub-efi-amd64-bin \
xorriso \
mtools \
dosfstools \
qemu-system-x86 \
ovmfsudo dnf install -y \
gcc \
make \
nasm \
grub2-tools-extra \
xorriso \
mtools \
dosfstools \
qemu-kvm \
edk2-ovmfThe primary build script is run.sh. It cleans the build environment, assembles Assembly sources (nasm), compiles C sources (gcc), links the 64-bit kernel (ld), generates a 64MB FAT32 RAM disk, builds a hybrid BIOS/UEFI ISO (jarvis.iso), and launches QEMU.
./run.shOutputs generated:
jarvis.iso/jarvis_uefi.isoβ Hybrid BIOS + UEFI bootable ISO image.disk.imgβ 128 MB FAT32 disk image for QEMU testing.ramdisk.imgβ 64 MB FAT32 image embedded into the ISO.
./run.sh --run./run.sh --run --uefi(Uses OVMF firmware to simulate a modern UEFI system with GOP graphical console)
./run.sh --run --nographic(Press Ctrl+A then X to exit QEMU in headless mode)
Jarvis OS produces a hybrid ISO (jarvis.iso) compatible with both legacy BIOS and modern UEFI hardware.
Find your USB drive identifier (e.g., /dev/sdX using lsblk), then run:
sudo dd if=jarvis.iso of=/dev/sdX bs=4M status=progress conv=fdatasyncUse Rufus or balenaEtcher:
- Select
jarvis_uefi.isoorjarvis.iso. - Target: DD Image mode (or standard ISO mode).
- Boot your PC into BIOS/UEFI setup and select the USB drive.
Once Jarvis OS boots, you will be greeted by the custom shell prompt:
| Command | Description |
|---|---|
ls [path] |
List files and directories in FAT32 filesystem |
cd <path> |
Change current working directory |
cat <file> |
Display contents of a text file |
touch <file> |
Create a new empty file |
write <file> <text> |
Write text content to a file |
rm <file> |
Delete a file |
mkdir <dir> |
Create a new directory |
rmdir <dir> |
Delete an empty directory |
ps |
Display active kernel tasks and process states |
mem |
Display physical memory & heap stats |
sysinfo |
Display detailed system hardware & kernel report |
cpuid |
Query x86_64 CPU vendor, model, features, and Long Mode |
arch |
Display kernel architecture, paging, and register specs |
clear |
Clear screen output |
reboot |
Perform system reboot |
help |
Show available shell commands |
π‘ Tip: Press
TABfor automatic filename completion in the shell.
AOS/
βββ DOCUMENTATION.md # Comprehensive technical documentation & tutorials
βββ README.md # Main project guide (this file)
βββ .gitignore # Excludes build binaries, ISOs, and raw disk images
βββ run.sh # Automated build and run script
βββ link.ld # Linker script for 64-bit kernel ELF
βββ test_boot.sh # Quick boot test helper script
βββ test_uefi_console.sh # UEFI GOP console test script
βββ include/ # Kernel C header files
β βββ acpi.h, ata.h, fat32.h, gdt.h, idt.h, io.h, kmalloc.h
β βββ math.h, pci.h, pmm.h, screen.h, shell.h, string.h, task.h, timer.h, vmm.h
βββ src/ # Kernel source code
β βββ arch/x86_64/ # GDT, IDT, ACPI, Assembly loaders (loader.s, interrupts.s)
β βββ core/ # Main kernel entry (kernel.c), Shell, Multitasking
β βββ drivers/ # ATA PIO, PS/2 Keyboard, PCI, VGA Screen
β βββ fs/ # FAT32 Driver implementation
β βββ libc/ # Builtin math and string helper libraries
β βββ mm/ # Physical (PMM), Virtual (VMM), and Heap (kmalloc) memory managers
βββ iso/ # Staging directory for GRUB ISO creation
For a complete breakdown of kernel internals, step-by-step learning paths, and architecture design details, refer to:
- DOCUMENTATION.md β Architectural deep-dive and 12-step educational tutorial index.
Jarvis OS is open-source software licensed under the MIT License.