Functions of OS

Functions of OS

Published by: Sujan

Published date: 18 Jun 2021

Functions of OS - Photo

Functions of OS

  • The operating system is a large and complex software consisting of several components.

  • Each component of the operating system has its own set of defined inputs and outputs.

  • Different components of OS perform specific tasks to provide the overall functionality of the operating system.

     

  • Main functions of OS are as follows:

{PHOTO}

Fig: Functions of OS

1. Process Management

The activities of process management handled by the OS are:—

(1) Control access to shared resources like file, memory, I/O and CPU

(2) Control execution of applications

(3) Create, execute and delete a process (system process or user process)

(4) Cancel or resume a process

(5) Schedule a process

(6) Synchronization, communication, and deadlock handling for processes.

  • A process is a program in a state of execution.

     

  • It is a unit of work for the operating system.

     

  • A program may have two or more processes running.

     

  • To accomplish a task, a process needs to have access to different system resources like I/O devices, CPU, memory, etc.

     

  • The process management function of an operating system handles the allocation of resources to the processes in an efficient manner.

2. Memory Management

The activities of memory management handled by OS are:—

(1) Allocate memory

(2) Free memory

(3)Re-allocate memory to a program when a used block is freed.

(4) Keep track of memory usage.

  • In a computer, there may be multiple processes executing at the same time.

  • Every process that needs to execute, requires a certain amount of memory.

     

  • Memory management schemes handle the allocation of memory to different processes.

     

  • On completion of process execution, the memory is de-allocated and made available to another process.

     

  • This requires some memory protection and sharing mechanism.

3. File Management

The file management tasks include: —

(1) Create and delete both files and directories

(2) Provide access to files

(3) Allocate space for files

(4) Keep back-up of files

(5) Secure files.

  • The file management function of the operating system involves handling the file system which consists of two parts—a set of files, and a directory structure.

     

  • File is a collection of related information, has a name, and is stored on a secondary storage.

     

  • Data cannot be stored on the secondary storage if it is not in the form of a file.

     

  • A file has attributes like its name, location, size, type, time, and date of creation etc.

     

  • The information stored in a file can be accessed in different ways—sequential access (access is in a sequential order from start to end) and direct access (the file can be accessed in any order).

4. Device Management

  • Several peripheral devices like mouse, hard disk, printer, plotter, etc. are connected to the computer.
  • The peripheral devices have varying characteristics like character or block device, sequential or random access device, and a dedicated or shared device.
  • OS manages and controls the devices attached to the computer.
  • OS provides appropriate functionality to the application programs for controlling different aspects of the devices.
  • OS handles the devices by combining both hardware and software techniques.

5. Protection and Security:—

  • OS protects the resources of the system.
  • User authentication, file attributes like read, write, encryption, and back-up of data are used by OS to provide basic protection.
  • The access of programs, processes, and users, to the resources defined by the computer, are controlled by the protection mechanism.

     

  • Protection ensures that the resources of the computer are used in a consistent way.

     

  • Security mechanism prevents unauthorized access to the computer.

     

  • Security concerns include:— Security of software, the security of data stored in the computer, and the security of physical resources of the computer.