Fixed bootloop

master
E. Almqvist 3 years ago
parent 8f7f3f90d6
commit ced00ad854
  1. 2
      bootloader/bootloader.asm
  2. 4
      kernel/interupt.c
  3. 3
      kernel/kernel.c

@ -60,7 +60,7 @@ pm_init:
mov fs, ax mov fs, ax
mov gs, ax mov gs, ax
mov ebp, 0x900000 ; Update the stack pointer mov ebp, 0xf00000 ; Update the stack pointer
mov esp, ebp mov esp, ebp
call BEGIN_PM call BEGIN_PM

@ -13,7 +13,7 @@ typedef struct {
uint base; uint base;
} __attribute__((packed)) idtr; } __attribute__((packed)) idtr;
__attribute__((aligned(4))) __attribute__((aligned(16)))
static idt_entry IDT[IDT_MAX_DESCS]; static idt_entry IDT[IDT_MAX_DESCS];
static idtr IDTR; static idtr IDTR;
@ -31,7 +31,7 @@ void idt_set_desc(uint8 idx, void* isr, uint8 flags) {
idt_entry* desc = &IDT[idx]; // get descriptor idt_entry* desc = &IDT[idx]; // get descriptor
desc->offset_1 = (uint) isr & 0xffff; desc->offset_1 = (uint) isr & 0xffff;
desc->selector = 0x05; // kernel code selector for the GDT (null is 0x0 - 0x4 => code is 0x05 to something...) desc->selector = 0x08; // kernel code selector for the GDT (null is 0x0 - 0x4 => code is 0x05 to something...)
desc->reserved = 0; desc->reserved = 0;
desc->type_attr = flags; desc->type_attr = flags;
desc->offset_2 = (uint) isr >> 16; desc->offset_2 = (uint) isr >> 16;

@ -52,7 +52,6 @@ void print_kernel_stats() {
} }
void kernel_init() { void kernel_init() {
idt_init(); // Enable interupts
vga_init(); // Initialize the screen first vga_init(); // Initialize the screen first
// i.e. clear the screen et cetera. // i.e. clear the screen et cetera.
@ -67,6 +66,6 @@ void kernel_init() {
print_kernel_motd(); print_kernel_motd();
print_kernel_stats(); print_kernel_stats();
idt_init(); // Enable interupts
while(true) {} while(true) {}
} }

Loading…
Cancel
Save