Move PICS import into _start function

This commit is contained in:
Philipp Oppermann
2018-10-26 16:44:42 +02:00
parent d802763867
commit b8206b895f
2 changed files with 5 additions and 2 deletions

View File

@@ -147,12 +147,14 @@ Until now nothing happened because interrupts are still disabled in the CPU conf
#[cfg(not(test))] #[cfg(not(test))]
#[no_mangle] #[no_mangle]
pub extern "C" fn _start() -> ! { pub extern "C" fn _start() -> ! {
use blog_os::interrupts::PICS; // new
println!("Hello World{}", "!"); println!("Hello World{}", "!");
blog_os::gdt::init(); blog_os::gdt::init();
blog_os::interrupts::init_idt(); blog_os::interrupts::init_idt();
unsafe { PICS.lock().initialize() }; unsafe { PICS.lock().initialize() };
x86_64::instructions::interrupts::enable(); // new x86_64::instructions::interrupts::enable(); // new
println!("It did not crash!"); println!("It did not crash!");
loop {} loop {}

View File

@@ -6,7 +6,6 @@
extern crate blog_os; extern crate blog_os;
extern crate x86_64; extern crate x86_64;
use blog_os::interrupts::PICS;
use core::panic::PanicInfo; use core::panic::PanicInfo;
/// This function is the entry point, since the linker looks for a function /// This function is the entry point, since the linker looks for a function
@@ -14,6 +13,8 @@ use core::panic::PanicInfo;
#[cfg(not(test))] #[cfg(not(test))]
#[no_mangle] // don't mangle the name of this function #[no_mangle] // don't mangle the name of this function
pub extern "C" fn _start() -> ! { pub extern "C" fn _start() -> ! {
use blog_os::interrupts::PICS;
println!("Hello World{}", "!"); println!("Hello World{}", "!");
blog_os::gdt::init(); blog_os::gdt::init();