Execute a command in operating system:
In order to execute a command OS does the
following steps:
- It accepts a command from a user through mouse clicks or from the keyboard. Through a port number it is able to recognize what is the source of input.
- It must interpret these commands and take actions accordingly.
- It must provide a file system that can interpret the name of the program being requested and determine the location of the file on secondary storage device for example.
- It must read the appropriate blocks from the device into memory. Only then can the operating system transfer control to the program being executed.
In case of multiple programs executing simultaneously, CPU does some extra jobs to allot the CPU time in an equitable way to each program, and also maintain the integrity of each program, etc.