Linux2.4.26内核在Virtex II Pro开发板上的移植----编译内核(四)ZZ
- UID
- 1023229
- 来自
- 中国
|
Linux2.4.26内核在Virtex II Pro开发板上的移植----编译内核(四)ZZ
下载内核
因为是针对PowerPC的内核,所以比较难找。 #wget http://www.bitmover.com/bk-client2.0.shar
#sh bk-client2.0.shar
#cd bk-client2.0
#sh demo.sh 生成bkf命令
#./bkf clone bk://ppc.bkbits.net/linuxppc_2_4_devel linuxppc-2.4.26 又是一大工程,网速太慢了,下了一天。
设置编译环境
#export PATH=/home/yaoq/ppc/usr/bin/:/home/yaoq/gcc-3.3.6-glibc-2.3.2/powerpc-405-linux-gnu/bin/PATH 设置编译工具链路径
#cd linuxppc_2_4_devel 进入kernel source tree目录下面
#vim Makefile
修改:
ARCH :=PPC
CROSS_COMPILE =powerpc-405-linux-gnu-
保存
下载BSP至kernel source tree
按照对应的目录覆盖原文件
如在生成的BSP下有arch/ppc/platform/xilinx_ocp
将下面的文件覆盖到linux2.4.26/arch/ppc/platform/xilinx_ocp/下面。
drivers目录也是一样的。
修改部分代码
#cd linuxppc-2.4.26
#vim arch/ppc/boot/common/ns16550.c
修改:
#define SERIAL_BAUD 115200 #设置串口波特率
#vim arch/ppc/platforms/xilinx_ocp/Makefile
修改成:
xilinx_ocp-objs += xbasic_types.o xdma_channel.o xdma_channel_sg.o \
xipif_v1_23_b.o xpacket_fifo_v2_00_a.o xpacket_fifo_l_v2_00_a.o \
xversion.o
#vim arch/ppc/boot/simple/embed_config.c
//#error I2C needed for obtaining the Ethernet MAX address //注释掉该语句 #vim arch/ppc/platform/xilinx_ocp/xilinx_syms.c
修改:
#include "xpacket_fifo_v1_00_b.h"
EXPORT_SYMBOL(XPacketFifoV100b_Initialize);
EXPORT_SYMBOL(XPacketFifoV100b_Read);
EXPORT_SYMBOL(XPacketFifoV100b_SelfTest);
EXPORT_SYMBOL(XPacketFifoV100b_Write);
为:
#include "xpacket_fifo_v2_00_a.h"
EXPORT_SYMBOL(XPacketFifoV200a_Initialize);
EXPORT_SYMBOL(XPacketFifoV200a_Read);
EXPORT_SYMBOL(XPacketFifoV200a_SelfTest);
EXPORT_SYMBOL(XPacketFifoV200a_Write);
#make menuconfig 可参考本人的.config文件本人将一些重要的配置罗列如下:
Platform support
(40x) Processor Type
(Xilinx-ML300) Machine Type
(UART0)TTYS0 device and default console
Gerneral setup
Networking support
Sysctl support
System V IPC
Default bootloader kernel arguments
Initial kernel command string: "console=ttyS0,115200 ip=on root=/dev/xsysace/disc0/part3 rw init=/bin/sh"
Block devices
Xilinx on-chip System ACE
Network block device support
RAM disk support
[16384] Default RAM disk size
Initial RAM disk (initrd) support
Per partition statistics in /proc/partitions
Network device support
Network device support
Ethernet(10 or 100Mbit)--->
Ethernet(10 or 100Mbit)
<*>Xilinx on-chip ethernet
Character devices
<*>Standard/generic (8250/16550 and compatible UARTs) serial support
support for console on serial port
Unix98 PTY support
(256) Maximum number of Unix98 PTYs in use (0-2048)
File systems
<*>kernel automounter support
<*> Kernel automounter version 4 support (also supports v3)
Virtual memory file system support (former shm fs)
NTFS file system srpport(read only)
/proc file system support
/dev file system support (EXPERIMETAL)
Automatically mount at boot
Second extended fs support
Native Language Support--->
Default NLS Option: "iso8859-1"
注:没有列出的选项并不表示没有选中。如果想完全参考,见config file
#make dep
#make zImgae.initrd
#cd arch/ppc/boot/images
#ls
Makefile vmlinux.gz zImage.initrd.elf zImage.initrd.embedded
zImage.initrd.elf就是我们所需要的编译好的内核镜像。
来源:fcni_cn的百度空间 |
|
|
|
|
|