2021-11-16 00:09:27 -06:00
|
|
|
use x86_64::instructions::hlt;
|
2021-11-22 03:51:11 -06:00
|
|
|
use bootloader::BootInfo;
|
2021-11-16 00:09:27 -06:00
|
|
|
pub mod drivers;
|
|
|
|
pub mod gdt;
|
|
|
|
pub mod init;
|
|
|
|
pub mod interrupts;
|
2021-11-22 03:51:11 -06:00
|
|
|
pub mod memory;
|
|
|
|
// #[no_mangle]
|
|
|
|
// pub extern "C" fn _start(boot_info: &'static BootInfo) -> ! {
|
|
|
|
// crate::kmain::kernel_main(boot_info);
|
|
|
|
// // sloop();
|
|
|
|
// }
|
2021-11-16 00:09:27 -06:00
|
|
|
|
|
|
|
#[allow(unused)]
|
|
|
|
pub fn shutdown() -> ! {
|
2021-11-17 08:42:54 -06:00
|
|
|
unsafe {
|
|
|
|
cpuio::outw(0x2000, 0x604);
|
|
|
|
}
|
|
|
|
|
2021-11-16 00:09:27 -06:00
|
|
|
sloop();
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn sloop() -> ! {
|
|
|
|
loop {
|
|
|
|
hlt();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#[cfg(test)]
|
|
|
|
pub fn test_runner(tests: &[&dyn Fn()]) {
|
2021-11-17 08:42:54 -06:00
|
|
|
for test in tests {
|
|
|
|
test();
|
|
|
|
}
|
2021-11-16 00:09:27 -06:00
|
|
|
}
|