In x86, you can use the TSS for task switching between running processes, however, it is recommended to use only one TSS (as you have to) and perform software task switching, especially if you want to port the kernel to other hardware which don't have TSS's.
In x86-64 (64 bit), there is no TSS (e.g. it doesn't do anything like in x86), so, how would someone go about doing task switching without it (since before, you would use at least one)?
You would do it the same way you would do it on any other platform: you store the contents of the appropriate registers:
for the task you're switching away from, and restore the same for the task you're switching to.
Often this is done by pushing all the state onto the stack you're switching from, and popping it off the stack you're switching to. This way, only the stack pointer needs to be passed around or managed by the kernel to track what's waiting in the background.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With