TSS Troubles
Posted: Mon Oct 02, 2006 11:03 pm
I'm in need of some help setting up and loading a TSS.
I have the entry set up in the GDT, but whenever I issue the LTR assembler command, Bochs gives the warning 'fetch_raw_descriptor: GDT: index (ff57)1fea > limit (30)' and then I get a GP fault.
I have the TSS segment at GDT[5], so my LTR command is basically 'LTR 0x28'. I'm pretty sure that's right. LTR takes the offset into the GDT as the argument, right?
I've inspected the GDT in the bochs debugger, and that shows the TSS as set up correctly, so I'm not too sure what I'm doing wrong. I've also tried 'LTR 0x05', but that gives a 'ltr: selector.ti != 0' error, and based on what I said above and looking at other OS code (NewOS, AMOS, TabOS), I'm pretty certain I'm doing it right.
If someone would be so kind as to review my code... I've been staring at this for a couple days and reading the Intel docs, but I'm at a loss as to what I'm screwing up here.
Just two links... the first one is to my GDT code, the next one is for my main kernel initialization routines (which is where the LTR statement is).
gdt.c
eduos.c
I'd appreciate any help on this one. Thanks.
I have the entry set up in the GDT, but whenever I issue the LTR assembler command, Bochs gives the warning 'fetch_raw_descriptor: GDT: index (ff57)1fea > limit (30)' and then I get a GP fault.
I have the TSS segment at GDT[5], so my LTR command is basically 'LTR 0x28'. I'm pretty sure that's right. LTR takes the offset into the GDT as the argument, right?
I've inspected the GDT in the bochs debugger, and that shows the TSS as set up correctly, so I'm not too sure what I'm doing wrong. I've also tried 'LTR 0x05', but that gives a 'ltr: selector.ti != 0' error, and based on what I said above and looking at other OS code (NewOS, AMOS, TabOS), I'm pretty certain I'm doing it right.
If someone would be so kind as to review my code... I've been staring at this for a couple days and reading the Intel docs, but I'm at a loss as to what I'm screwing up here.
Just two links... the first one is to my GDT code, the next one is for my main kernel initialization routines (which is where the LTR statement is).
gdt.c
eduos.c
I'd appreciate any help on this one. Thanks.