Пример #1
0
        public Process(int _pid, int _vmSize, PhysicalMemory pm)
        {
            pid    = _pid;
            vmSize = _vmSize;

            vm = new VirtualMemory(pid, vmSize);
            pt = new PageTable(vmSize, pid, vm, pm, this);
        }
Пример #2
0
        public PageTable(int size, int _pid, VirtualMemory _vm, PhysicalMemory _pm, Process p)
        {
            pid           = _pid;
            entryList     = new List <PageTableEntry>();
            vm            = _vm;
            pm            = _pm;
            owningProcess = p;

            //instantite 64 page table entries
            for (int x = 0; x < 64; x++)
            {
                entryList.Add(new PageTableEntry(-1, true, false, pid, 0, this));
            }
        }
Пример #3
0
        public PageTable(int size, int _pid, VirtualMemory _vm, PhysicalMemory _pm, Process p)
        {
            pid           = _pid;
            entryList     = new List <PageTableEntry>();
            vm            = _vm;
            pm            = _pm;
            owningProcess = p;

            for (int x = 0; x < 64; x++)
            {
                if (x < 16)
                {
                    entryList.Add(new PageTableEntry(-1, true, false, -1, pid));
                }
                else if (x > 16 && x < 64)
                {
                    entryList.Add(new PageTableEntry(-1, false, false, -1, pid));
                }
            }
        }