摘要:
在从事Linux Kernel开发的过程中,user_app和kernel之间传递数据时不能使用memcpy()函数,必须使用copy_to/from_kernel或者是put/get_user。原因是kernel和user_app内存不能直接互访。1. put_userNameput_user -- Write a simple value into user space.Synopsisput_user ( x, ptr);ArgumentsxValue to copy to user space.ptrDestination address, in user space.ContextU 阅读全文
摘要:
/proc/devices/下的设备是驱动程序生成的,它可产生一个major供mknod作为参数。/dev/下的设备是通过mknod加上去的,用户通过此设备名来访问驱动。The following script,scull_load, is part of thesculldistribution. The user of a driver that is distributed in the form of a module can invoke such a script from the system'src.localfile or call it manually whene 阅读全文