Selaa lähdekoodia

Use UD2 instead of CLI;HLT for CRASH().

This way the kernel prints out a nice register dump so we can find
out where we crashed.
Andreas Kling 6 vuotta sitten
vanhempi
commit
c5e55f4737
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      Kernel/kassert.h

+ 1 - 1
Kernel/kassert.h

@@ -2,7 +2,7 @@
 
 
 #include "VGA.h"
 #include "VGA.h"
 
 
-#define CRASH() do { asm volatile("cli;hlt"); } while(0)
+#define CRASH() do { asm volatile("ud2"); } while(0)
 #define ASSERT(x) do { if (!(x)) { kprintf("ASSERTION FAILED: " #x "\n%s:%u in %s\n", __FILE__, __LINE__, __PRETTY_FUNCTION__); CRASH(); } } while(0)
 #define ASSERT(x) do { if (!(x)) { kprintf("ASSERTION FAILED: " #x "\n%s:%u in %s\n", __FILE__, __LINE__, __PRETTY_FUNCTION__); CRASH(); } } while(0)
 #define RELEASE_ASSERT(x) do { if (!(x)) CRASH(); } while(0)
 #define RELEASE_ASSERT(x) do { if (!(x)) CRASH(); } while(0)
 #define ASSERT_NOT_REACHED() ASSERT(false)
 #define ASSERT_NOT_REACHED() ASSERT(false)