In looking at the OS dev wiki I see the following:
>"The TSS is primarily suited for hardware multitasking, where each individual process has its own TSS. In Software multitasking, one or two TSS's are also generally used, as they allow for entering Ring 0 code after an interrupt."
Would you not be able to enter Ring0 after an interrupt with a TSS entry? Is this why it is still required?
Was curious if it guards against some C pre-processor issues.
/** include/asm-i386/system.h */
#define switch_to(tsk) do {
[...]
} while (0)For details, see http://c-faq.com/cpp/multistmt.html:
if (foo)
MULTI_LINE_MACRO;
Breaks without some wrapper like if (1) { A; B; } or do { A; B; } while (0): if (foo)
A;
B; // oops, unconditional (e.g., "goto fail")Later, with Red Hat's 4g4g kernels that Linus rejected, the problem would go away for people who installed Red Hat's version of the OS on systems with many gigabytes of memory.
What were the 4g4g kernels? Might you have any literature and/or on those?
If you want to have lots of fun, you could look at switch_mm() on a modern kernel :)
Thanks to the author, for caring about the paper people. : )