mirror of
https://github.com/xomboverlord/xomb.git
synced 2026-01-11 18:33:15 +01:00
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:
31
src/multiboot2_main.rs
Normal file
31
src/multiboot2_main.rs
Normal 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user