public static void run() { RAM.init(); Disk.init(); PCBManager.init(); osStartTime = DateTimeOffset.Now.ToUnixTimeMilliseconds(); Loader loader = new Loader("C:/Users/HOME/Documents/Visual Studio 2017/Projects/OSSImulator/OS-Simulator/OSSImulator/OSSImulator/Program-File.txt"); loader.Start(); jobMetricses = new JobMetrics[PCBManager.getJobListSize()]; for (int i = 0; i < jobMetricses.Length; i++) { jobMetricses[i] = new JobMetrics(); } string s = Disk.readDisk(2); Console.WriteLine("DISK TEST: " + s); while (custardStands()) { ready(); aim((schedulingType != null) ? schedulingType : Schedulingtype.FIFO); fire(); } }
public void Schedule() { if (!RAM.isRAWFull()) { int totalJobs = PCBManager.getJobListSize(); for (int i = 1; i <= totalJobs; i++) { if (!PCBManager.getPCB(i).isJobInMemory() && PCBManager.getPCB(i).getProcessStatus() == PCB.PROCESS_STATUS.NEW && !RAM.isRAWFull()) { loadJobToRAM(PCBManager.getPCB(i)); } } } }
public void FIFOSChedule() { int totalJobs = PCBManager.getJobListSize(); if (PCBManager.getCurrentPcbSortType() != PCBManager.PCB_SORT_TYPE.JOB_NUMBER) { ; } { PCBManager.sortPcbList(PCBManager.PCB_SORT_TYPE.JOB_NUMBER); } if (readyQueue.Count() == 0) { readyQueue.Clear(); } for (int i = 1; i < totalJobs + 1; i++) { readyQueue.Add(PCBManager.getPCB(i)); } sortType = PCBManager.PCB_SORT_TYPE.JOB_NUMBER; }
public static void updateOsMetric() { int jobsInProgress = numberOfBusyCpus(); OSMetrics osMetrics = new OSMetrics(PCBManager.getJobListSize(), numberOfBusyCpus(), completedJobs, getAverageWaitTime(), getAverageRunTime()); //update OsMetrics }