What is an operating system?

In any computer system we have:

  • hardware devices
  • application software

Such a system has one major flaw: There is no way for application software written by one vendor to be aware of software in the same system written by another vendor. When two pieces of software in the same system are not aware of each other, it is only a matter of time before they clash in some way resulting in the subsequent incorrect operation of one or both programs. This is clearly not acceptable.

The solution is to define a piece of software which manages resources in a system. This is the operating system. Programs are written so that they request resources from the OS which grants or denies the requests and allocates resources to the programs.

The other problem with this system is the potential pile-up of redundant code. The software required to interface devices at the hardware port level may require many instructions to perform just one operation. This operation may be performed by a program many times which is when we put that code into a procedure. This operation will also be performed by many programs, but they cannot share each other's procedures because they do not know about each other. Instead they share the OS procedures for accessing devices: One call intruction will result in the code being executed to perform a high-level operation. The interface to the collection of such procedures needs to be held constant so that applications can depend upon the structure of the interface. This interface is an API. There are many benefits to an API, all resulting from smaller application programs:

  • reduced application development time
  • less code to write means less bugs
  • less disk and memory space used

The purpose of an Operating System is therefore:

  • to manage system resources on behalf of multiple software entities
  • to provide a higher-level interface to the hardware devices in the system


What should be included in an Operating System?

This depends on the purpose of the OS. An OS that is designed for arcade games may not need a GUi. Possible candidates for inclusion in an Operating System are:

  • Resource management: shared resources and locked resources
  • Protection: The OS can enforce the good behaviour of a program and terminate/suspend any program that violates the code of conduct. An example of poor behaviour is unauthorised access to memory that does not belong to the program.
  • Hardware interface; The code to make accessing hardware easier may be provided for some or all of the possible hardware devices that could be attached to the system.

shared resources

Shared resources do not require explicit permission to access them, but must be accessed through an API.

locked resources

Ownership of locked resources must be requested by the application. Since only one application may access a locked resource at ony one time, an API is not essential other than to provide higher-level of abstraction.