10ms Round Robin scheduler (blank processes)
This commit is contained in:
@@ -1,9 +1,35 @@
|
||||
#include "kernel.h"
|
||||
#include "process.h"
|
||||
|
||||
extern struct process_t* processes_list;
|
||||
extern struct process_t* current_process;
|
||||
|
||||
// DEBUG: how many times we did schedule
|
||||
int scheduled = 0;
|
||||
|
||||
void scheduler_init()
|
||||
{
|
||||
// Choose first process?
|
||||
current_process = processes_list;
|
||||
}
|
||||
|
||||
void scheduler_schedule()
|
||||
{
|
||||
DEBUG("Scheduler called!");
|
||||
//DEBUG("Scheduler called!");
|
||||
if (current_process->next != NULL)
|
||||
{
|
||||
current_process = current_process->next;
|
||||
} else
|
||||
{
|
||||
current_process = processes_list;
|
||||
}
|
||||
scheduled++;
|
||||
DEBUG("SCHEDULER CALLED: current_process=%p", current_process);
|
||||
|
||||
// debug
|
||||
/* if (scheduled == 5)
|
||||
{
|
||||
DEBUG("enough, halting");
|
||||
hcf();
|
||||
} */
|
||||
}
|
||||
Reference in New Issue
Block a user