Device management is the process by which an operating system handles input and output devices like keyboards, printers, and storage drives. The OS relies on device drivers to facilitate communication between devices and running processes. It allocates devices and schedules access to shared resources. Device management also involves buffering strategies that temporarily store data to match differences in processing and transfer speeds.
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 ratings0% found this document useful (0 votes)
19 views18 pages
Os CH 4
Device management is the process by which an operating system handles input and output devices like keyboards, printers, and storage drives. The OS relies on device drivers to facilitate communication between devices and running processes. It allocates devices and schedules access to shared resources. Device management also involves buffering strategies that temporarily store data to match differences in processing and transfer speeds.
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/ 18
Chapter-4
Device- Management
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 1
Introduction Devices usually refer to physical/hardware devices such as computers, laptops, servers, mobile phones, and more. Device management is the process of controlling the Input/Output devices like disk, microphone, keyboard, printer, magnetic tape, USB ports, camcorder, scanner, other accessories, and supporting units. The operating system handles communication with the devices via their drivers. Device drivers are software modules that can be plugged into an OS to handle a particular device. Operating System takes help from device drivers to handle all I/O devices. 03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 2 Introduction Con’t… The system has multiple devices, to handle these physical or virtual devices, the OS requires a separate program known as a device controller. The Device Controller works like an interface between a device and a device driver to convert serial bit stream to block of bytes and perform error correction as necessary. The fundamentals of I/O devices may be divided into three categories: Block Device: It stores data in fixed-size blocks, each with its unique address.
For example- Disks.
Character Device: It transmits or accepts a stream of characters, none of which can be addressed individually. For example, keyboards, printers, etc. Network Device: It is used for transmitting the data packets. 03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 3 Functions of the device management in the operating system An Operating System does the following activities in device management: • Keeps tracks of all devices by using a Program responsible for this task which is called I/O controller. • It decides which process gets the device when and for how much time. • It connects devices to various programs in efficient way without error. • Allocates the device in the efficient way. • De-allocates devices when they are no longer in use.
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 4
Types of devices There are three types of Operating system peripheral devices: dedicated, shared, and virtual. Dedicated Device: some devices are allocated or assigned to process only one job at a time until that job releases them. Devices such as plotters, printers, tape drives, floppy disks and other similar devices require such an allocation mechanism because it will be inconvenient if multiple people share them simultaneously. Shared Devices : are assigned to multiple processes by interleaving their requests. For example, hard disk it is shared, but interleaving between different processes requests.
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 5
Types of devices Con’t… Virtual Devices : a hybrid of the two devices, and they are dedicated devices that have been transformed into shared devices. For example, a printer can be transformed into a shareable device by using a spooling program that redirects all print requests to a disk.
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 6
Characteristics of serial and parallel devices Serial Transmission Parallel Transmission The data is transmitted one bit at a Various data bits are time over a single wire or channel. simultaneously transmitted together. Requires a single line to Requires multiple lines communicate and transfer data. Serial transmission is not time- Parallel transmission is time-sensitive sensitive Serial transmission is reliable for Parallel transmission is used for a transferring data to longer distance. limited distance, provides higher speed. Slow Fast 03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 7 Serial Transmission vs Parallel Transmission
Figure 4.1: Serial Transmission Figure 4.2: Parallel Transmission
Example: Data transfer between Data transfer between a computer to a printer
computer to a modem
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 8
Buffering strategies The buffer is an area in the main memory used to store or hold data temporarily. The act of storing data temporarily in the buffer while it is being transferred between two devices or between a device and an application known as buffering. I/O buffering is the process of temporarily storing data that is passing between a processor and a peripheral devices.
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 9
Why Buffering is required? Buffering is done for three reasons: To manage with a speed mismatch between the sender and receiver of a data stream. To adapt between devices that have different data-transfer sizes. To support copy semantics for application I/O.
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 10
How Buffering Works? In an operating system, buffer works in the following way :
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 11
Types of Buffering There are three main types of buffering in the operating system: 1. Single buffering: Only one buffer is used to transfer the data between two devices. The sender produces one block of data into the buffer. After that, the receiver receives the buffer. Only when the buffer is empty, the processor again produces the data.
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 12
Types of Buffering Con’t… 2. Double buffering: Two buffers are used in the place of one. The sender produces one buffer while the receiver consumes another buffer simultaneously. So, the sender not needs to wait for filling the buffer. It is also known as buffer swapping.
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 13
Types of Buffering Con’t… 3. Circular buffering: When more than two buffers are used, the buffers collection is called a circular buffer. Each buffer is being one unit in the circular buffer. The data transfer rate will increase using the circular buffer rather than the double buffering.
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 14
Direct memory access(DMA) Direct memory access is a method that allows an input/output (I/O) device to send or receive data directly to or from the main memory, by passing the CPU to speed up memory operations. This process is managed by a chip known as a DMA controller (DMAC).
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 15
Operation of the DMA Controller 1. CPU programs DMA controller by setting its registers to know what to transfer and where. It also issues a command to the disk controller telling it to read data from the disk into its internal buffer and verify the checksum. 2. DMA controller initiates the transfer by issuing a read request over the bus to the disk controller. 3. Write to memory bus cycle. 4. When the write is complete, the disk controller sends an acknowledgement signal to the DMA controller, also over the bus. 5. DMA controller increments the memory address to use and decrements the byte count. 6. DMA controller interrupts the CPU for process completion. 03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 16 Recovery from failure Device recovery is a process to recover inoperable devices due to incorrect or bad storage state.
This is done by using a Bootable Recover Assist Media or a Bootable Backup
Media.
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 17
END OF CHAPTER -FOUR
03/26/2024 OPERATING SYSTEM PREPARED BY MELKAMU D. MTU DEPARTMENT OF SE 18