简体   繁体   中英

Accessing Linux Drivers

Simply put, can a user space application access device drivers running in kernel mode? If I want to read from the I2C Linux character driver, can a basic C executable (extensionless) do that or do I need to develop a kernel module specifically for that task? If a basic C app can access the I2C character driver, what does that gcc makefile look like?

Yes. User space application can access the kernel driver if the driver is character device or the driver exposing the stream interfaces.

Specific to i2c, user space application can write and reads to the i2c device via sysfs api. Refer the kernel document here https://www.kernel.org/doc/Documentation/i2c/dev-interface

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM