Linux user space hardware recognition

I want to be able to test my Linux hardware in C. How do I get the information that appears in dmesg in C? For example, for the keyboard the message is entered: AT Translated Set 2 keyboard as / devices / platform / i8042 / serio0 / input / input0 I want to get the label in my program, AT Translated Set 2 and the path, / devices / platform / i 8042 / serio0 / input / input0. Any idea how to do this?

Amit

+3
source share
3 answers

You can also see the contents of files in / proc.

/ proc / version, / proc / ioports, / proc / iomem, / proc / meminfo and others have a lot of information in them.

/proc/bus .

usbutils pciutils, , lsusb lspci .

+4

klogctl.

, : util-linux

0

libhal hal daemon. HAL , sysfs. /sys/devices /sys/bus.

HAL, sysfs , .

0

Source: https://habr.com/ru/post/1718468/


All Articles