Programmer: Bill McQuain CS 1704: Process Management Simulation ---------------------------------------------------------------------- Command 1: start P01 0 Process 0 added. ---------------------------------------------------------------------- Command 2: ps 0 P01 PID: 0 Priority: 0 ---------------------------------------------------------------------- Command 3: start P02 3 Process 1 added. ---------------------------------------------------------------------- Command 4: start P03 0 Process 2 added. ---------------------------------------------------------------------- Command 5: ps all Processes with priority 0: P01 PID: 0 Priority: 0 P03 PID: 2 Priority: 0 Processes with priority 1: Processes with priority 2: Processes with priority 3: P02 PID: 1 Priority: 3 Processes with priority 4: ---------------------------------------------------------------------- Command 6: switch 0 Process 0 now in run mode. ---------------------------------------------------------------------- Command 7: ps all Running process: P01 PID: 0 Priority: 0 Call stack: Stack is empty. Processes with priority 0: P03 PID: 2 Priority: 0 Processes with priority 1: Processes with priority 2: Processes with priority 3: P02 PID: 1 Priority: 3 Processes with priority 4: ---------------------------------------------------------------------- Command 8: call main 0 3 1 2 3 Call to main initiated. ---------------------------------------------------------------------- Command 9: call F01 1 2 2 3 5 Call to F01 initiated. ---------------------------------------------------------------------- Command 10: ps 0 P01 PID: 0 Priority: 0 Call stack: Function: F01 Parameters: 2 Locals: 3 5 Function: main Parameters: Locals: 1 2 3 ---------------------------------------------------------------------- Command 11: set 1 100 ---------------------------------------------------------------------- Command 12: ps 0 P01 PID: 0 Priority: 0 Call stack: Function: F01 Parameters: 2 Locals: 100 5 Function: main Parameters: Locals: 1 2 3 ---------------------------------------------------------------------- Command 13: switch 0 Process 2 now in run mode. ---------------------------------------------------------------------- Command 14: ps all Running process: P03 PID: 2 Priority: 0 Call stack: Stack is empty. Processes with priority 0: P01 PID: 0 Priority: 0 Processes with priority 1: Processes with priority 2: Processes with priority 3: P02 PID: 1 Priority: 3 Processes with priority 4: ---------------------------------------------------------------------- Command 15: call main 0 1 1 Call to main initiated. ---------------------------------------------------------------------- Command 16: call G01 0 0 Call to G01 initiated. ---------------------------------------------------------------------- Command 17: call G02 1 3 2 1 2 Call to G02 initiated. ---------------------------------------------------------------------- Command 18: ps 2 P03 PID: 2 Priority: 0 Call stack: Function: G02 Parameters: 3 Locals: 1 2 Function: G01 Parameters: Locals: Function: main Parameters: Locals: 1 ---------------------------------------------------------------------- Command 19: switch 0 Process 0 now in run mode. ---------------------------------------------------------------------- Command 20: return Function F01 terminated for process P01 ---------------------------------------------------------------------- Command 21: ps 0 P01 PID: 0 Priority: 0 Call stack: Function: main Parameters: Locals: 1 2 3 ---------------------------------------------------------------------- Command 22: return main terminated for process P01 ---------------------------------------------------------------------- Command 23: ps 0 Process not found. ---------------------------------------------------------------------- Command 24: return There is no running process. ---------------------------------------------------------------------- Command 25: ps all Processes with priority 0: P03 PID: 2 Priority: 0 Processes with priority 1: Processes with priority 2: Processes with priority 3: P02 PID: 1 Priority: 3 Processes with priority 4: ---------------------------------------------------------------------- Command 26: start P04 2 Process 3 added. ---------------------------------------------------------------------- Command 27: ps 3 P04 PID: 3 Priority: 2 ---------------------------------------------------------------------- Command 28: switch 3 Process 1 now in run mode. ---------------------------------------------------------------------- Command 29: call main 0 0 Call to main initiated. ---------------------------------------------------------------------- Command 30: ps 1 P02 PID: 1 Priority: 3 Call stack: Function: main Parameters: Locals: ---------------------------------------------------------------------- Command 31: switch 3 No eligible processes. ---------------------------------------------------------------------- Command 32: ps all Running process: P02 PID: 1 Priority: 3 Call stack: Function: main Parameters: Locals: Processes with priority 0: P03 PID: 2 Priority: 0 Processes with priority 1: Processes with priority 2: P04 PID: 3 Priority: 2 Processes with priority 3: Processes with priority 4: ---------------------------------------------------------------------- Command 33: kill 2 Process 2 removed. ---------------------------------------------------------------------- Command 34: kill 0 Process not found: 0 ---------------------------------------------------------------------- Command 35: ps all Running process: P02 PID: 1 Priority: 3 Call stack: Function: main Parameters: Locals: Processes with priority 0: Processes with priority 1: Processes with priority 2: P04 PID: 3 Priority: 2 Processes with priority 3: Processes with priority 4: ---------------------------------------------------------------------- Command 36: switch 1 No eligible processes. ---------------------------------------------------------------------- Command 37: exit Exiting script execution. ----------------------------------------------------------------------