Operating System Overview

 Operating Systems Introduction

What is an Operating System? 

What does an operating system do?

An Operating System provides an environment for useful tasks and programs to be executed. It is a platform for the useful programs to run. It is an interface between the user and the System.
1.1. Basic Operating System Concepts — Operating Systems Study Guide

Program: process in execution.


Multi-processor Systems.

Over the last couple of years, multiprocessing systems have begun to dominate the landscape of computing. Here are three main reasons why we need to switch over to multi-processing systems:
  1. Increased throughput : By increasing the number of processes we can increase the amount of yield. The simple analogy to this would be, 3 men may take 5 days to build a wall, whereas if there are 5 men, in a period of 5 days the wall can be built and painted. It is simply more work in less time.
  2.  Economy   of  Scale : A single multiprocessor system costs lesser than multiple single processor systems.
  3. Increased Reliability  : If the function/tasks are to be divided among several users, then the failure of one process will not halt the system only slows it down, If one process fails, the other processes have to work for an excess amount in order to cover up for the slack of the process that had failed. A simple example for this can be a cricket match, where if Virat Kohli gets out early in the innings, the innings will not come to a halt but only the run rate would have lowered and the other batsmen in the team have to cover up for the slack from Virat Kohli.
[Note: The idea of a multiprocessing system is to never leave a CPU idle]


  Clustered Systems

Clustering is a concept similar to multi-processing systems,more inclined to its third advantage mentioned above. Clustering is usually used to provide high-availability service which is to say that the servers will remain running even if one or more systems in that cluster fail. Cluster are used to provide high-performance computing environments.

There are two kinds of clustering. Namely, symmetric and asymmetric.

Asymmetric clustering  involves a system that is running and another system that is in hot-standby mode. The system in the hot-standby mode monitors the running of the other system until it fails. Upon the failure of the initial system, the system in the hot-stand by mode immediately takes over and maneuvers to become the active server.

Symmetric clustering  involves two or more servers running at the same time while monitoring each other. This structure is more efficient than the asymmetric structure.

Operating Systems: Introduction
                                                               Clustered System

Operating System Structure


Job-pool: The operating system needs to keep several jobs in memory simultaneously. This cannot be stored in the man memory as the main memory is too small to accommodate all the jobs, hence these jobs are stored in something called the job-pool. The job to be executed is selected from the job queue. If several of these jobs are ready to be executed the selection  of which job is to be executed is done by using a scheduling algorithm.


 
Time-Sharing: Time sharing is a logical extension of multi-programming that executes multiple jobs in the CPU by switching among them. The switching is so rapid and frequent that the users can interact with each program while it is being executed, hence providing an interactive interface. The response time for such an interaction is typically less than one second. Time-sharing also allows multiple users to share the system simultaneously. In a time sharing system, the goal is accomplished sometimes through the process of swapping where processes are swapped in and out of the  main memory. When the process is swapped out of the main memory it is temporarily stored in something called the virtual memory. This allows users to run programs that are larger than the actual physical memory.

Timer:  In order to maintain control over the CPU so that one process does not take forever in an infinite loop to execute and call the return function, we make use of the timer  with the help of which we can forcefully halt the execution of one process and load another process if need be.



Operating System for Process Management

The operating system executes the following tasks as a part of the process management scheme:
  • scheduling processes and threads on the CPU
  • Creating and deleting both user and system processes
  • Suspending and Resuming processes
  • Providing mechanisms for process synchronization
  • Providing mechanisms for process communication
 

Operating System for Memory Management

The operating system executes the following tasks as a part of the memory management scheme:
  • keeping track of which section of the memory is being used and the user of this section
  • deciding which processes need to be swapped in and out of the main memory
  • Allocation and Deallocation of memory


Operating System for Storage Management

The operating system executes the following tasks as a part of the storage management scheme:
  • Creating and deleting files
  • Creating and deleting directories to organize files
  • Supporting primitives for manipulating files and directories
  • Mapping files onto secondary storage devices
  • Backing up files on stable(nonvolatile) storage media
[Note: WORM; abbrev. Write once Read many times]

Caching

The programmer (or the compiler) implements the register-allocation and the register-replacement algorithms to decide which information to keep in registers and which to keep in main memory.
The systems have an instruction cache to hold the instructions expected to be executed next. Without this cache, the CPU would have to wait several cycles while an instruction is being fetched from the main memory.  

                                                Caching of an integer "A"
                                                
                                 Migration of an Integer "A" from disk to register

The movement of information between levels of storage hierarchy may be either explicit or implicit, depending on the hardware design and the controlling operating system software. The data transfer from cache to the CPU and registers is usually a hardware function, with no operating system intervention. In contrast, transfer of data from the disk to memory is usually controlled by the operating system. In a multi-tasking environment, extreme care needs to be taken while the CPU is switching back and forth between processes to ensure that when several processes are trying to access the integer "A" , they obtain the most recently updated value of "A". Since multiple CPUs can execute parallelly, care must be taken to ensure that any update in one cache is reflected in all other caches where "A" exists. This is known as cache coherency.

Protection and Security

  • If a system allows multiple users and concurrent execution of multiple processes then, access to the data must be regulated.
  • The integrity of various peripheral devices is protected by making the device control registers in-accessible to the users.
  • A  protection-oriented system provides a means to distinguish between authorized and unauthorized usage.





Comments

Popular Posts