implement kernel panic
This commit is contained in:
4
common.c
4
common.c
@@ -84,7 +84,9 @@ char *strcpy(char *dst, const char *src) {
|
||||
*d++ = *src++;
|
||||
*d = '\0';
|
||||
return dst;
|
||||
}
|
||||
} // The strcpy function continues copying even if
|
||||
// src is longer than the memory area of dst.
|
||||
// This can easily lead to bugs and vulnerabilities
|
||||
|
||||
int strcmp(const char *s1, const char *s2) {
|
||||
while (*s1 && *s2) {
|
||||
|
15
kernel.c
15
kernel.c
@@ -27,12 +27,17 @@ void putchar(char ch) {
|
||||
}
|
||||
|
||||
void kernel_main(void) {
|
||||
printf("\n\nHello %s\n", "RETARD!");
|
||||
printf("60 + 9 = %d, %x\n", 60 + 9, 0x1234abcd);
|
||||
// printf("\n\nHello %s\n", "friend :3");
|
||||
// printf("60 + 9 = %d, %x\n", 60 + 9, 0x1234abcd);
|
||||
//
|
||||
// for (;;) {
|
||||
// __asm__ __volatile__("wfi");
|
||||
// }
|
||||
|
||||
memset(__bss, 0, (size_t) __bss_end - (size_t) __bss);
|
||||
|
||||
for (;;) {
|
||||
__asm__ __volatile__("wfi");
|
||||
}
|
||||
PANIC("BOOOO!!! GET INFECTED WITH BOOTKID YOU SKID! 0x1337h@x0r");
|
||||
printf("you lucky bitch got away\n");
|
||||
}
|
||||
|
||||
__attribute__((section(".text.boot")))
|
||||
|
Reference in New Issue
Block a user