SlideShare a Scribd company logo
General Information
• Class time (NC 141)
Mon (8.00-10.00)
Tue (12.00-13.00)
• Lab Tutorial (Mon, 2.00pm-4.00pm) Room 119
• Grading Policy
– Midsem – 30%
– Endsem – 50%
– Internal – 20% (Tutorial, Class tests, Scribe and Attendance)
• http://cse.iitkgp.ac.in/~bivasm/OS2016.html
• Text Books / References :
1. Silbersehatz A. and Galvin P., “Operating System Concepts”, Wiley.
2. Tanenbaum A.S., “Operating System Design & Implementation”,
Practice Hall NJ.
3. Stalling, William, “Operating Systems”, Maxwell McMillan International
Editions, 1992.
4. Dietel H. N., “An Introduction to Operating Systems”, Addison Wesley.
General Information
What is an Operating System?
Why do we need an Operating
System?
Hardware (resource)
CPU Memory
Disk
Input/
Output
Write a program to sort n elements
What is an Operating System?
(User’s view)
– A program that acts as an intermediary between a
user of a computer and the computer hardware
– Defines an interface for the user to use services
provided by the system
– Creates an environment for the user
• Abstract Machine
– Hides complex details of the underlying hardware
– Provides common API to applications and services
– Simplifies application writing
• Command Interpreter
– Part of a OS that understands and executes
commands that are entered interactively by a
human being or from a program
– Shell
What is an Operating System?
(User’s view)
Operating
System
Video Card
CPU
Monitor Printer
Disk
Memory
Network
Application
Shell
What is an Operating System?
(User’s view)
Why is abstraction important?
• Without OSs and abstract interfaces, application writers must
program all device access directly
– load device command codes into device registers
– understand physical characteristics of the devices
• Applications suffer!
– very complicated maintenance and upgrading
– no portability
What Operating Systems Do
(User’s view)
Depends on the point of view
• Single user system
• Users want convenience, ease of use
– Don’t care about resource utilization
Optimized for single user
experience
What Operating Systems Do
(User’s view)
Depends on the point of view
• Shared computer such as mainframe must keep
all users happy
• Response time minimum
– Keep all the users happy Shared CPU,
memory
• OS is a resource allocator
– Manages all resources
– Decides between conflicting requests for
efficient and fair resource use
• OS is a control program
– Controls execution of programs to prevent
errors and improper use of the computer
What Operating Systems Do
(Systems view)
Concept of Process
• Process
– Program loaded in memory and in execution
• Program is a passive entity
• Process is an active entity
12
Types of Systems
• Batch Systems
– Multiple jobs, but only one job in memory at one
time and executed (till completion) before the next
one starts
Operating system
User program
Jobs waiting
Types of Systems
• Multiprogrammed Systems
– Multiple jobs in memory, CPU is
multiplexed between them
– Single user cannot keep CPU and
I/O devices busy at all times
– When it has to wait (for I/O for
example), OS switches to
another job
– Multiprogramming organizes
jobs (code and data) so CPU
always has one to execute
– A subset of total jobs in system
is kept in memory
– One job selected and run via job
scheduling
• Effective resource utilization
• Poor user experience
• Time-sharing Systems (multitasking)
logical extension of multiprogramming in which CPU switches jobs so
frequently that users can interact with each job while it is running, creating
interactive computing
– Response time should be < 1 second
– Each user has at least one program executing in memory
– If several jobs ready to run at the same time  CPU scheduling
Types of Systems
Low Response
time
Low Response
time
• OS is a resource allocator
– Manages all resources
– Decides between conflicting requests for
efficient and fair resource use
• OS is a control program
– Controls execution of programs to prevent
errors and improper use of the computer
What Operating Systems Do
(Systems view)
Manage resources
CPU
1. Share the CPU with several users
2. Decide when to allocate CPU to which user
(CPU scheduling)
3. Ensure fair user experience
Job 1
Job 2
Job 3
1. Share memory with several different users
2. Should not overlap
3. Ensure protection
Memory
• OS is a resource allocator
– Manages all resources
– Decides between conflicting requests for
efficient and fair resource use
• OS is a control program
– Controls execution of programs to prevent
errors and improper use of the computer
What Operating Systems Do
(Systems view)
Control program (Protection)
• Multiple jobs are sharing the common resource
– With sharing, many processes could be adversely affected by a bug in
one program
– Make sure that error in one program could cause problems only for that
program
– A job gets stuck in an infinite loop
• Prevent correct operations of other jobs
– One erroneous program might modify another program, even operating
system
CPU
(J1)
J2, J3
waiting
Incorrect program cannot
cause other programs to
execute incorrectly
Role of Operating system
• Computer system can be divided into four components:
– Hardware – provides basic computing resources
• CPU, memory, I/O devices
– Application programs – define the ways in which the system
resources are used to solve the computing problems of the
users
• Word processors, compilers, web browsers, database systems, video
games
– Users
• People, machines, other computers
– Operating system
• Controls and coordinates use of hardware among various applications
and users
Four Components of a Computer System
Execution of OS
• Interrupt driven
• Until an interrupt comes, OS remains Idle
• Interrupt/trap
– Possibility 1---- error
– Possibility 2
• User program invokes OS code by generating Interrupt,
system call
• To perform some task reserved for OS
• Accessing I/O devices (read, write files)
ISR
Providing abstraction via system calls
Operating
System
Video Card
CPU
Monitor Printer
Disk
Memory
Network
Application
System Calls: fork(), wait(), read(), open(), write(), mkdir(), kill() ...
Device
Mgmt File System Network
Comm.
Process
Mgmt
Protection Security
23
Kernel
Execution of OS
• Interrupt driven
• Until an interrupt comes, OS remains Idle
• User program invokes OS code by generating
Interrupt, system call
– To perform some task reserved for OS
– Accessing I/O devices (read, write files)
• Any difference in execution between user and
OS program?
Operating-System Operations
• Must distinguish between the use level code
and OS code
– User mode and kernel mode
– Mode bit provided by hardware
• Provides ability to distinguish when system is running user
code or kernel code
• System call changes mode to kernel, return from call
resets it to user
System boot
Hardware starts kernel mode
Load Operating system
Start user application
Switch to User mode
Whenever Trap or interrupt occurs, hardware switches to
user to kernel mode
Some instructions designated as
privileged, only executable in kernel
mode
Providing abstraction via system calls
Operating
System
Video Card
CPU
Monitor Printer
Disk
Memory
Network
Application
System Calls: fork(), wait(), read(), open(), write(), mkdir(), kill() ...
Device
Mgmt File System Network
Comm.
Process
Mgmt
Protection Security
28
• OS is a resource allocator
– Manages all resources
– Decides between conflicting requests for
efficient and fair resource use
• OS is a control program
– Controls execution of programs to prevent
errors and improper use of the computer
What Operating Systems Do
(Systems view)
Control program (Protection)
• Multiple jobs are sharing the common resource
– With sharing, many processes could be adversely affected by a bug in
one program
– Make sure that error in one program could cause problems only for that
program
– A job gets stuck in an infinite loop
• Prevent correct operations of other jobs
– One erroneous program might modify another program, even operating
system
CPU
(J1)
J2, J3
waiting
Incorrect program cannot
cause other programs to
execute incorrectly
• Software error creates exception or trap
• Division by zero, request for operating system service, setting timer
• Restricts user process from executing privilege instruction
Dual-mode operation allows OS to protect
itself and other system components
Privilege instructions
• E.g. Segmentation fault!
A1
A2
computation I/O computation
Time
U (A1)
Mode K
Initiates
I/O
Schedules A2
U (A2)
computation
K
Schedules A1
K U (A1)
Mode change
What is the difference between
Privileged Instruction and System call?
• Privileged instructions can only be performed in Kernel Mode
and users can never operate in Kernel mode directly. A system
call could initiate execution of privileged instructions by the
Kernel though, but the Kernel will be the decicion maker - not
the user.
• What is a privileged instruction?
• 1. ) The instructions which are executed and can be made to
run only in kernel mode. Then, these types of instructions are
known as Privileged Instructions. The instructions which are
executed and can be made to run only in User mode. Then,
these types of instructions are known as Non-Privileged
Instructions.
System calls
Operating
System
Video Card
CPU
Monitor Printer
Disk
Memory
Network
Application
System Calls: fork(), wait(), read(), open(), write(), mkdir(), kill() ...
Device
Mgmt File System Network
Comm.
Process
Mgmt
Protection Security
35
Win 32
POSIX
JVM
Standard C Library Example
• C program invoking printf() library call,
which calls write() system call
Resources Managed by OS
• Physical
– CPU, Memory, Disk, I/O Devices like keyboard,
monitor, printer
• Logical
– Process, File, …
Hence we have
1. Process management
2. Memory management
3. File management
4. I/O management
Process Management
• A process is a program in execution. Program is a passive
entity, process is an active entity.
• Process needs resources to accomplish its task
– CPU time
• Representation of process
– Process has one program counter specifying location of next
instruction to execute
– Data structure (stores information of a process)
• Many processes may be associated with the same program
• Typically system has many processes
– some user processes,
– some operating system processes
• Life cycle of a process
– States
– Arrival, Computation, I/O, I/O completion, termination
Process Management Activities
• Creating and deleting both user and system
processes
• Suspending and resuming processes
• Process scheduling
• Providing mechanisms for process synchronization
• Providing mechanisms for process communication
• Providing mechanisms for deadlock handling
The operating system is responsible for the following activities in
connection with process management:
P1
P2
R1
R2
R1
R2
P1
P2
Memory Management
• All instructions and data in memory in order to execute
– Translate the logical address to physical address
• Process terminates => MMU declares that the memory space is available
• Multiprogramming: Memory management manages several processes in
memory
– Optimizing CPU utilization and computer response to users
• Ensure memory protection
– Track illegal address
• Memory management activities
– Keeping track of which parts of memory are currently being used and by which
process
– Allocating and deallocating memory space as needed
• Introduces Virtual memory
– If the process size is bigger than the RAM size
• Hardware support
Process
Memory
Management Unit
Logical address Physical address
CPU
File Management
• OS provides uniform, logical view of information storage
– Abstracts physical properties to logical storage unit - File
– File => Collection of related information defined by the creator
– Each medium is controlled by device (i.e., disk drive, tape drive)
• Varying properties include access speed, capacity, data-
transfer rate, access method (sequential or random)
User
Files (user’s
view)
Disk
(sector,
track)
Device Driver
Physical media
Mapping
File Management
• OS provides uniform, logical view of information storage
– Abstracts physical properties to logical storage unit - file
– Each medium is controlled by device (i.e., disk drive, tape drive)
• Varying properties include access speed, capacity, data-transfer rate, access
method (sequential or random)
• OS implements the abstract concept of file by managing mass
storage media (disk etc) and devices that control them
• Files usually organized into directories
• Access control on most systems to determine who can access
what
• File-System management
– Creating and deleting files and directories
– Primitives to manipulate files and dirs
– Mapping files onto secondary storage
• Usually disks used to store data that does not fit in
main memory or data that must be kept for a
“long” period of time
– Most of the programs are stored on disk
• Proper management is of central importance
• Entire speed of computer operation depends on
disk subsystem and its algorithms
• OS activities
– Storage allocation (logical blocks)
– Free-space management
– Disk scheduling
Disk Management
I/O Subsystem
• One purpose of OS is to hide peculiarities of hardware
devices from the user
• I/O subsystem responsible for
– Memory management of I/O including buffering (storing data
temporarily while it is being transferred), caching (storing parts of
data in faster storage for performance)
– General device-driver interface
– Drivers for specific hardware devices
I/O devices
Device Drivers
I/O subsystem (general interface)
OS design and structure
• Large complex system
– Designed carefully
• if it is to function properly
• Modified easily
• Common approach
– Partition the tasks into small
components/modules
– Each module must accomplish some specified task
UNIX
• UNIX – consists of two separable parts
– Systems programs
– The kernel
• Consists of everything below the system-call
interface and above the physical hardware
• Provides the file system, CPU scheduling, memory
management, and other operating-system
functions; a large number of functions for one level
Traditional UNIX System Structure
Evolves over
time
MS-DOS
• Application programs can
directly access I/O
routines
• Makes the system
vulnerable
• No mode bit
• Limitations in
hardware
• Intel 8088

