SlideShare a Scribd company logo
I/O Devices Protection
Internal topic
Presented by Muhammad Abdullah
Roll no. BSF2103722
Topic
no.1
Introduction:
 I/O protection in operating systems is an essential mechanism to provide
secure access to I/O devices from user and kernel modes
 In most operating systems, I/O protection is implemented using the concept
of I/O privilege levels or rings. The processor and the operating system define
four different privilege levels, also called rings, where ring 0 is the highest
and contains the kernel mode, while ring 3 is the lowest and contains the user
mode.
I/O Protection Issued:
 An I/O instruction issued by a process in user mode has to be executed with a
privileged instruction in the kernel mode. The kernel mode is the only ring
that can directly access the hardware. The operating system sets up I/O
privilege levels to control access to I/O devices by processes running at
different privilege levels.
Importance:
 The protection is provided through hardware-based features like device
controllers, memory-mapped I/O, and system calls, used in the operating
system to provide access to I/O devices.
 In I/O protection, every I/O device is allocated a unique I/O space or I/O
ports that are accessible only by the kernels to avoid unauthorized access.
The operating system maintains a mapping between the device drivers and
memory buffers, and the device controllers are programmed to treat all I/O
addresses generated by user processes as invalid.
 The operating system also provides mechanisms such as input and output
permission bits that restrict the access to I/O devices for all the user
processes. The permission bits help ensure that no unauthorized process can
gain access to the device.
 The I/O protection in modern operating systems also incorporates Virtual
Memory Management (VMM) technology with page-level protection. With this
technology, the kernel provides a different map of the physical memory in
each process's virtual address space, and every process can access a unique
copy of the data.
Function:
 The primary function of I/O protection in operating systems is to provide a
secure layer of access control to Input/output (I/O) devices, ensuring that
only authorized processes and users can access I/O devices. Here are some of
the main functions of I/O protection:
1. Prevent unauthorized access:
 I/O protection mechanisms ensure that only authenticated and authorized
processes can interact with I/O devices. Unauthorized access can lead to data
theft, data loss, or other security breaches
2. Maintain data integrity:
 I/O protection ensures that data being read from or written to I/O devices is
protected from unauthorized access, unauthorized modification or deletion,
and corruption.
3. Provide isolation:
 By implementing I/O protection, processes are prevented from accessing
other processes' I/O data, enhancing security and preventing critical data
breaches.
4. Prevent system crashes:
 The proper protection of I/O devices prevents device drivers from accessing
memory outside their allocated memory space, thereby preventing system
crashes.
5. Support multi-user environment:
 I/O protection plays a crucial role in supporting a multi-user operating
system environment by ensuring that each user can only access and
communicate with the devices authorized for their account
6. Support virtual machines:
 In virtual machine environments, I/O protection mechanisms ensure that
virtual machine guests cannot access I/O devices other than those allowed by
their virtual machine host.
Summary:
 In summary, I/O protection mechanisms are essential in operating systems to
control access to I/O devices and to prevent unauthorized access, thereby
ensuring the security of the system.
Process Synchronization
External topic
Presented by Muhammad Abdullah
Roll no. Bsf2103722
Topic
no.2
Introduction
 Synchronization refers to the coordination of activities or processes to ensure
that they happen in the correct order and at the right time. In computing,
synchronization is particularly important when multiple processes or threads
are accessing shared resources, as it ensures that all processes have access to
the resource at the correct time and in the correct order.
 In an operating system, process synchronization refers to the techniques and
mechanisms used to ensure that multiple processes or threads do not
interfere with each other and that they access shared resources in a
coordinated and controlled manner. Some common examples of shared
resources include memory, files, and hardware devices.
Example:
 Where two processes try to update the same variable in memory. If both
processes attempt to update the variable at the same time, its values can
become inconsistent or corrupt. To avoid this, synchronization mechanisms
can be used to enforce mutual exclusion and ensure that only one process can
update the variable at a time. One way to achieve this is using a mutex. In
this case, the variable and a corresponding mutex are shared between the
two processes. Before accessing the variable, each process checks if the
mutex is locked by another process, and if it is, it waits until the mutex is
released. Once the mutex is released, the process can acquire it, update the
variable, and release the mutex to allow other processes to access it.
Example:
 Here's an example in pseudocode:
