some minor stuff; good night
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
@@ -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++;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user