More Related Content

Similar to ayq.ppt

Module 1 Introduction.ppt
Module 1 Introduction.pptModule 1 Introduction.ppt
Module 1 Introduction.ppt
shreesha16
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdf
nikhil287188
 
os unit 1 (2).pptx. introduction to operating systems
os unit 1 (2).pptx. introduction to operating systemsos unit 1 (2).pptx. introduction to operating systems
os unit 1 (2).pptx. introduction to operating systems
ssuser6aef00
 
LEC 1.pptx
LEC 1.pptxLEC 1.pptx
LEC 1.pptx
GulRana13
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecture
jeetesh036
 
Introduction and Types of Operating System.pptx
Introduction and Types of Operating System.pptxIntroduction and Types of Operating System.pptx
Introduction and Types of Operating System.pptx
aparna14patil
 
chapter1.ppt
chapter1.pptchapter1.ppt
chapter1.ppt
UsamaKhan987353
 
operating-system-objectives-and-functions-d2.ppt
operating-system-objectives-and-functions-d2.pptoperating-system-objectives-and-functions-d2.ppt
operating-system-objectives-and-functions-d2.ppt
senthilnathans2015
 
operating systemPPT sfgSun< Shg<SKJ <JSg
operating systemPPT sfgSun< Shg<SKJ <JSgoperating systemPPT sfgSun< Shg<SKJ <JSg
operating systemPPT sfgSun< Shg<SKJ <JSg
Dashrath5
 
