SKC wrote:
Code:
dw isr_wrapper.handler
dw 0x8
db 10101110b
dw isr_wrapper.handler>>16
dd isr_wrapper.handler>>32
dd 0
When I try to compile this, I get an error saying "shift operator may only be applied to scalar values".
SKC wrote:
Btw, you shouldn't load 0 into the segment registers. You should create a proper GDT.
I was following a tutorial and that's what it told me to do.
Here is my GDT. Is this right? Can I remove putting null into the segment registers?
Code:
section .rodata
gdt:
dq 0 ; null descriptor
.code: equ $ - gdt
dq 0x00209a0000000000 ; 64-bit code descriptor (exec/read)
dq 0x0009200000000000 ; 64-bit data descriptor (read/write)
align 4
dw 0
.pointer:
dw $ - gdt - 1
dq gdt
Octocontrabass wrote:
The first 32 entries in the IDT are for exceptions. If you've remapped the PICs to use any of those entries, you're going to have a lot of problems. (And if you remapped them outside the first 32 entries, any IRQ will cause an exception because your IDT only has 32 entries.)
Here is how I remap the PICs. This is what I gathered from reading the wiki and looking at other's code. I thought this just allowed me to access the keyboard, I didn't know it messed with IDT exceptions.
Code:
setup_pics:
mov al, 0x11
out 0x20, al ; restart PIC1
out 0x10, al ; restart PIC2
mov al, 0x20
out 0x21, al ; PIC1 now starts at 32
mov al, 0x28
out 0x11, al ; PIC2 now starts at 40
mov al, 0x04
out 0x21, al ; setup cascading
mov al, 0x02
out 0xa1, al
mov al, 0x01
out 0x21, al
out 0xa1, al
ret