mirror of
https://github.com/gbowne1/ClassicOS.git
synced 2024-11-21 22:06:51 -08:00
fixing up some missing bits in isr.c and isr.h
This commit is contained in:
parent
1630352383
commit
e99a09639d
@ -3,8 +3,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// Define the isr_regs structure
|
||||
|
||||
// IDT entry structure
|
||||
struct idt_entry
|
||||
{
|
||||
|
@ -12,8 +12,20 @@ enum
|
||||
SERIAL_PORT_INTERRUPT = 0x24
|
||||
};
|
||||
|
||||
void dummy_isr(struct isr_regs *regs)
|
||||
{
|
||||
printf("Timer interrupt occurred!\n");
|
||||
}
|
||||
|
||||
// ISR table
|
||||
void (*isr_table[256])(struct isr_regs *regs);
|
||||
void (*isr_table[256])(struct isr_regs *regs) = {
|
||||
// initialize the dummy isr_table
|
||||
[TIMER_INTERRUPT] = dummy_isr, // Timer interrupt
|
||||
[KEYBOARD_INTERRUPT] = dummy_isr, // Keyboard interrupt
|
||||
[NETWORK_INTERRUPT] = dummy_isr, // Network interrupt
|
||||
[DISK_INTERRUPT] = dummy_isr, // Disk interrupt
|
||||
[SERIAL_PORT_INTERRUPT] = dummy_isr // Serial port interrupt
|
||||
};
|
||||
|
||||
// Register an ISR
|
||||
void isr_register(uint8_t num, void (*handler)(struct isr_regs *regs))
|
||||
|
@ -3,6 +3,15 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct isr_regs
|
||||
{
|
||||
uint32_t gs, fs, es, ds; // Segment selectors
|
||||
uint32_t edi, esi, ebp, esp; // Pushed by pusha instruction
|
||||
uint32_t ebx, edx, ecx, eax; // Pushed by the interrupt handler
|
||||
uint32_t int_no, err_code; // Interrupt number and error code (if applicable)
|
||||
uint32_t eip, cs, eflags, esp_at_signal; // Pushed by the processor automatically
|
||||
};
|
||||
|
||||
// Structure for storing register values during an ISR
|
||||
struct idt_regs
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user