mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
31 lines
673 B
Rust
31 lines
673 B
Rust
#![cfg_attr(not(test), no_std)]
|
|
#![cfg_attr(not(test), no_main)]
|
|
#![cfg_attr(test, allow(unused_imports))]
|
|
|
|
use blog_os::println;
|
|
use core::panic::PanicInfo;
|
|
|
|
#[cfg(not(test))]
|
|
#[no_mangle]
|
|
pub extern "C" fn _start() -> ! {
|
|
use blog_os::interrupts::PICS;
|
|
|
|
println!("Hello World{}", "!");
|
|
|
|
blog_os::gdt::init();
|
|
blog_os::interrupts::init_idt();
|
|
unsafe { PICS.lock().initialize() };
|
|
x86_64::instructions::interrupts::enable();
|
|
|
|
println!("It did not crash!");
|
|
blog_os::hlt_loop();
|
|
}
|
|
|
|
/// This function is called on panic.
|
|
#[cfg(not(test))]
|
|
#[panic_handler]
|
|
fn panic(info: &PanicInfo) -> ! {
|
|
println!("{}", info);
|
|
blog_os::hlt_loop();
|
|
}
|