MyOS Kernel
isr.c File Reference
#include "../../kernel.h"
#include "../../tasking.h"
#include "../../vga_err.h"
#include "../../address_spaces.h"
#include "../halt.h"
#include "../paging.h"
#include "../serial.h"
#include "gdt.h"
#include "idt.h"
#include "isr.h"
#include "interrupt.h"
#include <cpu/ports.h>
#include <stdint.h>
#include <string.h>
#include <sys/syscalls.h>
#include <sys/types.h>

Data Structures

struct  isr_handler_info
 

Functions

void isr_install ()
 
void isr_handler (registers_t *r)
 
void isr_register_handler (int n, pid_t pid, void *handler)
 
void irq_handler (registers_t *r)
 

Variables

static isr_handler_info irq_handlers [16] ={0}
 Handlers for the PIC interrupts.
 
static char * exception_messages []
 List of messages for each exception.
 

Function Documentation

◆ irq_handler()

void irq_handler ( registers_t r)

Handler for PIC interrupts

Parameters
rThe saved state of the CPU

◆ isr_handler()

void isr_handler ( registers_t r)

Handler for non-PIC interrupts

Parameters
rThe saved state of the CPU

◆ isr_install()

void isr_install ( )

Install the interrupt handlers into the IDT.

◆ isr_register_handler()

void isr_register_handler ( int  n,
pid_t  pid,
void *  handler 
)

Register an IRQ handler

If the PID is 0, the handler will be called directly, otherwise a thread will be made in the PID starting at the handler's address.

Parameters
nThe IRQ to register a handler for
pidThe PID that will handle the interrupt.
handlerThe address of the handler.