1 / 19

CSI 400/500 Operating Systems Spring 2009

CSI 400/500 Operating Systems Spring 2009. Lecture #14 – Device Management and Drivers Monday, March 23 rd , 2009. Device Manager. Handles communication between Operating System and external devices Contains collection of device drivers

darci
Download Presentation

CSI 400/500 Operating Systems Spring 2009

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSI 400/500 Operating SystemsSpring 2009 Lecture #14 – Device Management and Drivers Monday, March 23rd, 2009

  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. 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

  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 it’s added to the library automatically

  6. Buffering • Maintaining data in repository before needed • Input buffers facilitate speedier processing • Output buffers prevents suspends for slow transfer rate

  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. 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 • We’ll discuss such protocols later in the course

  10. Driver Optimization • When writing a device driver, consider best means to access data: • 1st Come, 1st Served (FCFS) • Shortest Seek Time (SST) • Scan/Look – access in direction

  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. 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

  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

  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

  16. Sysfs • User space “copy” of kernel’s device model • File system for device model interfaces • Contains file descriptors and device driver specifications

  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

  18. Device classes • Class inheritance chain of device drivers • Top level classes: • Bus • Class • Device • Devices are categorized as input, output, and data

  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

More Related