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
35
36
37
38
#![no_std]
#![no_main]
#![feature(custom_test_frameworks)]
#![feature(decl_macro)]
#![test_runner(crate::tests::test_runner)]
#![reexport_test_harness_main = "test_start"]

pub mod tests;
pub mod logger;
pub mod qemu;
pub use bootloader;
use logger::log;

use crate::logger::error;

pub macro boot($func:path) {
    bootloader::entry_point!(boot);
    pub fn boot(_info: &'static bootloader::BootInfo) -> ! {
        let boot_func: fn(&'static bootloader::BootInfo) = $func;
        boot_func(_info);
        loop {};
    }
}


#[cfg_attr(not(all(feature = "ext_panic", test)), panic_handler)]
pub fn on_panic(_info : &core::panic::PanicInfo) -> ! {
    error!("[FAILED]");
    loop {}
}


#[cfg(test)]
#[test_case]
pub fn meta_test() {
    assert_eq!(1,1);
}