Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHow to create a Kernel driver
Dear Hippo
I have read you guide how to create a simple kernel driver . i wish you can give a more information to do it . <div class='quotetop'>QUOTE </div> --- Quote Start --- # copy module files to rootfs and generate modules.dep make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- INSTALL_MOD_PATH=~/rootfs modules_install[/b] --- Quote End --- first , i don't konw what's means the "INSTALL_MOD_PATH=~/rootfs modules_install" can you tell me ? second . if i want to config it when i use "menuconfig" what should i modify. can you give me a document ?3 Replies
- Altera_Forum
Honored Contributor
You have to modify Kconfig and Makefile for the drivers. Look at the sud dirs of kernel drivers.
make modules_install is need only when you use modules. It copies the moudels files .ko into rootfs. It is not needed if you do not use moduels. - Altera_Forum
Honored Contributor
Thanks hippo
but i can't find the *.ko in rootfs.I want to know which dir can be find the *.ko file when i use the command "modules_install" . I want to know can i use the next commnd to insert a module or remove a module. <div class='quotetop'>QUOTE </div> --- Quote Start --- #insmod 加载模块# rmmod 卸载模块[/b] --- Quote End --- Thanks ! - Altera_Forum
Honored Contributor
First, enable modules support in your kernel.
Then config the drivers which you want to turn into modules, with [M] your drivers. Then build the kernel and modules install. The modules fies will be in the /lib/modules/2.6.11-uc0/kernel/drivers/..... . There is a file /lib/modules/2.6.11-uc0/modules.dep, which list all of them.