0% found this document useful (0 votes)
36 views56 pages

UNIT-I Operating System - Compatibility Mode

The document provides an introduction to operating systems, including definitions, goals, functions, and types. It defines an operating system as a program that acts as an intermediary between the user and computer hardware, managing resources and controlling execution of programs. The major functions of an OS are described as process management, memory management, I/O device management, file management, storage management, and security/protection. Different types of operating systems are discussed such as batch, time-sharing, distributed, and real-time systems.

Uploaded by

Rudraksh sah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views56 pages

UNIT-I Operating System - Compatibility Mode

The document provides an introduction to operating systems, including definitions, goals, functions, and types. It defines an operating system as a program that acts as an intermediary between the user and computer hardware, managing resources and controlling execution of programs. The major functions of an OS are described as process management, memory management, I/O device management, file management, storage management, and security/protection. Different types of operating systems are discussed such as batch, time-sharing, distributed, and real-time systems.

Uploaded by

Rudraksh sah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

8/28/2023

Operating System
Introduction (UNIT I)

Dr. Indrajeet Kumar


Department of CSE
Graphic Era Hill University
Dehradun

Introduction
• OS provides interface
between user and
hardware. USERS

OPERATING
• It is a system software. SYSTEM

SYSTEM HARDWARE
• It manages everything.

1
8/28/2023

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


• OS is a resource allocator
– Manages all resources (OS as a government).
– Decides between conflicting requests for
efficient and fair resource use.
• OS is a program controller
– Controls execution of programs to prevent
errors and improper use of the computer.
• Resource allocation and control is especially
important when having several users connected
to the same mainframe or microcomputer.

2
8/28/2023

Operating System Definition (Cont)


• “The one program running at all times on
the computer” is the kernel.
• Operating System works like a
Government, manage everything.

Operating System Design & Goals


• Each OS has different goals and design:
– Mainframe – maximize HW utilization/efficiency.
– PC – maximum support to user applications.
– Handheld – convenient interface for running
applications, performance per amount of battery life.

efficiency convenience

Performance, simplicity of use


resource utilization

3
8/28/2023

Abstract view of OS
User User User User Program
1 2 3 N interface

Compiler Assembler Text editor MS Word

Level 2 System and application program

Operating User
Level 1 System program
OS
Computer Hardware interface
Level 0

OS Functions
• Operating system controls and
coordinates the use of hardware among
application programs.
• The major services of an operating system are −
• Process Management
• Memory Management
• I/O Device Management
• File Management
• Storage Management
• Security & Protection

4
8/28/2023

Process Management
• Scheduling processes and threads on the
CPU.
• Creating and deleting user and system
level process.
• Suspending and resuming the process.
• Providing the mechanism for process
synchronization and Process
communication.

Memory Management
• Keeping track of which part of memory are
currently being used by whom.

• Deciding which process & data to move


into and out of memory.

• Allocating and de-allocating memory


space as needed.

10

5
8/28/2023

File Management
• Creating and deleting files.
• Creating and deleting directories to
organize files.
• Supporting primitives for manipulating files
and directories.
• Mapping files onto secondary storage.
• Backing up files on stable or nonvolatile
storage media.

11

Storage Management
• Free space management.
• Storage allocation.

• Disk Scheduling.
Migration of data from HDD to HW register

Magnetic Main Cache H/W


Disk Memory memory Register

12

6
8/28/2023

I/O System Management


• A memory management component that
includes buffering caching, and spooling.
• A general device driver interface.

• Drivers for specific hardware devices.

13

Protection & Security


• Protection is a mechanism for controlling
the access of processes or users to the
resources defined by computer system.
• Protection can improve the reliability by
detecting latent errors at the interfaces
between components.

• Early detection can improve the system


performances.

14

7
8/28/2023

• To avoid the loss or unauthorized access


of data, system security accounts an
important role.

• It is job of system security to defend a


system from external or internal attacks.

15

Evolution of Operating system


Electronic
Generation Year Types of OS Device
device used

First 1945-55 Vaccum Tubes Plug Boards

Second 1955-65 Transistors Batch Systems

Integrated
Third 1965-80 Multiprogramming
Circuits (IC)

Large Scale
Fourth Since 1980 PC
Integration

16

8
8/28/2023

Operating System Operations


• Operating systems operate in dual mode:
– Kernel Mode (0)
– User Mode (1)

