Skip to content

About

Minimal #![no_std] zero-heap multi-arch micro-unikernel (<64 KB) for x86_64, ARM64 & RISC-V with Ring-3 isolation, CAN/SPI/I2C/UART/PCIe drivers, APIC/SMP & UEFI/BIOS boot

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

exploidus-nano

Minimal #![no_std], zero-heap multi-architecture micro-unikernel (< 64 KB full-feature footprint) for x86_64, ARM64 (AArch64), and RISC-V 64 with Ring-3 isolation, per-task CR3 paging, capability-gated MMIO/IPC, industrial bus drivers (CAN, SPI, I2C, UART, PCIe), APIC/SMP multi-core scheduling, and a 100 Hz control loop.

Authors

  • Rahad Bhuiya (rahadbhuiya2021@gmail.com): kernel architecture, x86_64 bare-metal & UEFI boot, GDT/TSS/IDT, 4-level CR3 paging, syscall gate, drivers, scheduler, and GNC loop.
  • Sonali Rani: formal threat model, security invariants, verification specs (docs/FORMAL_MODEL.md), and comparative evaluation.

Layout

  • src/main.rs / src/uefi_main.rs: Multiboot1 (0x1BADB002) and Pure UEFI (ExitBootServices) entry points.
  • src/arm64_main.rs / src/riscv64_main.rs: AArch64 and RISC-V 64 bare-metal entry points (linker_arm64.ld, linker_riscv64.ld).
  • src/arch.rs / src/smp.rs: GDT, 64-bit TSS (RSP0), IDT (#UD, #DF, #GP, #PF, INT 0x80, IRQ0), 8259 PIC, APIC/SMP multi-core coordination, 100 Hz PIT, and Ring-3 entry/fault recovery.
  • src/paging.rs: static-pool 4-level CR3 page tables (USER=0 for kernel, W^X for Ring-3).
  • src/cap.rs / src/mpu.rs / src/ipc.rs: MAC capability tokens with O(1) generation revocation, non-overlapping MPU regions, and 64-byte gated IPC.
  • src/drivers.rs / src/bus.rs / src/serial.rs / src/vga.rs: capability/MPU-checked MmioPort, CAN/SPI/I2C/UART/PCIe bus drivers, COM1 (0x3F8), and 80x25 VGA (0xB8000).
  • src/sched.rs / src/gnc.rs / src/audit.rs / src/rng.rs: 100 Hz cyclic WCET scheduler, Joseph-form scalar Kalman estimator, audit ring, and RDRAND/RDTSC seeding.
  • src/proofs.rs: 7 Kani (CBMC) proof harnesses.

Build and Run

Host tests and lints:

cargo fmt --check
cargo clippy --lib --tests -- -D warnings
cargo test

Legacy BIOS / Multiboot1 (22,892 bytes ELF32):

cargo build --release --features baremetal --target x86_64-unknown-none
llvm-objcopy -O elf32-i386 target/x86_64-unknown-none/release/exploidus-nano target/x86_64-unknown-none/release/exploidus-nano.elf32
qemu-system-x86_64 -kernel target/x86_64-unknown-none/release/exploidus-nano.elf32 -nographic -no-reboot -m 32M

Pure UEFI (13,824 bytes BOOTX64.EFI):

cargo build --release --features uefi --target x86_64-unknown-uefi

ARM64 (AArch64) & RISC-V 64 bare-metal:

cargo build --release --features arm64 --target aarch64-unknown-none
cargo build --release --features riscv64 --target riscv64gc-unknown-none-elf

Prebuilt bootable exploidus-nano.iso (BIOS + UEFI) and per-architecture binaries are automatically built in GitHub Actions and attached to tagged v* releases.

Booting the ISO & Architecture Binaries

1. Boot exploidus-nano.iso in QEMU (Legacy BIOS):

qemu-system-x86_64 -cdrom exploidus-nano.iso -serial stdio -no-reboot -m 32M

2. Boot exploidus-nano.iso in QEMU (Pure UEFI with OVMF):

qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -cdrom exploidus-nano.iso -serial stdio -no-reboot -m 64M

3. Flash ISO to USB for Real x86_64 Hardware:

sudo dd if=exploidus-nano.iso of=/dev/sdX bs=4M status=progress oflag=sync

(On Windows, flash exploidus-nano.iso directly using Rufus or balenaEtcher.)

4. Boot ARM64 (AArch64) & RISC-V 64 in QEMU:

qemu-system-aarch64 -machine virt -cpu cortex-a53 -nographic -kernel target/aarch64-unknown-none/release/exploidus-arm64
qemu-system-riscv64 -machine virt -bios none -nographic -kernel target/riscv64gc-unknown-none-elf/release/exploidus-riscv64

Using as a #![no_std] Rust Crate

Add exploidus-nano to your bare-metal or RTOS firmware:

cargo add exploidus-nano

Core modules exposed by exploidus_nano:

  • exploidus_nano::cap & exploidus_nano::mpu — MAC capability tokens and non-overlapping MPU region guards
  • exploidus_nano::bus — capability-gated CAN, SPI, I2C, UART, and PCIe drivers
  • exploidus_nano::smp — APIC/SMP multi-core bring-up and inter-core mailbox IPC
  • exploidus_nano::sched & exploidus_nano::gnc — 100 Hz cyclic WCET scheduler and Joseph-form Kalman estimator

Kani proofs (Linux):

cargo kani --lib --output-format terse

License

GPL-2.0-only (see LICENSE). Commercial dual-licensing is available for proprietary deployments.

About

Minimal #![no_std] zero-heap multi-arch micro-unikernel (<64 KB) for x86_64, ARM64 & RISC-V with Ring-3 isolation, CAN/SPI/I2C/UART/PCIe drivers, APIC/SMP & UEFI/BIOS boot

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages