Setup kernel stack; but process is failing
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <stdbool.h>
|
||||
#include "sched/scheduler.h"
|
||||
#include "config.h"
|
||||
#include "sched/process.h"
|
||||
|
||||
struct interrupt_descriptor idt[256];
|
||||
struct idtr idt_reg;
|
||||
@@ -118,6 +119,11 @@ static void gp_fault_handler(struct cpu_status_t* ctx)
|
||||
|
||||
struct cpu_status_t* interrupt_dispatch(struct cpu_status_t* context)
|
||||
{
|
||||
if (context == NULL)
|
||||
{
|
||||
panic(NULL, "Interrupt dispatch recieved NULL context!");
|
||||
}
|
||||
|
||||
switch(context->vector_number)
|
||||
{
|
||||
case 0:
|
||||
@@ -140,6 +146,7 @@ struct cpu_status_t* interrupt_dispatch(struct cpu_status_t* context)
|
||||
break;
|
||||
case 6:
|
||||
DEBUG("Invalid Opcode!");
|
||||
panic(context, "Invalid Opcode!");
|
||||
break;
|
||||
case 7:
|
||||
DEBUG("Device Not Available!");
|
||||
@@ -194,7 +201,8 @@ struct cpu_status_t* interrupt_dispatch(struct cpu_status_t* context)
|
||||
if (ticks % SCHEDULER_QUANTUM == 0)
|
||||
{
|
||||
CLEAR_INTERRUPTS;
|
||||
scheduler_schedule();
|
||||
struct cpu_status_t* current_ctx = scheduler_schedule(context);
|
||||
process_switch(current_ctx->iret_rsp, current_ctx->iret_rip);
|
||||
SET_INTERRUPTS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user