• With the mode bit, we are able to


distinguish between a task executed by
OS or executed by users.

17

Transition from user to kernel


mode
• Transition from user to kernel mode

User Process
User
Mode
User Process Calls system Return from
(bit=1)
executing call system call

Kernel Trap mode bit=0 return mode bit=1 Kernel


Mode
Execute system calls
(bit=0)

18

9
8/28/2023

Types of Operating System


• Some of the widely used operating
systems are as:
• Batch Operating System
• Time-Sharing Operating Systems
• Distributed Operating System
• Network Operating System
• Real-Time Operating System
• Clustered System
• Handheld System

19

Batch Operating System


• In this type of system, there is no direct
interaction between user and the computer.
• The user has to submit a job (written on cards or
tape) to a computer operator.
• It is the responsibility of operator to sort the jobs
with similar needs.
• Then computer operator places a batch of
several jobs on an input device.
• Jobs are batched together by type of languages
and requirement.

20

10
8/28/2023

Batch Operating System Structure

Examples: Payroll System, Bank Statements etc.

21

Advantages of Batch Operating


System:
• It is very difficult to guess or know the time
required by any job to complete.
• Multiple users can share the batch
systems.
• The idle time for batch system is very less
• It is easy to manage large work repeatedly
in batch systems.

22

11
8/28/2023

Disadvantages of Batch Operating


System
• The computer operators should be well
known with batch systems.
• Batch systems are hard to debug.

• It is sometime costly.
• The other jobs will have to wait for an
unknown time if any job fails.

23

Time-Sharing Operating Systems


• Each task is given some time to execute, so that all the
tasks work smoothly.
• Each user gets time of CPU as they use single system.
• These systems are also known as
Multitasking/Multiprogramming Systems.
• The task can be from single user or from different users
also.
• The time that each task gets to execute is called
quantum.
• After this time interval is over OS switches over to next
task.

24

12
8/28/2023

Examples: Multics, Unix etc.

25

Advantages & Disadvantages

Advantages:
– Each task gets an equal opportunity
– Less chances of duplication of software
– CPU idle time can be reduced
Disadvantages:
– Reliability problem
– One must have to take care of security and
integrity of user programs and data
– Data communication problem

26

13
8/28/2023

Distributed Operating System


• Various autonomous interconnected
computers communicate each other using
a shared communication network.
• These are referred as loosely coupled
systems or distributed systems.

• Remote access is enabled within the


devices connected in that network

27

Examples: LOCUS etc.

28

14
8/28/2023

Advantages:
• Failure of one will not affect the other network
communication, as all systems are independent from
each other.
• Since resources are being shared, computation is
highly fast and durable.
• Load on host computer reduces.
• These systems are easily scalable as many systems
can be easily added to the network.
• Delay in data processing reduces.

29

Disadvantages:
• Failure of the main network will stop the
entire communication
• To establish distributed systems the
language which are used are not well
defined yet.
• These types of systems are not readily
available as they are very expensive.
• Underlying software is highly complex and
not understood well.

30

15
8/28/2023

Network Operating System


• These systems run on a server and provide the
capability to manage data, users, groups,
security, applications, and other networking
functions.
• These type of operating systems allow shared
access of files, printers, security, applications,
and other networking functions over a small
private network.
• The connected computers are popularly known
as tightly coupled systems.

31

Network Operating System Structure

Examples: Microsoft Windows Server 2003, 2008,


UNIX, Linux, Mac OS X, Novell NetWare etc.

32

16
8/28/2023

Advantages:

• Highly stable centralized servers.


• Security concerns are handled through
servers.
• New technologies and hardware up-
gradation are easily integrated to the
system.
• Server access are possible remotely from
different locations and types of systems.

33

Disadvantages:

• Servers are costly.

• User has to depend on central location for


most operations.

• Maintenance and updates are required


regularly.

34

17
8/28/2023

Real-Time Operating Systems


• These types of OSs serves the real-time
systems.

• The time interval required to process and


respond to inputs is very small. This time interval
is called response time.

• Real-time systems are used when there are


time requirements are very strict like missile
systems, air traffic control systems, robots etc.

35

Types of RTOS
Hard Real-Time Systems: Soft Real-Time Systems:
• Where time constraints • These OSs are for
are very strict and even applications where for
the shortest possible time-constraint is less
delay is not acceptable. strict.

