当前位置: 首页 > news >正文

没有ARM开发板一样移植uboot并用SKYEYE仿真

移植U-BOOT到S3C2410X并用SKYEYE仿真

本人初学u-boot,一下是我的一点实践:如果你有什么问题,相互交流学习。如果你想了解更多UBOOT可以到我空间看看其他bootloader文档。
原博客地址: http://student.csdn.net/space.php
一.  源码准备
a)  U-BOOT源代码 u-boot-2009.06-rc3.tar.bz2  官方最新版
b)  Skyeye源代码  skyeye-1.2.4_Rel.tar.gz  
c)  交叉编译器  arm-linux-gcc-3.4.1.tar.bz2
二.  建立交叉编译环境
1.  arm-linux-gcc-3.4.1.tar.bz2 拷贝到系统的根目录
#tar zxvf  arm-linux-gcc-3.4.1.tar.bz2
源码会自动解压到/usr/local/arm/../bin目录下
2   #ivi /etc/profile 在最后加入
export PATH=$PATH:/usr/local/arm/3.4.1/bin/:.
然后注销系统,重新登陆
#arm-linux-gcc  v查看配置是否成功
三.  编译u-boot,生成U-BOOT.BIN文件
1.  #tar jxvf  u-boot-2009.06-rc3.tar.bz2
2.  #cd  u-boot-2009.06-rc3
3.  建立自己的开发板,我的取名为paul2410
#vi Makefile  paul2410建立编译相
加入paul2410_config: unconfig
            @./mkconfig $(@:_config=) arm arm920t paul2410 NULL s3c24x0
先在board目录中建立paul2410目录并执行以下命令
#cp board/samsung/smdk2410/* board/paul2410  fr
#cd board/paul2410
#mv smdk2410.c teach2410.c
#修改paul2410目录下的Makefilesmdk改为paul
注:我就是没有该这个,在编译的时候出错了,无法建立.depend依赖等相关信息
include/configs/目录中
#cp smdk2410.h paul2410.h
编译
#make paul2410_config
#make CROSS_COMPILE=arm-linux-
等一小会你就 会开到你成功了
看到有u-boot.bin文件的生成,呵呵,我高兴坏了,就以上工作我就搞了老半天,编译老出错,
补充:我的这个uboot版本编译出现这种问题:在paul2410目录u-boot.lds文件中
. = ALIGN(4);
            /*.rodata :{*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }*/ 
这是原本的代码,但是编译说语法错误,后来我找了一个u-boot.1.1.6u-boot.lds一看,代码如下,我便修改之:
              rodata : { *(.rodata)}
重新编译成功了。
四.  由于我的开发板上2440,只好用skyeye来模拟了,但效果一样不差。
先在u-boot目录下建立文件skyeye.conf内容如下:
# skyeye config file for S3C2410X

    cpu: arm920t
    mach: s3c2410x
   
    # physical memory
    #mem_bank: map=M, type=RW, addr=0x00000000, size=0x00100000
    mem_bank: map=M, type=RW, addr=0x30000000, size=0x04000000
    #mem_bank: map=M, type=RW, addr=0xC0000000, size=0x04000000,file=./vmlinux
    #mem_bank: map=M, type=RW, addr=0x30000000, size=0x03F80000
    #mem_bank: map=M, type=RW, addr=0x33F80000, size=0x00080000,
file=./u-boot.bin,boot=yes
    #mem_bank: map=M, type=RW, addr=0xc1000000, size=0x01000000
   
    # all peripherals I/O mapping area
    mem_bank: map=I, type=RW, addr=0x48000000, size=0x20000000
   
    mem_bank: map=I, type=RW, addr=0x19000300, size=0x00000020
    #net: type=cs8900a, base=0x19000300, size=0x20,int=9, mac=08:00:3E:26:0A:5B, ethmod=tuntap, hostip=10.0.0.1
    #nandflash: type=s3c2410x,name=K9F1208U0B,dump=./nand.dump
    #lcd: type=s3c2410x, mod=gtk
    dbct:state=on
