Explorar o código

change(debugging): crash when makeing breakpoints

greatbridf %!s(int64=2) %!d(string=hai) anos
pai
achega
50d68c0ff9
Modificáronse 1 ficheiros con 7 adicións e 4 borrados
  1. 7 4
      include/kernel_main.h

+ 7 - 4
include/kernel_main.h

@@ -1,10 +1,13 @@
 #pragma once
 #include <types/types.h>
 
-static inline void __break_point(void)
-{
-    asm volatile("xchgw %bx, %bx");
-}
+#define __crash() asm volatile("ud2")
+
+#ifdef __BOCHS_SYSTEM__
+#define __break_point() asm volatile("xchgw %bx, %bx")
+#else
+#define __break_point() __crash()
+#endif
 
 #define MAKE_BREAK_POINT() __break_point()