some minor stuff; good night

This commit is contained in:
Karina
2025-12-22 02:47:27 +04:00
parent a83bd40a86
commit e834122e08
4 changed files with 11 additions and 5 deletions
+3 -1
View File
@@ -1,4 +1,6 @@
// borrowed from https://github.com/hubenchang0515/font8x16/blob/master/font8x16.h
// font8x16 bitmap font
// Source: https://github.com/hubenchang0515/font8x16
// License: MIT
unsigned char font8x16[][16] = {
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, //0x00,
+5 -1
View File
@@ -1,3 +1,5 @@
#ifndef IDT_H
#define IDT_H
#pragma once
#include "types.h"
@@ -16,4 +18,6 @@ typedef struct {
u64 base;
} __attribute__((packed)) IDTPtr;
void idt_init();
void idt_init();
#endif
+1 -1
View File
@@ -115,7 +115,7 @@ static void print_hex(u64 u) {
while (u > 0) {
i32 digit = u % 16;
if (digit < 10) { buffer[i] = digit + '0'; }
else { buffer[i] = digit - 10 + 'a'; }
else { buffer[i] = digit - 10 + 'A'; }
u /= 16;
i++;
}
+2 -2
View File
@@ -53,8 +53,8 @@ __attribute__((noreturn)) void panic(Registers *regs) {
kprintf("\n\n");
kprintf("\t\t\tKERNEL PANIC :( \n");
kprintf("\t\t-------------------------\n");
kprintf("\t\tCPU EXCEPTION: %d (%s)\n", regs->int_no, exception_messages[regs->int_no]);
kprintf("\t\tError Code: %x\n", regs->err_code);
kprintf("\t\tCPU EXCEPTION: %s (%d)\n", exception_messages[regs->int_no], regs->int_no);
if (regs->err_code) kprintf("\t\tError Code: %x\n", regs->err_code);
kprintf("\t\tInstruction Pointer (RIP): %x\n", regs->rip);
kprintf("\t\tCode Segment (CS): %x\n", regs->cs);
kprintf("\t\tFlags (RFLAGS): %x\n", regs->rflags);