blob: bb1dcec1793fe2850d6904e0869d87fb277a8c5c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#![no_main]
#![feature(compiler_builtins_lib)]
#![feature(custom_test_frameworks)]
#![feature(abi_x86_interrupt)]
#![feature(panic_info_message)]
#![test_runner(crate::testing::test_runner)]
#![no_std]
pub mod interrupts;
pub mod io;
pub mod testing;
use core::fmt::Write;
pub use io::qemu::{exit_qemu, QemuExitCode};
pub use io::vga_text::OStream;
pub use io::{qemu, serial, vga_text};
#[no_mangle]
extern "C" fn _start() -> ! {
kernel::init();
if cfg!(test) {
qemu::exit_qemu(qemu::QemuExitCode::Success);
}
loop {}
}
#[panic_handler]
#[no_mangle]
extern "C" fn panic_handler(info: &core::panic::PanicInfo) -> ! {
if cfg!(test) {
testing::serial_panic(info);
}
testing::panic(info);
}
|