Page 1 of 1

First task: Which fields are used?

Posted: Sat Aug 02, 2003 9:03 am
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...

Re:First task: Which fields are used?

Posted: Sat Aug 02, 2003 9:28 am
by Thunder
In software multitaking you have tu save just all base regs, EIP, EFLAGS, and segment registers, if needed :P

Re:First task: Which fields are used?

Posted: Sat Aug 02, 2003 9:38 am
by Peter_Vigren
I was talking about hardware multitasking (since I mentioned the LTR instruction)...

Re:First task: Which fields are used?

Posted: Sun Aug 03, 2003 2:55 am
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.

Re:First task: Which fields are used?

Posted: Mon Aug 04, 2003 4:13 am
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.

Re:First task: Which fields are used?

Posted: Mon Aug 04, 2003 8:06 am
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. :)

Re:First task: Which fields are used?

Posted: Fri Aug 08, 2003 9:25 pm
by Peter_Vigren
Oh, I see (more or less).