add basic kernel crash screen
This commit is contained in:
parent
3ef9be01ae
commit
43278fb351
5 changed files with 63 additions and 1 deletions
37
src/kernel/lib/havarie.c
Normal file
37
src/kernel/lib/havarie.c
Normal file
|
@ -0,0 +1,37 @@
|
|||
#include "internal/havarie.h"
|
||||
|
||||
#include "internal/text_screen.h"
|
||||
|
||||
void capsize() {
|
||||
print_havarie_msg();
|
||||
|
||||
asm("cli\n"
|
||||
"hlt");
|
||||
|
||||
for(;;);
|
||||
}
|
||||
|
||||
void print_havarie_msg() {
|
||||
tsclear_screen();
|
||||
tscursor_set(0, 0);
|
||||
tsputs("Havarie - the clipper has capsized\n\n\n", TEXT_SCREEN_BG_BLACK | TEXT_SCREEN_FG_LIGHT_CYAN);
|
||||
|
||||
|
||||
int eax, ebx, ecx, edx, esi, edi, esp, ebp;
|
||||
asm("mov %%eax, %[eax]\n"
|
||||
"mov %%ebx, %[ebx]\n"
|
||||
"mov %%ecx, %[ecx]\n"
|
||||
"mov %%edx, %[edx]\n"
|
||||
"mov %%esi, %[esi]\n"
|
||||
"mov %%edi, %[edi]\n"
|
||||
"mov %%esp, %[esp]\n"
|
||||
"mov %%ebp, %[ebp]\n"
|
||||
: [eax]"=m" (eax), [ebx]"=m" (ebx), [ecx]"=m" (ecx), [edx]"=m" (edx),
|
||||
[esi]"=m" (esi), [edi]"=m" (edi), [esp]"=m" (esp), [ebp]"=m" (ebp)
|
||||
);
|
||||
|
||||
tsprintf("eax=0x%x\t\tesi=0x%x\n", eax, esi);
|
||||
tsprintf("ebx=0x%x\t\tedi=0x%x\n", ebx, edi);
|
||||
tsprintf("ecx=0x%x\t\tesp=0x%x\n", ecx, esp);
|
||||
tsprintf("edx=0x%x\t\tebp=0x%x\n", edx, ebp);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue