Article Title: how to add a driver module to the kernel statically. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Suppose you want to load a flash Driver written by yourself into the project, and you can select this driver when configuring the kernel through menuconfig. What should I do? There are three steps: 1. Add your flashtest. c file to the/driver/mtd/maps/directory.
2. Modify the kconfig document in the/driver/mtd/maps directory:
Config MTD_flashtest
Tristate "ap71 flash"
Third, modify the makefile document in this directory.
Add the following content: obj-$ (CONFIG_MTD_flashtest) + = flashtest. o. When you run make menucofnig, you will find the ap71 flash option. If you select this option. This option is saved in the. config document. When you compile the kernel, it will read. config file. When the ap71 flash option is yes, when the system calls makefile under/driver/mtd/maps/, the flashtest. o is added to the kernel. To achieve your purpose.
After the driver module is loaded, create a node in the dev directory. The command is as follows:
Mknod int_ctl c 98 0
Int_ctl indicates the device name, C indicates the character device, 98 indicates the master device number, and 0 indicates the slave device number.
Cat/proc/interrupts
Cat/proc/devices