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?
Setting up initial TSS example
RE:Setting up initial TSS example
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.
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.