yeahnix 发表于 2004-9-7 21:35:21

rtai in skyeye编译过程及出错信息

最近编译了rtai for xscale in skyeye ,编译通过了,但是运行时候有问题,没有搞懂原因,还请各位大侠指点。

                                                         --yeahnix

所需文件:

lubboock060203,用了二进制编译器 和 initrd.img文件系统
rootfs.tar.gz //直接用二进制,由于太大,去掉了qpe和libstdc++,libnss*,使其在8M范围内
arm-linux-toolchain-bin-05-23-03.tgz //直接用二进制,解压缩

linux-2.4.19.tar.gz
patch-2.4.19-rmk7.gz
diff-2.4.19-rmk7-pxa2.gz
rtai-24.1.13.tgz
patch-2.4.19-rmk-pxa-arm-rthal5

rtai-3.1-test4.tar.bz2//测试时这个编译也通过了,只是不支持版本化的内核。

编译过程:
1、安装toolchain
arm-linux-toolchain-bin-05-23-03.tgz
        tar xzvf -C /usr/local

2、编译内核:
* linux-2.4.19.tar.gz                  - kernel sources from ftp://ftp.kernel.org
* patch-2.4.19-rmk7.gz                 - patches by Russell King from ftp://ftp.arm.linux.org.uk
* diff-2.4.19-rmk7-pxa2.gz           - patches by Nicolas Pitre
* patch-2.4.19-rmk-pxa-arm-rthal5 -rtai patch for pxa250 from rtai-24.1.13.tgz

Kernel build steps:

1.1) Untar the Linux kernel sources (downloaded from ftp.kernel.org):

   % tar xvzf linux-2.4.19.tar.gz

   if the Linux sources were compressed withbzip2,use the following command:

   % bzip2 -dc linux-2.4.19.tar.bz2 | tar xvf -

1.2) Apply Russell's arm-linux patches:

   % gzip -dc patch-2.4.19-rmk7.gz | patch -p1

1.3) Apply Nicolas' PXA255 and PXA262 development platforms Linux patches:

   % gzip -dc diff-2.4.19-rmk7-pxa2.gz | patch -p1

1.4) Apply rtai patches:
cd linux
patch -p0 < patch-2.4.19-rmk-pxa-arm-rthal5

   

1.5) Build the kernel (after patching):

   % make lubbock_config
   % make oldconfig
   make xconfig //去掉了pcmcia(否则好像启动不了),去掉网卡(不知道skyeye支持不,也不知道选什么,所以直接不用)
   % make dep
   % make zImage
   直接编译缺省会有问题,并没有使用ramdisk,所以,

3、使用ramdisk:
修改linux下的.config 参数指定为8M ramdisk
.config
CONFIG_CMDLINE="mem=64M root=/dev/ram ramdisk=8192 ramdisk_start=0xc1000000 console=ttyS0,115200"

修改如下文件
arch/arm/mach-pxa/lubbock.c
fixup_lubbock function //1
去掉下面的注释,使得ramdisk起作用。同时修改 4 * 1024 * 1024为
8 * 1024 * 1024
#if 0
#endif//1 此处是参考版主的文章,实际上由于diff-2.4.19-rmk7-pxa2.gz和pxa1不同,且没有使用diff-2.4.19-rmk7-pxa1-intc1,所以直接将上述对应的内容拷贝到这里就行了。
make oldconfig
make xconfig
General Setup
* default kernel command string: mem=64M root=/dev/ram ramdisk=8192 ramdisk_start=0xc1000000 console=ttyS0,115200
Block Device
* Initial RAM disk (initrd) support
参照rtai的说明,在选择时,必须使得内核支持rtai。
然后编译内核,生成zImage


4、skyeye.conf
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=0x00800000, file=./initrd.img
mem_bank: map=M, type=RW, addr=0xa1800000, size=0x02800000

