mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Move PIC initialization and interrupt::enable to blog_os::init
This commit is contained in:
@@ -15,6 +15,8 @@ pub mod vga_buffer;
|
|||||||
pub fn init() {
|
pub fn init() {
|
||||||
gdt::init();
|
gdt::init();
|
||||||
interrupts::init_idt();
|
interrupts::init_idt();
|
||||||
|
unsafe { interrupts::PICS.lock().initialize() };
|
||||||
|
x86_64::instructions::interrupts::enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn test_runner(tests: &[&dyn Fn()]) {
|
pub fn test_runner(tests: &[&dyn Fn()]) {
|
||||||
|
|||||||
@@ -9,13 +9,9 @@ use core::panic::PanicInfo;
|
|||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn _start() -> ! {
|
pub extern "C" fn _start() -> ! {
|
||||||
use blog_os::interrupts::PICS;
|
|
||||||
|
|
||||||
println!("Hello World{}", "!");
|
println!("Hello World{}", "!");
|
||||||
|
|
||||||
blog_os::init();
|
blog_os::init();
|
||||||
unsafe { PICS.lock().initialize() };
|
|
||||||
x86_64::instructions::interrupts::enable();
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
test_main();
|
test_main();
|
||||||
|
|||||||
Reference in New Issue
Block a user