安装skyeye:
#tar zxvf  skyeye-1.2.4_Rel.tar.gz
#cd skyeye-1.2.4
#make  make NO_DBCT=1
注:如果你是新手,请看readme,那里写得很详细
编译完成,你将会看到enjoy it 那你已经编译成功了
五.  测试u-boot
# /skyeye-1.2.4/binary/skyeye e ./u-boot
一下是我机子上的:
[root@localhost u-boot-2009.06-rc3]# /skyeye-1.2.4/binary/skyeye -e ./u-boot.bin
check format of ./u-boot.bin error: File format not recognized
big_endian is false.
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
mach info: name s3c2410x, mach_init addr 0x805cbf4
dbct info: Note: DBCT not compiled in. This option will be ignored
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm920t mmu ops
check format of ./u-boot.bin error: File format not recognized
load "./u-boot.bin" error
[root@localhost u-boot-2009.06-rc3]# /skyeye-1.2.4/binary/skyeye -e ./u-boot 
big_endian is false.
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
mach info: name s3c2410x, mach_init addr 0x805cbf4
dbct info: Note: DBCT not compiled in. This option will be ignored
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm920t mmu ops
exec file "./u-boot"'s format is elf32-little.
load section .text: addr = 0x33f80000  size = 0x000131b4.
load section .glue_7: addr = 0x33f931b4  size = 0x00000000.
load section .glue_7t: addr = 0x33f931b4  size = 0x00000000.
load section .rodata: addr = 0x33f931b4  size = 0x00000720.
load section .rodata.str1.4: addr = 0x33f938d4  size = 0x0000417b.
load section .data: addr = 0x33f97a50  size = 0x00000c2c.
load section .u_boot_cmd: addr = 0x33f9867c  size = 0x00000468.
not load section .bss: addr = 0x33f98ae4  size = 0x000048ac .
not load section .debug_line: addr = 0x00000000  size = 0x000063e3 .
not load section .debug_info: addr = 0x00000000  size = 0x000159cf .
not load section .debug_abbrev: addr = 0x00000000  size = 0x00005b37 .
not load section .debug_aranges: addr = 0x00000000  size = 0x00000800 .
not load section .debug_frame: addr = 0x00000000  size = 0x00002c90 .
not load section .debug_pubnames: addr = 0x00000000  size = 0x00002209 .
not load section .debug_str: addr = 0x00000000  size = 0x000040ef .
not load section .comment: addr = 0x00000000  size = 0x00000426 .
not load section .debug_ranges: addr = 0x00000000  size = 0x00000608 .
call ARMul_InitSymTable,kernel filename is ./u-boot.
start addr is set to 0x33f80000 by exec file.
ERROR: s3c2410x_io_write_word(0x4c000000) = 0x00ffffff
ERROR: s3c2410x_io_write_word(0x4c000008) = 0x00048032
U-Boot 2009.06-rc3 ( 7月 09 2009 - 22:13:35)
DRAM:  64 MB
Flash: 512 kB
*** Warning - bad CRC, using default environment
In:    serial
Out:   serial
Err:   serial
ERROR: s3c2410x_io_write_word(0x1900030a) = 0x00000000
SMDK2410 #到这你已经成功了
SMDK2410 # ls
Unknown command 'ls' - try 'help'
SMDK2410 # help
?       - alias for 'help'
autoscr - DEPRECATED - use "source" command instead
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
bootvx  - Boot vxWorks from an ELF image
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
date    - get/set/reset date & time
dcache  - enable or disable data cache
echo    - echo args to console
erase   - erase FLASH memory
flinfo  - print FLASH memory information
go      - start application at address 'addr'
help    - print online help
icache  - enable or disable instruction cache
iminfo  - print header information for application image
imls    - list all images found in flash
imxtract- extract a part of a multi-image
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
md      - memory display
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill)
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
printenv- print environment variables
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sleep   - delay execution for some time
source  - run script from memory
tftpboot- boot image via network using TFTP protocol
version - print monitor version
SMDK2410 # ls
Unknown command 'ls' - try 'help'
SMDK2410 # help
?       - alias for 'help'
autoscr - DEPRECATED - use "source" command instead
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
bootvx  - Boot vxWorks from an ELF image
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
date    - get/set/reset date & time
dcache  - enable or disable data cache
echo    - echo args to console
erase   - erase FLASH memory
flinfo  - print FLASH memory information
go      - start application at address 'addr'
help    - print online help
icache  - enable or disable instruction cache
iminfo  - print header information for application image
imls    - list all images found in flash
imxtract- extract a part of a multi-image
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
md      - memory display
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill)
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
printenv- print environment variables
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sleep   - delay execution for some time
source  - run script from memory
tftpboot- boot image via network using TFTP protocol
version - print monitor version
SMDK2410 # date
ERROR: s3c2410x_io_write_word(0x57000040) = 0xffffffff
ERROR: s3c2410x_io_write_word(0x57000040) = 0xfffffffe
Date: 2065-25-45 (unknown day)    Time: 45:85:85
SMDK2410 #
注:skyeye是开源软件,现在可以模拟很多种ARM,同时可以调试linux等操作系统,这对于没有开发板的嵌入式学习者是个很好的选择。


