Operating Systems Fundamentals: A Comprehensive Overview, Lecture notes of Operating Systems

Chapter-1- Introduction to Operating Systems

Typology: Lecture notes

2017/2018

Uploaded on 01/12/2018

jhananie-sabs
jhananie-sabs 🇮🇳

1 document

1 / 15

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Operating System
Unit-1- Chapter-1 – Introduction to OS
Operating System Structure:
Operating system is divided into number of layers.
1. Hardware lowest layer represents hardware
2. Kernel it controls the computer resources, allotting them to different users and to
different tasks.
3. Shell editor It is a utility which acts as the command interpreter for the kernel and is the
interface between the user and the kernel.
Service of operating systems:
The services of OS is classified as (i) user point of view (ii) system point of view
i. User point of view:
1. User interface (UI) the UI can either be GUI – Graphical User Interface (eg:
windows, menus) or CLI – Command Line Interface (eg: text commands)
1
ShellKernelHardwareSystem calls
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Operating Systems Fundamentals: A Comprehensive Overview and more Lecture notes Operating Systems in PDF only on Docsity!

Operating System

Unit-1- Chapter-1 – Introduction to OS

Operating System Structure:

Operating system is divided into number of layers.

  1. Hardware lowest layer represents hardware
  2. Kernel it controls the computer resources, allotting them to different users and to different tasks.
  3. Shell editor It is a utility which acts as the command interpreter for the kernel and is the interface between the user and the kernel.

Service of operating systems:

The services of OS is classified as (i) user point of view (ii) system point of view

i. User point of view:

  1. User interface (UI) the UI can either be GUI – Graphical User Interface (eg: windows, menus) or CLI – Command Line Interface (eg: text commands)

ShellKernelHardwareSystem calls

  1. Program execution system must be able to load a program into memory and to run the program.
  2. I/O operation a running program might require I/O from a file or I/O device.
  3. File system manipulation programs needs to read and write files.
  4. (^) Error detection errors like power failure, memory error, printer out of paper.
  5. Communication OS should provide mechanism for inter process communication

ii. System point of view:

  1. (^) Resource management when multiple jobs runs at the same time, OS allocates resources based on priority.
  2. Protection and security It ensures that all access to the system resources is controlled.
  3. Accounting OS keeps track of resources used by different users.

Types of Operating Systems:

OS is classified as

  1. Batch processing system
  2. Multiprogramming system
  3. Time sharing system
  4. Parallel system
  5. (^) Distributed system
  6. Real time system
  7. Batch processing system:

A batch is a sequence of user jobs formed for the purpose of processing by a batch processing system. Each job in the batch is independent of other jobs in the batch.

  • The OS defines a job which has predefined sequence of commands, programs and data as a single unit.
  • The OS keeps a number of jobs in memory and executes them without any manual information.
  1. To adapt between devices that have different data transfer sizes.

Spooling: (simultaneous peripheral operations on line)

Spooling refers to putting data of various I/O jobs in a buffer. This buffer is a special area in memory or hard disk which is accessible to I/O devices.

  • Handles I/O device data spooling as devices have different data access rates.
  • Maintains the spooling buffer which provides a waiting station where data can rest while the slower device catches up.

Advantages

  • The spooling operation uses a disk as a very large buffer.
  • Spooling is capable of overlapping I/O operation for one job with processor operations for another job.
  1. Multi programming system:
    • Sharing the processor, when two or more programs reside in memory at the same time, is referred as multiprogramming. Multiprogramming assumes a single shared processor. Multiprogramming increases CPU utilization by organizing jobs so that the CPU always has one to execute.
    • The following figure shows the memory layout for a multiprogramming system.

An OS does the following activities related to multiprogramming.

  • The operating system keeps several jobs in memory at a time.
    • This set of jobs is a subset of the jobs kept in the job pool.
    • The operating system picks and begins to execute one of the jobs in the memory.
    • (^) Multiprogramming operating systems monitor the state of all active programs and system resources using memory management programs to ensures that the CPU is never idle, unless there are no jobs to process.

Advantages

  • High and efficient CPU utilization.
  • User feels that many programs are allotted CPU almost simultaneously.

Disadvantages

  • CPU scheduling is required.
  • To accommodate many jobs in memory, memory management is required.
  1. Time sharing system:

Time-sharing is a technique which enables many people, located at various terminals, to use a particular computer system at the same time. Time-sharing or multitasking is a logical

Advantages:

  • (^) Saves money as the multiprocessor systems cost less than equivalent multiple single processor systems.
  • Increase reliability as functions are distributed properly among several processors.
  • Increased throughput as by increasing the number of processors.

Disadvantages:

  • Implementation is complex.
  • Requires resource management and protection.
  1. Distributed systems:

