# SimMemManager Script 0 # # Scheduling with one user process # - initial loading of OS # - load of user process into VM # - load of 0-th page of user process into RM # - servicing page faults # - memory read commands # - memory write commands ########################################################################### # # Set up system: # page size: 100 # # frames: 100 # # vpages: 200 # frame factor: 50% # quantum: 3 # sysinit 100 100 200 0.5 3 # # The OS should be allocated the first 16 pages of virtual memory and # the first 16 frames of physical memory. Let's see: show pmt # # Queue up an arrival with some memory reads to successive process pages: arrival 1000 1 20 12 MemAccess 1000 1 125 MemAccess 1000 3 225 MemAccess 1000 5 325 MemAccess 1000 7 425 MemAccess 1000 9 525 # # It should take 1 tick to make the process arrive. Its 12 pages should # be loaded into virtual memory immediately after the 16 pages allocated # to the OS. Let's see if that works: simto 1 show 1000 show pmt # After two more ticks its 0-th page to be loaded into frame 16 and the # process should be in the run state: simto 3 show 1000 # # The next tick should cause a page fault for page 1 of the process, and # two more ticks should result in a page load to frame 17 of RM and the # process being back in the run state: simto 6 show 1000 show pmt # # The pattern should repeat itself for every three ticks until the process # has got 6 pages loaded: simto 21 show 1000 show pmt # # The process's frame limit should be 6, so the next read should trigger # a page replacement, recycling the first page that was loaded for the # process: MemAccess 1000 11 625 simto 24 show 1000 # # Run the process to completion: simto 35 show 1000