summaryrefslogtreecommitdiff
path: root/kernel/src/panic.rs
diff options
context:
space:
mode:
authorNathan Ringo <nathan@remexre.com>2024-02-24 22:03:49 -0600
committerNathan Ringo <nathan@remexre.com>2024-02-24 22:03:49 -0600
commitc8de43bf43242c4ebac3d0ecb8e7951fe2371506 (patch)
treeb438bb1b47b41241702f5783fb7ec3326a4e8ab7 /kernel/src/panic.rs
Initial commit
Diffstat (limited to 'kernel/src/panic.rs')
-rw-r--r--kernel/src/panic.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/src/panic.rs b/kernel/src/panic.rs
new file mode 100644
index 0000000..ed6e5d4
--- /dev/null
+++ b/kernel/src/panic.rs
@@ -0,0 +1,12 @@
+use core::panic::PanicInfo;
+
+#[panic_handler]
+fn panic(_info: &PanicInfo) -> ! {
+ loop {
+ for byte in "panic\n".bytes() {
+ unsafe {
+ core::ptr::write_volatile(0x10000000 as *mut u8, byte);
+ }
+ }
+ }
+}