rust-operating-system/src/main.rs
2022-02-25 19:39:09 -08:00

39 lines
628 B
Rust

// #![feature(abi_x86_interrupt, asm)]
#![no_std]
#![no_main]
#![feature(custom_test_frameworks)]
#![test_runner(crate::test_utils::test_runner)]
#![reexport_test_harness_main = "test_main"]
#[macro_use]
mod vga_buffer;
#[macro_use]
mod serial;
mod test_utils;
#[cfg(not(test))]
#[panic_handler]
fn panic(info: &core::panic::PanicInfo) -> ! {
println!("{info}");
loop {}
}
#[no_mangle]
pub extern "C" fn _start() -> ! {
#[cfg(test)]
test_main();
println!("Gamarjoba, munde!");
loop {}
}
#[test_case]
fn basic_test() {
assert_eq!(5, 5);
}
#[test_case]
fn basic_test2() {
assert_eq!(4, 4);
}