Пример #1
0
 public Cpu(Ram ram)
 {
     Ram = ram;
     ReadyQueue = new ReadyQueue(PriorityCount);
     DeviceReadQueue = new DeviceQueue();
     DeviceWriteQueue = new DeviceQueue();
     Locks = Enumerable.Range(1, LockCount).Select(x => (DeviceId)(x + Devices.Locks)).Select(x => new Lock(x)).ToArray();
     Events = Enumerable.Range(1, EventCount).Select(x => (DeviceId)(x + Devices.Events)).Select(x => new Event(x)).ToArray();
     SleepTimer = new CpuSleepTimer();
     _processes = new Dictionary<uint, ProcessContextBlock>();
     _operations = OpCodeMetaInformationBuilder.GetMetaInformation().ToDictionary(x => x.OpCode, OpCodeMetaInformationBuilder.BuildOperation);
     IdleProcess = new ProcessContextBlock { Id = 1, };
     InputDevice = new TerminalInputDevice();
 }
Пример #2
0
 public Cpu(Ram ram)
 {
     Ram              = ram;
     ReadyQueue       = new ReadyQueue(PriorityCount);
     DeviceReadQueue  = new DeviceQueue();
     DeviceWriteQueue = new DeviceQueue();
     Locks            = Enumerable.Range(1, LockCount).Select(x => (DeviceId)(x + Devices.Locks)).Select(x => new Lock(x)).ToArray();
     Events           = Enumerable.Range(1, EventCount).Select(x => (DeviceId)(x + Devices.Events)).Select(x => new Event(x)).ToArray();
     SleepTimer       = new CpuSleepTimer();
     _processes       = new Dictionary <uint, ProcessContextBlock>();
     _operations      = OpCodeMetaInformationBuilder.GetMetaInformation().ToDictionary(x => x.OpCode, OpCodeMetaInformationBuilder.BuildOperation);
     IdleProcess      = new ProcessContextBlock {
         Id = 1,
     };
     InputDevice = new TerminalInputDevice();
 }