Merge branch 'post-06-new' into post-07-new-rebased

This commit is contained in:
Philipp Oppermann
2019-04-26 15:24:28 +02:00
18 changed files with 289 additions and 286 deletions

View File

@@ -1,22 +1,25 @@
#![cfg_attr(not(test), no_std)]
#![cfg_attr(not(test), no_main)]
#![cfg_attr(test, allow(unused_imports))]
#![no_std]
#![no_main]
#![feature(custom_test_frameworks)]
#![test_runner(blog_os::test_runner)]
#![reexport_test_harness_main = "test_main"]
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();
blog_os::init();
unsafe { PICS.lock().initialize() };
x86_64::instructions::interrupts::enable();
#[cfg(test)]
test_main();
println!("It did not crash!");
blog_os::hlt_loop();
}
@@ -28,3 +31,9 @@ fn panic(info: &PanicInfo) -> ! {
println!("{}", info);
blog_os::hlt_loop();
}
#[cfg(test)]
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
blog_os::test_panic_handler(info)
}