Getting deeper inside LDM
So far, we have discussed buses, drivers, and devices, which were used to build the system device topology. While this is true, the previous topics were the tip of the iceberg. Under the hood, LDM relies on the three lowest level data structures, which are kobject
, kobj_type
, and kset
. These are used to link the objects.
Before we go any further, let's define some of the terms that will be used throughout this chapter:
- sysfs: sysfs is an in-memory virtual filesystem that shows the hierarchy of kernel objects, abstracted by instances of
struct kobject
. - Attribute: An attribute (or sysfs attribute) appears as a file in sysfs. From within the kernel, it can be mapped to anything: a variable, a device property, a buffer, or anything useful to the driver that may need to be exported to the world.
In this section, we will learn how each of these structures is involved in the device model.
Understanding the kobject structure
struct...