0% found this document useful (0 votes)
32 views

Device Management - PPTM

Uploaded by

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

Device Management - PPTM

Uploaded by

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

Device

Management
Peripheral Devices

• Additional hardware components that connect to a computer.

• Types :

-Input Devices: Keyboard, Mouse, Trackpad, Microphone etc.

-Output Devices: Monitor, Printer etc.

-Storage Devices: Hard disk ,Solid state drive (SSD), External Hard drive.

-Communication Devices: Modem, Network Interface Cards(NIC).


Classification of I/O devices in OS
I/O devices can be classified based on the data transfer methods, and the interaction with the CPU.

Character Devices and Block Devices:

1  Character Devices: These devices transfer data character by character, and the data is not stored in a buffer.
Examples include keyboards, mice, and serial ports.
 Block Devices: These devices transfer data in blocks or chunks, and the data is typically stored in buffers. Examples
include hard drives, SSDs, and optical drives.

Synchronous and Asynchronous I/O:

2
 Synchronous I/O: The process waits for the I/O operation to complete before proceeding. It is a blocking operation,
and the process is idle during the I/O operation.
 Asynchronous I/O: The process initiates the I/O operation and continues with other tasks without waiting for it to
complete. The process is notified later when the I/O operation finishes.
Direct Memory Access (DMA):

3
 DMA I/O: A separate DMA controller is used for data transfer between the I/O device and memory, reducing CPU
involvement and enhancing performance.

Memory-Mapped I/O and Port-Mapped I/O:

4
 Memory-Mapped I/O: I/O devices are treated as if they are a part of the computer's memory. Reading and writing
to specific memory addresses interact with the I/O devices.
 Port-Mapped I/O: I/O devices are accessed through dedicated I/O ports. Special processor instructions are used to
communicate with these ports.

Programmed I/O and Interrupt-Driven I/O:

5  Programmed I/O: The CPU controls data transfer between the device and memory by continuously checking the
device status.
 Interrupt-Driven I/O: The I/O device interrupts the CPU when it needs attention, allowing the CPU to perform
other tasks until the interrupt occurs
Device Controller

• Hardware components responsible for managing the communication and data transfer between a computer's
CPU and peripheral devices.

• Acts as the intermediaries between hardware and the OS.

• Examples: USB, Graphics, NIC, Disk & DMA Controllers etc.

• Functions:

1. Data Transfer
2. Control and Status
3. Interrupt handling
4. Buffering
5. Error handling.
Device Driver

• Software components that serve as intermediaries between the operating system and the controllers.

• Provide a standardized interface for the OS to interact with various types of device controllers.

• Examples: Sound driver, Printer driver, NIC driver etc.

I/O Device
Device Controller Memory CPU

Block diagram of communication between I/O device and CPU.


Memory Mapped I/O.

• Memory-mapped I/O is a technique used in computer architecture where the same address space (memory
addresses) is used for both memory and I/O operations.

• Means specific regions of the address space are reserved for I/O device registers .

• Allows the CPU to access them using standard memory access instructions.

• Each I/O device typically has a set of control registers, status registers, and data registers.

• Set of register:

- Control Registers: Used to configure the behavior of the I/O device.


- Status Registers: Provide information about the current state of the I/O device.
- Data Registers: Used for the actual transfer of data between the CPU and the I/O device.
Memory Mapped I/O.

• In this computer organization, there is common bus (data, address, and control) for I/O and memory.

• So, same instructions can control both I/O and Memory.

• Instructions:

1. Load (LDA)
- Examples: LDA R1, [0x1000]; LDR R7, [0x4000] etc.

2. Store (STR)
- Examples: STA R2, [0x2000]; STA R8, [0x8000] etc.
How the same instructions can control both I/O and Memory ?
• By using different address.
• Example:

1. STR R2, [0x2000]


- The program stores data into main memory from a CPU register.

2. STR R8, [0x7001]


- The program sends data to the NIC for transmission.

0 x 0000

Memory Address Bus

0 x 7000 Data Bus


I/O Register CPU
0 x 8000 Control Bus

Memory

0 x FFFF
Memory Space
Figure: Memory Mapped I/O.
Merits and Demerits Memory Mapped I/O.

• Merits
1. Faster I/O Operations: CPU can access I/O devices at the same speed as it accesses memory.
2. Simplified Programming: Load(LDA) and Store(STR) instruction.
3. Efficient Use of Memory Space: I/O devices share the same address space as the memory

• Demerits
1. Limited I/O Address Space: Memory-mapped I/O limits the I/O address space.
2. Slower Response Time: If an I/O device is slow to respond, it can delay CPU’s access to memory.
3. Inefficient for Large Data Transfer: As, CPU initiates and manages the transfer.
Working of an I/O operation.
1. Device driver loads the appropriate registers in the
Printer
------ device controller.
Keyboard ------ Monitor
Mouse ---
Disks 2. Then, device controller checks these registers to
determine what action to take.

3. After that data is transferred to its local buffer.


Disk USB Graphics
CPU
Controller Controller Controller
4. Once the data transfer is complete, it informs the device
driver via interrupt that it has finished its operation.

5. Lastly, the device driver returns control to the OS.

Memory
Thank You

You might also like