Davido Digital Solutions

Functions of an Operating System

The OS creates a working environment in which the user can run programs.

The general functions of the operating system are;

1. Processor management.

The processor is a scarce resource. It executes tasks called processes.

A Multi-tasking computer system can run several applications simultaneously. At times, several tasks may require processing, hence creating competition. However, the CPU can only execute one program at any one time.

Therefore, access to the CPU must be carefully controlled and monitored. The OS must decide, which program will be allowed into the system, and for how long.

To do this, the OS arranges the tasks according to priority and has the ability to stop a particular task to allow the processor to service another task.

2. Memory allocation and loading of programs.

Programs must be loaded into memory before they can be executed, and moved out of memory when they are no longer required. Therefore, before processing starts, the OS ensures that the programs are transferred into the available memory location in the Main memory (RAM) from the backing store, e.g. a disk.

At any one given time, a number of tasks may require the memory so that they can be accessed and processed by the computer. The computer memory is a scarce resource, and therefore, the OS must determine which task will remain in memory awaiting for execution and which one will be sent back to secondary storage to wait.

The OS keeps track of what parts of memory are in use and by which program, and what parts are free.

The OS also handles the data files used by the programs that are being executed by the CPU.

In addition, the OS ensures that storage space is provided for data generated by programs and during data transfer operations such as, disk copying or printing.

3. Input/Output devices and ports management.

Every computer has many Input and Output (I/O) devices. The OS controls the input from and output to the various devices. It also tries to monitor the state of each I/O device and signals any faults detected.

During the course of their execution, programs will request the use of an Input or Output device. In a multi-user system, conflicts are likely to occur when one program requests a device that is being used by another program. Therefore, the OS will control allocation of I/O devices and attempt to resolve any conflicts that arise.

Because most input/output devices are slower than the processor, the OS has to control the flow of data from the time of input to the time the user receives it as information. It ensures that the right data reaches the processor at the right time.

The OS also defines the various input/output ports found on the computer, e.g., printer port.

4. Management of secondary storage devices.

The OS manages the storage and retrieval of data on secondary storage devices. It also utilizes the free space on hard disks to enhance the performance of the computer by temporarily holding tasks on it that were in RAM ready for processing but have to wait for some time.

5. Management of communication devices and ports.

Communication refers to how the various devices and programs in and out of the computer system send and receive messages from one another and from the processor.

The OS controls the communication process between the various tasks and the computer. To achieve external communication, an external device is usually connected to a communication port using cables or wireless communication media.

6. File management.

The OS is concerned with the logical organization of the information (the File System) and provides a means through which files can be sorted, retrieved and shared.

It also provides a means of protecting data files and programs against unauthorized access and corruption.

7. Job scheduling.

The OS arranges and loads programs in order to provide a continuous sequence of processing and also provide the appropriate responses to events.

The processor can handle only one task at a time. Therefore, in a situation where more than one application program is occupying the main storage, the OS has to determine which task will be processed first and ensures that the one that is currently being processed is closely monitored to avoid wasting time in the processor.

The jobs are allocated priorities so as to ensure that there is continuous processing until all the jobs within the memory are executed. This ensures that the CPU does not remain idle at any given instance.

Some of the job scheduling functions include:
  • Controlling the loading and running of programs.
  • Communicating directly with users and/or the operator.
  • Dealing with user commands to organize files and run programs.
NB: A Job is a group of tasks taken as a unit of work for a computer, e.g., one or more computer programs, files, and instructions, to the operating system.

8. Job sequencing.

The OS keeps a list of jobs/tasks currently being run and monitors them as they move in and out of the processor. It also arranges them in a particular order to make it easy for the processor to execute them and to know how and when to fetch instructions and data for each task.

9. Resource control and allocation.

The OS controls the selection and operation of hardware devices used for input, output and storage.

The OS determines which task uses a particular resource and at what time. To do this, it gives each resource a unique identification number called an Interrupt number so that, when two tasks request to use a resource at the same time, the one with higher priority interrupt is granted control.

This prevents an undesirable situation called deadlock that occurs when a particular task holds a needed resource and refuses to release it for use by other tasks.

10. Error reporting and correction routines.

The OS has many ways of reporting to the user of any errors that occur during program execution. It does this by monitoring the status of the computer system and performing error checks on both hardware and software.

In case of a fatal error that cannot be corrected, the program will be suspended permanently. E.g., the user program will prematurely terminate when it encounters an illegal operation, such as, dividing a number by 0 or if it attempts to read a data file that had not been opened.

11. Interrupt handling.

An Interrupt is a break from the normal sequential processing of instructions m a program.

The processor stops executing the current program to wait for the corrective response of the user. Control is returned to the program that was interrupted once corrective action has been taken.

Some causes of Interrupt.

i). An Interrupt caused by Power failure.

ii). Arithmetic or logic errors.

iii). Hardware malfunction, e.g. parity errors.

Device driver - a software that the OS uses to control a specific piece of hardware.

12. Interfaces the user to the system's hardware.

The OS provides quick means of communication between the computer user and its programs. The user requests the services of the OS by use of commands and the OS communicates the messages regarding the processing to the user through, either the screen or printer. Thus, a form of 'conversation' is established between the OS and the computer user.

13. Logging and accounting.

The OS keeps records (internal logs) on how the computer's resources, e.g., CPU time, memory usage, and the peripherals are being used. It also keeps a complete record of all that happens during processing (usually in the form of a printed log).

14. The OS protects hardware, software and data from improper use. They ensure that application programs use the hardware in an efficient way.

Examples of operating systems:

· Windows operating system.

· MacOS (Macintosh).

· Unix.

· Linux.

Previous Post Next Post
Davido Digital Solutions