Linux Driver Questions!

Asked 2 years ago, Updated 2 years ago, 36 views

I made a driver and installed the insmod and added it to the module.

Other programs have even added values to variables in this module, but is there any way for me to read the variable values that have been changed in this driver in user space?

I'd appreciate it if you could tell me in detail. Thank you.

linux c

2022-09-22 08:05

2 Answers

By default, Linux provides two APIs: copy_to_user() and copy_from_user() to transfer data between kernel space and user space. And the API for transferring data from the kernel to the user area is copy_to_user.

Below is a link to the usage example. http://esos.hanyang.ac.kr/tc/kims/entry/%EB%A6%AC%EB%88%85%EC%8A%A4-%EB%94%94%EB%B0%94%EC%9D%B4%EC%8A%A4-%EB%93%9C%EB%9D%BC%EC%9D%B4%EB%B2%84-%EA%B3%B5%EB%B6%80-2-character-driver-%EC%98%88%EC%A0%9C


2022-09-22 08:05

I think I can find out the changed variable value by supporting the iotl command or /proc in the driver module I wrote.


2022-09-22 08:05

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.