Esempio n. 1
0
        public OperatingSystem(CPU cpu, Disk disk, SchedulingPolicy sp)
        {
            CPU                  = cpu;
            Disk                 = disk;
            m_dProcessTable      = new Dictionary <int, ProcessTableEntry>();
            m_lReadRequests      = new List <ReadTokenRequest>();
            cpu.OperatingSystem  = this;
            disk.OperatingSystem = this;
            m_spPolicy           = sp;

            //"idle" process here
            IdleCode idleCode = new IdleCode();

            m_dProcessTable[m_cProcesses] = new ProcessTableEntry(m_cProcesses, "idle", idleCode);
            m_cProcesses++;
        }
Esempio n. 2
0
        public OperatingSystem(CPU cpu, Disk disk, SchedulingPolicy sp)
        {
            CPU                  = cpu;
            Disk                 = disk;
            m_dProcessTable      = new Dictionary <int, ProcessTableEntry>();
            m_lReadRequests      = new List <ReadTokenRequest>();
            cpu.OperatingSystem  = this;
            disk.OperatingSystem = this;
            m_spPolicy           = sp;

            IdleCode idleCode = new IdleCode();

            m_dProcessTable[IDLE_PROCESS_ID]           = new ProcessTableEntry(IDLE_PROCESS_ID, "idle", idleCode);
            m_dProcessTable[IDLE_PROCESS_ID].StartTime = CPU.TickCount;
            m_spPolicy.AddProcess(m_cProcesses);
            m_cProcesses++;
        }