This coincides with my Operating System's Project and am on an unforgiving time limit. Its such a big project and theres soo many parts to it and I can't really write down the details....theres too many things to this. But if any1 knows anything about operating systems and what a Short Term scheduler and long term scheduler is......can you plz help me? This is what it's supposed to do:
The Scheduler
The Scheduler loads programs from the disk into RAM according to the given scheduling policy. The scheduler must note in the PCB, which physical addresses in RAM each program/job begins. This ‘start’ address must be stored in the base-register of the process. It must also use the Input/Output buffer size information (in the control cards) for allocating space in RAM. The Scheduler method either loads one program at a time (in a simple batching system) or multiple programs (in a multiprogramming system) depending on passed parameter(s). Thus, the Scheduler works closely with the Memory manager and the Effective-Address method.
Dispatcher
The Dispatcher method assigns a process to the CPU. The dispatcher will extract parameter data from the PCB and accordingly set the CPU’s PC, and other registers, before the OS calls the CPU to execute it.
How do i implement this?
I've started something but its a working progress and i need help to continue the progression!
import java.util.*;
public class scheduler()
{
public static PCB pcbs = new PCB();
public static Queue readyQueue = new Queue();
for (int i = 0; i </*file input*/; i++)
{
pcbs.getPCB(i).timeStamp();
readyQueue.enqueue(i);
}
while (!readyQueue.empty())
{
if (readyQueue.empty())
{
clock.tick(); //system clock implementation is used...start timer
System.out.println( "Current Clock Time = "+clock.time());
}
else
{
int pcb[] = readyQueue.dequeue();
pcb.getNext(value).updateCPUWaitTime();
switchIn(value);
runProcess(pcb,4);
switchOut(value);
}
}
}
I guess what would really help me out is some good pseudocode.
All i know is as the jobs/process is taken in....they are supposed to get placed in the readyQueue and the short term scheduler and dispatcher sets up the parameters for CPU execution. I understand concepts but implementation is hard!