歡迎您光臨本站 註冊首頁

RHEL5.2中架設skyeye+uClinux環境

←手機掃碼閱讀     火星人 @ 2014-03-24 , reply:0

剛開始學習linux嵌入式開發,經過2天的嘗試,今天終於把skyeye+uClinux配置成功了,特記下我配置的過程,希望對你有用!!

說下我的系統平台:我用的是在linux下的VMare+RHEL5.2(2.6.18-92.el5)

首先下載如下版本的文件:
skyeye: skyeye-1.2.5_REL.tar.gz

下載地址:http://download.gro.clinux.org/skyeye/skyeye-1.2.5_REL.tar.gz

arm-elf-tools: arm-elf-tools-20040427.sh

下載地址:http://www.lumit.org/download/tools/arm-elf-tools-20040427.sh

arm-linux-tools: arm-linux-tools-20070808.tar.gz
下載地址:http://ftp.snapgear.org/pub/snap ... ols-20070808.tar.gz

uClinux: uClinux-dist-20080808.tar.bz2

下載地址:http://mirror.lzu.edu.cn/softwar ... st-20080808.tar.bz2



安裝步驟:

1、安裝arm-elf-tools交叉編譯環境:

chmod a+x arm-elf-tools-20030314.sh

./arm-elf-tools-20030314.sh

[root@work ~]# which arm-elf-gcc
/usr/local/bin/arm-elf-gcc

說明 arm-elf-gcc 已經安裝
如果提示錯誤:
tail: 。。。。「+43」。。。。。

gunzip: stdin: not in gzip format


解決方法如下:

這是由於腳本中的tail沒寫對,必須加一個 -n 參數

用vi打開 arm-elf-tools-20030314.sh

將第39行的代碼:

tail +${SKIP} ${SCRIPT} | gunzip | tar xvf -

改成如下:

tail -n +${SKIP} ${SCRIPT} | gunzip | tar xvf -

2、安裝arm-linux-tools交叉編譯環境:

tar zxvf arm-linux-tools-20070808.tar.gz
就好在本目錄下產生一個usr目錄,比如我的就是/root/usr/這時要把它鏈接到/usr/local/下
ln -n /root/usr/local /usr/local/arm
編輯.bash_profile添加一行export PATH=$PATH:/usr/local/arm/bin
保存重啟系統

3、安裝skyeye:
tar zxvf skyeye-1.2.5_REL.tar.gz
進入解壓后的skyeye目錄,接下來執行:
make
make install
如果一切正常,運行
skyeye
會出現一下信息:
[root@work ~]# skyeye

**************************** WARNING **********************************
If you want to run ELF image, you should use -e option to indicate
your elf-format image filename. Or you only want to run binary image,
you need to set the filename of the image and its entry in skyeye.conf.
***********************************************************************

Your elf file is little endian.
Failed to open skyeye config file skyeye.conf in the same directory
error: No such file or directory
SkyEye 1.2.5
Bug report: skyeye-developer@lists.gro.clinux.org
Usage: skyeye [options] -e program [program args]
Default mode is STANDALONE mode
------------------------------------------------------------------
Options:
-e exec-file the (ELF executable format)kernel file name.
-l load_address,load_address_mask
Load ELF file to another address, not its entry.
-b specify the data type is big endian when non "-e" option.
-d in GDB Server mode (can be connected by GDB).
-c config-file the skyeye configure file name.
-h The SkyEye command options, and ARCHs and CPUs simulated.
------------------------------------------------------------------
----------- Architectures and CPUs simulated by SkyEye-------------
-------- ARM architectures ---------
at91
lpc
s3c4510b
s3c44b0x
s3c44b0
s3c3410x
ep7312
lh79520
ep9312
cs89712
sa1100
pxa_lubbock
pxa_mainstone
at91rm92
s3c2410x
s3c2440
sharp_lh7a400
ns9750
-------- BlackFin architectures ----
bf533
bf537


3、編譯uClinux:
#tar jxvf uClinux-dist-20080808.tar.bz2
#cd uClinux-dist
#make menuconfig
選擇
Vendor/Product: GDB/Skyeye
Kernel Version: linux-2.6.x
Libc Version: uClibc
保存退出

在 uclinux-dist 目錄下建立模擬AT91的skyeye配置文件 skyeye.conf,內容如下:
cpu: arm7tdmi
mach: at91
mem_bank: map=M, type=RW, addr=0x00000000, size=0x00004000
mem_bank: map=M, type=RW, addr=0x01000000, size=0x00400000
mem_bank: map=M, type=R, addr=0x01400000, size=0x00400000, file=images/boot.rom
mem_bank: map=M, type=RW, addr=0x02000000, size=0x00400000
mem_bank: map=M, type=RW, addr=0x02400000, size=0x00008000
mem_bank: map=M, type=RW, addr=0x04000000, size=0x00400000
mem_bank: map=I, type=RW, addr=0xf0000000, size=0x10000000
lcd: state=on
然後執行:
make dep

