Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15496240
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类:

2010-04-26 11:03:52

一、搭建mips平台编译环境及生成相关
准备工作
1、在home目录下建立一个mute目录,用于项目开发相关开发的一个目录
2、 拷贝西格码公司提供的SMP8634平台相关开发源码包到刚才新建的目录mute下。
第一步:建立编译环境
1、在mute目录下解压 smp86xx_toolchain_2.8.0.1.tar.bz2 包
debian:/home/mute# tar jxvf smp86xx_toolchain_2.8.0.1.tar.bz2
2、进入解压后的目录
debian:/home/mute# cd smp86xx_toolchain_2.8.0.1
3、拷贝以下源码包到dl目录下(说明:)
binutils-2.15.91.0.2.tar.bz2  gcc-3.4.2.tar.bz2  linux-libc-headers-2.6.11.0.tar.bz2
ccache-2.3.tar.gz             gdb-6.5.tar.bz2    uClibc-0.9.27.tar.bz2
debian:/home/mute/smp86xx_toolchain_2.8.0.1# cp -ar /8634/smp86xx_toolchain_2.8.0.1/dl/* ./dl/
4、配置交叉工具链
debian:/home/mute/smp86xx_toolchain_2.8.0.1# make menuconfig

5、编译
debian:/home/mute/smp86xx_toolchain_2.8.0.1# make
debian:/home/mute/smp86xx_toolchain_2.8.0.1# source toolchain-path.env
第二步:编译bootloader
1、
debian:/home/mute#tar zxvf CPU_KEYS_SMP8634_xosMc0-1.tar.gz
debian:/home/mute# cd CPU_KEYS_SMP8634_xosMc0-1
debian:/home/mute/CPU_KEYS_SMP8634_xosMc0-1# source CPU_KEYS.env
debian:/home/mute# tar jxvf smp86xx_boot_loader_2.8.0.1.tar.bz2
debian:/home/mute# cd smp86xx_boot_loader_2.8.0.1
debian:/home/mute/smp86xx_boot_loader_2.8.0.1# ls
Makefile  README  inc.gnxnv.Makefile  inc.yamon.Makefile  inc.zboot.Makefile  pf  tools  zboot
debian:/home/mute/smp86xx_boot_loader_2.8.0.1# ln -s tools/genxenv/configs/852-E2.config  xenv.config
debian:/home/mute/smp86xx_boot_loader_2.8.0.1# make zboot
debian:/home/mute/smp86xx_boot_loader_2.8.0.1# mkdir sources
debian:/home/mute/smp86xx_boot_loader_2.8.0.1# cp /8634/smp86xx_boot_loader_2.8.0.1/sources/yamon-src-02.06.tar.gz  sources/
debian:/home/mute/smp86xx_boot_loader_2.8.0.1# ls /8634/smp86xx_boot_loader_2.8.0.1/reference/
eBIOS_v1.5_LED  eBIOS_v1.5_LED.tar.gz
debian:/home/mute/smp86xx_boot_loader_2.8.0.1# mkdir reference
debian:/home/mute/smp86xx_boot_loader_2.8.0.1# cp /8634/smp86xx_boot_loader_2.8.0.1/reference/eBIOS_v1.5_LED.tar.gz  reference/

debian:/home/mute/smp86xx_boot_loader_2.8.0.1# make yamon

debian:/home/mute/smp86xx_boot_loader_2.8.0.1# cp bin/* /tftpboot/mute/

第三步:建立文件系统
debian:/home/mute# tar jxvf smp86xx_rootfs_2.8.0.1.tar.bz2
debian:/home/mute# cd smp86xx_rootfs_2.8.0.1
debian:/home/mute/smp86xx_rootfs_2.8.0.1# ls
Config.in  Makefile  README  package  target  test_if_zlib_is_available.sh  toolchain  tools  xbin
debian:/home/mute/smp86xx_rootfs_2.8.0.1# mkdir dl
debian:/home/mute/smp86xx_rootfs_2.8.0.1# ls
Config.in  Makefile  README  dl  package  target  test_if_zlib_is_available.sh  toolchain  tools  xbin
debian:/home/mute/smp86xx_rootfs_2.8.0.1# cp /8634/smp86xx_rootfs_2.8.0.1/dl/* ./dl/
debian:/home/mute/smp86xx_rootfs_2.8.0.1# ls dl
bash-3.0.tar.gz        cramfs-1.1.tar.gz  linux-libc-headers-2.6.11.0.tar.bz2  uClibc-0.9.27.tar.bz2
busybox-1.5.0.tar.bz2  gdb-6.5.tar.bz2    ncurses-5.2.tar.gz
debian:/home/mute/smp86xx_rootfs_2.8.0.1# make menuconfig
Package Selection for the target  --->
    busybox version (busybox 1.00)  --->
      (X) busybox 1.5.0
[*] customize

