G53OPS - Operating Systems

This course is run at the The University of Nottingham within the School of Computer Science & IT. The course is run by Graham Kendall (EMAIL : gxk@cs.nott.ac.uk)


Introduction to Operating Systems


This section is based on (Tanenbaum, 1992), pages 1-5.

Before we look at what an operating system does we ought to know what an operating system is.

If we just build a computer, using physical components, we end up with a lot of assembled metal, plastic and silicon. In this state the computer can do nothing useful.

To turn it into one of the most versatile tools known to man we need software. We need applications that allow us to write letters, develop (other) programs and calculate cash flow forecasts.

But, if all we have are the applications, then each programmer has to deal with the complexities of the hardware. If a program requires data from a disc, the programmer would need to know how every type of disc worked and then be able to program at a low level in order to extract the data. In addition, the programmer would have to deal with all the error conditions that could arise.


As an example, it is a lot easier for a programmer to say READ NEXT RECORD than have to worry about moving the read/write heads, waiting for the correct sector to come around and then reading the data (and this is very simplified view of what actually happens).

It was clear, from an early stage in the development of computers, that there needed to be a layer of software that sat between the hardware and the software.

This had led to this view of a computer.

A layered view of a computer

The bottom layer of the hardware consists of the integrated circuits, the cathode ray tubes, the wire and everything else that electrical engineers use to build physical devices.

The next layer of hardware (microprogramming) is actually software (sometimes called firmware) that provides basic operations that allow communication with the physical devices. This software is normally in Read Only Memory (and that is why it is called firmware).

The machine language layer defines the instruction set that are available to the computer. Again, this layer is really software but it is considered as hardware as the machine language will be part and parcel of the hardware package supplied by the hardware supplier.

The operating system is a layer between this hardware and the software that we use. It allows us (as programmers) to use the hardware in a user friendly way.

Furthermore, it allows a layer of abstraction from the hardware. For example, we can issue a print command without having to worry about what printer is physically connected to the computer. In fact, we can even have different operating systems running on the same hardware (e.g. DOS, Windows and UNIX) so that we can use the hardware using an operating system that suits us.

On top of the operating system we have the system software. This is the software that allows us to do useful things with the computer, but does not directly allow us to use the computer for anything that is useful in the real world (this is a broad statement which we could argue about but system software really only allows us to use the computer more effectively).

It is important to realise that system software is not part of the operating system. However, much system software is supplied by the computer manufacturer that supplied the operating system. But, system software can be written by programmers and many large companies have teams of programmers (often called system programmers) who's main aim is to make the operating system easier to use for other people (typically programmers) in the organisation.

The main difference between the operating system and system software is that the operating system runs in kernel or supervisor mode (system software and applications run in user mode). This means that the hardware stops the user programs directly accessing the hardware. And, due to this restriction, you cannot, for example, write your own disc interrupt handler and replace the one in the operating system. However, you can write your own (say) command shell and replace the one supplied with the computer.

Finally, at the top level we have the application programs that, at last, allow us to do something useful.

Two views of an operating system

In the section above, we viewed the operating system in the context of how it fits in within the overall structure of the computer. Now we are going to look at another two views of an operating system.

One view considers the operating system as a resource manager. In this view the operating system is seen as a way of providing the users of the computer with the resources they need at any given time.

Some of these resource requests may not be able to be met (memory, CPU usage etc.) but, as we shall see later in the course, the operating system is able to deal with scheduling problems such as these.

Other resources have a layer of abstraction placed between them and the physical resource. An example, of this is a printer. If your program wants to write to a printer, in this day and age, it is unlikely that the program will be directly connected to a physical printer. The operating system will step in and take the print requests and spool the data to disc. It will then schedule the prints, making the best use of the printer as it can. During all of this it will appear to the user and the program as if their prints requests are going to a physical printer.

Another view of an operating system sees it as a way of not having to deal with the complexity of the hardware. In (Tanenbaum, 1992) the example is given of a floppy disc controller (using an NEC PDP765 controller chip).

This chip has sixteen commands which allow the programmer to read and write data, move the disc heads, format tracks etc. Just carrying out a simple READ or WRITE command requires thirteen parameters, which are packed into nine bytes. The operation, when complete, returns 23 status and error fields packed into seven bytes.

And, if you think that is complicated, we have barely scratched the surface (for example, concerning ourselves with if the floppy disc is spinning, what type of recording method we should use and the fact that hard discs are just as complicated but work differently).
It is all these complexities that the operating system hides and in this view of the machine the operating system can be seen as an extended machine or a virtual machine.

Last Page Back to Main Index Next Page

 

 


 Last Updated : 08/01/2002