interrupts in longmode

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

interrupts in longmode

Post 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
Author of COBOS
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post 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
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

Post 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
Author of COBOS
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

Post by os64dev »

ok, i found out the problem. i used rex iret instead of iretq. doh. everything works fine now.
Author of COBOS
Post Reply