5、initrd.img
直接用lubbock的bin目录下的rootfs.tar.gz,由于比较大,我去掉了qpe以及libnss*和libstdc++*
制作过程:
dd if/dev/zero of=initrd.img bs=1k count=8192
mkfs.ext2 -c initrd.img
mount -o loop -t ext2 initrd.img /tmp
cd rootfs
cp -av * /tmp//2
umount /tmp//3

6,编译rtai
cd rtai-24.1.13,
make menuconfig 选择使用老版本,新版本好像编译不能通过,而rtai3.1新版本可以,只是不支持版本华内核
make dep
make
./setsched up
make install INSTALL_MOD_PATH=/tmp //刚才的//2处 //3前
make dev INSTALL_MOD_PATH=/tmp


7、将zImage和vmlinux拷贝到skyeye.conf目录下(建立符号链接也可以)运行skyeye
版本0.7.7
skyeye
target sim
load
run

8、运行过程
skyeye vmlinux
***************************************************************
****                                                       ****
****   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"...targ
et sim
(SkyEye) target sim
cpu info: xscale, xscale, 69052100, fffffff0, 2
mach info: name pxa_lubbock, mach_init addr 0x81415f8
SKYEYE: use xscale mmu ops
Loaded ROM zImage
Loaded ROM ./initrd.img
Connected to the simulator.
(SkyEye) load
Loading section .init, size 0x14000 vma 0xc0008000
Loading section .text, size 0x14c900 vma 0xc001c000
Loading section .kstrtab, size 0x5630 vma 0xc0168900
Loading section __ex_table, size 0x9b8 vma 0xc016df30
Loading section __ksymtab, size 0x24b0 vma 0xc016e8e8
Loading section .data, size 0x1124f vma 0xc0172000
rStart address 0xc0008000
Transfer rate: 12386104 bits/sec.
(SkyEye) r
Starting program: /test/vmlinux
Uncompressing Linux................................................... done, boo
ting the kernel.
Linux version 2.4.19-rmk7-pxa2-rthal5 (root@ysh) (gcc version 3.2.1) #8 二 8月 3
1 21:27:31 CST 2004
CPU: XScale-PXA250 revision 0
Machine: Intel DBPXA250 Development Platform
Ignoring unrecognised tag 0x00000000
Memory clock: 99.53MHz (*27)
Run Mode clock: 99.53MHz (*1)
Turbo Mode clock: 99.53MHz (*1.0, inactive)
On node 0 totalpages: 16384
zone(0): 16384 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: mem=64M root=/dev/ram ramdisk=8192 ramdisk_start=0xc1000000
console=ttyS0,115200
Console: colour dummy device 80x30
Calibrating delay loop... 7.27 BogoMIPS
Memory: 64MB = 64MB total
Memory: 54888KB available (1330K code, 303K data, 80K init)
Dentry cache hash table entries: 8192 (order: 4, 65536 bytes)
Inode cache hash table entries: 4096 (order: 3, 32768 bytes)
Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
Buffer-cache hash table entries: 4096 (order: 2, 16384 bytes)
Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Disabling CPU frequency change support.
CPU clock: 0.000 MHz (0.000-0.000 MHz)
Starting kswapd
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
Console: switching to colour frame buffer device 80x30
Keyboard interface test failed: 00
Keyboard interface test failed: 00
Keyboard interface test failed: 00
initialize_kbd: Keyboard reset failed, no ACK
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with no serial options enabled
ttyS00 at 0x0000 (irq = 15) is a PXA UART
ttyS01 at 0x0000 (irq = 14) is a PXA UART
ttyS02 at 0x0000 (irq = 13) is a PXA UART
SA1100 Real Time Clock driver v1.00
rtc: warning: initializing default clock divider/trim value
Keyboard timed out
keyboard: Timeout - AT keyboard not present?
Keyboard timed out
keyboard: Timeout - AT keyboard not present?
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
loop: loaded (max 8 devices)
Probing Lubbock flash at physical address 0x00000000 (32-bit buswidth)
CFI: Found no Lubbock flash device at location zero
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 8192)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com
RAMDISK: ext2 filesystem found at block -1056964608
RAMDISK: Loading 8192 blocks into ram disk... done.
Freeing initrd memory: 8192K
VFS: Mounted root (ext2 filesystem) readonly.
Freeing init memory: 80K
INIT:version 2.78 booting
INIT:Entering runlevel: 3