Unit I OS.pdf
Unit I OS.pdfUnit I OS.pdf
Unit I OS.pdf
UmaYadav45
 
Os1
Os1Os1
Operting system
Operting systemOperting system
Operting system
KAnurag2
 
Ch1
Ch1Ch1
What is an Operating Systems?
What is an Operating Systems?What is an Operating Systems?
What is an Operating Systems?
JayaKamal
 
Introduction to OS.pptx
Introduction to OS.pptxIntroduction to OS.pptx
Introduction to OS.pptx
taruian
 
Unit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptxUnit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptx
ThamaraiselviAvinuty
 
OS chapter 1.pptx
OS chapter 1.pptxOS chapter 1.pptx
OS chapter 1.pptx
StBulteBelay
 
OS chapter 1.pptx
OS chapter 1.pptxOS chapter 1.pptx
OS chapter 1.pptx
StBulteBelay
 
Ch1 - OS.pdf
Ch1 - OS.pdfCh1 - OS.pdf
Ch1 - OS.pdf
OmarKamil1
 
unit1 part1.ppt
unit1 part1.pptunit1 part1.ppt
unit1 part1.ppt
suresh554942
 

Similar to ayq.ppt (20)

Module 1 Introduction.ppt
Module 1 Introduction.pptModule 1 Introduction.ppt
Module 1 Introduction.ppt
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdf
 