Process 1:
acquire(mutex)
variable = variable + 1
release(mutex)
Process 2:
acquire(mutex)
variable = variable – 1
release(mutex)
In this example, each process acquires the mutex and updates the variable inside a critical
section. The mutex ensures that only one process can update the variable at a time,
preventing any race conditions or inconsistencies. This is just one example of how
synchronization can be used to ensure correct and efficient execution of processes in an
operating system. Other synchronization mechanisms like semaphores, monitors, and
barriers can also be used to manage access to shared resources and prevent conflicts
between processes
There are several common techniques for
achieving synchronization in computer
systems. These include
1. locking:
 A lock is a synchronization mechanism that ensures that only one process or
thread can access a shared resource at a time. Locking is typically
implemented using mutexes or semaphores to ensure that the resource is
properly protected
2. Atomic operations:
 An atomic operation is an operation that is indivisible and uninterruptible.
Atomic operations are typically used to ensure that multiple processes do not
interfere with each other when accessing the same memory location.
3. Barrier synchronization:
 A barrier is a synchronization mechanism that ensures that all processes or
threads have reached a certain point in their execution before continuing.
Barriers are commonly used in parallel processing to ensure that all processes
have completed their work before continuing to the next phase of processing
4. Message passing:
 Message passing is a communication mechanism where processes or threads
send messages to each other to coordinate their activities. This mechanism is
commonly used in distributed systems to ensure that all processes are aware
of each other's activities and progress.
5. Semaphores:
 A semaphore is a data structure that is used to control access to shared
resources. It can be used to ensure that only one process or thread can access
a shared resource at any given time. Semaphores can be either binary or
counting, and they can be used to enforce mutual exclusion, synchronization,
and resource allocation.
6. Mutexes:
 A mutex is a programming object used to protect shared resources by creating
a critical section. Only one thread can access the shared resource when the
mutex is locked. If another thread tries to access the same resource while it
is locked, it will wait until the mutex is released
7. Monitors:
 A monitor is a higher-level abstraction of a mutex. A monitor provides a
mechanism for multiple threads to access shared resources in a synchronized
way. Programmers use monitors to specify which code is a critical section or a
region that requires exclusive access to shared resources
Function of Synchronization
Here are some specific functions of synchronization in an operating system:
1. Mutual Exclusion: With mutual exclusion, only one process or thread can access a
shared resource at any given time, ensuring data consistency and preventing conflicts
that may arise when multiple processes are trying to access the same resource
simultaneously.
2. 2. Coordination: Coordination mechanisms are used to ensure the correct order of
execution of operations involving shared resources among concurrent processes. For
example, a synchronization mechanism can be used to ensure that a dependent process
waits until a required resource is available and can access it.
3. : Deadlocks can occur when multiple processes are waiting to acquire resources that
are locked by other processes. Using synchronization mechanisms such as timeouts or
prioritization can help prevent deadlocks by ensuring that resources are released or
given higher priority to certain processes
Summary
 Overall, synchronization is a vital aspect of computer systems, particularly in
multi-process or multi-threaded environments where shared resources are
common. By using synchronization mechanisms like locking and barrier
synchronization, systems can ensure that all processes and threads operate
correctly and in the appropriate order
MCQS
1. Which of the following is a technique used for thread communication?
A. Pipes
B. Signals
C. Shared memory
D. All of the above.
2. What is the difference between synchronization and concurrency?
A. Synchronization refers to the process of coordinating access to shared resources,
while concurrency refers to the ability of multiple tasks to execute at the same
time.
B. Synchronization refers to the ability of multiple tasks to execute at the same
time, while concurrency refers to the process of coordinating access to shared
resources.
C. Synchronization and concurrency are the same thing.
D. None of the above.
3. Which of the following is a technique used to prevent deadlocks?
A. Resource allocation graphs
B. Banker's algorithm
C. Timeouts
D. All of the above
MCQS
4. What is a deadlock?
A. A situation where two or more threads are waiting indefinitely for a resource to
become available.
B. A situation where two or more threads access a shared resource and try to
change its value at the same time.
C. A situation where two or more threads are competing for the same resource.
D. A situation where two or more threads are executing in parallel
5. Which of the following is true about monitors?
A. Monitors are a synchronization mechanism used for thread communication and
synchronization.
B. Monitors use signals and wait queues to coordinate access to shared resources.
C. Monitors are implemented as a class with methods that are synchronized.
D. All of the above.
6. What is a mutex?
A. A type of lock that allows multiple threads to access a shared resource
simultaneously.
B. A synchronization mechanism that prevents deadlocks.
C. A data structure used for parallel processing.
D. A variable used for inter-process communication
MCQS
7. What is a semaphore?
A. A type of lock that allows multiple threads to access a shared resource
simultaneously.
B. A variable used for inter-process communication.
C. A synchronization mechanism that prevents deadlocks.
D. A data structure used for parallel processing.
8. What is a race condition?
A. A situation where two or more threads access a shared resource and try to
change its value at the same time.
B. A situation where two or more threads are waiting indefinitely for a resource to
become available.
C. A situation where two or more threads are competing for the same resource.
D. A situation where two or more threads are executing in parallel
9. Which of the following is NOT an example of synchronization in computer
science?
A. Locks
B. Semaphores
C. Interrupts
D. Monitors
What is synchronization in computer science?
A. The process of maintaining consistency and order between two or more
processes.
B. The process of managing multiple tasks on a single processor.
C. The process of preventing deadlocks in a system.
D. The process of parallel processing.
Short question
1. What is synchronization?
2. Write the function of synchronization?
3. What is mutexes?
4. What is semaphores?
5. How synchronization work ?
Long question
Write the technique to achieve the synchronization?
THANK YOU

