在SkyEye下制作自己的文件系统的问题
我想自己做一个可以运行在SkyEye下的文件系统。SkyEye: SkyEye-0.7.7
目标系统:xscale_lubbock
内核版本:Linux-2.6.7
文件系统:ramdisk, ext2, 16M
工具链: xscale-gcc-3.3.3(所在目录/usr/local/xscale/3.3.3)
busybox: busybox-1.00-rc3
KERNEL_DIR=/home/Kernel
BUSYBOX_DIR=/home/Busybox
RAMDISK_DIR=/home/Ramdisk
具体步骤如下:
1) 编译内核:
a) cd $KERNEL_DIR/linux-2.6.7
b) make ARCH=arm lubbock_defconfig
c) make ARCH=arm meunconfig
--->Choose: General Setup
--->(root=/dev/ram initrd=0xa1000000,0x00400000 console=ttyS0,115200 mem=64M)
--->Choose: Block Devices
---><*>RamDisk support
--->(16384) Default Ram disk size(kbytes)
--->[*] Initial Ram disk (initrd) support
--->Save and Exit
d) make ARCH=arm CROSS_COMPILE=/usr/local/xscale/3.3.3/arm-linux-
在arch/arm/boot生成编译好的内核(zImage)
2) 编译busybox
a) cd $BUSYBOX_DIR/busybox-1.00-rc3
b) make menuconfig
--->Choose: Build Option
--->[ ] Build BusyBox as a static binary (no shared libs) (默认设置为选中这项,现在取消这项)
--->[*] Do you want to build BusyBox with a Cross Compiler?
(/usr/local/xscale/3.3.3/bin/arm-linux-) Cross Compiler prefix
--->Choose: Networking Utilities
--->[ ] route (默认设置为选中这项,现在取消这项)
c) make
d) make install
所有的可执行文件默认被复制到busybox-1.00-rc3/_install目录中
3) 制作文件系统RamDisk
A) 生成基本的映像文件
a) cd $RAMDISK_DIR/
b) dd if=/dev/zero of=ramdisk.img bs=1024 count=16384
c) mke2fs ramdisk.img
d) file ramdisk.img (检查映像文件是否被格式化成为ext2的文件系统)
e) mkdir tmpDir
f) mount ramdisk.img tmpDir/ -o loop
g) cd tmpDir
h) mkdir bin
mkdir dev
mkdir etc
mkdir home
mkdir lib
mkdir mnt
mkdir proc
mkdir tmp
mkdir usr
mkdir var
i) cd dev
mknod console c 5 1
mknod fb0 c 29 0
mknod kmem c 1 2
mknod mem c 1 1
mknod null c 1 3
mknod ram b 1 0
mknod random c 1 8
mknod ts c 10 9
mknod tty c 5 0
mknod tty0 c 4 0
mknod tty1 c 4 1
mknod ttyAM0 c 204 16
mknod ttyAM0 c 204 17
mknod urandom c 1 9
mknod zero c 1 5
B) 配置系统启动脚本
a) cd ../etc
b) mkdir init.d
cd init.d
vi rcS
#!/bin/sh
mount -t proc proc /proc
mkdir /var/tmp
mkdir /var/log
mkdir /var/run
mkdir /var/lock
cat /etc/motd
cd ..
c) vi inittab
(Nothing)
d) vi inittab
Welcome to
_ _____ __ __ _ _
/ \ /__ \ /\_/\| | |_|
/ _ \ | || |/ /\ /\ \ | | _ _____ ___
/ /_\ \| |__| | / /\_/\ \| | | |_ \| | | |\ \/ /
/ /___\ \ | |__\ \ | | | || |___ | | |_| | |_| |/ \
/_/ \_\| | \_\|_| |_||_____||_|_| |_|\____|\_/\_/
ARMLinux for Skyeye
For further information check:
http://hpclab.cs.tsinghua.edu.cn/~skyeye/
e) vi fstab
proc /proc proc default 0 0
C) 复制busybox的可执行文件和动态连接库
a) cd ..
b) cp $BUSYBOX_DIR/busybox-1.00-rc3/_install . -dpR
c) cd lib
cp /usr/local/xscale/3.3.3/lib/ld-2.3.2.so .
/usr/local/xscale/3.3.3/bin/arm-linux-strip ld-2.3.3.so
ln -s ld-2.3.2.so ld-linux.2.so
d) cd ../usr
mkdir arm-linux/lib -p
cd arm-linux/lib
cp /usr/local/xscale/3.3.3/lib/libc-2.3.2.so .
cp /usr/local/xscale/3.3.3/lib/libc.so .
/usr/local/xscale/3.3.3/bin/arm-linux-strip ld-2.3.3.so
ln -s libc-2.3.2.so libc.so.6
e) cd ../etc
f) vi ld.so.conf
/lib
/usr/local/arm-linux/lib
cp /sbin/ldconfig .
export ROOT=$RAMDISK_DIR/tmpDir
ldconfig -r -C ld.so.cache
D) 生成基本的映像文件
a) cd ../../
b) umount ramdisk.img
c) rm tmpDir -rf
4) 制作文件系统RamDisk
cpu: xscale
mach: pxa_lubbock
mem_bank: map=I, type=RW, addr=0x40000000, size=0x0c000000
mem_bank: map=M, type=RW, addr=0xa0000000, size=0x00200000
mem_bank: map=M, type=RW, addr=0xa0200000, size=0x00100000, file=zImage, boot=yes
mem_bank: map=M, type=RW, addr=0xa0300000, size=0x00d00000
mem_bank: map=M, type=RW, addr=0xa1000000, size=0x01000000, file=./ramdisk.img
mem_bank: map=M, type=RW, addr=0xa2000000, size=0x02000000
mem_bank: map=M, type=RW, addr=0xc0000000, size=0x00096000
5) 运行SkyEye
a) 将上述步骤生成的zImage, ramdisk.img, skyeye.conf放在同一目录中
b) 运行skeye
# skyeye
***************************************************************
**** ****
**** SkyEyeSimulator Ver 0.7.7 withGDB 5.3 Interface ****
**** ****
***************************************************************
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.Type "show warranty" for details.
This SkyEye was configured as "--host=i686-pc-linux-gnu --target=arm-elf".
(SkyEye) tar s
cpu info: xscale, xscale, 69052100, fffffff0, 2
mach info: name pxa_lubbock, mach_init addr 0x8141b8c
lcd info: turn on lcd!
SKYEYE: use xscale mmu ops
Loaded ROM zImage
Loaded ROM ./ramdisk.img
Connected to the simulator.
(SkyEye) run
Starting program:
warning: No executable file specified.
warning: No program loaded.
Uncompressing Linux................................................................ done, booting the kernel.
Linux version 2.6.7 ([email protected]) (gcc version 3.3.3) #6 Thu Aug
19 22:19:55 EDT 2004
CPU: XScale-PXA250 revision 0 (ARMv5TE)
CPU: D undefined 5 cache
CPU: I cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets
CPU: D cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets
Machine: Intel DBPXA250 Development Platform (aka Lubbock)
Memory policy: ECC disabled, Data cache writeback
Memory clock: 99.53MHz (*27)
Run Mode clock: 99.53MHz (*1)
Turbo Mode clock: 99.53MHz (*1.0, inactive)
On node 0 totalpages: 16384
DMA zone: 16384 pages, LIFO batch:4
Normal zone: 0 pages, LIFO batch:1
HighMem zone: 0 pages, LIFO batch:1
Built 1 zonelists
Kernel command line: root=/dev/ram initrd=0xa1000000,0x01000000 console=ttyS0,115200 mem=64M
PID hash table entries: 512 (order 9: 4096 bytes)
Console: colour dummy device 80x30
Memory: 64MB = 64MB total
Memory: 46448KB available (1606K code, 368K data, 76K init)
Calibrating delay loop... 7.29 BogoMIPS
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
checking if image is initramfs...it isn't (ungzip failed); looks like an initrd
Freeing initrd memory: 16384K
NET: Registered protocol family 16
Linux Kernel Card Services
options:none
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc.
ttyS0 at MMIO 0x40100000 (irq = 15) is a FFUART
ttyS1 at MMIO 0x40200000 (irq = 14) is a BTUART
ttyS2 at MMIO 0x40700000 (irq = 13) is a STUART
RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
Using anticipatory io scheduler
Lubbock configured to boot from ROM (bank 0)
Probing Lubbock Boot ROM at physical address 0x00000000 (32-bit buswidth)
CFI: Found no Lubbock Boot ROM device at location zero
Probing Lubbock Application Flash at physical address 0x04000000 (32-bit buswidth)
CFI: Found no Lubbock Application Flash device at location zero
pxa2xx_udc: version 14-Dec-2003
gs_bind: Gadget Serial v0.1 bound
gs_module_init: Gadget Serial v0.1 loaded
mice: PS/2 mouse device common for all mice
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 8192)
NET: Registered protocol family 1
RAMDISK: ext2 filesystem found at block 0
RAMDISK: Loading 16384 blocks into ram disk... done.
VFS: Mounted root (ext2 filesystem) readonly.
Freeing init memory: 76K
SKYEYE ARMul_STC,NOT ALLOW, undefinstr,CPnum is 2, instr ed2d420c, addr befff920
SKYEYE ARMul_LDC,NOT ALLOW, underinstr, CPnum is 2, instr ecbd420c, addr befff920
/sbin/init: error while loading shared libraries: libc.so.6: cannot open shared
object file: No such file or directory
Kernel panic: Attempted to kill init! 问题解决了吗? 还没有,在编译内核时,在COMMAND_LINE中加入LD_LIBRARY_PATH=/usr/local/arm-linux/lib,则上述的连接错误就会消失。但是busybox仍然没有办法启动。
busybox启动时执行的是/sbin/init,在其源码中加入printf语句,发现init启动后总是停在一些跟控制台(console)相关的操作上,然后就不动了。
如果用其他的sh先将系统启动,再执行busybox的其他功能,如ls,cat...之类的均能正常执行。 我们好象没有碰到这个问题。
页:
[1]