Skip to content

Commit 621ba77

Browse files
committed
Ship it
1 parent 5fcb4a1 commit 621ba77

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

kernel/cpu/riscv/src/panic.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,42 @@ void abort() {
1313
panic_abort();
1414
}
1515

16+
static void kekw() {
17+
// clang-format off
18+
char const *const msg =
19+
"======+++++++***************####**++++++========" "\n"
20+
"=--:::----:-==++*****+++++==++++*+====---=======" "\n"
21+
"-::........::-==++++++===--:::.:::::::-=========" "\n"
22+
":::----=---:::-====++===--:::...::-=============" "\n"
23+
"--==+++++=+++=::--==+++=----==+++++***+++=======" "\n"
24+
":. :----======+#*++===-===---:.:::::--=====" "\n"
25+
"=----===+++++======+**++++=====--::-===---------" "\n"
26+
"==----:-==========++++++++++++====++++**++====++" "\n"
27+
"========+++========+++++++++++++++=======+++=+++" "\n"
28+
"=====++++++========++++====+++***++++++**#*+++++" "\n"
29+
"=====++++++=======++====-=====+*##******##*+++++" "\n"
30+
"===+++++=======+++**+==-=========*#######*++++++" "\n"
31+
"=========-===---========+++=--=*+==+****++++++++" "\n"
32+
"---====--==:...:----::. .::::=========+++======" "\n"
33+
"-------:--:..........:::::::::::::-=--==========" "\n"
34+
"--------:. .. ....:-:. .::...:::..::----========" "\n"
35+
"-------:...........--....::...::...::::---======" "\n"
36+
"------:. .........-===:.:::...:::......:---=====" "\n"
37+
"-----=-. .... .. ..........:::::::. :--====" "\n"
38+
"------=-::-...+##= ::-:-=====" "\n"
39+
"::::--====-=+: :::......:--=----:.-----====-" "\n"
40+
".::----==--=+=--=+++**********++==---===--===---" "\n"
41+
".:-:-=--===-==--=+****++++++++++=--=*===-====---" "\n"
42+
"..:-:==-======---=++++++++====---===+========---" "\n"
43+
"..:---==-=====---==========+#*=--==+++=======--=" "\n"
44+
"...--:=+===---============++++=====++=======---=" "\n";
45+
// clang-format on
46+
// c9 8d 74
47+
rawprint("\033[38;2;201;141;116m\n\n");
48+
rawprint(msg);
49+
rawprint("\033[0m\n\n");
50+
}
51+
1652
// Call this function when and only when the kernel has encountered a fatal error.
1753
// Prints register dump for current kernel context and jumps to `panic_poweroff`.
1854
void panic_abort() {
@@ -27,6 +63,7 @@ void panic_abort() {
2763
// Immediately power off or reset the system.
2864
void panic_poweroff() {
2965
rawprint("**** KERNEL PANIC ****\nhalted\n");
66+
kekw();
3067
asm volatile("csrci " CSR_STATUS_STR ", %0" ::"ri"(1 << CSR_STATUS_IE_BIT));
3168
while (1) asm volatile("wfi");
3269
}

kernel/src/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ static void kernel_lifetime_func() {
104104
shutdown_mode = atomic_load(&kernel_shutdown_mode);
105105
} while (shutdown_mode == 0);
106106

107+
logk(LOG_FATAL, "We do a little trolling");
108+
panic_abort();
109+
107110
// Shut down the userland.
108111
userland_shutdown();
109112
// Tie up loose ends.

0 commit comments

Comments
 (0)