User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

tutorials:dvk521:documentations:kernel_porting_and_configuration [2013/11/21 15:54]
tutorials:dvk521:documentations:kernel_porting_and_configuration [2013/12/23 14:50] (current)
Line 1: Line 1:
-====== ​Development Environment Setup ======+====== ​Kernel Porting and Configuration ​======
-===== Install ubuntu ===== +==== Kernel Porting ​==== 
-What to do: install ubuntu on the computer hard drive by using [[|wubi.exe]] +Get the linux kernel source code [[​waveshare/​Source_Code/​linux-sunxi-sunxi-3.4.61.tar.gz|linux-sunxi-sunxi-3.4.61]], 
-Default SystemWIN7 32 bit +Or can be obtained from the internet
-(Noteit's possible to install the ubuntu12.04 on virtual machinehoweversome wired problems may occur when burning ​the image into the SD card)+​linux-sunxi/​linux-sunxi/​releases  ​, 
 +To avoid unexpected error while portingplease download ​the 3.4.61 version kernel. ​
 +=== Extract the kernel source code ===
 +Assume that the source code was placed under /​home/​waveshare/​cubieboard/​kernel directory, use the following command to extract it: 
 +  #cd /​home/​waveshare/​cubieboard/​kernel
 +  #tar -xzvf linux-sunxi-sunxi-3.4.61.tar.gz
 +Now we get the linux-sunxi-sunxi-3.4.61 original source code, as shown in the picture below:
-===== ubuntu Basic Commands ===== 
-Update software source: 
-  # sudo apt-get upgrade  ​ 
-  # sudo apt-get install update  ​ 
-Install text editor vim: 
-  # sudo apt-get vim  ​ 
 +=== Assign the cross compiler === 
 +The purpose of kernel porting is to run the linux-sunxi-sunxi-3.4.61 on Cubieboard. ​
 +Modify the Makefile under root directory:
 +  #cd linux-sunxi-sunxi-3.4.61
 +  #vi Makefile
 +Edit the following lines:
 +  ARCH   ?= $(SUBARCH) ​
 +  ARCH        ?= arm
 +  CROSS_COMPILE ​  ?= arm-linux-gnueabihf-
 +ARCH specifies the target platform as arm, CROSS_COMPILE assigns the cross compile tool chain. As shown in the picture below: ​
-===== Cross Compiler Installation =====+Note: the vim editor is recommended.
-The ARM cross compile tool chain is required for porting kernel, use the following command to install+=== Clear the temp files ===  
-  # sudo apt-get install gcc-arm-linux-gnueabihf  ​+Under the root directory, enter
 +  #make clean
 +=== Copy the default config file === 
 +Under the root directory, enter:
 +  #make sun4i_defconfig
 +A hidden .config file will be generated under the root directory.
 +=== Config the kernel === 
 +Under the root directory, enter:
 +  #make menuconfig
 +Config the kernel on the popup window, as shown in the picture below:
 +=== Compile the kernel === 
 +Under the root directory, enter:
 +  #make uImage ​
 +It will take much time to complete the compiling.
 +When completed, the compressed kernel image will be generated under linux-sunxi-sunxi-3.4.61/​arch/​arm/​boot directory.
 <WRAP noprint> <WRAP noprint>
 {{tag>​Cubieboard Cubietruck}} {{tag>​Cubieboard Cubietruck}}
 </​WRAP>​ </​WRAP>​
tutorials/dvk521/documentations/kernel_porting_and_configuration.1385020462.txt.gz · Last modified: 2013/12/23 14:50 (external edit)