Re: General protection fault on return from any interrupt
Posted: Sun Apr 13, 2014 11:25 pm
Thanks for the reply though, it was originally written in AT&T until I couldn't figure out was wrong with it and I wanted to compare it to other code :/ it runs properly using ret instead of iret though... at least for a while
edit: bochs gives a "check_cs(0x0010): not a valid code segment" though it is changed to 0x8 when the interrupt occurs
edit2: CS is set 0x10 directly after grub2, from what I gather from this: Can somebody tell me if this ASM is ok ? is that setting CS to 0x10 is not valid if DS has that value already :/ however I do have:
at the end of my GDT setting CS = 0x8 manually in bochs seems to fix it, going to try implement it into my build
edit3: Wow I feel stupid -_- I forgot put the jmp in at the end of the gdt_flush
edit: bochs gives a "check_cs(0x0010): not a valid code segment" though it is changed to 0x8 when the interrupt occurs
edit2: CS is set 0x10 directly after grub2, from what I gather from this: Can somebody tell me if this ASM is ok ? is that setting CS to 0x10 is not valid if DS has that value already :/ however I do have:
Code: Select all
mov $0x10, %ax
mov %ax, %ds
mov %ax, %es
mov %ax, %fs
mov %ax, %gs
mov %ax, %ss
edit3: Wow I feel stupid -_- I forgot put the jmp in at the end of the gdt_flush