Page 1 of 1

interrupts in longmode

Posted: Fri Feb 02, 2007 7:04 am
by os64dev
Ok, i have the following issue: whenever i enable interrupts in long mode bochs give me the message on an iret.:
iret64: return CS selector null
Anyone any idea why? I've loaded a GDT and an IDT but no TSS as i don't switch priority or do i always need an TSS in long mode.

regards

Posted: Fri Feb 02, 2007 10:25 am
by JAAman
i see no mention of a need to have a TSS (though i would...)

however, that error indicates that you dont have the proper CS on the stack

most likely your trashing your stack, by either poping more than you pushed, or not as much -- either way your stack at iret isnt where it was at the start of the isr

Posted: Sat Feb 03, 2007 6:54 am
by os64dev
my isr routine consists of solely the iret statement and call it manually. I found out from the AMD manuals that with longmode i have to have the statement 'rex iret' in my isr but that doesn't fix the problem. but if i change the target cs field in the idt, it gives an error regarding a faulty cs so my cs is ok. It fails on the iret statement.

regards

Posted: Sat Feb 03, 2007 10:05 am
by os64dev
ok, i found out the problem. i used rex iret instead of iretq. doh. everything works fine now.