os unit 1 (2).pptx. introduction to operating systems
os unit 1 (2).pptx. introduction to operating systemsos unit 1 (2).pptx. introduction to operating systems
os unit 1 (2).pptx. introduction to operating systems
 
LEC 1.pptx
LEC 1.pptxLEC 1.pptx
LEC 1.pptx
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecture
 
Introduction and Types of Operating System.pptx
Introduction and Types of Operating System.pptxIntroduction and Types of Operating System.pptx
Introduction and Types of Operating System.pptx
 
chapter1.ppt
chapter1.pptchapter1.ppt
chapter1.ppt
 
operating-system-objectives-and-functions-d2.ppt
operating-system-objectives-and-functions-d2.pptoperating-system-objectives-and-functions-d2.ppt
operating-system-objectives-and-functions-d2.ppt
 
operating systemPPT sfgSun< Shg<SKJ <JSg
operating systemPPT sfgSun< Shg<SKJ <JSgoperating systemPPT sfgSun< Shg<SKJ <JSg
operating systemPPT sfgSun< Shg<SKJ <JSg
 
Unit I OS.pdf
Unit I OS.pdfUnit I OS.pdf
Unit I OS.pdf
 
Os1
Os1Os1
Os1
 
Operting system
Operting systemOperting system
Operting system
 
Ch1
Ch1Ch1
Ch1
 
What is an Operating Systems?
What is an Operating Systems?What is an Operating Systems?
What is an Operating Systems?
 
Introduction to OS.pptx
Introduction to OS.pptxIntroduction to OS.pptx
Introduction to OS.pptx
 
