Massive backlog of changes

This commit is contained in:
2022-06-15 15:59:31 -05:00
parent c962a83ff0
commit a52f06f81e
49 changed files with 1855 additions and 1083 deletions

View File

@@ -1,17 +1,17 @@
#include "kernel.h"
#include "x86/isr.h"
#include "stdio.h"
#include "x86/apic.h"
#include "x86/processstate.h"
#include "context.h"
#include "platform/interrupts.h"
#include <stdint.h>
struct interrupt_frame_t
{
size_t eip;
size_t cs;
size_t eflags;
size_t esp;
size_t ss;
uint32_t eip;
uint32_t cs;
uint32_t eflags;
uint32_t esp;
uint32_t ss;
};
void isr_generic(struct interrupt_frame_t *frame)
@@ -24,9 +24,16 @@ void isr_division_by_zero(struct interrupt_frame_t *frame)
printf("Exception: Division by zero\n");
}
void isr_segment_not_present(struct interrupt_frame_t *frame, unsigned int error)
{
irq_disable();
printf("Exception: NP fault, code %08x\n", error);
asm("hlt");
}
void isr_gp_fault(struct interrupt_frame_t *frame, unsigned int error)
{
asm("cli");
irq_disable();
asm("mov $0x10, %%ax; "
"mov %%ax, %%ds; "
"mov %%ax, %%es; "
@@ -39,7 +46,7 @@ void isr_gp_fault(struct interrupt_frame_t *frame, unsigned int error)
void isr_page_fault(struct interrupt_frame_t *frame, unsigned int error)
{
size_t addr;
uint32_t addr;
asm("mov %%cr2, %0"
: "=r"(addr));
asm("mov $0x10, %%ax; "
@@ -54,8 +61,7 @@ void isr_page_fault(struct interrupt_frame_t *frame, unsigned int error)
void isr_double_fault(struct interrupt_frame_t *frame, unsigned int error)
{
asm("cli");
irq_disable();
printf("Exception: Double fault (!!), code %08x\n", error);
asm("hlt");
}