Re: Problem writing interrupts handler?
Posted: Tue Mar 01, 2016 3:00 pm
Could the issue be that I need to switch to protected mode? I'm not sure if QEMU starts us out in 32 bits or not.
From my understanding here: http://wiki.osdev.org/Protected_Mode You set up the GDT and set a control register. I did the same thing, but it didn't fix the issue.
Here's how I do it:
From my understanding here: http://wiki.osdev.org/Protected_Mode You set up the GDT and set a control register. I did the same thing, but it didn't fix the issue.
Here's how I do it:
Code: Select all
gdt_flush:
mov 4(%esp), %eax
lgdt (%eax)
mov 0x10, %ax
mov %ax, %ds
mov %ax, %es
mov %ax, %fs
mov %ax, %gs
mov %ax, %ss
mov %cr0, %eax
or %al, 1 // set PE (Protection Enable) bit in CR0 (Control Register 0)
mov %eax, %cr0
ljmp $0x08, $.flush
.flush:
ret