Simulator

This lesson explains how to run the simulator which mimics some aspects​ of an operating system to help you solidify your​ understanding.

The program, process-run.py, allows you to see how process states change as programs run and either use the CPU (e.g., perform an add instruction) or do I/O (e.g., send a request to a disk and wait for it to complete).

As described in the chapter, processes can be in a few different states:

  • RUNNING - the process is using the CPU right now

  • READY - the process could be using the CPU right now but (alas) some other process is

  • WAITING - the process is waiting on I/O (e.g., it issued a request to a disk)

  • DONE - the process is finished executing

To run the program and get its options, do this in the terminal provided below:

prompt> ./process-run.py -h

If this doesn’t work, type “python” before the command, like this:

prompt> python process-run.py -h

Get hands-on with 1200+ tech skills courses.