返回信息流我是用的是Xilinx v5的板,里边的处理器是powerpc440,交叉编译工具是ELDK,我没有用uboot,因为是Xilinx板子自带的SystemACE能引导启动。我在CF卡上分了2个分区,一个是FAT16,用来存放.ace文件(ace文件由内核镜像zImage.elf和Xilinx EDK生成的与硬件配置相关的dowload.bit合并而成);另一个是EXT3分区,用来存放根文件系统。
用busybox编译时,改了一个网上的脚本:
#!/bin/sh
#
# mkrootfs creates a root filesystem for the
# Xilinx ML507 embedded development kit.
#
#
#
# Modify variables below to meet your requirements
#
# position of your embedded rootfs
LFS=/opt/ml507_rootfs
# cross compiler prefix
CC=powerpc-linux-gcc
# target prefix
TARGET_PREFIX=/opt/eldk/ppc_4xxFP
# cross build tools directory
BUILD_TOOLS=/opt/eldk/
# embedded linux kernel sources
PPC_KERNEL=/root/Download/linux-2.6-xlnx.git
MKROOTFS=`pwd`
echo "mkrootfs starting..."
echo
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "usage: $0 [options]"
echo
echo "options:"
echo " -h | --help - show this help"
echo " -ieee1394 - build and install firewire support (libraw, libdc, etc.)"
exit
fi
if [ "$1" = "-ieee1394" ]; then
echo "Building ML300 root filesystem with IEEE1394 firewire support in $LFS"
else
echo "Building ML507 root filesystem in $LFS"
fi
echo "...press a key to proceed or CTRL-C to abort..."
read
cd ${MKROOTFS}
# remove old rootfs, if exist
if [ -a ${LFS} ]
then echo "Removing old rootfs..."; rm -rf ${LFS}
fi
# create directories
echo Creating directory structure...
mkdir -p ${LFS}/{bin,boot,dev/{pts,shm},etc/opt,home,lib,mnt,proc}
mkdir -p ${LFS}/{root,sbin,tmp,usr/local,var,opt}
for dirname in ${LFS}/usr ${LFS}/usr/local
do
mkdir $dirname/{bin,etc,include,lib,sbin,share,src}
ln -s share/{man,doc,info} $dirname
mkdir $dirname/share/{dict,doc,info,locale,man}
mkdir $dirname/share/{nls,misc,terminfo,zoneinfo}
mkdir $dirname/share/man/man{1,2,3,4,5,6,7,8}
done
mkdir ${LFS}/var/{lock,log,mail,run,spool}
mkdir -p ${LFS}/var/{tmp,opt,cache,lib/misc,local}
mkdir ${LFS}/opt/{bin,doc,include,info}
mkdir -p ${LFS}/opt/{lib,man/man{1,2,3,4,5,6,7,8}}
chmod 0750 ${LFS}/root
chmod 1777 ${LFS}/tmp ${LFS}/var/tmp
# for syslogd
ln -s /tmp/messages ${LFS}/var/log/messages
# copy glibc
echo Copying glibc...
cd ${TARGET_PREFIX}/lib
cp *-*.so ${LFS}/lib
cp -d *.so.[*0-9] ${LFS}/lib
cp libSegFault.so libmemusage.so libpcprofile.so ${LFS}/lib
echo "glibc files installed. To reduce the size of installed libraries, use strip /lib/*.so"
# install nsswitch.conf from build-tools/glibc/nss/
echo Installing /etc/nsswitch.conf
cp ${BUILD_TOOLS}/ppc_4xxFP/etc/nsswitch.conf ${LFS}/etc
# install kernel modules
echo "Install kernel modules..."
#cd ${PPC_KERNEL}
cp -a /opt/modules4rfs/* ${LFS}
#/opt/modules4rfs里面是lib/modules,是事先我在内核源码目录下make modules&&make modules_install生成的
# install /etc
echo "Installing /etc..."
cd ${MKROOTFS}
cp -a etc ${LFS}
# install /home
echo "Installing /home..."
cd ${MKROOTFS}
cp -a home ${LFS}
# done
echo "Your rootfs has been created."
echo
echo "Now installing busybox to get a running system."
cd /opt/busybox-1.13.3
# Adjust .config for installing the busybox targets properly.
#mv .config .config.OLD
#cat .config.OLD | sed /^PREFIX/d > .config.OLD2 && rm -f .config.OLD
#echo "PREFIX=\"$LFS\"" > .config
#cat .config.OLD2 >> .config && rm -f .config.OLD2
make && make install
# FireWire support
if [ "$1" = "ieee1394" ]; then
echo "Adding FireWire IEEE1394 support (libraw1394, libdc1394)"
cd ${MKROOTFS}
sh mklibraw1394.sh
sh mklibdc1394.sh
fi
echo "Changing permissions and ownerships"
chown -R root ${LFS}
chmod -R a+x ${LFS}
echo "Done."
执行脚本之前,还先make menuconfig了一下,改了一下安装路径,并把Cross Compiler Prefix设为powerpc-linux-gcc
然后把所有的文件夹拷贝到ext3分区里边,启动时minicom的全部信息如下:
Using Xilinx Virtex440 machine description
Linux version 2.6.29-rc5 (root@localhost.localdomain) (gcc version 4.2.2) #12 P9
Zone PFN ranges:
DMA 0x00000000 -> 0x00010000
Normal 0x00010000 -> 0x00010000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00010000
MMU: Allocated 1088 bytes of context maps for 255 contexts
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
Kernel command line: console=ttyS0 root=/dev/xsa2 rw init=/sbin/init
Xilinx intc at 0x81800000 mapped to 0xfdfff000
PID hash table entries: 1024 (order: 10, 4096 bytes)
clocksource: timebase mult[d55555] shift[22] registered
Console: colour dummy device 80x25
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 256128k/262144k available (3264k kernel code, 5856k reserved, 128k data)
Calibrating delay loop... 598.01 BogoMIPS (lpj=1196032)
Mount-cache hash table entries: 512
net_namespace: 880 bytes
NET: Registered protocol family 16
PCI: Probing PCI hardware
bio: create slab <bio-0> at 0
XGpio: /plb@0/gpio@81460000: registered
XGpio: /plb@0/gpio@81400000: registered
XGpio: /plb@0/gpio@81420000: registered
XGpio: /plb@0/gpio@81440000: registered
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
NET: Registered protocol family 1
msgmni has been set to 500
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
83e00000.serial: ttyS0 at MMIO 0x83e01003 (irq = 16) is a 16550A
console [ttyS0] enabled
brd: module loaded
loop: module loaded
xsysace 83600000.sysace: Xilinx SystemACE revision 1.0.12
xsysace 83600000.sysace: capacity: 1000944 sectors
xsa: xsa1 xsa2
Xilinx SystemACE device driver, major=254
Device Tree Probing 'ethernet'
xilinx_lltemac 81c00000.ethernet: no IRQ found.
mice: PS/2 mouse device common for all mice
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
kjournald starting. Commit interval 5 seconds
EXT3-fs warning: mounting unchecked fs, running e2fsck is recommended
EXT3 FS on xsa2, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) on device 254:2.
Freeing unused kernel memory: 168k init
Warning: unable to open an initial console.
Bad trap at PC: 48016e4c, SR: 2d000, vector=2010
init has generated signal 5 but has no handler for it
Kernel panic - not syncing: Attempted to kill init!
Rebooting in 180 seconds..
当我把Cross Compiler Prefix设为powerpc-linux-后,
红色那行Bad trap at PC: 10155218, SR: 2d000, vector=2010,PC值变了。
后来我还试过直接用powerpc-linux-gcc编译了一个helloworld可执行程序并更名为init,然后把/sbin下的init替换掉,
结果还是Bad trap at PC ,具体的值我就没有记下来
另外,我把网上下载的ramdisk.tar.gz和zImage.elf一起生成的initrd-zImage.elf,然后再和download.bit文件合成.ace文件却能顺利从CF启动。
有谁也是在做类似的东西的,请帮帮忙,谢谢!
这是一条镜像帖。来源:北邮人论坛 / embedded-system / #4378同步于 2009/4/3
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Embedded_System机器人发帖
xilinx powerpc440启动出错
qvb
2009/4/3镜像同步3 回复
订阅后,新回复会通过你的通知中心匿名送达。