Hi,
For 80x86; I'd recommend having a look at the "protected mode virtual interrupts" feature.
This feature (if you use it as a scheduler hint) means that if a user-space thread does "CLI" it clears the CPU's VIF (Virtual Interrupt Flag). When the kernel thinks it might want to do a task switch it checks VIF and decides if it should do the task switch or postpone the task switch, and if the task switch is being postponed the kernel can set VIP (Virtual Interrupt Pending). When user-space thread does "STI" it sets the VIF and causes an exception if VIP was set; and the scheduler uses that exception to do the task switch that was postponed.
Cheers,
Brendan
_________________ For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
|