#include #include #include #include #include #include void debug_init() { vga_init(); serial_init(PORT_COM1); } uint64_t num2str(uint64_t num, uint32_t base, char *buf) { // Convert a number to string if(num == 0) { buf[0] = '0'; buf[1] = '\0'; return 0; } uint32_t i=0, j=0; char chars[] = "0123456789ABCDEF"; // Build the string starting with the least significant digit while(num > 0) { buf[i++] = chars[num%base]; num /= base; } // Invert the string to get digits in right order i--; j=0; while(j