Beispiel #1
0
        public void CreateProcess(string sCodeFileName)
        {
            Code code = new Code(sCodeFileName);

            m_dProcessTable[m_cProcesses]           = new ProcessTableEntry(m_cProcesses, sCodeFileName, code);
            m_dProcessTable[m_cProcesses].StartTime = CPU.TickCount;
            m_spPolicy.AddProcess(m_cProcesses);
            m_cProcesses++;
        }
Beispiel #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++;
        }