Press enter to skip the top menu

Computer Fundamentals

Operating Systems

Learning Outcomes

Introduction

If we turn on a computer in order to do some word processing, we notice that there can be up to a one minute interval between us actually supplying power to the machine and the time that we can actually tell it to run Microsoft Word. We also notice that the disk drive is very active during this interval. Why this delay?

The answer is that the computer is loading the operating system from the hard drive. Because we rarely interact directly with the operating system, as beginners, we can be even unaware of its existence. However without the operating system our computers would not be able to run. So what exactly is the operating system and what does it do?

The operating system is a suite or a large number of programmes that control the running of the computer. Some of the functions of the operating system include controlling the following:

We shall look at each of those aspects of the operating system.

Keyboard Input

We shall first look at keyboard input. When using a computer to do word processing we are so accustomed to seeing every key that we press appearing on our screen that we take it for granted. However the apparently instantaneous appearance of the characters on the screen is very deceptive. The data goes through a lot of processing from the time we press a keyboard key with our finger until the fraction of a second later when we see that character on the screen.

One part of the operating system is devoted exclusively to controlling input from the keyboard. This would be called the keyboard driver. This driver first reserves a portion of the main memory for storing the data received from the keyboard. This is known as the keyboard buffer. Any data entered by the keyboard is stored in this buffer. The driver periodically checks this buffer – perhaps 20 times every second – and if any data has been entered transfers that data to the programme that is waiting for input.

Occasionally if you are typing quickly into a word processor, the system appears to hang up and nothing appears or the screen. Suddenly all the last 30 characters or so that you have typed appears on the screen together. The reason for this delay is that other programmes may have been running in the background which prevented the keyboard driver from running. As soon as it gets a chance to run it collects all of the data in the keyboard buffer and transfers it all together to the programme that had been waiting for the input.

Go to top

Mouse Input

The movements of the mouse on the mouse pad is monitored by the portion of the operating system called the mouse driver. Again data relating to the mouse’s movement is stored in a buffer – the mouse buffer. The mouse driver uses this data to position the mouse pointer on the screen. This same information is passed to GUI based programmes who need to know where the mouse is positioned over them. As an example of this Word will need to know where over its text the mouse is positioned so that when the user clicks the mouse Word can place the cursor at that point in the text..

As well as the position of the mouse, other data that stored in the mouse buffer is:

The press and release times are needed so that the mouse driver can determine if a double click was made.

Go to top

Screen Display

Modern screens are made up of pixels. Each pixel has its position on the screen as well as its own colour data attached to it. In computers a colour is defined as a combination of the three colours Red, Green and Blue. The value of each colour can vary from 0 to 255. Thus if a colour is defined as 255,0,0 it means that it is pure red, while 0, 0, 255 means that it is pure blue. An average screen would be 1440 pixels long and 900 pixels high. This means that it would contain 1,296,000 pixels. Each pixel would also require three bytes of data attached to it to indicate the colour of the pixel.

To control the screen display, the screen driver reserves a block of memory large enough to accommodate information on all of the pixels that will be used to make up the display. In the case of a 1440 X 900 screen the amount of memory required would be 3,888,000 bytes. This area is referred to as the screen buffer. When a word processor wishes to display part of a document’s text on the screen it passes to the screen driver the text as well as the font, size etc of that text and the magnification of the screen that is required. The screen driver then builds up a screenful of this data pixel by pixel and finally the programme that actually controls the screen uses this data to paint a picture on the screen. This may sound a lot of processing but it occurs each time you press a key on the keyboard to enter a letter into the document you are processing or whenever you move the display using the scroll bar.

Go to top

Disks

Disks are used for permanent storage of data. That means that data can be written to them and read from them. As you might expect by now each disk will have a disk buffer where data written to it will be stored before being transferred to the disk and data read from it will be stored before being transferred to the programme that wants it. This transfer of data in both ways is controlled by the disk drivers. Some of the functions of the disk drivers are:

Go to top

Access to Printers

Just about all application programmes at one time or another wish to print their data. The biggest user of printers would be word processors. Normally when you purchase a printer, a CD or DVD will accompany it that will include drivers for that printer for the most common operating system. Before you can use that printer you must install the driver software into your computer.

When your word processor wishes to print to that printer it passes the data it wishes to print to that printer’s driver. The driver then formats that data and places it in the buffer for the printer. When the printer is ready to start printing another portion of the operating system controls that data from the buffer to the actual printer.

Go to top

Access to CPU

So far in this chapter we have discussed word processors, spreadsheets, keyboard drivers, mouse drivers, screen drivers, disk drivers and printer drivers all running on the one computer. All of those are dedicated programmes that either control the production of written documents or else control the hardware items they are designed to control. There is, however, only one CPU in the computer, so how does the system know to transfer control from one programme to another. This is done by a special programme called the scheduler, which controls all of the other programmes that are waiting in memory to run.

There are a number of different ways that a scheduler can control access to the computer. We shall describe the simplest method known as the round robin.

A scheduler using the Round Robin method simply creates a list of the programmes in memory that are supposed to be running. These programmes include the scheduler itself. Each programme is allocated an amount of time on the CPU. Once this time is up, the programme is suspended and the next programme in line gets access to the CPU. In this way all programmes in memory get an opportunity to use the CPU.

The amount of time allocated to each programme may be as small as 1 millisecond, but since control passes back to each programme so quickly each one thinks that it has sole access to the CPU.

Go to top

Exercise

  1. List four of the functions of the operating system.
  2. What is the name of the part of the operating system that controls the entry of data using a keyboard?
  3. What is a keyboard buffer?
  4. Describe some of the functions of the mouse driver.
  5. Name and describe some of the data that is stored in the mouse buffer.
  6. Describe the workings of the screen buffer.
  7. List some of the functions of the disk driver
  8. Drivers for the keyboard, mouse and screen are automatically part of the operating system. Another computer peripheral must have its drivers loaded into the computer before the peripheral is capable of working. Which peripheral device is this?
  9. Part of the operating system is a scheduler called the Round Robin.
    1. What is a scheduler and what is its main function
    2. Explain how the Round Robin scheduler works.
Go to top