mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Add a new blog_os::init function instead of calling init_idt directly
This commit is contained in:
@@ -11,6 +11,10 @@ pub mod interrupts;
|
|||||||
pub mod serial;
|
pub mod serial;
|
||||||
pub mod vga_buffer;
|
pub mod vga_buffer;
|
||||||
|
|
||||||
|
pub fn init() {
|
||||||
|
interrupts::init_idt();
|
||||||
|
}
|
||||||
|
|
||||||
pub fn test_runner(tests: &[&dyn Fn()]) {
|
pub fn test_runner(tests: &[&dyn Fn()]) {
|
||||||
serial_println!("Running {} tests", tests.len());
|
serial_println!("Running {} tests", tests.len());
|
||||||
for test in tests {
|
for test in tests {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ use core::panic::PanicInfo;
|
|||||||
pub extern "C" fn _start() -> ! {
|
pub extern "C" fn _start() -> ! {
|
||||||
println!("Hello World{}", "!");
|
println!("Hello World{}", "!");
|
||||||
|
|
||||||
blog_os::interrupts::init_idt();
|
blog_os::init();
|
||||||
|
|
||||||
// invoke a breakpoint exception
|
// invoke a breakpoint exception
|
||||||
x86_64::instructions::interrupts::int3();
|
x86_64::instructions::interrupts::int3();
|
||||||
|
|||||||
Reference in New Issue
Block a user