previous | start

Minix Dispatcher (cont.)

The previous Minix scheduling routines in the kernel determine which process should run next.

But the restart() function in the Minix kernel is responsible for causing the next process to actually run.

Here is about a third of the code for restart:

_restart:

! Restart the current process or the next process if it is set. 

        cmp     (_next_ptr), 0          ! see if another process is scheduled
        jz      0f
        mov     eax, (_next_ptr)
        mov     (_proc_ptr), eax        ! schedule new process 
        mov     (_next_ptr), 0
0:      mov     esp, (_proc_ptr)        ! 
        ....                            
        ....
        iretd                           ! continue process



previous | start