mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Move PICS import into _start function
This commit is contained in:
@@ -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 {}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user