]> wirehaze git hosting - stm32f411ceu6.git/blob - sys/core/kentry.c

wirehaze git hosting

panic ()
[stm32f411ceu6.git] / sys / core / kentry.c
1 #include <uart.h>
2 #include <led.h>
3
4 __attribute__ ((noreturn)) void kentry (void);
5
6 static const char *text[] = {
7 "hello, friend.\r\n",
8 "hello, friend?\r\n",
9 "that's lame.\r\n",
10 "maybe i should give you a name.\r\n",
11 "but that's a slippery slope.\r\n",
12 "you're only in my head.\r\n",
13 "we have to remember that.\r\n",
14 "shit.\r\n",
15 "it's actually happening, i'm talking to an imaginary person.\r\n\n"
16 };
17
18 void
19 kentry (void)
20 {
21 unsigned int line;
22
23 for (line = 0; line < sizeof text / sizeof *text; ++line)
24 kputs_busytc (text[line]);
25
26 /* Trigger a fault to test kernel panic */
27 asm ("udf #0");
28
29 kputs_busytc ("Unreachable");
30
31 while (1)
32 asm ("wfi");
33 }