Compiling a driver as a part of a kernel, not as a module

余生长醉 提交于 2019-12-03 12:50:59
MatrixManAtYrService

You're definitely going to have to put the driver source in the kernel source tree and update the makefile to include it. You can see how this works in steps 1.1 through 1.3 here.

If user-level software does any talking with the device driver it probably does it via system calls. Search through the source of the driver looking for asmlinkage if you find any of these then you're looking at adding some system calls. The remainder of the above document will explain how to set them up. You'll have to modify at least two files (and they might vary slightly depending on your kernel version).

If the device driver does any talking with the kernel directly, we're dealing with Interrupts, Memory Mapped I/O, or DMA. To be honest with you I do not know whether they can be handled within the source file for your driver (in which case you're good do go), or whether they also require modifying other files in the source tree. The Linux Kernel Module Programming Guide is a good resource for such things.

Good Luck

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!