Linux kernel platform abstraction and data structures
The Linux device model is built on top of some fundamental data structures, including struct device
, struct device_driver
, and struct bus_type
. The first data structure represents the device to be driven, the second is the data structure of each software entity intended to drive the device, and the latter represents the channel between the device and the CPU.
Device base structure
Devices help extract either physical or virtual devices. They are built on top of the struct device
structure, which is worth introducing first, as described in include/linux/device.h
:
struct device { struct device *parent; struct kobject kobj; struct bus_type *bus; struct device_driver *driver; ...