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...
First task: Which fields are used?
Re:First task: Which fields are used?
In software multitaking you have tu save just all base regs, EIP, EFLAGS, and segment registers, if needed
Re:First task: Which fields are used?
I was talking about hardware multitasking (since I mentioned the LTR instruction)...
- Pype.Clicker
- 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?
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?
Oh, silly me! :-[ I should have remembered that! Thanx Pype.Pype.Clicker wrote: Intel manuals classify TSS fields in static and dynamic fields.
Re:First task: Which fields are used?
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.