mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 06:58:22 +00:00
cae7428ed0
Added a basic kernel panic function and interrupt support for x86_64 (mostly for exception handling)
35 lines
551 B
C
35 lines
551 B
C
#include <limine.h>
|
|
#include <kernel/console.h>
|
|
#include <arch/cls.h>
|
|
|
|
static volatile struct limine_terminal_request liminettyr = {
|
|
.id = LIMINE_TERMINAL_REQUEST,
|
|
.revision = 0
|
|
};
|
|
|
|
struct limine_terminal_response* liminetty;
|
|
|
|
void liminewrite(char* str, size_t c){
|
|
|
|
liminetty->write(liminetty->terminals[0], str, c);
|
|
|
|
}
|
|
|
|
void kmain(){
|
|
if(!liminettyr.response)
|
|
return;
|
|
|
|
liminetty = liminettyr.response;
|
|
liminetty->write += 0xFFFF800000000000;
|
|
|
|
console_setwritehook(liminewrite);
|
|
|
|
bsp_setcls();
|
|
gdt_bspinit();
|
|
idt_bspinit();
|
|
|
|
|
|
}
|
|
|
|
|