Dear Daniel: I think the most important reason is: the file your said is in the user-space, while the driver code is running in the kernel-space.For the security reason, the direct acess between these two space is forbidden. The solution to your problem: 1. use the /proc or /sys filesystem 2. printk 3. write a user-space program to read these data from driver and then save them to a file
2010-01-15 snoppy1314 发件人: Daniel (Youngwhan) Song 发送时间: 2010-01-15 09:53:44 收件人: kernelnewbies 抄送: 主题: Why the linux does not allow the access to a file in the devicedriver? Hi, Could somebody help me to understand the reason why the linux kernel does not allow the access to a file in the device driver? For example, for debugging purpose, if a device driver want to log some data in a file by using open/write/read method like in user application, how a driver can access to a file in a specific filesystem? Any comment or docs or web pages would be appreciated. Thank you, Dan.