Cross-compilation and driver porting of the linux2.6.30.4 kernel on the TQ2440 Development Board

Source: Internet
Author: User

recently, due to the drive experiment on the TQ2440 (ARM9) board, cross-compiling is done on the host (ubuntu13.10) for the system kernel on the front target board.

One, cross-compiling of the kernel:

1. Prepare 2.6.30.4 version of the kernel source package, which I use the embedded company provides kernel source package linux-2.6.30.4_20121214.tar.bz2.


2. Open Terminal Input command: Tar vxjf linux-2.6.30.4_20121214.tar.bz2 extract kernel source package to get a folder named opt, and then enter the command: sudo mv opt/usr/local/cut the source code to usr/ Under local, of course this you can choose to move to other folders you like.


3. Enter the command: cd/usr/local/opt/embedsky/linux-2.6.30.4 into the kernel source directory, and then enter the command: LS view file, find a name of Config_embedsky_ W43 (my touchscreen is 4.3-inch, so Select this), and then enter the command in the current directory: CP config_embedsky_w43. config, copy one to change his name to. config.


4. Login root, enter the command: Make Menuconfig, then eject the Linux configuration interface--linux Kernel configuration, select the last item--save an Alternate configuration File , and then select OK to save the configuration.


5. Enter the command: make to compile it (Root permission). What cross-compilation path configuration and support platform configuration, people embedded in the source code inside the makefile file has already been configured for you, this need not worry. Wait for the compilation to finish, enter the kernel source folder under Vmlinux, cross-compile successfully!


two. Porting the driver:

After the successful completion of the cross-compilation of the kernel, the next step is to start porting the driver to the system kernel of the target board, you just need to pay attention to the makefile file writing, Add the path of the 2.6.30.4 kernel and the cross-compiler toolchain ARM-LINUX-GCC, then enter the Make command directly, then compile the driver module that can be loaded into the TQ2440 target board system kernel.

The source code for the specific makefile is as follows (assuming that the driver I want to compile is named Mybeep):

obj-m:=mybeep.occ=arm-linux-gcckerneldir=/usr/local/opt/embedsky/linux-2.6.30.4pwd:=$ (shell pwd) default:$ (make) -C $ (kerneldir) m=$ (PWD) modulesclean:$ (make)-C $ (kerneldir) m=$ (PWD) Modules_install





This article is from the "Stop Thinking" blog, make sure to keep this source http://9110091.blog.51cto.com/9100091/1546954

Cross-compilation and driver porting of the linux2.6.30.4 kernel on the TQ2440 Development Board

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.