Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Introduction of operating system, Summaries of Operating Systems

An introduction to operating systems, including their objectives, components, and functions. It covers topics such as multiprogramming, multitasking, and distributed operating systems. It also discusses the components of operating systems, such as process management, file management, and network management.

Typology: Summaries

2021/2022

Available from 11/17/2022

vaishnavi-dewangan
vaishnavi-dewangan 🇮🇳

1 document

1 / 32

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Operating System Notes
Unit 1: Introduction
INDEX:
S.NO.
TOPIC
P.NO.
1
Operating System Objective and Functions
1
2
Evolution of Operating System
3
3
Components of Operating System
9
4
Services of Operating System
16
5
Operating System Structure
19
6
Computer System Structure
32
7
Interrupts
23
8
System Call
23
9
Modes of Operation
29
10
System Programs in OS
30
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download Introduction of operating system and more Summaries Operating Systems in PDF only on Docsity!

Operating System Notes

Unit – 1: Introduction

INDEX:

S.NO. TOPIC P.NO.

1 Operating System Objective and Functions 1

2 Evolution of Operating System 3

3 Components of Operating System 9

4 Services of Operating System 16

5 Operating System Structure 19

6 Computer System Structure 32

7 Interrupts 23

8 System Call 23

9 Modes of Operation 29

10 System Programs in OS 30

What is an Operating System?

  • A program that acts as an intermediary between a user of a computer and the computer hardware
  • Operating system goals:

▫ Execute user programs and make solving user problems easier

▫ Make the computer system convenient to use

▫ Use the computer hardware in an efficient manner

Operating System Definition

  • No universally accepted definition
  • Operating System exists to offer a reasonable way to solve the problem of creating a usable computing system.
  • The fundamental goal of computer system is to execute system programs and to make solving user programs easier.
  • Since bare hardware alone is not particularly easy to use, application programs are developed.
  • A simple view point is that it includes everything a vendor ships when you order the Operating System.
  • The features that are included vary greatly across systems.
  • A more common definition: “The one program running at all times on the computer” is the kernel.
  • Along with the Kernel, there are two different types of programs : System Programs, Application Programs
  • The emergence of mobile devices have resulted in an increase in the number of features that constitute an operating system.
  • The mobile operating systems often include not only a core kernel, but also a middleware.

Objectives of Operating System

The objectives of the operating system are −  To make the computer system convenient to use in an efficient manner.

 To hide the details of the hardware resources from the users.

 To provide users a convenient interface to use the computer system.

 To act as an intermediary between the hardware and its users, making it easier for the users to access and use other resources.

Various Evolution of the Operating System

 The various evolution of an operating system are given below

Serial Processing:

 Early computer from late 1940 to the mid 1950’s.  The programmer interacted directly with the computer hardware.  These machine are called bare machine as they don't have OS.  Every computer system is programmed in its machine language.  Uses Punch Card, paper tapes and language translator

These system presented two major problems.

  1. Scheduling
  2. Set up time Scheduling: Used signup sheet to reserve machine time. A user may sign up for an hour but finishes his job in 45 minutes. This would result in wasted computer idle time, also the user might run into the problem not finish his job in allotted time. Set up time: A single program involves: ● Loading compiler and source program in memory ● saving the compiled program (object code) ● Loading and linking together object program and common function

 Each of these steps involves the mounting or dismounting tapes on setting up punch cards. If an error occur user had to go the beginning of the set up sequence.  Thus, a considerable amount of time is spent in setting up the program to run.  This mode of operation is turned as serial processing, reflecting the fact that users access the computer in series.

The Batch System

 Early computers were very expensive, and therefore it was important to maximize processor utilization. ● The wasted time due to scheduling and setup time in Serial Processing was unacceptable. ● To improve utilization, the concept of a batch operating system was developed. ● Batch is defined as a group of jobs with similar needs. The operating system allows users to form batches.  Computer executes each batch sequentially, processing all jobs of a batch considering them as a single process called batch processing.