• Built for saving life like


automatic parachutes or
air bags which are
required to be readily
available in case of any
accident.

36

18
8/28/2023

Examples: Industrial control systems, weapon


systems, robots, air traffic control systems, etc.

37

Advantages & Disadvantages


Advantages:
– Maximum resource utilization
– Less Task Shifting time
– Error Free

Disadvantages:
– Use heavy system resources:
– Complex Algorithms:
– Specific Device driver and interrupt signals

38

19
8/28/2023

Clustered Operating Systems


• Like parallel systems, clustered systems
gather together multiple CPUs to
accomplish computational work.
• Clustered systems differ from parallel
systems, however, in that they are
composed of two or more individual
systems coupled together.
• Clustering is usually performed to provide
high availability.

39

Types of COS
• Asymmetric Clustering:
– In this, one machine is in hot standby mode
while the other is running the applications.

– The hot standby host (machine) does nothing


but monitor the active server.

– If that server fails, the hot standby host


becomes the active server.

40

20
8/28/2023

• Symmetric Clustering:

– In this, two or more hosts are running


applications, and they are monitoring each
other.

– This mode is obviously more efficient, as it


uses all of the available hardware.

41

• Parallel Clustering:

– Parallel clusters allow multiple hosts to


access the same data on the shared storage.

– Because most operating systems lack


support for this simultaneous data access by
multiple hosts, parallel clusters are usually
accomplished by special versions of software
and special releases of applications.

42

21
8/28/2023

Handheld Operating Systems


• It includes Personal Digital Assistants
(PDAs), such as Palm-Pilots or Cellular
Telephones with connectivity to a network
like Internet.
• They are usually of limited size due to
which most handheld devices have a small
amount of memory, include slow
processors, and feature small display
screens.

43

Types of Operating System


• Some of the widely used operating
systems are as:

• Single User Operating System

• Multi-User Operating System

• Multi-Tasking Operating System

• Multiprocessing Operating System

44

22
8/28/2023

Single User Operating System

• As name suggests, OS is designed for one user


to effectively use a computer at a time.

• Examples: DOS, Old versions of window, etc.

45

Multi-user Operating Systems


• This type of OS allows multiple users to
simultaneously use the system.
• The processor splits its resources and handles
one user at a time.

• some network systems utilize this kind of


operating system.

• Example: UNIX, Linux, MAC etc.

46

23
8/28/2023

Multi-Tasking Operating System


• In this type of OS several applications
maybe simultaneously loaded and used in
the memory.
• While the processor handles only one
application at a particular time it is capable
of switching between the applications
effectively to apparently simultaneously
execute each application.
• Example: Windows OS.

47

Multi-processing Operating Systems


• Systems with more than one CPU in close
communication, Also known as multi-
processing systems.

• Tightly coupled system.

Advantages
 Increased throughput.

48

24
8/28/2023

Types
• Asymmetric multiprocessing:

– Each processor is assigned a specific task.

– Master processor schedules and allocated


work to slave processors.

– Suitable for extremely large systems.

49

• Symmetric multiprocessing:

– Each processor runs and identical copy of the


operating system.
– Many processes can run at once without
performance decline.

– Most modern operating systems support


SMP.

50

25
8/28/2023

51

Advantages:
• Increase throughput: by increasing
number of processors, to get more work
done in less time.
• Economy of Scale: They can share
peripherals, mass storage, and power
supplies etc.
• Increase Reliability: If failure one
processor will not halt the system, only
slow down.

52

26
8/28/2023

Abstract View of OS

53

View of Operating System Services

54

27
8/28/2023

OS services and Functions


• User Interface
• Program execution
• I/O Operations
• File system manipulations
• Communications
• Error detection
• Resource allocation
• Accounting
• Protection & Security

55

Architecture of Operating System

56

28
8/28/2023

Operating Systems Working

57

UNIX OS Structure

58

29
8/28/2023

Summary

59

Multi-Programmed Systems
• Multi-programming increases CPU utilization by
organizing jobs so that the CPU always has one to
execute.
• The operating system keeps several jobs in memory
simultaneously as shown in fig.
• In Multi-programming system,
the Operating system simply
switches to, and execute, another job.
• When that job needs to wait, the
CPU is switched to another job, and
So on.

60

