Setting up initial TSS example

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
tom1000000

Setting up initial TSS example

Post by tom1000000 »

Hello,

I have decided my OS will use software task switching.

However, I think I still need to set up an initial TSS for when I switch into protected mode. However, I'm not sure what values I should put in the TSS eg for EIP. Are the values irrelevant as I won't be jumping TO this TSS?

Is there any good example code that shows how to set it up?
Brill

RE:Setting up initial TSS example

Post by Brill »

When you switch to protected mode, you're not switching tasks but just jumping to a different location in your program so no, you don't have to set up a TSS. A TSS just saves the register state between tasks. You don't need it for switching to protected mode.

If you want example code, look up some other peoples os's to see how they switch to protected mode.

Personaly i don't make the switch in my os, the Grub bootloader does it for me before loading the kernel.
Post Reply