Linux Device Drivers. Inroduction. What’s a ‘device-driver’?. A special kind of computer program Intended to control a peripheral device Needs to execute ‘privileged’ instructions Must be integrated into the OS kernel Interfaces both to kernel and to hardware
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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
- the device processes individual bytes
(e.g., keyboard, printer, modem)
- the device processes groups of bytes
(e.g., hard disks, CD-ROM drives)
open(), seek(), read(), write(), close(), ...
(special ‘/dev’ directory is for devices)
several devices the same driver controls
individuals, or commercial ‘partners’, look
at their design-specs and manuals.
-- which prevents professors from teaching
students the design-details that they learn.
of technical information to programmers.
that made their products more valuable.
creating applications for your system!
Controlling the three LEDs
control register (0x64, write-only)
status register (0x64, read-only)
input buffer register (0x60, write-only)
output buffer register (0x60, read-only)
input port register timing signals
output port register interrupt signals
bit #0: output-buffer full
bit #1: input-buffer full
causing hardware to perform wrong action!
cli(); // do not recognize interrupts
/* critical code-fragment goes here */
sti(); // ok to recognize interrupts
(to ‘register’ service-functions with kernel)
(to ‘unregister’ your service-functions)
(e.g., #include <linux/module.h>)
(e.g., #define __KERNEL__, MODULE)