Hiding complexity

From Computer Science Wiki
Resource Management[1]

Without software, a computer is effectively useless. Computer software controls the use of the hardware (CPU, memory, disks etc.), and makes the computer into a useful tool for its users.

The software side of a computer can be divided into programs, libraries and the operating system. Each layer hides much of the complexity of the layer below, and provides a set of abstract services and concepts to the layer above.[2]

For example, the computer's hard disk allows data to be stored on it in a set of fixed-sized blocks. The operating system hides this complexity, and provides the concept of files to the application software. In turn, an application program such as a word processor hides the idea of a file, and allows the user to work with documents instead.[3]

Operting system diagram.png

The most fundamental of all system software is the operating system. It has three main tasks to perform.[4]

  1. The operating system must shield the details of the hardware from the application programs, and thus from the user.
  2. The operating system has to substitute a set of abstract services to the application programs, to replace the physical hardware services. When applications use these abstract services, the operations must be translated into real hardware operations.
  3. Finally, the resources in a computer (CPU, memory, disk space) are limited. The operating system must act as a resource manager, optimising the use of the resources, and protecting them against misuse and abuse. When a system provides multiuser or multitasking capabilities, resources must be allocated fairly and equitably amongst a number of competing requests.


Why does the OS hide the complexity[edit]

Remember Operating systems must manage highly complex resources. Let's look at file systems as an example. For a user, you simply create, open, save, or rename files. But actually, the computer is assigning data onto a block device, tracking where those blocks are, ensure integrity of those blocks, and ensuring security of those blocks. Why would each application need to re-invent this process? How could we ensure the data is written (and read) to the block device in a way which guarantee's reliability, stability, and security if applications are deciding how blocks should be written?

Imagine if you wanted to drive a car you had to build the engine from many parts. Does that make any sense?

How does the OS hide the complexity[edit]

The operating system has a number of sub-systems, each responsible for a different function of the computer. Again if we look at the file system, there is a specific set of processes that pay attention (listen) for any read requests or write requests. If an application requests to read something from a disk, the file system part of the operating system will ensure the application is authorized to make that request and then retrieve the blocks for the file and pass them to the application as a file object. The application will then organize the file object into a user-friendly image or text or document and pass that to the user.

Back to the car: you decide you want to listen to the radio. You turn on the radio and music comes out of the speaker. You aren't thinking about the electrical signals travelling from the power button to the microprocessor which then receives signal from the antenna and modulates the signal into sound wave and then passes the signal to speakers. You are just listening to music.



Standards[edit]

These standards are used from the IB Computer Science Subject Guide[5]

  • Outline how an operating system hides the complexity of the hardware from users and applications.


References[edit]

  1. http://www.flaticon.com/
  2. https://minnie.tuhs.org/CompArch/Lectures/week07.html
  3. https://minnie.tuhs.org/CompArch/Lectures/week07.html
  4. https://minnie.tuhs.org/CompArch/Lectures/week07.html
  5. IB Diploma Programme Computer science guide (first examinations 2014). Cardiff, Wales, United Kingdom: International Baccalaureate Organization. January 2012.