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

后端 未结 1 774
情歌与酒
情歌与酒 2021-02-15 10:43

I am trying to create a minimalistic Linux for an embedded device. That means the necessity of compiling kernel and drivers. One driver is written directly for the device\'s boa

相关标签:
1条回答
  • 2021-02-15 11:04

    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

    0 讨论(0)
提交回复
热议问题