Unit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptxUnit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptx
 
OS chapter 1.pptx
OS chapter 1.pptxOS chapter 1.pptx
OS chapter 1.pptx
 
OS chapter 1.pptx
OS chapter 1.pptxOS chapter 1.pptx
OS chapter 1.pptx
 
Ch1 - OS.pdf
Ch1 - OS.pdfCh1 - OS.pdf
Ch1 - OS.pdf
 
unit1 part1.ppt
unit1 part1.pptunit1 part1.ppt
unit1 part1.ppt
 

Recently uploaded

官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
enizeyimana36
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
sachin chaurasia
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
IJNSA Journal
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
Aditya Rajan Patra
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
NazakatAliKhoso2
 

Recently uploaded (20)

官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
 

ayq.ppt

  • 1. General Information • Class time (NC 141) Mon (8.00-10.00) Tue (12.00-13.00) • Lab Tutorial (Mon, 2.00pm-4.00pm) Room 119
  • 2. • Grading Policy – Midsem – 30% – Endsem – 50% – Internal – 20% (Tutorial, Class tests, Scribe and Attendance) • http://cse.iitkgp.ac.in/~bivasm/OS2016.html • Text Books / References : 1. Silbersehatz A. and Galvin P., “Operating System Concepts”, Wiley. 2. Tanenbaum A.S., “Operating System Design & Implementation”, Practice Hall NJ. 3. Stalling, William, “Operating Systems”, Maxwell McMillan International Editions, 1992. 4. Dietel H. N., “An Introduction to Operating Systems”, Addison Wesley. General Information
  • 3. What is an Operating System?
  • 4. Why do we need an Operating System? Hardware (resource) CPU Memory Disk Input/ Output Write a program to sort n elements
  • 5. What is an Operating System? (User’s view) – A program that acts as an intermediary between a user of a computer and the computer hardware – Defines an interface for the user to use services provided by the system – Creates an environment for the user
  • 6. • Abstract Machine – Hides complex details of the underlying hardware – Provides common API to applications and services – Simplifies application writing • Command Interpreter – Part of a OS that understands and executes commands that are entered interactively by a human being or from a program – Shell What is an Operating System? (User’s view)
  • 8. Why is abstraction important? • Without OSs and abstract interfaces, application writers must program all device access directly – load device command codes into device registers – understand physical characteristics of the devices • Applications suffer! – very complicated maintenance and upgrading – no portability
  • 9. What Operating Systems Do (User’s view) Depends on the point of view • Single user system • Users want convenience, ease of use – Don’t care about resource utilization Optimized for single user experience
  • 10. What Operating Systems Do (User’s view) Depends on the point of view • Shared computer such as mainframe must keep all users happy • Response time minimum – Keep all the users happy Shared CPU, memory
  • 11. • OS is a resource allocator – Manages all resources – Decides between conflicting requests for efficient and fair resource use • OS is a control program – Controls execution of programs to prevent errors and improper use of the computer What Operating Systems Do (Systems view)
  • 12. Concept of Process • Process – Program loaded in memory and in execution • Program is a passive entity • Process is an active entity 12
  • 13. Types of Systems • Batch Systems – Multiple jobs, but only one job in memory at one time and executed (till completion) before the next one starts Operating system User program Jobs waiting
  • 14. Types of Systems • Multiprogrammed Systems – Multiple jobs in memory, CPU is multiplexed between them – Single user cannot keep CPU and I/O devices busy at all times – When it has to wait (for I/O for example), OS switches to another job – Multiprogramming organizes jobs (code and data) so CPU always has one to execute – A subset of total jobs in system is kept in memory – One job selected and run via job scheduling • Effective resource utilization • Poor user experience
  • 15. • Time-sharing Systems (multitasking) logical extension of multiprogramming in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing – Response time should be < 1 second – Each user has at least one program executing in memory – If several jobs ready to run at the same time  CPU scheduling Types of Systems Low Response time Low Response time
  • 16. • OS is a resource allocator – Manages all resources – Decides between conflicting requests for efficient and fair resource use • OS is a control program – Controls execution of programs to prevent errors and improper use of the computer What Operating Systems Do (Systems view)
  • 17. Manage resources CPU 1. Share the CPU with several users 2. Decide when to allocate CPU to which user (CPU scheduling) 3. Ensure fair user experience Job 1 Job 2 Job 3 1. Share memory with several different users 2. Should not overlap 3. Ensure protection Memory
  • 18. • OS is a resource allocator – Manages all resources – Decides between conflicting requests for efficient and fair resource use • OS is a control program – Controls execution of programs to prevent errors and improper use of the computer What Operating Systems Do (Systems view)
  • 19. Control program (Protection) • Multiple jobs are sharing the common resource – With sharing, many processes could be adversely affected by a bug in one program – Make sure that error in one program could cause problems only for that program – A job gets stuck in an infinite loop • Prevent correct operations of other jobs – One erroneous program might modify another program, even operating system CPU (J1) J2, J3 waiting Incorrect program cannot cause other programs to execute incorrectly
  • 20. Role of Operating system • Computer system can be divided into four components: – Hardware – provides basic computing resources • CPU, memory, I/O devices – Application programs – define the ways in which the system resources are used to solve the computing problems of the users • Word processors, compilers, web browsers, database systems, video games – Users • People, machines, other computers – Operating system • Controls and coordinates use of hardware among various applications and users
  • 21. Four Components of a Computer System
  • 22. Execution of OS • Interrupt driven • Until an interrupt comes, OS remains Idle • Interrupt/trap – Possibility 1---- error – Possibility 2 • User program invokes OS code by generating Interrupt, system call • To perform some task reserved for OS • Accessing I/O devices (read, write files) ISR
  • 23. Providing abstraction via system calls Operating System Video Card CPU Monitor Printer Disk Memory Network Application System Calls: fork(), wait(), read(), open(), write(), mkdir(), kill() ... Device Mgmt File System Network Comm. Process Mgmt Protection Security 23 Kernel
  • 24. Execution of OS • Interrupt driven • Until an interrupt comes, OS remains Idle • User program invokes OS code by generating Interrupt, system call – To perform some task reserved for OS – Accessing I/O devices (read, write files) • Any difference in execution between user and OS program?
  • 25. Operating-System Operations • Must distinguish between the use level code and OS code – User mode and kernel mode – Mode bit provided by hardware • Provides ability to distinguish when system is running user code or kernel code • System call changes mode to kernel, return from call resets it to user
  • 26. System boot Hardware starts kernel mode Load Operating system Start user application Switch to User mode Whenever Trap or interrupt occurs, hardware switches to user to kernel mode
  • 27. Some instructions designated as privileged, only executable in kernel mode
  • 28. Providing abstraction via system calls Operating System Video Card CPU Monitor Printer Disk Memory Network Application System Calls: fork(), wait(), read(), open(), write(), mkdir(), kill() ... Device Mgmt File System Network Comm. Process Mgmt Protection Security 28
  • 29. • OS is a resource allocator – Manages all resources – Decides between conflicting requests for efficient and fair resource use • OS is a control program – Controls execution of programs to prevent errors and improper use of the computer What Operating Systems Do (Systems view)
  • 30. Control program (Protection) • Multiple jobs are sharing the common resource – With sharing, many processes could be adversely affected by a bug in one program – Make sure that error in one program could cause problems only for that program – A job gets stuck in an infinite loop • Prevent correct operations of other jobs – One erroneous program might modify another program, even operating system CPU (J1) J2, J3 waiting Incorrect program cannot cause other programs to execute incorrectly
  • 31. • Software error creates exception or trap • Division by zero, request for operating system service, setting timer • Restricts user process from executing privilege instruction Dual-mode operation allows OS to protect itself and other system components Privilege instructions • E.g. Segmentation fault!
  • 32. A1 A2 computation I/O computation Time U (A1) Mode K Initiates I/O Schedules A2 U (A2) computation K Schedules A1 K U (A1) Mode change
  • 33. What is the difference between Privileged Instruction and System call?
  • 34. • Privileged instructions can only be performed in Kernel Mode and users can never operate in Kernel mode directly. A system call could initiate execution of privileged instructions by the Kernel though, but the Kernel will be the decicion maker - not the user. • What is a privileged instruction? • 1. ) The instructions which are executed and can be made to run only in kernel mode. Then, these types of instructions are known as Privileged Instructions. The instructions which are executed and can be made to run only in User mode. Then, these types of instructions are known as Non-Privileged Instructions.
  • 35. System calls Operating System Video Card CPU Monitor Printer Disk Memory Network Application System Calls: fork(), wait(), read(), open(), write(), mkdir(), kill() ... Device Mgmt File System Network Comm. Process Mgmt Protection Security 35 Win 32 POSIX JVM
  • 36. Standard C Library Example • C program invoking printf() library call, which calls write() system call
  • 37. Resources Managed by OS • Physical – CPU, Memory, Disk, I/O Devices like keyboard, monitor, printer • Logical – Process, File, … Hence we have 1. Process management 2. Memory management 3. File management 4. I/O management
  • 38. Process Management • A process is a program in execution. Program is a passive entity, process is an active entity. • Process needs resources to accomplish its task – CPU time • Representation of process – Process has one program counter specifying location of next instruction to execute – Data structure (stores information of a process) • Many processes may be associated with the same program • Typically system has many processes – some user processes, – some operating system processes • Life cycle of a process – States – Arrival, Computation, I/O, I/O completion, termination
  • 39. Process Management Activities • Creating and deleting both user and system processes • Suspending and resuming processes • Process scheduling • Providing mechanisms for process synchronization • Providing mechanisms for process communication • Providing mechanisms for deadlock handling The operating system is responsible for the following activities in connection with process management: P1 P2 R1 R2 R1 R2 P1 P2
  • 40. Memory Management • All instructions and data in memory in order to execute – Translate the logical address to physical address • Process terminates => MMU declares that the memory space is available • Multiprogramming: Memory management manages several processes in memory – Optimizing CPU utilization and computer response to users • Ensure memory protection – Track illegal address • Memory management activities – Keeping track of which parts of memory are currently being used and by which process – Allocating and deallocating memory space as needed • Introduces Virtual memory – If the process size is bigger than the RAM size • Hardware support Process Memory Management Unit Logical address Physical address CPU
  • 41. File Management • OS provides uniform, logical view of information storage – Abstracts physical properties to logical storage unit - File – File => Collection of related information defined by the creator – Each medium is controlled by device (i.e., disk drive, tape drive) • Varying properties include access speed, capacity, data- transfer rate, access method (sequential or random) User Files (user’s view) Disk (sector, track) Device Driver Physical media Mapping
  • 42. File Management • OS provides uniform, logical view of information storage – Abstracts physical properties to logical storage unit - file – Each medium is controlled by device (i.e., disk drive, tape drive) • Varying properties include access speed, capacity, data-transfer rate, access method (sequential or random) • OS implements the abstract concept of file by managing mass storage media (disk etc) and devices that control them • Files usually organized into directories • Access control on most systems to determine who can access what • File-System management – Creating and deleting files and directories – Primitives to manipulate files and dirs – Mapping files onto secondary storage
  • 43. • Usually disks used to store data that does not fit in main memory or data that must be kept for a “long” period of time – Most of the programs are stored on disk • Proper management is of central importance • Entire speed of computer operation depends on disk subsystem and its algorithms • OS activities – Storage allocation (logical blocks) – Free-space management – Disk scheduling Disk Management
  • 44. I/O Subsystem • One purpose of OS is to hide peculiarities of hardware devices from the user • I/O subsystem responsible for – Memory management of I/O including buffering (storing data temporarily while it is being transferred), caching (storing parts of data in faster storage for performance) – General device-driver interface – Drivers for specific hardware devices I/O devices Device Drivers I/O subsystem (general interface)
  • 45. OS design and structure • Large complex system – Designed carefully • if it is to function properly • Modified easily • Common approach – Partition the tasks into small components/modules – Each module must accomplish some specified task
  • 46. UNIX • UNIX – consists of two separable parts – Systems programs – The kernel • Consists of everything below the system-call interface and above the physical hardware • Provides the file system, CPU scheduling, memory management, and other operating-system functions; a large number of functions for one level
  • 47. Traditional UNIX System Structure Evolves over time
  • 48. MS-DOS • Application programs can directly access I/O routines • Makes the system vulnerable • No mode bit • Limitations in hardware • Intel 8088