diff options
Diffstat (limited to 'lib/DATS/panic.dats')
-rw-r--r-- | lib/DATS/panic.dats | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/DATS/panic.dats b/lib/DATS/panic.dats new file mode 100644 index 0000000..356eda5 --- /dev/null +++ b/lib/DATS/panic.dats @@ -0,0 +1,24 @@ +staload "lib/SATS/panic.sats" +staload "lib/SATS/writer.sats" + +staload UN = "prelude/SATS/unsafe.sats" + +#define ATS_DYNLOADFLAG 0 + +%{$ + inline void halt() { + while (1){ + __asm__ volatile ("cli ; hlt"); + } + } +%} + +extern fun halt():<!ntm> void = "mac#" + +implement panic_loc(loc,msg) = ( + put_string "KERNEL PANIC:\n "; + put_string loc; + put_string "\n\n "; + put_string msg; + halt(); +) |