码迷,mamicode.com
首页 > 其他好文 > 详细

socos-1

时间:2014-10-20 13:14:45      阅读:283      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   color   io   os   ar   for   

 

1. Install cross compile tool chain


 

download xilinx-2011.09-50-arm-xilinx-linux-gnueabi.bin and just run in terminal as follows:

 

sudo ./xilinx-2011.09-50-arm-xilinx-linux-gnueabi.bin

 

 

and it gives some useful information such as how to sovle the dash problem , and you just need to switch to the current mode using the given command and select no .

now it will gives some extra useless query , you just need to make a choice and enter ENTER to continue , keep going .

after that , you will find in your install directory , such as /root/CodeSourgery/... , indeed i just use /opt/cs as the install directory because i hate the long and terrible path , so in the /opt/cs/bin

directory , you will find :

bubuko.com,布布扣

yes , it has installed on the specified path , but when you type

arm-xilinx-linux-gnueabi-gcc -v

 

 you will find the tool chain can not be found , we need to include the current path
into system search path .

sudo gedit /etc/environment

 

and add /opt/cs/bin into the text :

PATH="/opt/cs/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

 

make sure you have type : symbol correctly .

after that , we need to source the PATH :

source /etc/environment

 

then re-type the command to see its version information :

bubuko.com,布布扣

okay ,here we have installed the tool chain correctly  .

 

2. Build the linux kernel


 

we need to download the source code from xilinx linux : https://github.com/Xilinx   

bubuko.com,布布扣

after downloaded , we just decompress  , make sure we have the xilinx_zynq_defconfig file , and it‘s the defualt config file for zynq chip .

bubuko.com,布布扣

 

now we open a terminal and enter the root directory of source tree .

at first , we need to export the ARCH variable into current session :

export ARCH=arm
export CROSS_COMPILE=arm-xilinx-linux-gnueabi-

and we can use

echo $ARCH
echo $CROSS_COMPILE

to make sure it has been exported normally.

second , we need to import the defualt config from xilinx_zynq_defconfig :

make xilinx_zynq_defconfig

 

as follows :

bubuko.com,布布扣

and then :

make menuconfig

 

we get :

bubuko.com,布布扣

this is because the simple UI is based on ncurses interface , and we need to install it before we go ahead .

sudo apt-get install libncurses5-dev

 

after that , we will see the normal menuconfig UI .

if you have the necessary information of how to config kernel , we can modify the configuration free . now we just skip configuration and using the defualt configuration from xilinx_zynq_defconfig .

select Exit to write the configuraiton into .config file  .

Third , we now just build the kernel source :

make UIMAGE_LOADADDR=0x8000 uImage

 

and waitting for about 20-30 minutes depending on your host performance .


 

  • problem : we maybe find some file missing such as follows :

bubuko.com,布布扣

indeed , i can find the chip.c in tar exploer , but after i decompress it , i can NOT find the chip.c anywhere .

so i need to copy the chip.c into kernel/irq/ directory .

  • problem: "mkimage" command not found - U-Boot images will not be built

this is okay , because the application mkimage is built from u-boot . besides , if we need not to use uImage , we just ignore the errors .

if you want to use uImage , please refer to here.

 

socos-1

标签:des   style   blog   http   color   io   os   ar   for   

原文地址:http://www.cnblogs.com/dragen/p/4036772.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!