SimScheduler implementation by Bill McQuain Script file: Script04.txt # SimMemManager Script 4 # # Scheduling with two user processes and plentiful memory ########################################################################### # # Set up system: # page size: 100 # # frames: 100 # # vpages: 200 # frame factor: 50% # quantum: 3 # Memory manager is trying to load process 9999 into VM process allocated 16 pages starting at VM page 0 9999 has requested process page 0 which is virtual page 0 giving this process a new frame will be loaded into real memory frame 0 9999 has requested process page 1 which is virtual page 1 giving this process a new frame will be loaded into real memory frame 1 9999 has requested process page 2 which is virtual page 2 giving this process a new frame will be loaded into real memory frame 2 9999 has requested process page 3 which is virtual page 3 giving this process a new frame will be loaded into real memory frame 3 9999 has requested process page 4 which is virtual page 4 giving this process a new frame will be loaded into real memory frame 4 9999 has requested process page 5 which is virtual page 5 giving this process a new frame will be loaded into real memory frame 5 9999 has requested process page 6 which is virtual page 6 giving this process a new frame will be loaded into real memory frame 6 9999 has requested process page 7 which is virtual page 7 giving this process a new frame will be loaded into real memory frame 7 9999 has requested process page 8 which is virtual page 8 giving this process a new frame will be loaded into real memory frame 8 9999 has requested process page 9 which is virtual page 9 giving this process a new frame will be loaded into real memory frame 9 9999 has requested process page 10 which is virtual page 10 giving this process a new frame will be loaded into real memory frame 10 9999 has requested process page 11 which is virtual page 11 giving this process a new frame will be loaded into real memory frame 11 9999 has requested process page 12 which is virtual page 12 giving this process a new frame will be loaded into real memory frame 12 9999 has requested process page 13 which is virtual page 13 giving this process a new frame will be loaded into real memory frame 13 9999 has requested process page 14 which is virtual page 14 giving this process a new frame will be loaded into real memory frame 14 9999 has requested process page 15 which is virtual page 15 giving this process a new frame will be loaded into real memory frame 15 Memory manager loaded OS: VM base page is: 0 VM size: 16 pages OS image loaded into real memory ---------------------------------------------------------- System initialized Real memory: 10000 bytes Virtual memory: 20000 bytes Page size: 100 bytes Quantum: 3 ---------------------------------------------------------- # # The OS should be allocated the first 16 pages of virtual memory and # the first 16 frames of physical memory. Let's see: Command: show pmt Page Frame Resident 0 0 Y 1 1 Y 2 2 Y 3 3 Y 4 4 Y 5 5 Y 6 6 Y 7 7 Y 8 8 Y 9 9 Y 10 10 Y 11 11 Y 12 12 Y 13 13 Y 14 14 Y 15 15 Y ---------------------------------------------------------- Command: show fmt Frame vPage Owner Allocated 0 0 9999 Y 1 1 9999 Y 2 2 9999 Y 3 3 9999 Y 4 4 9999 Y 5 5 9999 Y 6 6 9999 Y 7 7 9999 Y 8 8 9999 Y 9 9 9999 Y 10 10 9999 Y 11 11 9999 Y 12 12 9999 Y 13 13 9999 Y 14 14 9999 Y 15 15 9999 Y ---------------------------------------------------------- Command: show vpage 0 ------------- 0123456789 0|9999-0-ÄÄÄ 1|ÄÄÄÄÄÄÄÄÄÄ 2|ÄÄÄÄÄÄÄÄÄÄ 3|ÄÄÄÄÄÄÄÄÄÄ 4|ÄÄÄÄÄÄÄÄÄÄ 5|ÄÄÄÄÄÄÄÄÄÄ 6|ÄÄÄÄÄÄÄÄÄÄ 7|ÄÄÄÄÄÄÄÄÄÄ 8|ÄÄÄÄÄÄÄÄÄÄ 9|ÄÄÄÄÄÄÄÄÄÄ ------------- ---------------------------------------------------------- Command: show vpage 12 ------------- 0123456789 0|9999-12-ÄÄ 1|ÄÄÄÄÄÄÄÄÄÄ 2|ÄÄÄÄÄÄÄÄÄÄ 3|ÄÄÄÄÄÄÄÄÄÄ 4|ÄÄÄÄÄÄÄÄÄÄ 5|ÄÄÄÄÄÄÄÄÄÄ 6|ÄÄÄÄÄÄÄÄÄÄ 7|ÄÄÄÄÄÄÄÄÄÄ 8|ÄÄÄÄÄÄÄÄÄÄ 9|ÄÄÄÄÄÄÄÄÄÄ ------------- ---------------------------------------------------------- Command: show frame 0 ------------- 0123456789 0|9999-0-ÄÄÄ 1|ÄÄÄÄÄÄÄÄÄÄ 2|ÄÄÄÄÄÄÄÄÄÄ 3|ÄÄÄÄÄÄÄÄÄÄ 4|ÄÄÄÄÄÄÄÄÄÄ 5|ÄÄÄÄÄÄÄÄÄÄ 6|ÄÄÄÄÄÄÄÄÄÄ 7|ÄÄÄÄÄÄÄÄÄÄ 8|ÄÄÄÄÄÄÄÄÄÄ 9|ÄÄÄÄÄÄÄÄÄÄ ------------- ---------------------------------------------------------- Command: show frame 12 ------------- 0123456789 0|9999-12-ÄÄ 1|ÄÄÄÄÄÄÄÄÄÄ 2|ÄÄÄÄÄÄÄÄÄÄ 3|ÄÄÄÄÄÄÄÄÄÄ 4|ÄÄÄÄÄÄÄÄÄÄ 5|ÄÄÄÄÄÄÄÄÄÄ 6|ÄÄÄÄÄÄÄÄÄÄ 7|ÄÄÄÄÄÄÄÄÄÄ 8|ÄÄÄÄÄÄÄÄÄÄ 9|ÄÄÄÄÄÄÄÄÄÄ ------------- ---------------------------------------------------------- # # Queue up two arrivals: Command: arrival 1000 1 25 10 Job 1000 added to pending queue ---------------------------------------------------------- Command: MemAccess 1000 2 125 Added Read request (2, 125) for 1000 ---------------------------------------------------------- Command: MemAccess 1000 4 250 Added Read request (4, 250) for 1000 ---------------------------------------------------------- Command: MemAccess 1000 6 375 Added Read request (6, 375) for 1000 ---------------------------------------------------------- Command: MemAccess 1000 8 425 Added Read request (8, 425) for 1000 ---------------------------------------------------------- Command: MemAccess 1000 10 525 Added Read request (10, 525) for 1000 ---------------------------------------------------------- Command: MemAccess 1000 12 175 Added Read request (12, 175) for 1000 ---------------------------------------------------------- Command: MemAccess 1000 14 325 Added Read request (14, 325) for 1000 ---------------------------------------------------------- Command: MemAccess 1000 16 625 Added Read request (16, 625) for 1000 ---------------------------------------------------------- Command: MemAccess 1000 18 750 Added Read request (18, 750) for 1000 ---------------------------------------------------------- Command: MemAccess 1000 20 825 Added Read request (20, 825) for 1000 ---------------------------------------------------------- # Command: arrival 1001 2 25 10 Job 1001 added to pending queue ---------------------------------------------------------- Command: MemAccess 1001 3 125 Added Read request (3, 125) for 1001 ---------------------------------------------------------- Command: MemAccess 1001 5 250 Added Read request (5, 250) for 1001 ---------------------------------------------------------- Command: MemAccess 1001 7 375 Added Read request (7, 375) for 1001 ---------------------------------------------------------- Command: MemAccess 1001 9 425 Added Read request (9, 425) for 1001 ---------------------------------------------------------- Command: MemAccess 1001 11 525 Added Read request (11, 525) for 1001 ---------------------------------------------------------- Command: MemAccess 1001 13 175 Added Read request (13, 175) for 1001 ---------------------------------------------------------- Command: MemAccess 1001 15 325 Added Read request (15, 325) for 1001 ---------------------------------------------------------- Command: MemAccess 1001 17 625 Added Read request (17, 625) for 1001 ---------------------------------------------------------- Command: MemAccess 1001 19 750 Added Read request (19, 750) for 1001 ---------------------------------------------------------- Command: MemAccess 1001 21 825 Added Read request (21, 825) for 1001 ---------------------------------------------------------- # # Let's get both processes loaded: Command: simto 4 Advancing system time to 1 Notifying relevant processes of system tick Checking for new arrivals to hold queue Process 1000 entering hold state Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes Memory manager is trying to load process 1000 into VM process allocated 10 pages starting at VM page 16 Moving process 1000 to wait state 1000 has requested process page 0 which is virtual page 16 giving this process a new frame will be loaded into real memory frame 16 Selecting next process to run No eligible processes in system at this time Advancing system time to 2 Notifying relevant processes of system tick Checking for new arrivals to hold queue Process 1001 entering hold state Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes Memory manager is trying to load process 1001 into VM process allocated 10 pages starting at VM page 26 Moving process 1001 to wait state 1001 has requested process page 0 which is virtual page 26 giving this process a new frame will be loaded into real memory frame 17 Selecting next process to run No eligible processes in system at this time Advancing system time to 3 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking wait state for serviced page faults Moving process 1000 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1000 to running state Advancing system time to 4 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Checking wait state for serviced page faults Moving process 1001 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists ---------------------------------------------------------- Command: show 1000 PID: 1000 State: Running Memory: 10 V Base: 16 CPU need: 25 CPU time: 1 Page faults: 1 Pending I/O requests: none Pending Read requests: {(2, 125)(4, 250)(6, 375)(8, 425)(10, 525)(12, 175)(14, 325)(16, 625)(18, 750)(20, 825)} Pending Write requests: none Page map: Page Frame Resident 0 16 16 Y 1 17 N 2 18 N 3 19 N 4 20 N 5 21 N 6 22 N 7 23 N 8 24 N 9 25 N ---------------------------------------------------------- Command: show 1001 PID: 1001 State: Ready Memory: 10 V Base: 26 CPU need: 25 CPU time: 0 Page faults: 1 Pending I/O requests: none Pending Read requests: {(3, 125)(5, 250)(7, 375)(9, 425)(11, 525)(13, 175)(15, 325)(17, 625)(19, 750)(21, 825)} Pending Write requests: none Page map: Page Frame Resident 0 26 17 Y 1 27 N 2 28 N 3 29 N 4 30 N 5 31 N 6 32 N 7 33 N 8 34 N 9 35 N ---------------------------------------------------------- Command: show pmt Page Frame Resident 0 0 Y 1 1 Y 2 2 Y 3 3 Y 4 4 Y 5 5 Y 6 6 Y 7 7 Y 8 8 Y 9 9 Y 10 10 Y 11 11 Y 12 12 Y 13 13 Y 14 14 Y 15 15 Y 16 16 Y 26 17 Y ---------------------------------------------------------- Command: show fmt Frame vPage Owner Allocated 0 0 9999 Y 1 1 9999 Y 2 2 9999 Y 3 3 9999 Y 4 4 9999 Y 5 5 9999 Y 6 6 9999 Y 7 7 9999 Y 8 8 9999 Y 9 9 9999 Y 10 10 9999 Y 11 11 9999 Y 12 12 9999 Y 13 13 9999 Y 14 14 9999 Y 15 15 9999 Y 16 16 1000 Y 17 26 1001 Y ---------------------------------------------------------- # # Run through a few page faults for each process: Command: simto 10 Advancing system time to 5 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 125 resolves to virtual page 17 and offset 25 page is not resident... initiating page fault Moving process 1000 to PFWait state 1000 has requested process page 1 which is virtual page 17 giving this process a new frame will be loaded into real memory frame 18 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1001 to running state Advancing system time to 6 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 7 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Checking wait state for serviced page faults Moving process 1000 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 8 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 125 resolves to virtual page 27 and offset 25 page is not resident... initiating page fault Moving process 1001 to PFWait state 1001 has requested process page 1 which is virtual page 27 giving this process a new frame will be loaded into real memory frame 19 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1000 to running state Advancing system time to 9 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 18 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 10 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 250 resolves to virtual page 18 and offset 50 page is not resident... initiating page fault Moving process 1000 to PFWait state 1000 has requested process page 2 which is virtual page 18 giving this process a new frame will be loaded into real memory frame 20 Checking wait state for serviced page faults Moving process 1001 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1001 to running state ---------------------------------------------------------- Command: show Scheduler system state: Quantum: 3 System time: 10 Status PID Memory CPU Need CPU Time --------------------------------------------- pending running 1001 10 25 3 holding ready PFWait 1000 10 25 4 IOWait finished ---------------------------------------------------------- Command: show 1000 PID: 1000 State: PFWait Memory: 10 V Base: 16 CPU need: 25 CPU time: 4 Page faults: 3 Pending I/O requests: none Pending Read requests: {(6, 375)(8, 425)(10, 525)(12, 175)(14, 325)(16, 625)(18, 750)(20, 825)} Pending Write requests: none Page map: Page Frame Resident 0 16 16 Y 1 17 18 Y 2 18 20 Y 3 19 N 4 20 N 5 21 N 6 22 N 7 23 N 8 24 N 9 25 N ---------------------------------------------------------- Command: show 1001 PID: 1001 State: Running Memory: 10 V Base: 26 CPU need: 25 CPU time: 3 Page faults: 2 Pending I/O requests: none Pending Read requests: {(5, 250)(7, 375)(9, 425)(11, 525)(13, 175)(15, 325)(17, 625)(19, 750)(21, 825)} Pending Write requests: none Page map: Page Frame Resident 0 26 17 Y 1 27 19 Y 2 28 N 3 29 N 4 30 N 5 31 N 6 32 N 7 33 N 8 34 N 9 35 N ---------------------------------------------------------- # # And run through a few more. Process 1000 should reach its frame # allocation limit by time 18: Command: simto 18 Advancing system time to 11 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 19 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 12 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 250 resolves to virtual page 28 and offset 50 page is not resident... initiating page fault Moving process 1001 to PFWait state 1001 has requested process page 2 which is virtual page 28 giving this process a new frame will be loaded into real memory frame 21 Checking wait state for serviced page faults Moving process 1000 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1000 to running state Advancing system time to 13 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 20 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 14 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 375 resolves to virtual page 19 and offset 75 page is not resident... initiating page fault Moving process 1000 to PFWait state 1000 has requested process page 3 which is virtual page 19 giving this process a new frame will be loaded into real memory frame 22 Checking wait state for serviced page faults Moving process 1001 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1001 to running state Advancing system time to 15 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 21 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 16 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 375 resolves to virtual page 29 and offset 75 page is not resident... initiating page fault Moving process 1001 to PFWait state 1001 has requested process page 3 which is virtual page 29 giving this process a new frame will be loaded into real memory frame 23 Checking wait state for serviced page faults Moving process 1000 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1000 to running state Advancing system time to 17 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 22 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 18 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 425 resolves to virtual page 20 and offset 25 page is not resident... initiating page fault Moving process 1000 to PFWait state 1000 has requested process page 4 which is virtual page 20 giving this process a new frame will be loaded into real memory frame 24 Checking wait state for serviced page faults Moving process 1001 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1001 to running state ---------------------------------------------------------- Command: show Scheduler system state: Quantum: 3 System time: 18 Status PID Memory CPU Need CPU Time --------------------------------------------- pending running 1001 10 25 7 holding ready PFWait 1000 10 25 8 IOWait finished ---------------------------------------------------------- Command: show 1000 PID: 1000 State: PFWait Memory: 10 V Base: 16 CPU need: 25 CPU time: 8 Page faults: 5 Pending I/O requests: none Pending Read requests: {(10, 525)(12, 175)(14, 325)(16, 625)(18, 750)(20, 825)} Pending Write requests: none Page map: Page Frame Resident 0 16 16 Y 1 17 18 Y 2 18 20 Y 3 19 22 Y 4 20 24 Y 5 21 N 6 22 N 7 23 N 8 24 N 9 25 N ---------------------------------------------------------- Command: show 1001 PID: 1001 State: Running Memory: 10 V Base: 26 CPU need: 25 CPU time: 7 Page faults: 4 Pending I/O requests: none Pending Read requests: {(9, 425)(11, 525)(13, 175)(15, 325)(17, 625)(19, 750)(21, 825)} Pending Write requests: none Page map: Page Frame Resident 0 26 17 Y 1 27 19 Y 2 28 21 Y 3 29 23 Y 4 30 N 5 31 N 6 32 N 7 33 N 8 34 N 9 35 N ---------------------------------------------------------- # # The next page fault for process 1000 should trigger a page replacement: Command: simto 22 Advancing system time to 19 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 23 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 20 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 425 resolves to virtual page 30 and offset 25 page is not resident... initiating page fault Moving process 1001 to PFWait state 1001 has requested process page 4 which is virtual page 30 giving this process a new frame will be loaded into real memory frame 25 Checking wait state for serviced page faults Moving process 1000 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1000 to running state Advancing system time to 21 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 24 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 22 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 525 resolves to virtual page 21 and offset 25 page is not resident... initiating page fault Moving process 1000 to PFWait state 1000 has requested process page 5 which is virtual page 21 re-using a frame already allocated to this process choosing frame 16 unloading page 16 will be loaded into real memory frame 16 Checking wait state for serviced page faults Moving process 1001 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1001 to running state ---------------------------------------------------------- Command: show Scheduler system state: Quantum: 3 System time: 22 Status PID Memory CPU Need CPU Time --------------------------------------------- pending running 1001 10 25 9 holding ready PFWait 1000 10 25 10 IOWait finished ---------------------------------------------------------- Command: show 1000 PID: 1000 State: PFWait Memory: 10 V Base: 16 CPU need: 25 CPU time: 10 Page faults: 6 Pending I/O requests: none Pending Read requests: {(12, 175)(14, 325)(16, 625)(18, 750)(20, 825)} Pending Write requests: none Page map: Page Frame Resident 0 16 N 1 17 18 Y 2 18 20 Y 3 19 22 Y 4 20 24 Y 5 21 16 Y 6 22 N 7 23 N 8 24 N 9 25 N ---------------------------------------------------------- Command: show 1001 PID: 1001 State: Running Memory: 10 V Base: 26 CPU need: 25 CPU time: 9 Page faults: 5 Pending I/O requests: none Pending Read requests: {(11, 525)(13, 175)(15, 325)(17, 625)(19, 750)(21, 825)} Pending Write requests: none Page map: Page Frame Resident 0 26 17 Y 1 27 19 Y 2 28 21 Y 3 29 23 Y 4 30 25 Y 5 31 N 6 32 N 7 33 N 8 34 N 9 35 N ---------------------------------------------------------- # # Now run for awhile and see what happens: Command: simto 36 Advancing system time to 23 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 25 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 24 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 525 resolves to virtual page 31 and offset 25 page is not resident... initiating page fault Moving process 1001 to PFWait state 1001 has requested process page 5 which is virtual page 31 re-using a frame already allocated to this process choosing frame 17 unloading page 26 will be loaded into real memory frame 17 Checking wait state for serviced page faults Moving process 1000 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1000 to running state Advancing system time to 25 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 16 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 26 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 175 resolves to virtual page 17 and offset 75 page is resident, proceeding with access accessing frame 18 Checking wait state for serviced page faults Moving process 1001 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 27 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Quantum has expired for process 1000 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1001 to running state Advancing system time to 28 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 17 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 29 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 175 resolves to virtual page 27 and offset 75 page is resident, proceeding with access accessing frame 19 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 30 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Quantum has expired for process 1001 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1000 to running state Advancing system time to 31 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 325 resolves to virtual page 19 and offset 25 page is resident, proceeding with access accessing frame 22 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 32 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 33 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 625 resolves to virtual page 22 and offset 25 page is not resident... initiating page fault Moving process 1000 to PFWait state 1000 has requested process page 6 which is virtual page 22 re-using a frame already allocated to this process choosing frame 20 unloading page 18 will be loaded into real memory frame 20 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1001 to running state Advancing system time to 34 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 325 resolves to virtual page 29 and offset 25 page is resident, proceeding with access accessing frame 23 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 35 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Checking wait state for serviced page faults Moving process 1000 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 36 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 625 resolves to virtual page 32 and offset 25 page is not resident... initiating page fault Moving process 1001 to PFWait state 1001 has requested process page 6 which is virtual page 32 re-using a frame already allocated to this process choosing frame 21 unloading page 28 will be loaded into real memory frame 21 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1000 to running state ---------------------------------------------------------- Command: show Scheduler system state: Quantum: 3 System time: 36 Status PID Memory CPU Need CPU Time --------------------------------------------- pending running 1000 10 25 16 holding ready PFWait 1001 10 25 17 IOWait finished ---------------------------------------------------------- Command: show 1000 PID: 1000 State: Running Memory: 10 V Base: 16 CPU need: 25 CPU time: 16 Page faults: 7 Pending I/O requests: none Pending Read requests: {(18, 750)(20, 825)} Pending Write requests: none Page map: Page Frame Resident 0 16 N 1 17 18 Y 2 18 N 3 19 22 Y 4 20 24 Y 5 21 16 Y 6 22 20 Y 7 23 N 8 24 N 9 25 N ---------------------------------------------------------- Command: show 1001 PID: 1001 State: PFWait Memory: 10 V Base: 26 CPU need: 25 CPU time: 17 Page faults: 7 Pending I/O requests: none Pending Read requests: {(19, 750)(21, 825)} Pending Write requests: none Page map: Page Frame Resident 0 26 N 1 27 19 Y 2 28 N 3 29 23 Y 4 30 25 Y 5 31 17 Y 6 32 21 Y 7 33 N 8 34 N 9 35 N ---------------------------------------------------------- Command: show pmt Page Frame Resident 0 0 Y 1 1 Y 2 2 Y 3 3 Y 4 4 Y 5 5 Y 6 6 Y 7 7 Y 8 8 Y 9 9 Y 10 10 Y 11 11 Y 12 12 Y 13 13 Y 14 14 Y 15 15 Y 17 18 Y 19 22 Y 20 24 Y 21 16 Y 22 20 Y 27 19 Y 29 23 Y 30 25 Y 31 17 Y 32 21 Y ---------------------------------------------------------- Command: show fmt Frame vPage Owner Allocated 0 0 9999 Y 1 1 9999 Y 2 2 9999 Y 3 3 9999 Y 4 4 9999 Y 5 5 9999 Y 6 6 9999 Y 7 7 9999 Y 8 8 9999 Y 9 9 9999 Y 10 10 9999 Y 11 11 9999 Y 12 12 9999 Y 13 13 9999 Y 14 14 9999 Y 15 15 9999 Y 16 21 1000 Y 17 31 1001 Y 18 17 1000 Y 19 27 1001 Y 20 22 1000 Y 21 32 1001 Y 22 19 1000 Y 23 29 1001 Y 24 20 1000 Y 25 30 1001 Y ---------------------------------------------------------- # # Run a bit further. This should be interesting due to the fact that # some of the loaded pages have been re-hit, so the LRU page selection # should show up now in interesting ways. Command: simto 44 Advancing system time to 37 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 20 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 38 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 750 resolves to virtual page 23 and offset 50 page is not resident... initiating page fault Moving process 1000 to PFWait state 1000 has requested process page 7 which is virtual page 23 re-using a frame already allocated to this process choosing frame 24 unloading page 20 will be loaded into real memory frame 24 Checking wait state for serviced page faults Moving process 1001 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1001 to running state Advancing system time to 39 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 21 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 40 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 750 resolves to virtual page 33 and offset 50 page is not resident... initiating page fault Moving process 1001 to PFWait state 1001 has requested process page 7 which is virtual page 33 re-using a frame already allocated to this process choosing frame 25 unloading page 30 will be loaded into real memory frame 25 Checking wait state for serviced page faults Moving process 1000 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1000 to running state Advancing system time to 41 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 24 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 42 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 825 resolves to virtual page 24 and offset 25 page is not resident... initiating page fault Moving process 1000 to PFWait state 1000 has requested process page 8 which is virtual page 24 re-using a frame already allocated to this process choosing frame 16 unloading page 21 will be loaded into real memory frame 16 Checking wait state for serviced page faults Moving process 1001 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1001 to running state Advancing system time to 43 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 25 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 44 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process wants to access relative address 825 resolves to virtual page 34 and offset 25 page is not resident... initiating page fault Moving process 1001 to PFWait state 1001 has requested process page 8 which is virtual page 34 re-using a frame already allocated to this process choosing frame 17 unloading page 31 will be loaded into real memory frame 17 Checking wait state for serviced page faults Moving process 1000 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1000 to running state ---------------------------------------------------------- Command: show Scheduler system state: Quantum: 3 System time: 44 Status PID Memory CPU Need CPU Time --------------------------------------------- pending running 1000 10 25 20 holding ready PFWait 1001 10 25 21 IOWait finished ---------------------------------------------------------- Command: show 1000 PID: 1000 State: Running Memory: 10 V Base: 16 CPU need: 25 CPU time: 20 Page faults: 9 Pending I/O requests: none Pending Read requests: none Pending Write requests: none Page map: Page Frame Resident 0 16 N 1 17 18 Y 2 18 N 3 19 22 Y 4 20 N 5 21 N 6 22 20 Y 7 23 24 Y 8 24 16 Y 9 25 N ---------------------------------------------------------- Command: show 1001 PID: 1001 State: PFWait Memory: 10 V Base: 26 CPU need: 25 CPU time: 21 Page faults: 9 Pending I/O requests: none Pending Read requests: none Pending Write requests: none Page map: Page Frame Resident 0 26 N 1 27 19 Y 2 28 N 3 29 23 Y 4 30 N 5 31 N 6 32 21 Y 7 33 25 Y 8 34 17 Y 9 35 N ---------------------------------------------------------- # # Run to termination: Command: simto 53 Advancing system time to 45 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 16 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 46 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Checking wait state for serviced page faults Moving process 1001 to ready state Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 47 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Quantum has expired for process 1000 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1001 to running state Advancing system time to 48 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process accessing frame 17 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 49 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 50 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Quantum has expired for process 1001 Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1000 to running state Advancing system time to 51 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Advancing system time to 52 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process 1000 has terminated Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run Moving process 1001 to running state Advancing system time to 53 Notifying relevant processes of system tick Checking for new arrivals to hold queue Checking status of running process Process 1001 has terminated Checking wait state for serviced page faults no such process exists Checking blocked state for newly-satisfied processes no such process exists Checking hold state for startable processes no such process exists Selecting next process to run No eligible processes in system at this time ---------------------------------------------------------- Command: show Scheduler system state: Quantum: 3 System time: 53 Status PID Memory CPU Need CPU Time --------------------------------------------- pending running holding ready PFWait IOWait finished 1000 10 25 25 1001 10 25 25 ---------------------------------------------------------- Command: show 1000 PID: 1000 State: Term Memory: 10 V Base: 16 CPU need: 25 CPU time: 25 Page faults: 9 Pending I/O requests: none Pending Read requests: none Pending Write requests: none Page map: Page Frame Resident 0 none N 1 none N 2 none N 3 none N 4 none N 5 none N 6 none N 7 none N 8 none N 9 none N ---------------------------------------------------------- Command: show 1001 PID: 1001 State: Term Memory: 10 V Base: 26 CPU need: 25 CPU time: 25 Page faults: 9 Pending I/O requests: none Pending Read requests: none Pending Write requests: none Page map: Page Frame Resident 0 none N 1 none N 2 none N 3 none N 4 none N 5 none N 6 none N 7 none N 8 none N 9 none N ---------------------------------------------------------- Command: show pmt Page Frame Resident 0 0 Y 1 1 Y 2 2 Y 3 3 Y 4 4 Y 5 5 Y 6 6 Y 7 7 Y 8 8 Y 9 9 Y 10 10 Y 11 11 Y 12 12 Y 13 13 Y 14 14 Y 15 15 Y ---------------------------------------------------------- Command: show fmt Frame vPage Owner Allocated 0 0 9999 Y 1 1 9999 Y 2 2 9999 Y 3 3 9999 Y 4 4 9999 Y 5 5 9999 Y 6 6 9999 Y 7 7 9999 Y 8 8 9999 Y 9 9 9999 Y 10 10 9999 Y 11 11 9999 Y 12 12 9999 Y 13 13 9999 Y 14 14 9999 Y 15 15 9999 Y ---------------------------------------------------------- No more commands in script file. Exiting... ---------------------------------------------------------- Statistics for terminated processes: PID CPU Need Arrived Finished Wait time Turnaround Weighted Page Faults ---------------------------------------------------------------------------------- 1000 25 1 52 0 49 2.0 9/11(0.82) 1001 25 2 53 1 49 2.0 9/11(0.82) Overall statistics: Average wait time: 0.5 Average turnaround time: 49.0 Average weighted turnaround: 2.0 Page faults: 18/22(0.82) ----------------------------------------------------------