SlideShare a Scribd company logo
1 of 28
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

HDLC, PPP and SLIP
HDLC, PPP and SLIPHDLC, PPP and SLIP
HDLC, PPP and SLIPNaveen Kumar
 
4.file service architecture
4.file service architecture4.file service architecture
4.file service architectureAbDul ThaYyal
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMSkoolkampus
 
TCP/IP Protocols With All Layer Description
TCP/IP Protocols With All Layer DescriptionTCP/IP Protocols With All Layer Description
TCP/IP Protocols With All Layer DescriptionShubham Khedekar
 
When to use composite primary keys
When to use composite primary keysWhen to use composite primary keys
When to use composite primary keysalyssamarieparal
 
Relational database management system (rdbms) i
Relational database management system (rdbms) iRelational database management system (rdbms) i
Relational database management system (rdbms) iRavinder Kamboj
 
Deadlock management
Deadlock managementDeadlock management
Deadlock managementAhmed kasim
 
Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing marwan aldulaimy
 
OSI Model - Open Systems Interconnection
OSI Model - Open Systems InterconnectionOSI Model - Open Systems Interconnection
OSI Model - Open Systems InterconnectionAdeel Rasheed
 
SLA Agreement, types and Life Cycle
SLA Agreement, types and Life Cycle SLA Agreement, types and Life Cycle
SLA Agreement, types and Life Cycle Dr Neelesh Jain
 
Computer network basic concepts
Computer network   basic conceptsComputer network   basic concepts
Computer network basic conceptsrahul kapoliya
 
Introduction Cloud Computing
Introduction Cloud ComputingIntroduction Cloud Computing
Introduction Cloud ComputingRoel Honning
 
Distributed computing time
Distributed computing timeDistributed computing time
Distributed computing timeDeepak John
 
Design issues of dos
Design issues of dosDesign issues of dos
Design issues of dosvanamali_vanu
 

What's hot (20)

Client Server Architecture ppt
Client Server Architecture pptClient Server Architecture ppt
Client Server Architecture ppt
 
HDLC, PPP and SLIP
HDLC, PPP and SLIPHDLC, PPP and SLIP
HDLC, PPP and SLIP
 
4.file service architecture
4.file service architecture4.file service architecture
4.file service architecture
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
 
Transparency and concurrency
Transparency and concurrencyTransparency and concurrency
Transparency and concurrency
 
TCP/IP Protocols With All Layer Description
TCP/IP Protocols With All Layer DescriptionTCP/IP Protocols With All Layer Description
TCP/IP Protocols With All Layer Description
 
Error control
Error controlError control
Error control
 
When to use composite primary keys
When to use composite primary keysWhen to use composite primary keys
When to use composite primary keys
 
Relational database management system (rdbms) i
Relational database management system (rdbms) iRelational database management system (rdbms) i
Relational database management system (rdbms) i
 
Deadlock management
Deadlock managementDeadlock management
Deadlock management
 
Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing
 
OSI Model - Open Systems Interconnection
OSI Model - Open Systems InterconnectionOSI Model - Open Systems Interconnection
OSI Model - Open Systems Interconnection
 
SLA Agreement, types and Life Cycle
SLA Agreement, types and Life Cycle SLA Agreement, types and Life Cycle
SLA Agreement, types and Life Cycle
 
Computer network basic concepts
Computer network   basic conceptsComputer network   basic concepts
Computer network basic concepts
 
Introduction Cloud Computing
Introduction Cloud ComputingIntroduction Cloud Computing
Introduction Cloud Computing
 
Distributed computing time
Distributed computing timeDistributed computing time
Distributed computing time
 
Design issues of dos
Design issues of dosDesign issues of dos
Design issues of dos
 
Events vs Notifications
Events vs NotificationsEvents vs Notifications
Events vs Notifications
 
Advantages of DBMS
Advantages of DBMSAdvantages of DBMS
Advantages of DBMS
 

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 mndejenehundaol91
 
Protection and security
Protection and securityProtection and security
Protection and securitymbadhi
 
2 opreating system
2 opreating system2 opreating system
2 opreating systemHekmatFaisal
 
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 ConceptsMeenalJabde
 
Operating System Simple Introduction
Operating System Simple IntroductionOperating System Simple Introduction
Operating System Simple IntroductionDiwash Sapkota
 
Operating Systems R20 Unit 1.pptx
Operating Systems R20 Unit 1.pptxOperating Systems R20 Unit 1.pptx
Operating Systems R20 Unit 1.pptxPrudhvi668506
 
System protection in Operating System
System protection in Operating SystemSystem protection in Operating System
System protection in Operating Systemsohaildanish
 
2600 v03 n02 (february 1986)
2600 v03 n02 (february 1986)2600 v03 n02 (february 1986)
2600 v03 n02 (february 1986)Felipe Prado
 
Distributed systems_important 2marks.docx
Distributed systems_important 2marks.docxDistributed systems_important 2marks.docx
Distributed systems_important 2marks.docx20TUCS251VIJAYASHARA
 
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 StructuresChandrakantDivate1
 
Operating system interview question
Operating system interview questionOperating system interview question
Operating system interview questionsriram saravanan
 
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.pdffeelingcomputors
 

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

Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMELOISARIVERA8
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint23600690
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...EduSkills OECD
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptxPoojaSen20
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportDenish Jangid
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppCeline George
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesAmanpreetKaur157993
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17Celine George
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 

Recently uploaded (20)

Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 

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?