Finxing interrupts...
This commit is contained in:
parent
bb78281aaf
commit
3a0d674985
1
.gitignore
vendored
1
.gitignore
vendored
@ -51,3 +51,4 @@ Module.symvers
|
||||
Mkfile.old
|
||||
dkms.conf
|
||||
.vscode/*
|
||||
TODO.md
|
@ -15,7 +15,7 @@ extern irq_handler ; Defined in drivers/isr.h
|
||||
isr%1:
|
||||
cli ; Disable interrupts
|
||||
push byte 0 ; Push dummy error code
|
||||
push byte 1 ; Push interrupt number
|
||||
push byte %1 ; Push interrupt number
|
||||
jmp isr_common ; goto ISR handler
|
||||
%endmacro
|
||||
|
||||
|
@ -65,7 +65,7 @@ static void init_gdt() {
|
||||
static gdt_entry_t construct_entry(gdt_access_t access) {
|
||||
gdt_entry_t entry = (struct gdt_entry_struct) {
|
||||
.base_low = GDT_BASE & 0xFFFF,
|
||||
.base_middle = (GDT_BASE >> 16) % 0xFF,
|
||||
.base_middle = (GDT_BASE >> 16) & 0xFF,
|
||||
.base_high = (GDT_BASE >> 24) & 0xFF,
|
||||
.limit_low = (GDT_LIMIT & 0xFFFF),
|
||||
.access = access,
|
||||
|
@ -49,8 +49,8 @@
|
||||
#define GDT_DATA_TYPE_READ_WRITE_ACCESSED 0x3
|
||||
#define GDT_DATA_TYPE_READ_ONLY_EXPAND_DOWN 0x4
|
||||
#define GDT_DATA_TYPE_READ_ONLY_EXPAND_DOWN_ACCESSED 0x5
|
||||
#define GDT_DATA_TYPE_READ_WRITE_EXPAND_DATA 0x6
|
||||
#define GDT_DATA_TYPE_READ_WRITE_EXPAND_DATA_ACCESSED 0x7
|
||||
#define GDT_DATA_TYPE_READ_WRITE_EXPAND_DOWN 0x6
|
||||
#define GDT_DATA_TYPE_READ_WRITE_EXPAND_DOWN_ACCESSED 0x7
|
||||
#define GDT_DATA_TYPE_EXEC_ONLY 0x8
|
||||
#define GDT_CODE_TYPE_EXEC_ONLY_ACCESSED 0x9
|
||||
#define GDT_CODE_TYPE_EXEC_READ 0xA
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <stdint.h>
|
||||
#include "isr.h"
|
||||
#include "../libc/string.h"
|
||||
#include "tty.h"
|
||||
#include "../libc/string.h"
|
||||
#include "ports.h"
|
||||
|
||||
#define PIC1 0x20 // I/O address for master PIC
|
||||
@ -70,7 +70,7 @@ void ack_irq(uint32_t int_num) {
|
||||
// Send and End Of Interrupt(EOF) at the PICs.
|
||||
if(int_num >= 40)
|
||||
outb(PIC2_COMMAND, PIC_EOI); // Send reset signal to slave
|
||||
outb(PIC2_COMMAND, PIC_EOI); // In any case, reset the master
|
||||
outb(PIC1_COMMAND, PIC_EOI); // In any case, reset the master
|
||||
}
|
||||
|
||||
void irq_handler(registers_t regs) {
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include "drivers/tty.h"
|
||||
#include "drivers/gdt.h"
|
||||
#include "drivers/idt.h"
|
||||
#include "drivers/isr.h"
|
||||
#include "libc/stdio.h"
|
||||
|
||||
void kernel_main() {
|
||||
|
Loading…
Reference in New Issue
Block a user