The central idea behind the simple batch-processing scheme is:  Jobs were scheduled and submitted on cards and tapes. Then sequentially executed on the monitors by using Job Control Language. The first computers are used in the process of the batch operating process made the computer batch of jobs without any pause or stop. The program is written in the punch cards and then copied to the processing unit of the tape. When the computer completed a single job, it instantly begins the next task on the tape. Professional operators are trained to communicate with the machine where the users dropped the jobs and fetched back to pick the results after the job is executed.

 Though it is uncomfortable for the users it is made to keep the expensive computer as busy up to the extent by running a leveraged stream of jobs. The protection of memory doesn’t allow the memory area comprises the monitor to altered and the timer protects the job from monopolizing the system. The processor sustains as idle when the input and output devices are in use by the bad utilization of CPU time.

Multi-programmed Batch System:

 A single program cannot keep either CPU or I/O devices busy at all times.  Multiprogramming increases CPU utilization by organizing jobs in such a manner that CPU has always one job to execute.  If computer is required to run several programs at the same time, the processor could be kept busy for the most of the time by switching its attention from one program to the next.  Additionally I/O transfer could overlap the processor activity i.e, while one program is awaiting for an I/O transfer, another program can use the processor.  So CPU never sits idle or if comes in idle state then after a very small time it is again busy. This is illustrated in fig below.

Fig. Multiprogramming example

Multitasking or Time Sharing System:

 Multiprogramming didn't provide the user interaction with the computer system.  Time sharing or Multitasking is a logical extension of Multiprogramming that provides user interaction.

 Reduction of the load on the host computer.  Reduction of delays in data processing.

Features of Distributed Operating System

  1. Connecting Users and Resources:

 The main goal of a distributed system is to make it easy for users to access remote resources, and to share them with other users in a controlled manner. Resources can be virtually anything; typical examples of resources are printers, storage facilities, data, files, web pages, and networks. There are many reasons for sharing resources. One reason is economics.

  1. Transparency:

An important goal of a distributed system is to hide the fact that its process and resources are physically distributed across multiple computers. A distributed system that is capable of presenting itself to users and applications such that it is only a single computer system is called transparent. The concept of transparency can be applied to many aspects of a distributed system as shown in table.

Different Forms of Transparency

  1. Openness: Another important goal of distributed systems is openness. An open distributed system is a system that offers services in standards that describable the syntax and semantics of those service instances, standard rules in computer networks control the format, content, and meaning of messages sent and received. Such rules are formalized in the protocols. In distributed systems, services are typically specified through interfaces, often called interface definition languages (IDL). Interface definitions written in IDL almost always capture only the syntax of services. They accurately specify the names of functions that are available with the types of parameters, return values, possible exceptions that can be raised and so on.
  2. Scalability: The uncertain trend in distributed systems is towards larger systems. This observation has implications for distributed file system design. Algorithms that work well for systems with 100 machines can work for systems with 1000 machines and none at all for systems with 10, 000 machines. for starters, the centralized algorithm does not scale well. If opening a file requires contacting a single centralized server to record the fact that the file is open then the server will eventually become a bottleneck as the system grows.
  3. Reliability: The main goal of building distributed systems was to make them more reliable than single processor systems. The idea is that if some machine goes down, some other machine gets used to it. In other words, theoretically the reliability of the overall system can be a Boolean OR of the component reliability. For example, with four file servers, each with a 0.95 chance of being up at any instant, the probability of all four being down simultaneously is 0.000006, so the probability of at least one being available is (1-0.000006)= 0.999994, far better than any individual server.
  4. Performance: Building a transparent, flexible, reliable distributed system is useless if it is slow like molasses. In particular application on a distributed system, it should not deteriorate better than running some application on a single processor. Various performance metrics can be used. Response time is one, but so are throughput, system utilization, and amount of network capacity consumed. Furthermore, The results of any benchmark are often highly dependent on the nature of the benchmark. A benchmark involves a large number of independent highly CPU-bound computations which give radically different results than a benchmark that consists of scanning a single large file for same pattern.