30
8/28/2023

OS Features Needed for Multiprogramming


• I/O routine supplied by the system
• Memory management – the system must allocate
the memory to several jobs
• CPU scheduling – the system must choose among
several jobs ready to run
• Allocation of devices

61

Multiprogramming
• The OS gives each process a certain timeslice
(quantum) to run.
• Control is passed to another process if:
 Running process ends before time slice expires
 running process leaves the system.
 Running process needs and I/O operation
running
 process joins the I/O device queue,
 Time slice expires
 running process goes back to the CPU queue.

62

31
8/28/2023

Process States in a Multiprogrammed OS


.

63

Operating System Interface


• There are two fundamental ways for user
to interface with the OS:
– Command interpreter
– Graphical user interface
• Command interpreter allows users to
directly enter commands to be performed
by the OS.
• GUI provides the interface with the OS via
graphical user interface.

64

32
8/28/2023

Command Interpreter
• Some OS includes CLI in the kernel.

• Some OS treat CLI as program that is


running when a job is initiated.

• The main function of CLI is to get and


execute the user level command.

• Example: rm file.txt

65

66

33
8/28/2023

Graphical user interface


• A strategy for interfacing with the OS is
through user friendly interface i.e., GUI.

• In this rather entering commands, user


employs a mouse based window and
menu driven desktop system.

• GUI firstly appeared in 1973 at Xerox Alto


computer.

67

68

34
8/28/2023

System Call
• System calls provide an interface to the
services available as by an OS.
• These calls are generally written in C/C++,
or some low-level language.
• Mostly accessed by Application Program
Interface (API)
• Common API is WIN32 API, POSIX API,
JAVA API etc.

69

Examples
Copy the content of one file to another file.

70

35
8/28/2023

System Call
• System calls provide an interface to the
services available as by an OS.
• These calls are generally written in C/C++,
or some low-level language.
• Mostly accessed by Application Program
Interface (API)
• Common API is WIN32 API, POSIX API,
JAVA API etc.

71

Types of system call

72

36
8/28/2023

Process control
• End, abort.

• Load, Execute.

• Create process, terminate process.


• Get process attribute, set process attribute

• Wait event, signal event


• Allocate and free memory.

73

File management
• Crete file, delete file

• Open file, Close file.

• Read, write, reposition.

• Get file attributes, set file attributes.

74

37
8/28/2023

Device management
• Request device, release device

• Read, write, reposition.

• Logically attach or detach device.

• Get device attributes, set device attributes.

75

Information management
• Get time or date, Set time or date

• Get system data, Set system data,

• Get process, file or device attributes

• Set process, file or device attributes

76

38
8/28/2023

Communication
• Create or delete communication
connections.

• Send, receive message

• Transfer status information

• Attach or detach remote devices

77

78

39
8/28/2023

System Programs
• System programs provide a convenient environment for
program development and execution. They can be divided
into:
– File manipulation
– Status information
– File modification
– Programming language support
– Program loading and execution
– Communications
– Application programs
• Most users’ view of the operation system is defined by
system programs, not the actual system calls

79

Operating System Structure


• OS provides interface
between user and
hardware. USERS

OPERATING
SYSTEM
• It is a system software.
SYSTEM HARDWARE

• It manages everything.

80

40
8/28/2023

Simple Structure
• Initially OS don’t have well defined
structure.
• Such systems started as small, simple,
and limited systems.
• It was written to provide the most
functionality in the least space.
• Example: MS-DOS

81

Structure
Application program

Resident System Program

MD-DOS device driver

ROM BIOS device driver

82

41
8/28/2023

Structure
Are able to access the basic I/O
routines to write directly to the
Application program
display and disk drives.

Resident System System programs like loader, linker,


Program etc.

MD-DOS device Contains device driver


driver

Contains ROM and BIOS device


ROM BIOS device driver driver information.

83

Limitations
• Interfaces are not well separated.

• Levels of functionality are not well


separated.

• No dual mode of operation.

• No hardware protection.

84

42
8/28/2023

Layered Approach
• Provides better control over the computer
and application.

• Developer has more freedom to develop


modular operating system.

• Provides better debugging and verification


facility.

85

Structure
Layer N user
interface

Layer 1

Layer 0
(H/W)

86

43
8/28/2023

Limitations
• Difficulty with defining the functionality of
layers.
• Requirement of CPU scheduler.

