Download presentation
Presentation is loading. Please wait.
Published byJakayla Bearer Modified over 10 years ago
1
CSI 400/500 Operating Systems Spring 2009 Lecture #14 – Device Management and Drivers Monday, March 23 rd, 2009
2
2 Device Manager Handles communication between Operating System and external devices Contains collection of device drivers Contains library of interrupt handlers for device conditions
3
3 Device Driver Library of functions controlling access to device Contains functions like read, write, open, close, seek, ping, pipe, etc. Involved through system calls
4
Device Independence Standard set of operations common to all devices If no device specified, OS determines best available device to perform operation 4
5
Reconfigurable Device Drivers Addition of device without restarting operating system MS Windows has this capacity when it senses new hardware You install a driver and its added to the library automatically 5
6
6 Buffering Maintaining data in repository before needed Input buffers facilitate speedier processing Output buffers prevents suspends for slow transfer rate
7
7 Multiple Buffer Methods Double buffer The device has one buffer while the device driver has another Allows for data passing back and forth without interference Circular buffers Multiple buffers for each device and driver Prevents backlog of data Order of transmission becomes important
8
8 Device Types Device Managers catalog drivers based upon type Communication devices We ll discuss these further in the networking topic Storage devices Sequential access: ex. magnetic tape Random access: ex. disk I/O device Keyboards, mouse, printers, scanners have own drivers
9
Device Types, cont Communication Devices Transfer data between computer and external computer Requires defined interface Uses a mutually-understood protocol Well discuss such protocols later in the course 9
10
10 Driver Optimization When writing a device driver, consider best means to access data: 1 st Come, 1 st Served (FCFS) Shortest Seek Time (SST) Scan/Look – access in direction
11
11 Linux Device Management Devices signified by major and minor numbers Major number is device type Minor number is specific device Device drivers activated with _init() Driver interface recognized by operating system by register_()
12
12 Linux I/O Driver functions Open and close Read, readdir, and write Flush and release (for data buffers) Seek Map Sync lock
13
Linux Device Models C++ abstract classes Based on commonalities among drivers Model types: Udev Sysfs Kobject Device classes 13
14
Udev User device in /dev Gave device management to user space Used to be managed by dynamic node creation That was more tedious, requiring interaction between kernel and device driver 14
15
Udev set-up Uses series of daemons and utilities Has rules that can be constructed to ease interface with devices Typically used for direct-access auxiliary storage devices like CD-ROM drives or flash drives 15
16
Sysfs User space copy of kernels device model File system for device model interfaces Contains file descriptors and device driver specifications 16
17
Kobjects Data abstraction of device properties Things like usage counts, parameters, and object type Main fields: Kref : maintains reference count Kset pointer Kobj_type 17
18
Device classes Class inheritance chain of device drivers Top level classes: Bus Class Device Devices are categorized as input, output, and data 18
19
Plugged devices Coldplugged Devices that were connected at system boot time Hotplugged Devices installed since boot Device drivers considered on the fly Not stored in same directory Maintained as interrupt processing 19
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.