What are the tasks of the device manager?
• Logical view of various devices
• including (logical) harmonization of devices with the same purpose (device classes)
• Abstraction of physical access
• Providing control functions (usually via device files)
What are conditions for succesfull device management?
Conditions:
• Simultaneous access by multiple users or processes
• Access via network services
• Rights management and enforcement
What are optimization targets for device management?
Optimization targets:
• Reducing wait times
• Performing other tasks during waiting periods (-> process model)
Sketch a general overview between hardware, OS and the user application.
How is I/O hardware controlled?
What is a computing bus?
A computing bus is a communication system that transfers data between different components inside a computer or between computers.
It acts like a highway for data, allowing the CPU, memory, storage, and peripherals to communicate and exchange information.
Data Bus
Transfers actual data between components.
Width (number of bits) affects data transfer speed.
Address Bus
Carries the memory addresses of where data should be sent or retrieved from.
Determines the addressable memory space.
Control Bus
Carries control signals (e.g., read/write commands, interrupts) to coordinate activities.
What types of buses exist?
System Bus: Connects CPU, RAM, and motherboard components.
Internal Bus: Connects components within the CPU.
External Bus (I/O Bus): Connects external devices (e.g., USB, PCI, SATA).
Sketch a Computing Bus.
Whar are different ways that I/O devices may be adressed? Sketch them.
1. Separate Address Spaces (Port-Mapped I/O)
Main memory and I/O devices use distinct address spaces.
I/O ports are accessed using special instructions (e.g., IN/OUT on x86).
IN
OUT
Example: Traditional Port-Mapped I/O (PMIO).
2. Memory-Mapped I/O (MMIO)
Main memory and I/O devices share the same address space.
Devices are accessed just like normal memory, using standard load/store instructions.
Common in modern architectures.
3. Combination
A system may support both methods.
Devices can be accessed via memory-mapped regions or dedicated I/O ports, depending on architecture and design.
How can I/O device communication be handled?
Feature
Polling
Interrupts
CPU Involvement
Continuously checks device
Responds when signaled
Efficiency
Wastes CPU cycles (busy-wait)
More efficient, CPU can do other work
Complexity
Simple implementation
More complex (requires ISR handling)
Use Cases
Simple, infrequent tasks
Real-time, multitasking systems
Response Time
Depends on polling frequency
Immediate (event-driven)
What is DMA and what is its purpose?
DMA (Direct Memory Acccess) allows devices to transfer data directly to/from main memory without constant CPU involvement.
CPU sets up the transfer (source, destination, size).
DMA controller handles the data transfer.
CPU is interrupted when the transfer completes.
Reduces CPU load.
Faster for large data transfers.
Enables parallel execution (CPU and DMA work simultaneously).
Requires a DMA controller.
Potential for bus conflicts between CPU and DMA.
Needs careful synchronization.
What is device driver?
Device Drivers are software components that connect user applications and hardware controllers.
They control devices by:
Checking device status
Sending commands
Transferring data to/from devices
Drivers can manage multiple device instances.
What are I/O Handling methods in drivers?
Programmed I/O:
CPU performs direct control and polling.
Interrupt-Driven I/O:
Devices generate interrupts, no polling.
DMA I/O:
DMA controller transfers data; CPU sets up and is notified on completion.
What are important class drivers?
Many manufacturers offer devices that have the same behavior and the same functionality from the user’s viewpoint (logical view) but must physically be triggered in different ways (physical view). (Different addresses/ commands for controller) In this case, so-called class drivers group the device functionality logically. Class drivers use specific device drivers.
Character devices
These devices work on the basis of single bytes. They cannot be addressed absolutely. Starting from the current byte, it is possible to jump a certain number of bytes forward or backward within the byte stream.
Block devices
Blocks of bytes can be addressed. A logical view of mass-storage devices corresponds to the view of block devices.
Network devices
They work like block devices but in this case interaction can also be started by the device.
What subsystems handle USB connections in typical modern computer systems?
PCI Express (PCIe)
Standard bus for connecting peripheral devices (e.g., graphics cards, SSDs).
PCIe devices communicate through a PCIe Host Controller.
USB (Universal Serial Bus)
Connects peripheral and input devices (keyboards, mice, printers).
Supports auto-detection and hot-plugging (plug-and-play).
USB devices connect via a USB Host Controller, often implemented as a PCIe device.
A USB keyboard connects to the USB Host Controller.
The USB Host Controller is connected through PCIe, which is managed by the processor.
The OS interacts with the keyboard through the USB subsystem, which is part of the PCIe subsystem.
->The device-independent component of the operating system (within device management) can thus be “nested”.
How can application utilize devices?
Logical devices are presented to applications as device files.
In Unix/Linux, device files are visible in the file system hierarchy (e.g., /dev/sda, /dev/tty).
/dev/sda
/dev/tty
In Windows, device files are typically invisible but accessible through system APIs.
Interaction Method
Applications interact with devices using standard file interfaces:
Open, read, write, close, and ioctl system calls.
This abstracts the hardware details, allowing applications to access devices like regular files.
High-level drivers provide users/applications with an interface to interact with logical devices in the form of device files.
Last changeda month ago