Skip to content

Day08 - Device Model Exploration

Objective

Understand Linux device model through sysfs and device tree.


1. List all buses

ls /sys/bus

Observation: - Multiple bus types exist (platform, i2c, spi, usb...)


2. Explore platform bus

ls /sys/bus/platform
ls /sys/bus/platform/devices
ls /sys/bus/platform/drivers

Observation: - devices/ → hardware - drivers/ → driver list


3. Find test device

ls /sys/bus/platform/devices | grep test

Result: - test-device@0 exists

Conclusion: - Device Tree node created a platform device


4. Check driver binding

ls -l /sys/bus/platform/devices/test-device@0/driver

Observation: - No driver bound (expected)


5. Check tty device mapping

readlink -f /sys/class/tty/ttyAMA10

Result: - Points to /sys/devices/...

Conclusion: - /sys/class is a shortcut - real device lives in /sys/devices


6. Inspect Device Tree

ls /proc/device-tree

Find: - test-device@0 exists


7. Dump Device Tree

dtc -I fs -O dts /proc/device-tree > running.dts

Observation: - Many warnings - Common when dumping live system


Key Findings

  • Device Tree successfully creates platform device
  • sysfs reflects kernel device model
  • device is present even without driver
  • driver binding is separate step