More Related Content

What's hot

Unit 3 file management
Unit 3 file managementUnit 3 file management
Unit 3 file management
Kalai Selvi
 
Human Computer Interaction Chapter 3 HCI in the Software Process and Design ...
Human Computer Interaction Chapter 3 HCI in the Software Process and  Design ...Human Computer Interaction Chapter 3 HCI in the Software Process and  Design ...
Human Computer Interaction Chapter 3 HCI in the Software Process and Design ...
VijiPriya Jeyamani
 
File Management
File ManagementFile Management
File Management
Ramasubbu .P
 
Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System Interface
Wayne Jones Jnr
 
Mainframe systems
Mainframe systemsMainframe systems
Free Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFSFree Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFS
United International University
 
Multithreading and concurrency in android
Multithreading and concurrency in androidMultithreading and concurrency in android
Multithreading and concurrency in android
Rakesh Jha
 
File Management in Operating System
File Management in Operating SystemFile Management in Operating System
File Management in Operating System
Janki Shah
 
Human Computer Interaction Chapter 5 Universal Design and User Support - Dr....
Human Computer Interaction Chapter 5 Universal Design and User Support -  Dr....Human Computer Interaction Chapter 5 Universal Design and User Support -  Dr....
Human Computer Interaction Chapter 5 Universal Design and User Support - Dr....
VijiPriya Jeyamani
 
Concurrency Control Techniques
Concurrency Control TechniquesConcurrency Control Techniques
Concurrency Control Techniques
Raj vardhan
 
The Object Model
The Object Model  The Object Model
The Object Model
yndaravind
 
Handheld operting system
Handheld operting systemHandheld operting system
Handheld operting system
Aj Maurya
 
system calls, single user, multiuser os ...
system calls, single user, multiuser os                                      ...system calls, single user, multiuser os                                      ...
system calls, single user, multiuser os ...
myrajendra
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
Adeel Rasheed
 
Design Pattern in Software Engineering
Design Pattern in Software EngineeringDesign Pattern in Software Engineering
Design Pattern in Software Engineering
Manish Kumar
 
Object and class relationships
Object and class relationshipsObject and class relationships
Object and class relationships
Pooja mittal
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating system
tittuajay
 
Operating System Process Synchronization
Operating System Process SynchronizationOperating System Process Synchronization
Operating System Process Synchronization
Haziq Naeem
 
Basic os-concepts
Basic os-conceptsBasic os-concepts
Basic os-concepts
np_manjunath
 
File Management in Operating Systems
File Management in Operating SystemsFile Management in Operating Systems
File Management in Operating Systems
vampugani
 

What's hot (20)

Unit 3 file management
Unit 3 file managementUnit 3 file management
Unit 3 file management
 
Human Computer Interaction Chapter 3 HCI in the Software Process and Design ...
Human Computer Interaction Chapter 3 HCI in the Software Process and  Design ...Human Computer Interaction Chapter 3 HCI in the Software Process and  Design ...
Human Computer Interaction Chapter 3 HCI in the Software Process and Design ...
 
File Management
File ManagementFile Management
File Management
 
Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System Interface
 
