Re:SS/ESP on stack after interrupt
Posted: Thu Nov 28, 2002 1:32 pm
I didn't think not being pre-emptable is not a hindrance to running on multiple CPU's, linux was not-preemptable until relatively recently.
I am putting in spinlocks now to avoid having problems later, so I am thinking of how my design will grow.
Incidentally I have just coded my pre-empt protection into the kernel. Basically what happens is that when a kernel interrupt is called, the first instruction marks a flag that says "the kernel is in use, dont pre-empt" and clears this on exit.
My design means that complex calculation is not meant to be done during a system call. And hardware interrupts will still be able to happen if a system call is executing to avoid holding up I/O.
I reckon my design will avoid the need to disable interrupts at any point, which should help transition to multi-processor at a later point.
Update: I am getting into a right mess with my non-preemptable kernel, so I think I will switch to pype's mechanism for esp/ss restoration. Now to get it to work, I still getting GPF's at the moment
I am putting in spinlocks now to avoid having problems later, so I am thinking of how my design will grow.
Incidentally I have just coded my pre-empt protection into the kernel. Basically what happens is that when a kernel interrupt is called, the first instruction marks a flag that says "the kernel is in use, dont pre-empt" and clears this on exit.
My design means that complex calculation is not meant to be done during a system call. And hardware interrupts will still be able to happen if a system call is executing to avoid holding up I/O.
I reckon my design will avoid the need to disable interrupts at any point, which should help transition to multi-processor at a later point.
Update: I am getting into a right mess with my non-preemptable kernel, so I think I will switch to pype's mechanism for esp/ss restoration. Now to get it to work, I still getting GPF's at the moment