Page 1 of 1

Diferences between TSS and software taskswitching

Posted: Fri May 02, 2003 1:57 am
by Thunder
Hello,
What are diferences between TSS-hardware and software multitasking, on what kind of kernel it wrks better(monolithic and microkernel)?

How it woks? I know that on taskswitch it we must save registers, flags and other stuff. But when computer knows when to switch task, I think that we must use IRQ0-timer?
Please, explain me. :)
Thanks

Re:Diferences between TSS and software taskswitching

Posted: Fri May 02, 2003 6:23 am
by Whatever5k
When using TSS, you initiate a task switch by jumping to the appropriate TSS selector, the CPU then saves the task's state in the current TSS pointed to by the TSS register.
When using stack based (software) task.-switching, you first save the task's state on the current stack, load the stack of the new program (which contains EIP, CS & co.) and initiate an IRET. It *actually* has nothing to do with the IRQ0 timer - it's just that people use the clock to determine if a process has run too long.
So you basically do:

Code: Select all

clock()
  -> quantum--; if quantum = 0; switch_to_process(ANOTHER);
Hope that helps