wake-0 / fhvOS

This repository contains an os for the arm cortex a8 in combination with beaglebone.
GNU General Public License v2.0
7 stars 1 forks source link

[Kernel] Implement Idle Process #84

Closed trylimits closed 9 years ago

trylimits commented 9 years ago

Our os needs an Idle process. Otherwise we are not able to kill or block all remaining (non-idle) processes. The idle process should be hardcoded into the os and it should always have the pid=0. We also have to ensure that the process with pid=0 is never blocked and never killed.

One possibility is to add this to the KernelStart function or to add it into the scheduler code SchedulerStart().

We also should ensure that the idle process is never running as long as other processes are in READY or RUNNING state.

ghost commented 9 years ago

please let the PID = 0 unused until further notice. I'll maybe need it to safely change the ASID.

trylimits commented 9 years ago

Suggestion: Instead of implementing a hard-coded logic in the scheduler avoiding to run the idle-process if other processes are in READY state we should implement the idle process as following:

while(true)
{
    SystemYield();
}

SystemYield() should be added to the system API and should immediately switch to the next ready process.

trylimits commented 9 years ago

The above two commits implement the idle process which follows the concept in the above comment.

Pls close after reviewed.