Mainframe systems
Mainframe systemsMainframe systems
Mainframe systems
 
Free Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFSFree Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFS
 
Multithreading and concurrency in android
Multithreading and concurrency in androidMultithreading and concurrency in android
Multithreading and concurrency in android
 
File Management in Operating System
File Management in Operating SystemFile Management in Operating System
File Management in Operating System
 
Human Computer Interaction Chapter 5 Universal Design and User Support - Dr....
Human Computer Interaction Chapter 5 Universal Design and User Support -  Dr....Human Computer Interaction Chapter 5 Universal Design and User Support -  Dr....
Human Computer Interaction Chapter 5 Universal Design and User Support - Dr....
 
Concurrency Control Techniques
Concurrency Control TechniquesConcurrency Control Techniques
Concurrency Control Techniques
 
The Object Model
The Object Model  The Object Model
The Object Model
 
Handheld operting system
Handheld operting systemHandheld operting system
Handheld operting system
 
system calls, single user, multiuser os ...
system calls, single user, multiuser os                                      ...system calls, single user, multiuser os                                      ...
system calls, single user, multiuser os ...
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Design Pattern in Software Engineering
Design Pattern in Software EngineeringDesign Pattern in Software Engineering
Design Pattern in Software Engineering
 
Object and class relationships
Object and class relationshipsObject and class relationships
Object and class relationships
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating system
 
Operating System Process Synchronization
Operating System Process SynchronizationOperating System Process Synchronization
Operating System Process Synchronization
 
Basic os-concepts
Basic os-conceptsBasic os-concepts
Basic os-concepts
 
File Management in Operating Systems
File Management in Operating SystemsFile Management in Operating Systems
File Management in Operating Systems
 

Similar to input and output protection.pptx

CSI-503 - 10. Security & Protection (Operating System)
CSI-503 - 10. Security & Protection (Operating System) CSI-503 - 10. Security & Protection (Operating System)
CSI-503 - 10. Security & Protection (Operating System)
ghayour abbas
 
chapter 3 opreating system lecture note and its is impaortamt concept for mn
chapter 3 opreating system  lecture note and its is impaortamt concept for mnchapter 3 opreating system  lecture note and its is impaortamt concept for mn
chapter 3 opreating system lecture note and its is impaortamt concept for mn
dejenehundaol91
 
Protection and security
Protection and securityProtection and security
Protection and security
mbadhi
 
2 opreating system
2 opreating system2 opreating system
2 opreating system
HekmatFaisal
 
Chapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System ConceptsChapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System Concepts
MeenalJabde
 
Os lecture 6
Os lecture 6Os lecture 6
Os lecture 6
Dr. Ahmed J. Obaid
 
Operating System Simple Introduction
Operating System Simple IntroductionOperating System Simple Introduction
Operating System Simple Introduction
Diwash Sapkota
 
Operating Systems R20 Unit 1.pptx
Operating Systems R20 Unit 1.pptxOperating Systems R20 Unit 1.pptx
Operating Systems R20 Unit 1.pptx
Prudhvi668506
 
System protection in Operating System
System protection in Operating SystemSystem protection in Operating System
System protection in Operating System
sohaildanish
 
Operating system
Operating systemOperating system
Operating system
abhinavgarg12345
 
Operating system
Operating systemOperating system
Operating system
ǷřiţëƧh Chąuhąn
 
2600 v03 n02 (february 1986)
2600 v03 n02 (february 1986)2600 v03 n02 (february 1986)
2600 v03 n02 (february 1986)
Felipe Prado
 
Os services
Os servicesOs services
Os services
anilkumar_mca
 
Distributed systems_important 2marks.docx
Distributed systems_important 2marks.docxDistributed systems_important 2marks.docx
Distributed systems_important 2marks.docx
20TUCS251VIJAYASHARA
 
Security Architecture
Security ArchitectureSecurity Architecture
Security Architecture
amiable_indian
 
Chapter -2 Operating-System and its Structures
Chapter -2 Operating-System and its StructuresChapter -2 Operating-System and its Structures
Chapter -2 Operating-System and its Structures
Chandrakant Divate
 
Operating system interview question
Operating system interview questionOperating system interview question
Operating system interview question
sriram saravanan
 
Csc 2313 (lecture 2)
Csc 2313 (lecture 2)Csc 2313 (lecture 2)
Csc 2313 (lecture 2)
umardanjumamaiwada
 