PXA Linux Preview Kit
Kernel 2.4.19-rmk7-pxa2-rthal5 on an armv5tel
Linux login: root
login: root loginon `ttyS0'

#insmod
BusyBox v0.60.3 (2003.04.18-01:40+0000) multi-call binary

Usage: insmod ... MODULE ...

#insmod rtai
Using /lib/modules/2.4.19-rmk7-pxa2-rthal5/rtai/rtai.o
SKYEYE ARMul_MRC,CANT UndefInstrCPnum is f, instr ee153f10
insmod (54): undefined instruction: pc=c00265a0
Code: 00000000 00000000 00000000 00000000 (ee153f10)
Internal error: Oops - undefined instruction: c001f9d0
CPU: 0
pc : [<c00265a0>]    lr : [<c001e4b0>]    Not tainted
sp : c1641fb0ip : c4898000fp : 00000000
r10: 0006f890r9 : 0000001er8 : c48a1bf0
r7 : 00003907r6 : 0006b6c0r5 : c1641fecr4 : ffffffff
r3 : 80000000r2 : 00026094r1 : 00001002r0 : 00026094
Flags: NzcvIRQs offFIQs onMode SVC_32Segment user
Control: 3907Table: A1688000DAC: 00000015
Process insmod (pid: 54, stack limit = 0xc1640368)
Stack: (0xc1641fb0 to 0xc1642000)
1fa0:                                     00000000 00001002 0006f090 00000002
1fc0: 000a7448 0006f7ee 0006b6c0 c4898006 c48a1bf0 0000001e 0006f890 000a6148
1fe0: c4898000 bfffbb34 c48a1b48 00026094 80000010 ffffffff 65756c61 786e7100
Backtrace: no frame pointer
Code: 00000000 00000000 00000000 00000000 (ee153f10)
Segmentation fault
#rmmod rtai
#insmod rtai
Using /lib/modules/2.4.19-rmk7-pxa2-rthal5/rtai/rtai.o
SKYEYE ARMul_MRC,CANT UndefInstrCPnum is f, instr ee153f10
insmod (56): undefined instruction: pc=c00265a0
Code: 00000000 00000000 00000000 00000000 (ee153f10)
Internal error: Oops - undefined instruction: c001f9d0
CPU: 0
pc : [<c00265a0>]    lr : [<c001e4b0>]    Not tainted
sp : c1641fb0ip : c4898000fp : 00000000
r10: 0006f890r9 : 0000001er8 : c48a1bf0
r7 : 00003907r6 : 0006b6c0r5 : c1641fecr4 : ffffffff
r3 : 80000000r2 : 00026094r1 : 00001002r0 : 00026094
Flags: NzcvIRQs offFIQs onMode SVC_32Segment user
Control: 3907Table: A1688000DAC: 00000015
Process insmod (pid: 56, stack limit = 0xc1640368)
Stack: (0xc1641fb0 to 0xc1642000)
1fa0:                                     00000000 00001002 0006f090 00000002
1fc0: 000a7448 0006f7ee 0006b6c0 c4898006 c48a1bf0 0000001e 0006f890 000a6148
1fe0: c4898000 bfffbb34 c48a1b48 00026094 80000010 ffffffff 65756c61 786e7100
Backtrace: no frame pointer
Code: 00000000 00000000 00000000 00000000 (ee153f10)
Segmentation fault

chyyuu 发表于 2004-9-16 10:53:47

欢迎yeahix工作,很有意思!我将让学生也参与这些工作,这样你们也可以探讨一下!
页: [1]
查看完整版本: rtai in skyeye编译过程及出错信息