debian:/home/mute/smp86xx_rootfs_2.8.0.1# cd target/generic/target_skeleton/
debian:/home/mute/smp86xx_rootfs_2.8.0.1/target/generic/target_skeleton# mkdir tango cdrom
debian:/home/mute/smp86xx_rootfs_2.8.0.1# make      
debian:/home/mute/smp86xx_rootfs_2.8.0.1# source rootfs-path.env

第 四步:编译内核
debian:/home/mute# tar jxvf smp86xx_kernel_source_2.8.0.1.tar.bz2
debian:/home/mute/smp86xx_kernel_source_2.8.0.1# cd smp86xx_kernel_source_2.8.0.1
debian:/home/mute/smp86xx_kernel_source_2.8.0.1# cp /8634/smp86xx_kernel_source_2.8.0.1/linux-2.6.15.tar.gz  ./
debian:/home/mute/smp86xx_kernel_source_2.8.0.1# tar zxvf linux-2.6.15.tar.gz
debian:/home/mute/smp86xx_kernel_source_2.8.0.1# cd linux-2.6.15
debian:/home/mute/smp86xx_kernel_source_2.8.0.1/linux-2.6.15# make menuconfig
debian:/home/mute/smp86xx_kernel_source_2.8.0.1/linux-2.6.15# make vmlinux
debian:/home/mute/smp86xx_kernel_source_2.8.0.1/linux-2.6.15# make modules
debian:/home/mute/smp86xx_kernel_source_2.8.0.1/linux-2.6.15# make modules_install
debian:/home/mute/smp86xx_kernel_source_2.8.0.1/linux-2.6.15# make zbimage-linux-xrpc


debian:/home/mute/smp86xx_kernel_source_2.8.0.1/linux-2.6.15# cp arch/mips/boot/zbimage-linux-xrpc  /tftpboot/mute/

debian:/home/mute/smp86xx_kernel_source_2.8.0.1# cp -ar /8634/smp86xx_kernel_source_2.8.0.1/linux-2.6.15 ./
debian:/home/mute/smp86xx_kernel_source_2.8.0.1# make kernel-source-2.6.15

debian:/tftpboot# ls mute/
zbimage-linux-xrpc  zbimage-yamon  zboot2.bin

二、烧写目标代码到目标板
1、启动目标板,在等待5S过程中按ESC键, 使之进入yamon命令行下,如:
YAMON>
2、在yamon命令行下输入net init,初始化网络配置。
YAMON> net init
Ethernet driver for EM86XX (v1.0)
(MAC 00:16:e8:2e:fe:d3, tx_desc/rx_desc = 16/32)

em86xx_eth::open(em86xx_eth) - Full-duplex mode
em86xx_eth::open(em86xx_eth) - 100 Mbit/s
em86xx_eth ethernet start
DHCP was successfully configured.
ipaddr:      = 192.168.0.71
subnetmask:  = 255.255.255.0
gateway:     = 192.168.0.1
3、烧写zboot
3.1、按下面命令通过tftp下载目标代码到目标板
YAMON> load -b tftp://192.168.0.37/zboot2.bin 0xb0100000
About to load tftp://192.168.0.83/zboot2.bin
Press Ctrl-C to break
.....

Start = 0xb0100000, range = (0xb0100000,0xb012f193), format = BINARY
Length = 0x2f194 (192916)
Checksum = 0x86457147
3.2、按下面命令烧写目标代码到目标板
YAMON> pflash write 0x0 0xb0100000 0x2f194
  0x00000000 - 0x0002ffff will be erased
  0x00000000 - 0x0002f193 will be written
Erasing :
..........
Writing :
.................................................
Verifying (RAM 0xb0100000, size 0x2f194) : OK.
YAMON>
4、烧写yamon
4.1、按下 面命令通过tftp下载目标代码到目标板
YAMON> load -b tftp://192.168.0.37/zbimage-yamon 0xb0100000
About to load tftp://192.168.0.83/zbimage-yamon
Press Ctrl-C to break
......

Start = 0xb0100000, range = (0xb0100000,0xb01303ff), format = BINARY
Length = 0x30400 (197632)
Checksum = 0xd5974852
4.2、按下面命令烧写目标代码到目标板
YAMON> pflash write 0x40000 0xb0100000 0x30400
  0x00040000 - 0x0007ffff will be erased
  0x00040000 - 0x000703ff will be written
Erasing :
....
Writing :
..................................................
Verifying (RAM 0xb0100000, size 0x30400) : OK.
YAMON>
5、烧写内核及文件系统
5.1、 按下面命令通过tftp下载目标代码到目标板
YAMON>load -b tftp://192.168.0.37/zbimage-linux-xrpc 0xb0100000
5.2、按下面命令烧写目标代码到目标板
YAMON>pflash write -f 0x80000 0xb0100000 0x46e400  //Length = 0x46e400
阅读(2765) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

xgyz18202012-01-08 14:15:53

你好,能把 CPU_KEYS_SMP8634_xosMc0-1.tar.gz 这个文件给我传一份吗? 非常感谢。 我的邮箱是:liuminchinese@163.com