Hardware task switching questions
Posted: Mon Jan 01, 2007 2:38 pm
Hello,
When using hardware task switching, is it absolutely necessary to use one TSS for every process?
What are SS0:ESP0, SS1:ESP1 and SS2:ESP2 exactly? Are they related to different segment protection privilege levels (AKA rings)? In that case, why is there three of them for four privilege levels?
Should the AVL bit be set in TSS descriptors?
Should the busy bit be messed with? When?
I read in the Intel manual:
Also, how should it be done when called from user mode ring 3 (CPL/DPL/RPL)?
Thank you in advance.
When using hardware task switching, is it absolutely necessary to use one TSS for every process?
What are SS0:ESP0, SS1:ESP1 and SS2:ESP2 exactly? Are they related to different segment protection privilege levels (AKA rings)? In that case, why is there three of them for four privilege levels?
Should the AVL bit be set in TSS descriptors?
Should the busy bit be messed with? When?
I read in the Intel manual:
Normally, an interrupt is done by calling the interrupt gate with "int" + "interrupt_gate_descriptor_number". So how would an interrupt be handled with a task switch? Would it be done by calling (with call or jmp) the TSS gate that points to the actual interrupt handler or with "int + TSS gate number"?Interrupts and exceptions can be handled with a task switch to a handler task.
Also, how should it be done when called from user mode ring 3 (CPL/DPL/RPL)?
What kind of additional data are they talking about? Are they talking about things like process name, priority, niceness, etc. Does the CPU actually take care of saving and restoring all this additional data on every task switch?When the G flag is 0 in a TSS descriptor for a 32-bit TSS, the limit field must have a value equal to or greater than 67H, one byte less than the minimum size of a TSS. Attempting to switch to a task whose TSS descriptor has a limit less than 67H generates an invalid-TSS exception (#TS). A larger limit is required if an I/O permission bit map is included in the TSS. An even larger limit would be required if the operating system stores additional data in the TSS.
Thank you in advance.