#include #include #include void panic(int reason, int type) { // will fill with debugging info latter struct stack_frame *frame; #ifdef EASTEREGG_BLOATWARE printf("Kernel PANIC!!!!!!!\n"); printf( " _.-^^---....,,-- \n" " _-- --_ \n" "< >)\n" "| BOOM | <------- your computer\n" " \\._ _./ \n" " ```--. . , ; .--''' \n" " | | | \n" " .-=|| | |=-. \n" " `-=#$%&%$#=-' \n" " | ; :| \n" " _____.,-#%&$@%#&#~,._____\n"); #else printf("Kernel Panic!\n"); #endif printf("Reason:\n"); switch(reason) { case KERNEL_PANIC_PMAPSIZE : printf("\tThe physical map can't fit in the first memory zone.\n" "\tNote: If you have this issue, please contact me.\n" "\tIt's a fixable bug caused by an unlikely scenario.\n"); break; case KERNEL_PANIC_RSDP_UNFOUND: printf("\tRSDP unfound!\n"); break; case KERNEL_PANIC_KERNEL_RETURNED: printf("\tThe kernel (almost) reached its return!\n"); break; } printf("\nStack trace:\n"); asm("mov %%rbp,%0" : "=r"(frame) ::); for(; frame->next != 0; frame = frame->next) { printf("\t%x\n", frame->function_base); } //It's not public yet, but it will be printf("\nAfter ensuring your computer meets the requirements specified, if you think this is a bug, please open an issue on the git repo or email me at %s.\n", DEV_EMAIL); for(;;); }