Add halt loop

This commit is contained in:
greg 2019-07-18 10:31:02 -07:00
parent 0b8cd65458
commit 8b262daa3c

View File

@ -12,7 +12,7 @@ use core::panic::PanicInfo;
#[panic_handler] #[panic_handler]
fn panic(info: &PanicInfo) -> ! { fn panic(info: &PanicInfo) -> ! {
println!("{}", info); println!("{}", info);
loop {} halt_loop();
} }
pub fn init() { pub fn init() {
@ -30,10 +30,12 @@ pub extern "C" fn _start() -> ! {
for i in 1..10 { for i in 1..10 {
println!("Gamarjoba, munde: {}", i); println!("Gamarjoba, munde: {}", i);
} }
loop { halt_loop();
for _ in 0..100_000 {
} }
print!("-");
pub fn halt_loop() -> ! {
loop {
x86_64::instructions::hlt();
} }
} }