How to use tss in the same task

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
leetow2003
Member
Member
Posts: 70
Joined: Fri Nov 19, 2010 6:54 pm

How to use tss in the same task

Post by leetow2003 »

When to change privilege in the same task,
must I need tss?how to use tss?
who could give me an example?
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: How to use tss in the same task

Post 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.
leetow2003
Member
Member
Posts: 70
Joined: Fri Nov 19, 2010 6:54 pm

Re: How to use tss in the same task

Post 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?
Post Reply