]> git.lizzy.rs Git - loadnothing.git/blobdiff - stage2/src/main.rs
Halt instead of looping and using 100% CPU
[loadnothing.git] / stage2 / src / main.rs
index 75f787a76be732af69e690d0dc267ee7641aca61..2c663a35d5cfd32c2dc8bfbd07b22fa07136b0f5 100644 (file)
@@ -1,6 +1,7 @@
 #![no_std]
 #![no_main]
 
+use core::arch::asm;
 use core::panic::PanicInfo;
 
 static HELLO: &[u8] = b"Hello Stage2!";
@@ -31,5 +32,9 @@ pub extern "C" fn _start() -> ! {
         }
     }
 
-    loop {}
+    unsafe {
+        loop {
+            asm!("hlt");
+        }
+    }
 }