Csc 2313 (lecture 2)
Csc 2313 (lecture 2)Csc 2313 (lecture 2)
Csc 2313 (lecture 2)
umardanjumamaiwada
 
1Discuss the major components of an OS including file system, proc.pdf
1Discuss the major components of an OS including file system, proc.pdf1Discuss the major components of an OS including file system, proc.pdf
1Discuss the major components of an OS including file system, proc.pdf
feelingcomputors
 

Similar to input and output protection.pptx (20)

CSI-503 - 10. Security & Protection (Operating System)
CSI-503 - 10. Security & Protection (Operating System) CSI-503 - 10. Security & Protection (Operating System)
CSI-503 - 10. Security & Protection (Operating System)
 
chapter 3 opreating system lecture note and its is impaortamt concept for mn
chapter 3 opreating system  lecture note and its is impaortamt concept for mnchapter 3 opreating system  lecture note and its is impaortamt concept for mn
chapter 3 opreating system lecture note and its is impaortamt concept for mn
 
Protection and security
Protection and securityProtection and security
Protection and security
 
2 opreating system
2 opreating system2 opreating system
2 opreating system
 
Chapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System ConceptsChapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System Concepts
 
Os lecture 6
Os lecture 6Os lecture 6
Os lecture 6
 
Operating System Simple Introduction
Operating System Simple IntroductionOperating System Simple Introduction
Operating System Simple Introduction
 
Operating Systems R20 Unit 1.pptx
Operating Systems R20 Unit 1.pptxOperating Systems R20 Unit 1.pptx
Operating Systems R20 Unit 1.pptx
 
System protection in Operating System
System protection in Operating SystemSystem protection in Operating System
System protection in Operating System
 
Operating system
Operating systemOperating system
Operating system
 
Operating system
Operating systemOperating system
Operating system
 
2600 v03 n02 (february 1986)
2600 v03 n02 (february 1986)2600 v03 n02 (february 1986)
2600 v03 n02 (february 1986)
 
Os services
Os servicesOs services
Os services
 
Distributed systems_important 2marks.docx
Distributed systems_important 2marks.docxDistributed systems_important 2marks.docx
Distributed systems_important 2marks.docx
 
Security Architecture
Security ArchitectureSecurity Architecture
Security Architecture
 
Chapter -2 Operating-System and its Structures
Chapter -2 Operating-System and its StructuresChapter -2 Operating-System and its Structures
Chapter -2 Operating-System and its Structures
 
Operating system interview question
Operating system interview questionOperating system interview question
Operating system interview question
 
Csc 2313 (lecture 2)
Csc 2313 (lecture 2)Csc 2313 (lecture 2)
Csc 2313 (lecture 2)
 
Csc 2313 (lecture 2)
Csc 2313 (lecture 2)Csc 2313 (lecture 2)
Csc 2313 (lecture 2)
 
1Discuss the major components of an OS including file system, proc.pdf
1Discuss the major components of an OS including file system, proc.pdf1Discuss the major components of an OS including file system, proc.pdf
1Discuss the major components of an OS including file system, proc.pdf
 

Recently uploaded

How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
Kavitha Krishnan
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 

Recently uploaded (20)

How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 

