First task: Which fields are used?

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
Peter_Vigren

First task: Which fields are used?

Post by Peter_Vigren »

I am wondering about which fields in the first task's TSS (the one which is loaded with LTR) that are needed to be stored before a task switch.

I take it that Esp0 and Ss0 and those (and the I/O bitmap) must be set before a task switch occurs... But the rest of the fields should be stored upon a task switch, should they not? General purpose registers, segments registers, EIP etc...
Thunder

Re:First task: Which fields are used?

Post by Thunder »

In software multitaking you have tu save just all base regs, EIP, EFLAGS, and segment registers, if needed :P
Peter_Vigren

Re:First task: Which fields are used?

Post by Peter_Vigren »

I was talking about hardware multitasking (since I mentioned the LTR instruction)...
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:First task: Which fields are used?

Post by Pype.Clicker »

Intel manuals classify TSS fields in static and dynamic fields. Basically, you have to fill every static field that is relevant in your design (i.e. don't bother with ESP2 if you have no call-gate to a level-2 code descriptor :) ) and leave dynamic fields as they are: they'll be filled on the first switch by the current CPU context.
Peter_Vigren

Re:First task: Which fields are used?

Post by Peter_Vigren »

Pype.Clicker wrote: Intel manuals classify TSS fields in static and dynamic fields.
Oh, silly me! :-[ I should have remembered that! Thanx Pype.
mystran

Re:First task: Which fields are used?

Post by mystran »

You have to use LTR even with software multi-tasking (to get the ESP0 when swiching to kernel, so that doesn't indicate anything really. :)
Peter_Vigren

Re:First task: Which fields are used?

Post by Peter_Vigren »

Oh, I see (more or less).
Post Reply