Add halt loop
This commit is contained in:
parent
0b8cd65458
commit
8b262daa3c
10
src/main.rs
10
src/main.rs
@ -12,7 +12,7 @@ use core::panic::PanicInfo;
|
||||
#[panic_handler]
|
||||
fn panic(info: &PanicInfo) -> ! {
|
||||
println!("{}", info);
|
||||
loop {}
|
||||
halt_loop();
|
||||
}
|
||||
|
||||
pub fn init() {
|
||||
@ -30,10 +30,12 @@ pub extern "C" fn _start() -> ! {
|
||||
for i in 1..10 {
|
||||
println!("Gamarjoba, munde: {}", i);
|
||||
}
|
||||
loop {
|
||||
for _ in 0..100_000 {
|
||||
halt_loop();
|
||||
}
|
||||
print!("-");
|
||||
|
||||
pub fn halt_loop() -> ! {
|
||||
loop {
|
||||
x86_64::instructions::hlt();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user