Skip to content
giannitedesco edited this page Sep 14, 2010 · 3 revisions

Currently scaraOS supports pre-emptive multi tasking and per-task memory contexts. This means that multiple kernel threads can run and be pre-empted by other kernel threads. Kernel threads may have different sets of pagetables and context switch is implemented by loading the cr3 register with the correct value before switching to a task.

What is missing however is switch to userspace (CPL=3) and the corresponding switch from kernel mode stack to user mode stack. I am planning on implementing this using a TSS which, AIUI, is the only way to do it on x86. However I have no fucking clue how the TSS stuff works so it’s gonna take a lot of swatting up on the Intel manual vol2. Also it’s going to affect the interrupt handling paths considerably. Probably going to be a weeks worth of work for me right there :(

Clone this wiki locally