• More overheads during system calls.

87

Microkernels
• In the mid 1980’s, microkernel approach is adopted
to expand the UNIX kernel.
• In this all non-essential component of the kernel are
removed and implementing them as user-level
program.
• The size of kernel is reduced.
• It provides minimal process and memory
management.
• It provides communication between the client
program and various services that are running in
user space.

88

44
8/28/2023

Structure

Application
File system
Device User
Program driver
Mode

messages messages

Memory CPU
IPC Manage scheduli Kernel
ment ng Mode
Microkernel

Hardware

89

Pros & Cons


• It makes extending the OS easier.
• OS is easier to port from one hardware
design to another.
• It provides more security and reliability.
• If a service fails, the rest of the OS remain
untouched.
• Cons:
More system function overhead.

90

45
8/28/2023

Modules
• In this kernel has a set of core component.
• Core components link in additional
services via modules either at boot time or
run time.
• The idea for the design is for the kernel to
provide core services while other services
are implemented dynamically.

91

Structure

92

46
8/28/2023

Advantages
• More flexible than layered structure.
• More efficient than microkernel.

93

Hybrid system
• Mac OS X Structure (Mac book, Mac
desktop/Laptop)
• iOS (iPad/iPhone)
• Google Andriod (Mobile phone/Smart TVs)

94

47
8/28/2023

Mac OS X structure

95

Mac OS X structure
User Interface

Cocoa: Programming language


for application development.
BSD: command interface.

Kernel environment: consist of


microkernel and BSD.
Mach: Helpful in RPC and
memory management.
I/O Kit: development of device
driver.
Kernel Extensions: Dynamically
loadable modules.

96

48
8/28/2023

Architecture of Apple’s iOS

97

Architecture of Apple’s iOS


Cocoa: Programming language for
application development for mobile.
Provides services for graphics,
audio, and video.
Provides variety of services, like
cloud computing and DBMS.
Core OS based on kernel
environment.

98

49
8/28/2023

Android OS

99

Applications.

Application framework

ARE: Set of libraries and Dalvik virtual


machine.
DVM: designed for Android and is
optimized for mobile devices with
limited memory and CPU processing
capability.
Libraries: SQLite, webKit, media
framework etc.

Used for process, memory, and


device driver support.

100

50
8/28/2023

LINUX/WINDOWS
Operating System

101

History
• Linux is a modern, free operating system based on UNIX
standards.
• First developed as a small but self-contained kernel in 1991
by Linus Torvalds, with the major design goal of UNIX
compatibility.
• Its history has been one of collaboration by many users
from all around the world.
• It has been designed to run efficiently and reliably on
common PC hardware, but also runs on a variety of other
platforms.
• The core Linux operating system kernel is entirely original,
but it can run much existing free UNIX software, resulting in
an entire UNIX-compatible operating system free from
proprietary code.

102

51
8/28/2023

Components of a Linux System

103

Components of a Linux System


• Linux is composed of three main bodies of code: Kernel,
System Library & system utilities.

• The kernel is responsible for maintaining the


important abstractions of the operating system
– Kernel code executes in kernel mode with full access
to all the physical resources of the computer.
– All kernel code and data structures are kept in the
same single address space.

104

52
8/28/2023

Components of a Linux System


 The system libraries define a standard set of
functions through which applications interact with
the kernel, and which implement much of the
operating-system functionality that does not need
the full privileges of kernel code

 The system utilities perform individual


specialized management tasks

105

LINUX Startup stages


• Press the power button on your system, and
after few moments you see the Linux login
prompt.
• Have you ever wondered what happens
behind the scenes from the time you press
the power button until the Linux login prompt
appears?
• The following are the 6 high level stages of a
typical Linux boot process.

106

53
8/28/2023

Linux OS startup stages

107

LINUX VS WINDOWS NT

108

54
8/28/2023

LINUX VS WINDOWS NT

109

Questions
• How to install an operating system?
• What is booting?
• What is difference between Linux and Windows operating
system.
• Which file system is used for LINUX and Windows?
• What is difference between Volatile and Non-volatile storage
media?
• What is the directory structure of Linux and Windows
operating system?
• Difference between user and kernel mode of operating
system.
• Why protection and security is important for OS?

110

55
8/28/2023

Thank you

111

56

You might also like