Real Time operating System

A real-time system is defined as a data processing system in which the time interval required to process and respond to inputs is so small that it controls the environment. The time taken by the system to respond

S.NO. TRANSPARENCY DESCRIPTION

(1) Access Hide data representation. (2) Location Hide location (3) Migration Move place information. (4) Relocation Hide moved place relocation. (5) Replication Hide that a resource is replication. (6) Concurrency Shared data bases access (7) Failure Hide fact about resource failure. (8) Persistence Hide fact about memory location.

Operating system components help you get the correct computing by detecting CPU and memory hardware errors.

Process Management

The process management component is a procedure for managing many processes running simultaneously on the operating system. Every running software application program has one or more processes associated with them.

For example, when you use a search engine like Chrome, there is a process running for that browser program.

Process management keeps processes running efficiently. It also uses memory allocated to them and shutting them down when needed.

The execution of a process must be sequential so, at least one instruction should be executed on behalf of the process.

Functions of process management

Here are the following functions of process management in the operating system, such as:

o Process creation and deletion.

o Suspension and resumption.

o Synchronization process o Communication process

NOTE: OS facilitates an exchange of information between processes executing on the same or different systems.

File Management

A file is a set of related information defined by its creator. It commonly represents programs (both source and object forms) and data. Data files can be alphabetic, numeric, or alphanumeric.

o A distributed system also offers the user access to the various resources the network shares.

o It helps to access shared resources that help computation to speed up or offers data availability and reliability.

Main Memory management

Main memory is a large array of storage or bytes, which has an address. The memory management process is conducted by using a sequence of reads or writes of specific memory addresses.

It should be mapped to absolute addresses and loaded inside the memory to execute a program. The selection of a memory management method depends on several factors.

However, it is mainly based on the hardware design of the system. Each algorithm requires corresponding hardware support. Main memory offers fast storage that can be accessed directly by the CPU. It is costly and hence has a lower storage capacity. However, for a program to be executed, it must be in the main memory.

Functions of Memory management

An Operating System performs the following functions for Memory Management in the operating system:

o It helps you to keep track of primary memory.

o Determine what part of it are in use by whom, what part is not in use. o In a multiprogramming system, the OS decides which process will get memory and how much.

o Allocates the memory when a process requests.

o It also de-allocates the memory when a process no longer requires or has been terminated.

Secondary-Storage Management

The most important task of a computer system is to execute programs. These programs help you to access the data from the main memory during execution. This memory of the computer is very small to store all data and programs permanently. The computer system offers secondary storage to back up the main memory.

Today modern computers use hard drives/SSD as the primary storage of both programs and data. However, the secondary storage management also works with storage devices, such as USB flash drives and CD/DVD drives. Programs like assemblers and compilers are stored on the disk until it is loaded into memory, and then use the disk is used as a source and destination for processing.

Functions of Secondary storage management

Here are some major functions of secondary storage management in the operating system:

o Storage allocation

o Free space management o Disk scheduling

I/O Device Management

One of the important use of an operating system that helps to hide the variations of specific hardware devices from the user.

Security can improve reliability by detecting latent errors at the interfaces between component subsystems. Early detection of interface errors can prevent the foulness of a healthy subsystem by a malfunctioning subsystem. An unprotected resource cannot misuse by an unauthorized or incompetent user.

Command Interpreter System

One of the most important components of an operating system is its command interpreter. The command interpreter is the primary interface between the user and the rest of the system.

Many commands are given to the operating system by control statements. A program that reads and interprets control statements is automatically executed when a new job is started in a batch system or a user logs in to a time-shared system. This program is variously called.

o The control card interpreter, o The command-line interpreter,

o The shell (in UNIX), and so on.

Its function is quite simple, get the next command statement, and execute it. The command statements deal with process management, I/O handling, secondary storage management, main memory management, file system access, protection, and networking.

Services of Operating System

