【ecos学习5】redboot 加载运行hello world
背景:
从主机 192.168.2.14 IP,下载bin文件hello到ecos。
redboot>load -v -h 192.168.2.14 hello
Using default protocol (TFTP)
Entry point : 0x00108000,adress range :0x00108000-0x00136500
以上提示表示需要输入存放hello的起始地址
redboot>load -v -h 192.168.2.14 -b 0x00108000 hello
Using default protocol (TFTP)
Entry point : 0x00108000,adress range :0x00108000-0x00136500
不知为何这样提示,但用go测试是否下载成功hello
go 0x00108000
Hello, eCos world!已打印出来了
成功下载,执行。
如果提示:
"Unrecognized image type: 0x01080000"
解决方案原文引用:
Today I visited friend at his office and during talk I found dusted EDB9301 board at shelve. As he do not use it any more I was allowed to take it for experimenting.
First problem was bootloader — I am not so familiar with RedBoot so it took me a while to get it to load kernel from TFTP server. For reference: proper command is "load -v -r -b 0x01000000 /zImage-ep9301"
where “/zImage-ep9301″ is name of file to fetch. If you will get “Unrecognized image type: 0xe1a00000″ message instead then you forgot “-r” switch (RedBoot do not know format of zImage kernel). I got some hints from HitchHacker Guide to ENP-2611 page.
解决方案:
load -r
完整的load语句:
redboot>load -v -r -h 192.168.2.14 -b 0x00108000 hello
Raw file loaded 0x00108000-0x0121159,assumed entry at 0x00108000.
-v 显示加载过程
-r 加载纯数据,如果出现该选项,必须使用-b选项
-b 指定文件加载的起始位置
-h 用于加载的主机名,只用于TFTP方式,还可以用ip指定主机,则load语句不需要带-h选项
ip -l 192.168.2.14 -h 192.168.2.16
IP:192.168.2.14/255.255.0.0,Gateway:192.168.1.1
Default server:192.168.2.16
-l 设定本机IP
-h 设定远程TFTP主机IP
之后直接执行
redboot>load -v -r -b 0x00108000 hello
经过测试发现:
0x01008000是ecos的起始地址。
go 0x01008000
将重启redboot ,每次都不同,但是占此地址的机率大一些
参考资料:
http://marcin.juszkiewicz.com.pl/2009/04/15/edb9301-hacking/