diff options
author | Freya Murphy <freya@freyacat.org> | 2025-05-05 09:54:48 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-05-05 09:58:20 -0400 |
commit | 592c6992c7ea0c2e4cbea79fadb1c845f2fc050e (patch) | |
tree | 5d98b664749b67eb20d7fc279ff36bcf44843f21 /kernel/lib | |
parent | off by one (diff) | |
download | comus-592c6992c7ea0c2e4cbea79fadb1c845f2fc050e.tar.gz comus-592c6992c7ea0c2e4cbea79fadb1c845f2fc050e.tar.bz2 comus-592c6992c7ea0c2e4cbea79fadb1c845f2fc050e.zip |
pc spkr
Diffstat (limited to 'kernel/lib')
-rw-r--r-- | kernel/lib/panic.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/kernel/lib/panic.c b/kernel/lib/panic.c index 3a6e029..35ea0b1 100644 --- a/kernel/lib/panic.c +++ b/kernel/lib/panic.c @@ -1,6 +1,8 @@ #include <lib.h> #include <stdarg.h> #include <comus/asm.h> +#include <comus/drivers/ps2.h> +#include <comus/drivers/spkr.h> __attribute__((noreturn)) void __panic(unsigned int line, const char *file, const char *format, ...) @@ -16,6 +18,17 @@ __attribute__((noreturn)) void __panic(unsigned int line, const char *file, log_backtrace(); #endif - while (1) - halt(); + fatal_loop(); +} + +__attribute__((noreturn)) void fatal_loop(void) +{ + while(1) { + spkr_play_tone(1000); + ps2_set_leds(0x4); + kspin_milliseconds(200); + spkr_quiet(); + ps2_set_leds(0x0); + kspin_milliseconds(800); + } } |