Configure and compile the kernel of the Development Board & compile the written driver into the kernel

Source: Internet
Author: User
I. Kernel configuration and compilation of the Development Board

1. decompress the kernel package and copy the smdk6410_config Kernel configuration file to. config (default configuration file) to the kernel source code tree. Generally, the platform configuration file is stored in the arch/ARM/configs/directory of the kernel source code tree. smdk6410_config is a configured configuration file.

2. Adjust the configuration through the graphical interface

$> Make menuconfig (requires the ncurses Library)
Or:
$> Make xconfig
$> Make gconfig

The configuration options to be adjusted include:
A. Cancel enable loadable module support
B. Enter Device Driver-> graphics support --- enter the frame buffer Support Section and set the LCD screen to 480*272.

3. Modify the makefile under the kernel source code tree and search for cross_compile.

Cross_compile: = arm-Linux-set the compilation tool chain to arm-Linux-tool chain

4. Make ----- the entire compilation process can be completed in about 10 minutes. The generated zimage is under the kernel source code tree arch/ARM/boot /.

2. Compile the written driver into the kernel

1. Copy the written valid driver source file to the kernel source code tree/Drivers/ARM-drv/here, arm-DRV is specially created for your own driver, to distinguish it from other drivers.

2. Create the kconfig file about the driver in the arm-DRV directory.

The syntax for writing the kconfig file is relatively simple. You can refer to the kconfig file of other drivers in the kernel source code, such as the kconfig file of the driver/watchdog/kconfig dog driver.

3. Modify the kconfig file of the Upper-Layer Code and add the source "Drivers/ARM-drv/kconfig" line to the appropriate location.

The upper-layer kconfig file is arch/ARM/kconfig.

4. Run the make menuconfig command to test if the command is correct. The driver-related options appear on the graphic configuration interface, select this option to save and exit. A new one will be generated in the kernel source code tree directory. config file. Open and view the file, and you will find that it contains three lines about the driver:

This line is used to modify driver/makefile in (6 ).

Config_6410drv = y

The following two makefle files are used to edit arm-DRV.
Config_char01 = y
Config_char02 = y

5. Create and edit the makefile in the arm-DRV directory.

OBJ-$ (config_char01) + = char_test01.o
OBJ-$ (config_char02) + = char_test02.o

Two. O files correspond to. c files under arm-dev respectively.

(Refer to makefile rules in the dog driver/watchdog)

6. Modify the upper layer, that is, Driver/malefile,

Add obj-$ (config_6410drv) + = arm-drv/to the appropriate position.

7. Return to the kernel source code tree directory to make and compile the driver 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.