An Introduction To Device Drivers: Sarah Diesburg COP 5641 / CIS 4930
An Introduction To Device Drivers: Sarah Diesburg COP 5641 / CIS 4930
Drivers
Sarah Diesburg
COP 5641 / CIS 4930
Introduction
Device drivers
Black boxes to hide details of hardware devices
Use standardized calls
Independent of the specific driver
Main role
Map standard calls to device-specific operations
Can be developed separately from the rest of the
kernel
Plugged in at runtime when needed
The Role of the Device Driver
A common practice
Support for synchronous/asynchronous operation
Be opened multiple times
Exploit the full capabilities of the hardware
Easier user model
Easier to write and maintain
To assist users with policies, release device
drivers with user programs
Splitting the Kernel
Process management
Creates, destroys processes
Supports communication among processes
Signals, pipes, etc.
Schedules how processes share the CPU
Memory management
Virtual addressing
Splitting the Kernel
File systems
Everything in UNIX can be treated as a file
Linux supports multiple file systems
Device control
Every system operation maps to a physical device
Few exceptions: CPU, memory, etc.
Networking
Handles packets
Handles routing and network address resolution
issues
Splitting the Kernel
Loadable Modules
Character devices
Block devices
Network devices
Others
Character Devices
Beware of bugs
Buffer overrun
Overwriting unrelated data
Treat input/parameters with utmost suspicion
Uninitialized memory
Kernel memory should be zeroed before being made
available to a user
Otherwise, information leakage could result
Passwords
Security Issues