I’m developing a device driver for embedded linux(ARM).
How can I compile the KO file generated as a part of the kernel,
in a way that the module will be loaded in boot ?
this is the first time I need to compile the driver into the kernel and not as a loadable module. so I’m not sure how to do it.
Thanks,
Ramon.
For your first question, I assume that you want to build your driver statically into the kernel image(not as a module). First, you select a directory in drivers directory where you want to put your driver files. Assume you want to put your files in
drivers/char/. Copy your files into this directory. There will be aKconfigfile in thedrivers/char/directory, open it and add an entry like this in the before theendmenu.Save the file and open
Makefilein the same directory. Goto end of the file and add the following entry.That’s it you have added the file to the kernel tree. Now, as usual, do
make menuconfigand selectMYDRIVER.See this Kernel Compilation article for more info.