MyOS Kernel
|
#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. | |
void irq_handler | ( | registers_t * | r | ) |
Handler for PIC interrupts
r | The saved state of the CPU |
void isr_handler | ( | registers_t * | r | ) |
Handler for non-PIC interrupts
r | The saved state of the CPU |
void isr_install | ( | ) |
Install the interrupt handlers into the IDT.
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.
n | The IRQ to register a handler for |
pid | The PID that will handle the interrupt. |
handler | The address of the handler. |