make


4、在skyeye下運行uClinux

這個時候就可以用skyeye來調試運行kernel了,在uclinux-dist執行如下命令:

skyeye -e linux-2.6.x/linux
需要注意的是我已經在/usr/bin目錄中建立了一個skyeye的符號連接,所以上面才不需要輸入skyeye的完整路徑。另外,由於skyeye.conf就在當前目錄下,所以也就不用在skyeye命令中使用-c參數指定了
下面是uClinux跑起來的界面顯示:

[root@work uClinux-dist]# skyeye -e linux-2.6.x/linux
Your elf file is little endian.
arch: arm
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name at91, mach_init addr 0x805eb60
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm7100 mmu ops
Loaded ROM images/boot.rom
start addr is set to 0x01008000 by exec file.
Linux version 2.6.25-uc0 (root@work) (gcc version 4.2.1) #1 Wed Oct 15 14:30:09 CST 2008
CPU: Atmel-AT91M40xxx [14000040] revision 0 (ARMvundefined/unknown), cr=00000000
Machine: Atmel AT91 EB01
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 4064
Kernel command line:
PID hash table entries: 64 (order: 6, 256 bytes)
console [ttyS0] enabled
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 16MB = 16MB total
Memory: 15284KB available (820K code, 74K data, 60K init)
Mount-cache hash table entries: 512
io scheduler noop registered (default)
Atmel USART driver version 0.99
ttyS0 at 0xfffd0000 (irq = 2) is a builtin Atmel APB USART
ttyS1 at 0xfffcc000 (irq = 3) is a builtin Atmel APB USART
brd: module loaded
uclinux[mtd]: RAM probe address=0x1400000 size=0xff000
Creating 1 MTD partitions on "ROM":
0x00000000-0x000ff000 : "ROMfs"
uclinux[mtd]: set ROMfs to be root filesystem
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memory: 60K
Shell invoked to run file: /etc/rc
Command: hostname GDB-ARMulator
Command: /bin/expand /etc/ramfs.img /dev/ram0
Command: mount -t proc proc /proc
Command: mount -t ext2 /dev/ram0 /var
Command: mkdir /var/tmp
Command: mkdir /var/log
Command: mkdir /var/run
Command: mkdir /var/lock
Command: mkdir /var/empty
Command: cat /etc/motd
Welcome to
____ _ _
/ __| ||_|
_ _| | | | _ ____ _ _ _ _
| | | | | | || | _ \| | | |\ \/ /
| |_| | |__| || | | | | |_| |/ \
| ___\____|_||_|_| |_|\____|\_/\_/
| |
|_|

GDB/ARMulator support by <davidm@snapgear.com>
For further information check:
http://www.uclinux.org/

Execution Finished, Exiting

Sash command shell (version 1.1.1)
/>

注意:要在 skyeye.conf 所在目錄下執行skyeye。

如果你是按網上的教程配置可能會有很多錯誤,比如:
arm-linux-ld: ERROR: /opt/project/arm-linux/arm-linux/bin/../lib/gcc/arm-linux/3.4.3/libgcc.a(_divsi3.oS) uses VFP instructions, whereas u-boot does not
File in wrong format: failed to merge target specific data of file /opt/project/arm-linux/arm-linux/bin/../lib/gcc/arm-linux/3.4.3/libgcc.a(_divsi3.oS)
arm-linux-ld: ERROR: /opt/project/arm-linux/arm-linux/bin/../lib/gcc/arm-linux/3.4.3/libgcc.a(_umodsi3.oS) uses VFP instructions, whereas u-boot does not
File in wrong format: failed to merge target specific data of file /opt/project/arm-linux/arm-linux/bin/../lib/gcc/arm-linux/3.4.3/libgcc.a(_umodsi3.oS)
arm-linux-ld: ERROR: /opt/project/arm-linux/arm-linux/bin/../lib/gcc/arm-linux/3.4.3/libgcc.a(_modsi3.oS) uses VFP instructions, whereas u-boot does not
File in wrong format: failed to merge target specific data of file /opt/project/arm-linux/arm-linux/bin/../lib/gcc/arm-linux/3.4.3/libgcc.a(_modsi3.oS)
make: *** [u-boot] Error 1
這時典型的浮點問題,你可能要降低你的編譯工具版本,
或者修改arm-linux-gcc配置文件,或者在內核目錄下找相應架構的配置文件,去除軟浮點運算
或者選擇本文提到的arm-linux-tools版本的工具,並選擇linux 2.6.x內核,可順利完成

[火星人 ] RHEL5.2中架設skyeye+uClinux環境已經有684次圍觀

http://coctec.com/docs/linux/show-post-150418.html