IDT & Optimization
Re: IDT & Optimization
The bad luck number?? Does that mean the system detected bad luck?? (Sorry, just felt like making that distasteful joke, don't mind me)
CookieOS. Want a cookie? Its only black and white for now though, probably as bad as my baking skills.
-
- Member
- Posts: 32
- Joined: Fri Jan 31, 2014 8:21 am
Re: IDT & Optimization
So I got a Global Protection Fault. What would cause that to happen?
Would an invalid IDT trigger it?
Would an invalid IDT trigger it?
Re: IDT & Optimization
Look attentively, Bochs tells you about invalid IDT entry and even says what he finds invalid:inixsoftware wrote:So I got a Global Protection Fault. What would cause that to happen?
Would an invalid IDT trigger it?
Code: Select all
00128266044e[CPU0 ] interrupt(): gate.type(9) != {5,6,7,14,15}
00128266044e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x0d)
00128266044e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x08)
-
- Member
- Posts: 32
- Joined: Fri Jan 31, 2014 8:21 am
Re: IDT & Optimization
OK, I get that. However, how did an -O3 optimization cause this issue, while -O2 doesn't. That is my question.
Re: IDT & Optimization
Try reading Brendan's and Sortie's answers once again, you can find some possible answers to "how" question there.inixsoftware wrote:OK, I get that. However, how did an -O3 optimization cause this issue, while -O2 doesn't. That is my question.
I can add an idea about debugging: put a breakpoint on 'idt_set_gate' and examine IDT with (AFAIR) 'info idt' command of Bochs debugger after each return from this function (comparing results with parameters that were passed to function. If this procedure doesn't help, then it's possible that you enable interrupts too early or smth like that.