Page 1 of 1

How to use tss in the same task

Posted: Tue Apr 26, 2011 7:54 pm
by leetow2003
When to change privilege in the same task,
must I need tss?how to use tss?
who could give me an example?

Re: How to use tss in the same task

Posted: Wed Apr 27, 2011 12:33 am
by Gigasoft
In your TSS, initialize the ESPn and SSn fields for each privilege level that will be accessed from a higher-numbered privilege level. This gives the initial value of ESP and SS when transferring control to the lower-numbered privilege level. Set the I/O map base to the offset in your TSS where your I/O permission bit map begins and the interrupt redirection bitmap ends. The I/O permission bit map ends at the end of the TSS segment, or after 8192 bytes, whichever comes first. All other fields can be ignored. Make a descriptor that points to the TSS, with the type field set to 9 (inactive TSS). If you are not using the I/O permission bit map or the interrupt redirection bitmap, set the limit to 67h and set the I/O map base to 68h. Use the LTR instruction to activate the TSS.

When transferring control to a higher-numbered privilege level, the ESPn and SSn fields are not automatically updated, this must be done manually when required.

Re: How to use tss in the same task

Posted: Wed Apr 27, 2011 8:21 am
by leetow2003
when I call another code segment in p-mode
and privilege is changed,I want to know if the returning address
is saved in tss automatically?