mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Print a proper message on panics
This commit is contained in:
@@ -31,4 +31,11 @@ pub extern fn rust_main(multiboot_information_address: usize) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[lang = "eh_personality"] extern fn eh_personality() {}
|
#[lang = "eh_personality"] extern fn eh_personality() {}
|
||||||
#[lang = "panic_fmt"] #[no_mangle] pub extern fn panic_fmt() -> ! {loop{}}
|
|
||||||
|
#[lang = "panic_fmt"]
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern fn panic_fmt(fmt: core::fmt::Arguments, file: &'static str, line: u32) -> ! {
|
||||||
|
println!("\n\nPANIC in {} at line {}:", file, line);
|
||||||
|
println!(" {}", fmt);
|
||||||
|
loop{}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user