this is not necessary, the kernel stack should not be in shared space, and should start at the same point for each task, therefore, esp0 doesn't ever need to change (unless for some reason your storing values on the stack between calls?)Brendan wrote: Once the initial TSS is setup, you'd just change "TSS->esp0" during every task switch (if each task has it's own kernel stack).
on task switch, the kernel stack is swaped when the address space is swapped, and when the kernel function ends, it returns to its entry point (at the start of task), the only time this won't be correct on task swap, is if that task is in a kernel routine, in which case it will return to start before esp0 is ever used
basically, once it is set up, the TSS will never need to be changed, unless you are using the I/O bitmap