Exemplo n.º 1
0
        public Form1()
        {
            //initialize the UI elements
            InitializeComponent();

            initDataGridViews();

            this.FormBorderStyle = FormBorderStyle.FixedSingle;

            nextButton.Click     += new EventHandler(this.NextBtn_Click);
            completeButton.Click += new EventHandler(this.ContinueBtn_Click);

            nextButton.Text = "Start";

            //create the physical memory
            pm = new PhysicalMemory(PHY_MEM_SIZE);

            //create the 5 processes
            processList = new List <Process>();
            for (int x = 0; x < (PROCESS_NUM + 1); x++)
            {
                processList.Add(new Process(x, LOGICAL_ADDR_SPACE, pm));
            }

            //read in the lines from the file
            string[] lines = System.IO.File.ReadAllLines(@"input2a.data");
            foreach (string line in lines)
            {
                Console.WriteLine(line);
                fileLines.AddLast(line);
                lineCount++;
            }

            node = fileLines.First;
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 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;

            //instantite 64 page table entries
            for (int x = 0; x < 64; x++)
            {
                entryList.Add(new PageTableEntry(-1, true, false, pid, 0, this));
            }
        }
Exemplo n.º 4
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));
                }
            }
        }