本文转自 曾永刚 51CTO博客,原文链接:http://blog.51cto.com/zyg0227/260587

相关文章:

  • 如何通过httpclient获取访问域名的真实ip
  • NET客户端js调用服务器端控件的方法
  • 4周第5次课 zip压缩工具 tar打包 打包并压缩
  • Windows Server 2008R2 漫游用户配置
  • 大规模中文概念图谱CN-Probase正式发布
  • Windows XP \Windows 2003启动过程的学习及故障分析处理(五)
  • Ural State University Internal Contest October'2000 Junior Session
  • 使用React、Node.js、MongoDB、Socket.IO开发一个角色投票应用的学习过程(一)
  • pythony读取xml
  • 配置DNS支持邮件服务器域名解析,支持别名,反向查找区
  • Flash正式成为Googel Chrome浏览器内置插件
  • mysql主从切换步骤
  • GIS软件开发工具包TatukGIS Developer Kernel更新至v11.9丨附下载
  • javascript:typeof与instanceof区别
  • JS组件系列——Bootstrap Table 表格行拖拽(二:多行拖拽)
  • JavaScript-如何实现克隆(clone)函数
  • Angular 响应式表单 基础例子
  • Date型的使用
  • flutter的key在widget list的作用以及必要性
  • Java深入 - 深入理解Java集合
  • Java知识点总结(JDBC-连接步骤及CRUD)
  • Laravel Mix运行时关于es2015报错解决方案
  • mysql_config not found
  • Quartz实现数据同步 | 从0开始构建SpringCloud微服务(3)
  • SegmentFault 2015 Top Rank
  • Windows Containers 大冒险: 容器网络
  • XForms - 更强大的Form
  • 彻底搞懂浏览器Event-loop
  • 解决jsp引用其他项目时出现的 cannot be resolved to a type错误
  • 聊聊flink的TableFactory
  • 容器服务kubernetes弹性伸缩高级用法
  • 如何正确配置 Ubuntu 14.04 服务器?
  • 深入浅出webpack学习(1)--核心概念
  • 通过几道题目学习二叉搜索树
  • 限制Java线程池运行线程以及等待线程数量的策略
  • 再次简单明了总结flex布局,一看就懂...
  • 翻译 | The Principles of OOD 面向对象设计原则
  • 组复制官方翻译九、Group Replication Technical Details
  • ​DB-Engines 11月数据库排名:PostgreSQL坐稳同期涨幅榜冠军宝座
  • # 日期待t_最值得等的SUV奥迪Q9:空间比MPV还大,或搭4.0T,香
  • #微信小程序(布局、渲染层基础知识)
  • (8)STL算法之替换
  • (NSDate) 时间 (time )比较
  • (Redis使用系列) SpringBoot中Redis的RedisConfig 二
  • (离散数学)逻辑连接词
  • (篇九)MySQL常用内置函数
  • (转载)微软数据挖掘算法:Microsoft 时序算法(5)
  • .NET Core Web APi类库如何内嵌运行?
  • .net core使用ef 6
  • .net 简单实现MD5
  • .netcore 如何获取系统中所有session_如何把百度推广中获取的线索(基木鱼,电话,百度商桥等)同步到企业微信或者企业CRM等企业营销系统中...
  • .net下简单快捷的数值高低位切换
  • .set 数据导入matlab,设置变量导入选项 - MATLAB setvaropts - MathWorks 中国
  • .sh文件怎么运行_创建优化的Go镜像文件以及踩过的坑
  • []C/C++读取串口接收到的数据程序