Distributed Operating System is a model where distributed applications are running on multiple computers linked by communications. A distributed operating system is an extension of the network operating system that supports higher levels of communication and integration of the machines on the network.

There are two types of distributed systems. They are

  1. (^) Loosely coupled: Each processor has its own resources that are not accessible to other processors.
  1. Tightly coupled: processors share the computer bus, the clock, memory and peripheral devices.

Advantages:

  • Resource sharing provides mechanisms for sharing files at remote sites, processing information in a distributed database.
  • Computational speed up as computations can be partitioned into sub computations which can be run concurrently on various sites in a distributed system.
  • Reliability-if one site fails in a distributed system, then the remaining sites can continue operating.
  • Communication can be enabled by passing messages

Disadvantages:

  • Implementation is complex
  • Require memory and resource management and protection.
  1. Real time operating systems:

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 to an input and display of required updated information is termed as the response time.

There are two types of real-time operating systems.

Hard real-time systems

Hard real-time systems guarantee that critical tasks complete on time. In hard real-time systems, secondary storage is limited or missing and the data is stored in ROM. In these systems, virtual memory is almost never found.

Soft real-time systems

Soft real-time systems are less restrictive. A critical real-time task gets priority over other tasks and retains the priority until it completes. Soft real-time systems have limited utility than hard real-time systems.

Advantages:

  • Multitasking operation is accomplished by scheduling processes for execution independently of each other.
  • Each medium is controlled by speed, capacity, data transfer rate and access methods.
  • When multiple users have access to files, it is desirable to control by whom and in what ways.
  • (^) The activities like creation and deletion of files and directories.
  • Support primitives for manipulating files and directories.
  • Mapping of files onto secondary storage.
  • Backup of files on stable storage media.
  1. Input-Output Management:
  • OS manages device drivers for I/O devices.
  • To manage I/O operations with devices such as keyboard, mouse, printer.
  1. Secondary storage management:
  • When storage is not sufficient to accommodate all data and programs.
  • The functions are storage allocation, scheduling of disk management and allocation of free space.
  1. Networking:
  • It is a collection of programs and associated protocols, that do not share memory or peripheral devices.
  • The communication takes place through high speed buses or telephone lines.
  1. Protection system:
  • When multiple users are using multiple processors, the different processes need protection from one another.
  • It is responsible for controlling access of programs, processes or users to the resources.
  • (^) Improve reliability by early detection of errors.
  1. Command interpreter system:
  • When a job has to be executed, command-line interpreter reads the control statements and executes it.
  • It is responsible for creation and management of process.
  • I/O handling.
  • Secondary storage and main memory management.
  • Access of file systems.
  • (^) Protection and networking systems.

System calls:

It acts as an interface between the process and OS. Eg: copying a data from one file to another file.

System call implementation:

Invoking open system call

Open( )

User mode

Kernel mode

Open( )

User applicationSystem call interface•

  • transfer status information

  • attach or detach remote devices

There are 2 models of communication. They are (i) Shared memory model and (ii) Message passing model.

i. (^) Shared Memory model:

  • In this model, the memory is shared by other processors.
  • The processes use shared memory create and shared memory attach system calls to create and gain access to memory.
  • The memory is determined by processes and not by the OS.

Advantages: It allows maximum speed. Disadvantages: Protection and synchronization of shared memory is needed. ii. Message passing model:

  • (^) The processes exchange message with one another to transfer information.
  • Exchange takes place between processes directly or indirectly through a common mail box.
  • Before communication takes place, a connection must be opened and the name of other communicator must be known.
  • The recipient must give accept communication call.
  • Close connection call terminates the communication.

Advantages: Easy to implement. No problem exists when smaller amount of data is exchanged. Disadvantage: It requires more time as they are implemented using system calls that require kernel. System Programs: They provide a convenient environment for program development and execution. Some of them act as an interface to system calls and others are complex. The different categories of system programs are 5.i. File Management: They are used to create, copy, delete, rename, print, list and manipulate files and directories. 5.ii. Status information: They give information about date, time, available memory or space, number of users and other status information. 5.iii. File modification: text editors are available to create and modify the content of files stored on disk or tape. 5.iv. (^) Programming language support: compilers, assemblers and interpreters for languages like C, C++, Java , etc are provided to the user along with the OS. 5.v. Program loading and execution: After a program is compiled, it is loaded into memory for execution. 5.vi. Communication: They create virtual connections among process and users. The users can send messages to one another, browse web pages, send e-mail, log in remotely and transfer files from one computer to another. 5.vii. Application programs: They are used to solve some common problems or operations. Eg: web browsers, database systems, compilers, word processors and games. 5.viii. Command interpreter: Its function is to get and execute the next specified command given by the user. Virtual Machines:

  • A virtual machine provides an interface identical to the underlying bare hardware.