Page 1 of 1
Rings
Posted: Fri Oct 04, 2002 11:00 pm
by TheUbu
Hello,
Quick question I set up three descriptors a data, code and tss all in dpl 3 the tss is set up to use the dpl3 cs and ss however when I jmp to the tss I get a gpf the memory in use by the data in paging is set to user privs is there something else that I might have missed?
-Christopher
RE:Rings
Posted: Thu Oct 10, 2002 11:00 pm
by Keith
First, make sure that what you are leaving from, is within a TSS FIRST, you can load a tss with the ltr instruction. You'll need to do this before you go jumping to another TSS (you will probably only need to perform ltr once though.)
Second, do not include the RPL in your long jump. When jumping to a TSS, simply include something like "ljmp $0x30,$0" where $30 would be your selector and $0 will be your offset. The offset is ignored as it is grabbed from the new TSS instead.
In your TSS, you'll want to include the RPL as well for CS and SS.
Last, but surely not least, ljmp doesn't set the backlink of the new TSS, so if your program exits, it could be returning to an invalid address...If you want to set the backlink, use a far/long call instead.
In addition to that, make sure that the TSS descriptor in the GDT that you're jumping/calling is NOT set busy. Tasks cannot be entered more than once.
Hope this helps,
Cheers!