input and output protection.pptx

  • 1. I/O Devices Protection Internal topic Presented by Muhammad Abdullah Roll no. BSF2103722 Topic no.1
  • 2. Introduction:  I/O protection in operating systems is an essential mechanism to provide secure access to I/O devices from user and kernel modes  In most operating systems, I/O protection is implemented using the concept of I/O privilege levels or rings. The processor and the operating system define four different privilege levels, also called rings, where ring 0 is the highest and contains the kernel mode, while ring 3 is the lowest and contains the user mode.
  • 3. I/O Protection Issued:  An I/O instruction issued by a process in user mode has to be executed with a privileged instruction in the kernel mode. The kernel mode is the only ring that can directly access the hardware. The operating system sets up I/O privilege levels to control access to I/O devices by processes running at different privilege levels.
  • 4. Importance:  The protection is provided through hardware-based features like device controllers, memory-mapped I/O, and system calls, used in the operating system to provide access to I/O devices.  In I/O protection, every I/O device is allocated a unique I/O space or I/O ports that are accessible only by the kernels to avoid unauthorized access. The operating system maintains a mapping between the device drivers and memory buffers, and the device controllers are programmed to treat all I/O addresses generated by user processes as invalid.  The operating system also provides mechanisms such as input and output permission bits that restrict the access to I/O devices for all the user processes. The permission bits help ensure that no unauthorized process can gain access to the device.  The I/O protection in modern operating systems also incorporates Virtual Memory Management (VMM) technology with page-level protection. With this technology, the kernel provides a different map of the physical memory in each process's virtual address space, and every process can access a unique copy of the data.
  • 5. Function:  The primary function of I/O protection in operating systems is to provide a secure layer of access control to Input/output (I/O) devices, ensuring that only authorized processes and users can access I/O devices. Here are some of the main functions of I/O protection:
  • 6. 1. Prevent unauthorized access:  I/O protection mechanisms ensure that only authenticated and authorized processes can interact with I/O devices. Unauthorized access can lead to data theft, data loss, or other security breaches
  • 7. 2. Maintain data integrity:  I/O protection ensures that data being read from or written to I/O devices is protected from unauthorized access, unauthorized modification or deletion, and corruption.
  • 8. 3. Provide isolation:  By implementing I/O protection, processes are prevented from accessing other processes' I/O data, enhancing security and preventing critical data breaches.
  • 9. 4. Prevent system crashes:  The proper protection of I/O devices prevents device drivers from accessing memory outside their allocated memory space, thereby preventing system crashes.
  • 10. 5. Support multi-user environment:  I/O protection plays a crucial role in supporting a multi-user operating system environment by ensuring that each user can only access and communicate with the devices authorized for their account
  • 11. 6. Support virtual machines:  In virtual machine environments, I/O protection mechanisms ensure that virtual machine guests cannot access I/O devices other than those allowed by their virtual machine host.
  • 12. Summary:  In summary, I/O protection mechanisms are essential in operating systems to control access to I/O devices and to prevent unauthorized access, thereby ensuring the security of the system.
  • 13. Process Synchronization External topic Presented by Muhammad Abdullah Roll no. Bsf2103722 Topic no.2
  • 14. Introduction  Synchronization refers to the coordination of activities or processes to ensure that they happen in the correct order and at the right time. In computing, synchronization is particularly important when multiple processes or threads are accessing shared resources, as it ensures that all processes have access to the resource at the correct time and in the correct order.  In an operating system, process synchronization refers to the techniques and mechanisms used to ensure that multiple processes or threads do not interfere with each other and that they access shared resources in a coordinated and controlled manner. Some common examples of shared resources include memory, files, and hardware devices.
  • 15. Example:  Where two processes try to update the same variable in memory. If both processes attempt to update the variable at the same time, its values can become inconsistent or corrupt. To avoid this, synchronization mechanisms can be used to enforce mutual exclusion and ensure that only one process can update the variable at a time. One way to achieve this is using a mutex. In this case, the variable and a corresponding mutex are shared between the two processes. Before accessing the variable, each process checks if the mutex is locked by another process, and if it is, it waits until the mutex is released. Once the mutex is released, the process can acquire it, update the variable, and release the mutex to allow other processes to access it.
  • 16. Example:  Here's an example in pseudocode: Process 1: acquire(mutex) variable = variable + 1 release(mutex) Process 2: acquire(mutex) variable = variable – 1 release(mutex) In this example, each process acquires the mutex and updates the variable inside a critical section. The mutex ensures that only one process can update the variable at a time, preventing any race conditions or inconsistencies. This is just one example of how synchronization can be used to ensure correct and efficient execution of processes in an operating system. Other synchronization mechanisms like semaphores, monitors, and barriers can also be used to manage access to shared resources and prevent conflicts between processes
  • 17. There are several common techniques for achieving synchronization in computer systems. These include
  • 18. 1. locking:  A lock is a synchronization mechanism that ensures that only one process or thread can access a shared resource at a time. Locking is typically implemented using mutexes or semaphores to ensure that the resource is properly protected 2. Atomic operations:  An atomic operation is an operation that is indivisible and uninterruptible. Atomic operations are typically used to ensure that multiple processes do not interfere with each other when accessing the same memory location.
  • 19. 3. Barrier synchronization:  A barrier is a synchronization mechanism that ensures that all processes or threads have reached a certain point in their execution before continuing. Barriers are commonly used in parallel processing to ensure that all processes have completed their work before continuing to the next phase of processing 4. Message passing:  Message passing is a communication mechanism where processes or threads send messages to each other to coordinate their activities. This mechanism is commonly used in distributed systems to ensure that all processes are aware of each other's activities and progress.
  • 20. 5. Semaphores:  A semaphore is a data structure that is used to control access to shared resources. It can be used to ensure that only one process or thread can access a shared resource at any given time. Semaphores can be either binary or counting, and they can be used to enforce mutual exclusion, synchronization, and resource allocation. 6. Mutexes:  A mutex is a programming object used to protect shared resources by creating a critical section. Only one thread can access the shared resource when the mutex is locked. If another thread tries to access the same resource while it is locked, it will wait until the mutex is released
  • 21. 7. Monitors:  A monitor is a higher-level abstraction of a mutex. A monitor provides a mechanism for multiple threads to access shared resources in a synchronized way. Programmers use monitors to specify which code is a critical section or a region that requires exclusive access to shared resources
  • 22. Function of Synchronization Here are some specific functions of synchronization in an operating system: 1. Mutual Exclusion: With mutual exclusion, only one process or thread can access a shared resource at any given time, ensuring data consistency and preventing conflicts that may arise when multiple processes are trying to access the same resource simultaneously. 2. 2. Coordination: Coordination mechanisms are used to ensure the correct order of execution of operations involving shared resources among concurrent processes. For example, a synchronization mechanism can be used to ensure that a dependent process waits until a required resource is available and can access it. 3. : Deadlocks can occur when multiple processes are waiting to acquire resources that are locked by other processes. Using synchronization mechanisms such as timeouts or prioritization can help prevent deadlocks by ensuring that resources are released or given higher priority to certain processes
  • 23. Summary  Overall, synchronization is a vital aspect of computer systems, particularly in multi-process or multi-threaded environments where shared resources are common. By using synchronization mechanisms like locking and barrier synchronization, systems can ensure that all processes and threads operate correctly and in the appropriate order
  • 24. MCQS 1. Which of the following is a technique used for thread communication? A. Pipes B. Signals C. Shared memory D. All of the above. 2. What is the difference between synchronization and concurrency? A. Synchronization refers to the process of coordinating access to shared resources, while concurrency refers to the ability of multiple tasks to execute at the same time. B. Synchronization refers to the ability of multiple tasks to execute at the same time, while concurrency refers to the process of coordinating access to shared resources. C. Synchronization and concurrency are the same thing. D. None of the above. 3. Which of the following is a technique used to prevent deadlocks? A. Resource allocation graphs B. Banker's algorithm C. Timeouts D. All of the above
  • 25. MCQS 4. What is a deadlock? A. A situation where two or more threads are waiting indefinitely for a resource to become available. B. A situation where two or more threads access a shared resource and try to change its value at the same time. C. A situation where two or more threads are competing for the same resource. D. A situation where two or more threads are executing in parallel 5. Which of the following is true about monitors? A. Monitors are a synchronization mechanism used for thread communication and synchronization. B. Monitors use signals and wait queues to coordinate access to shared resources. C. Monitors are implemented as a class with methods that are synchronized. D. All of the above. 6. What is a mutex? A. A type of lock that allows multiple threads to access a shared resource simultaneously. B. A synchronization mechanism that prevents deadlocks. C. A data structure used for parallel processing. D. A variable used for inter-process communication
  • 26. MCQS 7. What is a semaphore? A. A type of lock that allows multiple threads to access a shared resource simultaneously. B. A variable used for inter-process communication. C. A synchronization mechanism that prevents deadlocks. D. A data structure used for parallel processing. 8. What is a race condition? A. A situation where two or more threads access a shared resource and try to change its value at the same time. B. A situation where two or more threads are waiting indefinitely for a resource to become available. C. A situation where two or more threads are competing for the same resource. D. A situation where two or more threads are executing in parallel 9. Which of the following is NOT an example of synchronization in computer science? A. Locks B. Semaphores C. Interrupts D. Monitors
  • 27. What is synchronization in computer science? A. The process of maintaining consistency and order between two or more processes. B. The process of managing multiple tasks on a single processor. C. The process of preventing deadlocks in a system. D. The process of parallel processing. Short question 1. What is synchronization? 2. Write the function of synchronization? 3. What is mutexes? 4. What is semaphores? 5. How synchronization work ? Long question Write the technique to achieve the synchronization?