Compile a module separately in Linux

Source: Internet
Author: User
Compile a module in Linux-general Linux technology-Linux programming and kernel information. The following is a detailed description. Disclaimer: This article is based on some network summaries.

1. Example: If the sound card Irq and I/O are incorrect, go to the/usr/src/linux/drivers/sound directory.
Gcc-o configure. c
./Configure
Select IO, IRQ, etc,
Make
Cp sound. o/lib/modules/2.0.34/misc
Rmmod sound
Insmod sound init_trace = 1
Test.
Until successful.
In this way, make menuconfig can be used in/usr/src/linux;
Make dep; make clean; make zImage;... much better.

Ii. Summary of other articles: Try to compile a CMI Audio Card Driver Module

1. There are several configurations used to compile the kernel in the/usr/src/linux-xxxx/configs directory. The configuration we save is stored here. Select the configuration we want, copy it to the/usr/src/linux-xxxx directory, and change it to. config.

Cp/usr/src/linux-xxxx/configs/kernel-2.4.19-arm.config/usr/src/linux-xxxx/. config

In the. config file under the/usr/src/linux-xxxx/directory, you can see the words CONFIG_XXXX_XXXX = y or # CONFIG_XXXX_XXXX is not set. Find the line # CONFIG_SOUND_CMPCI is not set and change it to CONFIG_SOUND_CMPCI = m, where m indicates compiling to a module. Comment out all other CONFIG_XXXX_XXXX = m.

2. Execute make modules directly in the/usr/src/linux-2.4.19 directory, just a few seconds, the compilation is complete.

Do not execute make modules_install. It will delete the existing modules in the system and only install the newly compiled modules.

3. Go to/usr/src/linux-2.4.19/drivers/sound/and find the cmpci. o file,

Cp/usr/src/linux-2.4.19/drivers/sound/cmpci. o/lib/modules/2.4.20/kernel/drivers/sound/

Sometimes you need to add the following words to the/lib/modules/2.4.1 */modules. dep file:/lib/modules/KNL_VERSION/kernel/drivers/sound/cmpci. o

After depmod is executed, use modprobe cmpci to insert the module into the kernel. Run the lsmod command to check that cmpci has been inserted into the kernel.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.