summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'cpu')
-rw-r--r--cpu/idt.c13
-rw-r--r--cpu/io.h1
-rw-r--r--cpu/io.s10
3 files changed, 19 insertions, 5 deletions
diff --git a/cpu/idt.c b/cpu/idt.c
index 60ab441..90bd56e 100644
--- a/cpu/idt.c
+++ b/cpu/idt.c
@@ -60,6 +60,7 @@ kernel_general_protection_fault(kernel_registers_t *regs) {
kprintf(" Error Code: %x\n", regs->error_code);
kprintf("Instruction Pointer: %x\n", regs->eip);
dump_backtrace(12);
+ asm("hlt");
for (;;)
;
EOI(0xD - 8);
@@ -257,9 +258,15 @@ void idt_init(void) {
PIC_remap(0x20);
// IRQ_set_mask(0xc);
- IRQ_set_mask(0xe);
- IRQ_clear_mask(2);
- IRQ_set_mask(0xB);
+ IRQ_clear_mask(0x5);
+ IRQ_clear_mask(0xB);
+ /*
+ IRQ_set_mask(0xe);
+ IRQ_set_mask(2);
+ IRQ_set_mask(1);
+ IRQ_set_mask(0);
+ IRQ_clear_mask(0x5);
+ IRQ_clear_mask(0xB);*/
idtr.interrupt_table = (struct IDT_Descriptor **)&IDT_Entry;
idtr.size = (sizeof(struct IDT_Descriptor) * IDT_MAX_ENTRY) - 1;
diff --git a/cpu/io.h b/cpu/io.h
index 5e28e86..38858a4 100644
--- a/cpu/io.h
+++ b/cpu/io.h
@@ -6,6 +6,7 @@ extern void outw(uint16_t, uint16_t);
extern void outl(uint16_t, uint32_t);
extern uint32_t inl(uint16_t);
+extern uint16_t inw(uint16_t);
extern uint16_t inb(uint16_t);
extern void rep_outsw(uint16_t count, uint16_t port, volatile void *addy);
diff --git a/cpu/io.s b/cpu/io.s
index 3c409de..31e9df0 100644
--- a/cpu/io.s
+++ b/cpu/io.s
@@ -4,6 +4,7 @@
.global outw
.global outl
.global inb
+.global inw
.global inl
.global rep_outsw
.global rep_insw
@@ -36,9 +37,9 @@ outb:
ret
outw:
- mov eax, [esp + 8]
+ mov ax, [esp + 8]
mov dx, [esp + 4]
- out dx, eax
+ out dx, ax
ret
inl:
@@ -46,6 +47,11 @@ inl:
in eax, dx
ret
+inw:
+ mov dx, [esp + 4]
+ in ax, dx
+ ret
+
inb:
mov dx, [esp + 4]
in al, dx