An Operating System provides services to both the users and to the programs.

 It provides programs an environment to execute.  It provides users the services to execute the programs in a convenient manner. Following are a few common services provided by an operating system −

 Program execution

 I/O operations  File System manipulation  Communication  Error Detection  Resource Allocation  Protection

Program execution

Operating systems handle many kinds of activities from user programs to system programs like printer spooler, name servers, file server, etc. Each of these activities is encapsulated as a process.

A process includes the complete execution context (code to execute, data to manipulate, registers, OS resources in use). Following are the major activities of an operating system with respect to program management −

 Loads a program into memory.  Executes the program.  Handles program's execution.  Provides a mechanism for process synchronization.  Provides a mechanism for process communication.  Provides a mechanism for deadlock handling.

I/O Operation

An I/O subsystem comprises of I/O devices and their corresponding driver software. Drivers hide the peculiarities of specific hardware devices from the users.

An Operating System manages the communication between user and device drivers.

 I/O operation means read or write operation with any file or any specific I/O device.  Operating system provides the access to the required I/O device when required.

File system manipulation

A file represents a collection of related information. Computers can store files on the disk (secondary storage), for long-term storage purpose. Examples of storage media include magnetic tape, magnetic disk and optical disk drives like CD, DVD. Each of these media has its own properties like speed, capacity, data transfer rate and data access methods.

A file system is normally organized into directories for easy navigation and usage. These directories may contain files and other directions. Following are the major activities of an operating system with respect to file management −

 Program needs to read a file or write a file.  The operating system gives the permission to the program for operation on file.  Permission varies from read-only, read-write, denied and so on.  Operating System provides an interface to the user to create/delete files.  Operating System provides an interface to the user to create/delete directories.

Operating-System Design and Implementation

Design Goals

Requirements define properties which the finished system must have, and are a necessary first step in designing any large complex system. User requirements are features that users care about and understand, and are written in commonly understood vernacular. They generally do not include any implementation details, and are written similar to the product description one might find on a sales brochure or the outside of a shrink- wrapped box. System requirements are written for the developers, and include more details about implementation specifics, performance requirements, compatibility constraints, standards compliance, etc. These requirements serve as a "contract" between the customer and the developers, ( and between developers and subcontractors ), and can get quite detailed. Requirements for operating systems can vary greatly depending on the planned scope and usage of the system. ( Single user / multi-user, specialized system / general purpose, high/low security, performance needs, operating environment, etc. )

Mechanisms and Policies  Policies determine what is to be done. Mechanisms determine how it is to be implemented.  If properly separated and implemented, policy changes can be easily adjusted without re- writing the code, just by adjusting parameters or possibly loading new data / configuration files. For example the relative priority of background versus foreground tasks.

Implementation  Traditionally OSes were written in assembly language. This provided direct control over hardware-related issues, but inextricably tied a particular OS to a particular HW platform.  Recent advances in compiler efficiencies mean that most modern OSes are written in C, or more recently, C++. Critical sections of code are still written in assembly language, ( or written in C, compiled to assembly, and then fine-tuned and optimized by hand from there. )  Operating systems may be developed using emulators of the target hardware, particularly if the real hardware is unavailable ( e.g. not built yet ), or not a suitable platform for development, ( e.g. smart phones, game consoles, or other similar devices. )

Operating-System Structure For efficient performance and implementation an OS should be partitioned into separate subsystems, each with carefully defined tasks, inputs, outputs, and performance characteristics. These subsystems can then be arranged in various architectural configurations: Simple Structure When DOS was originally written its developers had no idea how big and important it would eventually become. It was written by a few programmers in a relatively short amount of time, without the benefit of modern software engineering techniques, and then gradually grew over time to exceed its original expectations. It does not break the system into subsystems, and has no distinction

between user and kernel modes, allowing all programs direct access to the underlying hardware. ( Note that user versus kernel mode was not supported by the 8088 chip set anyway, so that really wasn't an option back then. )

Figure - MS-DOS layer structure

The original UNIX OS used a simple layered approach, but almost all the OS was in one big layer, not really breaking the OS down into layered subsystems:

Figure - Traditional UNIX system structure