Initial commit: XOmB exokernel foundation

Core kernel infrastructure:
- Multiboot2 boot with GRUB, long mode setup, higher-half kernel
- Serial port output for debugging
- Unified boot info abstraction for future UEFI support

Memory management:
- Physical frame allocator with bitmap tracking
- Page table manipulation via recursive mapping (PML4[510])
- Support for 4KB, 2MB, and 1GB page mappings
- TLB invalidation and proper NXE support

Build system:
- Cargo-based build with custom x86_64 target
- Makefile for QEMU and Bochs testing
- GRUB ISO generation for multiboot2 boot
This commit is contained in:
wilkie
2025-12-26 14:20:39 -05:00
commit c6fa2895e2
28 changed files with 4146 additions and 0 deletions

31
src/multiboot2_main.rs Normal file
View File

@@ -0,0 +1,31 @@
//! XOmB Multiboot2 Entry Point
//!
//! This is the Rust entry point for multiboot2 boot (used by Bochs/GRUB).
//! The actual entry is in assembly (boot/multiboot2_header.s), which then
//! calls into this code.
#![no_std]
#![no_main]
use core::panic::PanicInfo;
use core::fmt::Write;
// Re-export the library
use xomb::serial::SerialPort;
// Pull in the multiboot2 entry point
pub use xomb::boot::multiboot2::multiboot2_entry;
/// Panic handler for multiboot2 boot
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
let mut serial = unsafe { SerialPort::new(0x3F8) };
let _ = writeln!(serial, "\n!!! KERNEL PANIC !!!");
let _ = writeln!(serial, "{}", info);
loop {
unsafe {
core::arch::asm!("cli; hlt", options(nostack, nomem));
}
}
}