i wasn't clear enough what i meant by `interrupt handler'. i didn't mean the device-specific function, but its caller. in pc/trap.c you see if(up && !clockintr) preempted(); and on other platforms (perhaps not enough) there are calls to preempted() in the interrupt handler(s) that despatch the device-specific ones. preempted calls sched, which can switch to another process before returning.