Example #1
0
 public Loader(Driver k)
 {
     kernel = k;
     this.disk = k.Disk;
     this.RAM = k.RAM;
     this.NPQ = k.NewProcessQueue;
 }
 public LongTermScheduler(Driver k)
 {
     kernel = k;
     disk = k.Disk;
     RAM = k.RAM;
     NPQ = k.NewProcessQueue;
     WQ = k.WaitingQueue;
     RQ = k.ReadyQueue;
 }
Example #3
0
 public CPU(Driver k, int id)
 {
     kernel = k;
     disk = k.Disk;
     RAM = k.RAM;
     RQ = k.ReadyQueue;
     cpuPCB = new PCB();
     cache = new uint[1];
     this.id = id;
     thread = new Thread(new ThreadStart(this.Run));
     _suspendEvent = new ManualResetEventSlim(false);
     thread.Start();
 }
Example #4
0
 public static void WriteRAMToFile(RAM r)
 {
     lock (anotherFileLock)
     {
         StreamWriter file = File.AppendText("osProj.txt");
         file.WriteLine(r);
         file.Close();
     }
 }
Example #5
0
 public static void DisplayMemoryOfProcess(Process p, RAM r)
 {
     for (uint iterator = p.PCB.MemoryAddress; iterator < p.PCB.JobLength; iterator++)
     {
         uint _uint = r.ReadDataFromMemory((uint)iterator);
         string _data = String.Format("{0:X}", _uint);
         Console.WriteLine(_data);
     }
 }
Example #6
0
 public static void DisplayContentsOfRAM(RAM r)
 {
     for (int iterator = 0; iterator < r.GetMemorySize() - 963; iterator++)
     {
         uint _uint = r.ReadDataFromMemory((uint)iterator);
         string _data = String.Format("{0:X}", _uint);
         Console.WriteLine(_data);
     }
 }