间断的折腾了近一星期,welcome to uClinux的界面终于出现在显示器上,过程可谓三波五折。。

对于硬件资源缺乏的我们,skyeye的诱惑力是巨大的。

我是用VMware虚拟机安装的RedHat Linux 9.0,arm-elf-gcc 3.2.2,windows界面下download skyeye-1.2.4,也就是目前的最新版本, 放在了share folder指定的文件夹下,linux下在hgfs找到skyeye-1.2.4_Rel.tar.gz复制到 /home下,在终端

[root@pandy uClinux-dist]#cd  /home
[root@pandy uClinux-dist]#tar -zxvf  skyeye-1.2.4_Rel.tar.gz
[root@pandy uClinux-dist]# cd skyeye-1.2.4
[root@pandy uClinux-dist]#make

开始出现困扰了,最后部分如下:
binary/libppc.a(ppc_mmu.o)(.text+0x26a): In function `ppc_mmu_set_sdr1':
arch/ppc/common/ppc_mmu.c:240: undefined reference to `prom_quiesce'
collect2: ld returned 1 exit status
make: *** [binary/skyeye] Error 1
binary目录下并没有出现skyeye或者skyeye.exe

  baidu,google发现也有人出现同样的问题,而他的解决方法是在从新到旧实验了三个skyeye的版本后终于把0.9.5的版本安装并没报错,于是兴致勃勃采用同样的方法,结果还是失败告终。
  只好又回到skyeye-1.2.4,回头看看它的错误提示,出错的意思大概是在ppc_mmu_set_sdr1里没用到function prom_quiesce(),注释掉prom_quiesce(),然后

[root@pandy uClinux-dist]#make NO_LCD=1

成功!期待的enjoy it 出现了!binary下也有skyeye了。但prom_quiesce()函数的用处暂时不知道。启发是认真阅读完它的README文件,不要心急。截取最后一部分如下:
s   -lbfd -liberty --end-group  -lm
****
**** The binary file located at 'binary/skyeye', enjoy it.
****

开始准备运行uClinux内核。
[root@pandy uClinux-dist]#cd usr/src
[root@pandy uClinux-dist]#ls
 
里面有我需要的软件包,但名特长,所以ls后复制粘贴方便。
[root@pandy uClinux-dist]#tar uClinux-dist-20040408.tar.gz
[root@pandy uClinux-dist]#cd uClinux-dist
[root@pandy uClinux-dist]#make menuconfig

Vendor/Product Selection  --->中的配置如下:
--- Select the Vendor you wish to target
(philips) Vendor
---Select the Product you wish to target
 (lpc2210) GDB Products 
Kernel/Library/Defaults Selection  --->中的配置如下:
(linux-2.4.x) Kernel Version
(uClibc) Libc Version
[ ] Default all settings (lose changes)
[ ] Customize Kernel Settings
[ ] Customize Vendor/User Settings
[ ] Update Default Vendor Settin
exit,选择保存。

[root@pandy uClinux-dist]#make dep
[root@pandy uClinux-dist]#make

成功。在uClinux目录下建立skyeye.conf文件,配置如下:
cpu: arm7tdmi
mach: lpc
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/romfs.img
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

在当前目录下
[root@pandy uClinux-dist]# /home/skyeye-1.2.4/binary/skyeye -e linux-2.4.x/linux

big_endian is false.
arch: arm
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name lpc, mach_init addr 0x8067df0
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm7100 mmu ops
Loaded ROM   images/romfs.img
exec file "linux-2.4.x/linux"'s format is elf32-little.
load section .init: addr = 0x81008000  size = 0x0000a000.
SKYEYE:NumInstrs 0, mem_write_byte addr = 81008000 no bank
[root@pandy uClinux-dist]#

还是出现问题了,内核并没有成功运行。
于是论坛发帖求助,可能各人碰到的问题不一样,回帖的甚少。再仔细检查发现我在在menuconfig里面Vendor/Product按ZLG的pdf配置为philips/lpc2210,而网站多为GDB/ARMulator,于是从新设置
[root@pandy uClinux-dist]#make clean
[root@pandy uClinux-dist]#make menuconfig
[root@pandy uClinux-dist]#make dep
[root@pandy uClinux-dist]#make

这是个很长的过程,足以泡杯coffe
coffe喝完后,敲下
[root@pandy uClinux-dist]#/home/skyeye-1.2.4/binary/skyeye -e linux-2.4.x/linux
看见程序一行行上跑,
big_endian is false.
arch: arm
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name lpc, mach_init addr 0x806bdf0
can't find device module: (name:lcd, type:(null))
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm7100 mmu ops
Loaded ROM images/romfs.img
exec file "linux-2.4.x/linux"'s format is elf32-little.
load section .init: addr = 0x01000000 size = 0x0000a000.
load section .text: addr = 0x0100a000 size = 0x000dca40.
load section .data: addr = 0x010e8000 size = 0x00009ce4.
not load section .bss: addr = 0x010f1d00 size = 0x00022020 .
not load section .debug_abbrev: addr = 0x00000000 size = 0x0003d315 .
not load section .debug_info: addr = 0x00000000 size = 0x0186b95d .
not load section .debug_line: addr = 0x00000000 size = 0x002ba0f2 .
not load section .debug_pubnames: addr = 0x00000000 size = 0x0000c30b .
not load section .debug_aranges: addr = 0x00000000 size = 0x00002438 .
start addr is set to 0x01000000 by exec file.
ERROR:io_read: addr = fff00000
R d3,0,fff00000,0,0,1113d20,10f2974,0,1113d20,10f2970,0,0,0,10ea000,0,1000030,C d3,S 0,0,0,0,0,0,0,M 13,B 3,E 0,I 0,P 0,T 0,L 0,D 0
满以为就ok了,谁知光标就停在这里再也不动了,有出错提示ERROR:io_read: addr = fff00000
其实跑到这步已经是大跃进了,接下来很快问题就找出来了
skyeye.conf里的mach为lpc,但这个配置的demo应该是at91的,将lpc改为at91,保存

[root @pandy uClinux-dist]#/home/skyeye-1.2.4/binary/skyeye -e linux-2.4.x/linux
.....
Command: mkdir /var/tmp
Command: mkdir /var/log
Command: mkdir /var/run
Command: mkdir /var/lock
Command: cat /etc/motd
Welcome to
_ _
/ | ||_|
_ _| | | | _
_ _ _ _
| | | | | | || | _ /| | | |/ // /
| |_| | |
| || | | | | |_| |/ /
| _/ |_||_|_| |_|/ |/_//_/
| |
|_|
这个标志性的东西终于出来啦!
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