Tuesday, October 5, 2010

Functions of Operating System

PROCESS MANAGEMENT
  • A process is defined as a program in execution. 
  • It is more than program code.
 

To accomplish its task, a process needs certain resources like CPU time, memory files and I/O devices and as a process executes it changes its states. Each process may be in one of the following stages
  • New: The process is being created.
  • Running: Instruction are being executed.
  • Waiting: Waiting for some resource like memory, I/O , CPU time etc.
  • Ready: Process is in main memory and waiting to be assigned to CPU.
  • Terminate: The process finished execution.
An Operating System performs the following activities for processor management.
  • Creating and deleting both user and system processes.
  • Suspending and resuming processes.
  • Provide mechanisms for process synchronization.
  • Provide mechanism for process communication.

MEMORY MANAGEMENT


Main Memory is an array of addressable words or bytes that is quickly accessible. Main Memory is repository of quickly accessible data shared by CPU and I/O devices. Main Memory is volatile. Main memory is only storage device that CPU is able to address and access directly. For a program to be executed, it must be loaded into main memory. To improve CPU utilization and speed up computer response time, we keep several programs in memory.

The operating system is responsible for following activities in connection with the memory management
  • Keeping track of which part of memory are currently being used and by whom
  • Deciding which processes are to be loaded into memory
  • Allocating and deallocating memory space as needed
  • Swap IN and Swap OUT of processes
  • Managing the sharing of memory between process

FILE MANAGEMENT

A file is a collection of related information defined by the user. The files are organized into directories and sub-directories. These files resides permanently on secondary storage . All the secondary storage device have different characteristic in terms of physical organization, storage capacity, access methods and data transfer rate etc. Therefore File Management is one of the most important function of an operating system.

The Operating System is responsible for the following activities for file management
  • creating and deleting files
  • creating and deleting directories.
  • Supporting primitives for file and directories manipulation.
  • Mapping file on to secondary storage.
  • Backing up files on permanent storage media.

I/O MANAGEMENT

The two main jobs of computer are I/O and processing. The role of the operating system in computer I/O is to manage and control I/O operations. Because I/O devices vary widely in their function and speed, a variety of methods are needed to control them. These methods form the I/O sub-system.

The operating System is responsible for the following activities for I/O Management
  • buffering: Stores data being transferred between two devices or between device and application. Reasons of Buffering: Cope with a speed mismatch between the producer and consumer. and Provide adaptions for devices that have different data transfer sizes.
  • caching: Region of fast memory that holds copies of frequently used data.
  • spooling:.Is a buffer that holds output for a device such as printer
  • A general device driver interface: a translator that takes input  consist of high level commands and gives output consists of low level hardware specific instructions that are used by hardware controller
  • Drivers for specific hardware devices.
Only Device Driver know the complexities of the specific devices to which it is assigned.

No comments:

Post a Comment