#include "vga.h" #include "printf.h" #include "string.h" const char *bees_msg = "\n\n\n" " / \\ the number of bees generated by citrons os has exceeded the" "\n" " / \\ maximum amount your computer is capable of handling." "\n" " \\ -- /" "\n" " _====_ your computer will now halt." "\n" " / |--| \\" "\n" " / /==\\ \\ error: " "\n" " / /----\\ \\ %" "\n" " / /======\\ \\ %" "\n" " \\_/ ---- \\_/ %" "\n" " % " "\n" " % " "\n" " % " "\n" " % " "\n" " % " "\n" " % " "\n"; _Noreturn void bees(const char *error) { vsetcolor(vga_color(vga_white, vga_blue)); vclear(); // wrap the error message for (int i = 0; bees_msg[i] != '\0'; i++) { if (bees_msg[i] != '%') vputchar(bees_msg[i]); else { while (isspace(*error)) error++; for (int j = 20; j <= VGA_WIDTH - 3 && *error != '\0'; j++) vputchar(*(error++)); } } while (1) asm("cli;hlt"); }