UNIT-I Operating System - Compatibility Mode
UNIT-I Operating System - Compatibility Mode
Operating System
Introduction (UNIT I)
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
2
8/28/2023
efficiency convenience
3
8/28/2023
Abstract view of OS
User User User User Program
1 2 3 N interface
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.
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
12
6
8/28/2023
13
14
7
8/28/2023
15
Integrated
Third 1965-80 Multiprogramming
Circuits (IC)
Large Scale
Fourth Since 1980 PC
Integration
16
8
8/28/2023
17
User Process
User
Mode
User Process Calls system Return from
(bit=1)
executing call system call
18
9
8/28/2023
19
20
10
8/28/2023
21
22
11
8/28/2023
• It is sometime costly.
• The other jobs will have to wait for an
unknown time if any job fails.
23
24
12
8/28/2023
25
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
27
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
31
32
16
8/28/2023
Advantages:
33
Disadvantages:
34
17
8/28/2023
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.
36
18
8/28/2023
37
Disadvantages:
– Use heavy system resources:
– Complex Algorithms:
– Specific Device driver and interrupt signals
38
19
8/28/2023
39
Types of COS
• Asymmetric Clustering:
– In this, one machine is in hot standby mode
while the other is running the applications.
40
20
8/28/2023
• Symmetric Clustering:
41
• Parallel Clustering:
42
21
8/28/2023
43
44
22
8/28/2023
45
46
23
8/28/2023
47
Advantages
Increased throughput.
48
24
8/28/2023
Types
• Asymmetric multiprocessing:
49
• Symmetric multiprocessing:
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
54
27
8/28/2023
55
56
28
8/28/2023
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
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
63
64
32
8/28/2023
Command Interpreter
• Some OS includes CLI in the kernel.
• Example: rm file.txt
65
66
33
8/28/2023
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
72
36
8/28/2023
Process control
• End, abort.
• Load, Execute.
73
File management
• Crete file, delete file
74
37
8/28/2023
Device management
• Request device, release device
75
Information management
• Get time or date, Set time or date
76
38
8/28/2023
Communication
• Create or delete communication
connections.
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
• 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
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.
83
Limitations
• Interfaces are not well separated.
• No hardware protection.
84
42
8/28/2023
Layered Approach
• Provides better control over the computer
and application.
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.
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
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
96
48
8/28/2023
97
98
49
8/28/2023
Android OS
99
Applications.
Application framework
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
103
104
52
8/28/2023
105
106
53
8/28/2023
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