Load dynamic programs using FAT32

This commit is contained in:
2026-02-20 22:10:09 +01:00
parent 00d9ce656c
commit 235f17e7cf
26 changed files with 112 additions and 68 deletions

32
src/panic_handler.rs Normal file
View File

@@ -0,0 +1,32 @@
use core::arch::riscv64::wfi;
use alloc::{format, string::ToString};
use log::error;
use crate::vga::{Color, Vga, FONT_HEIGHT};
#[panic_handler]
fn panic(panic_info: &core::panic::PanicInfo) -> ! {
error!("PANIC !");
let mut panic_message = panic_info.message().to_string();
if let Some(location) = panic_info.location() {
panic_message = format!("{panic_message} at {}:{}", location.file(), location.line());
}
error!("{panic_message}");
Vga::clear_screen(Color::WHITE);
unsafe { Vga::draw_string(0, 0, "PANIC !", Color::BLACK, Color::WHITE) };
unsafe {
Vga::draw_string(
0,
FONT_HEIGHT as u16,
panic_message,
Color::BLACK,
Color::WHITE,
)
};
loop {
unsafe { wfi() }
}
}