redboot on QEMU for mini2440

(原创文章,欢迎转载,请注明出处,谢谢。)

最近有空呼吸新鲜空气,重新拿起来了eCos,做点东西共享给大家。

 

rt-thread最近很火,在mini2440的qemu平台上发表了测试和代码,这无疑给更多的爱好者以新的学习机会。

 

这段时间一直在研究ecos,所以有了把ecos移植到mini2440的qemu平台的想法。经过几天的折腾,终于可以在qemu的上面看到redboot的命令了。

 

先看看成果,然后进入枯燥的coding历程

 

现在开始看代码,:-)

 

 

1. 获得代码

 

git clone git://repo.or.cz/qemu/mini2440.git  qemu

 

修改启动部分为ram的最小地址直接启动

 

 

 

 

编译qemu for mini2440
./configure --target-list=arm-softmmu --disable-linux-user;make

 

安装,或者直接copy arm-softmmu里面的可执行文件也可以。

 

2. 让ecos增加对mini2440的支持

 

http://code.google.com/p/redboot-mini2440/ 这个project里面有全部的代码,不过可能用于各种原因并没有完善。

 

我们获得他的源代码基于ecos 3.0,然后我们根据smdk2410重新创建mini2440的hal 模块

 

3. 针对QEMU的修改

 

为了能让redboot顺利的运行在qemu上面,我们需要让程序直接跑在sdram上面,但是需要对硬件做必要的初始化。

所以,目前的RAM,ROM,ROMRAM都不太合适,我们加入一个新的启动方式QEMU,相当于ROMRAM方式下面禁用mmu的跳转

 

4. 如何在QEMU中运行

 

注意一下,需要用我们自己编译出来的qemu-system-arm

 

qemu-system-arm  -M mini2440 -m 128M -kernel install/bin/redboot.elf  -show-cursor -serial stdio

ricky@ricky-laptop:~/ecos/projects/mini2440-redboot$ sh qemu.sh 
S3C: CLK=240 HCLK=240 PCLK=240 UCLK=57
QEMU: ee24c08_init
DM9000: INIT QEMU MAC : 52:54:00:12:34:56
QEMU mini2440_reset: loaded kernel install/bin/redboot.elf at 0x30000000
S3C: CLK=240 HCLK=60 PCLK=30 UCLK=57
S3C: CLK=400 HCLK=100 PCLK=50 UCLK=57
+
RedBoot(tm) bootstrap and debug environment [QEMU]
Non-certified release, version UNKNOWN - built 15:39:35, Mar  1 2011
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
RedBoot is free software, covered by the eCos license, derived from the
GNU General Public License. You are welcome to change it and/or distribute
copies of it under certain conditions. Under the license terms, RedBoot's
source code and full license terms must have been made available to you.
Redboot comes with ABSOLUTELY NO WARRANTY.
Platform: MINI2440 system (ARM9) 
RAM: 0x00000000-0x04000000 [0x0001aab0-0x04000000 available]
RedBoot> help
Manage machine caches
   cache [ON | OFF]
Display/switch console channel
   channel [-1|<channel number>]
Compute a 32bit checksum [POSIX algorithm] for a range of memory
   cksum -b <location> -l <length>
Display (hex dump) a range of memory
   dump -b <location> [-l <length>] [-s] [-1|-2|-4]
Execute an image - with MMU off
   exec [-w timeout] [-b <load addr> [-l <length>]]
        [-r <ramdisk addr> [-s <ramdisk length>]]
        [-c "kernel command line"] [-t <target> ] [<entry_point>]
Execute code at a location
   go [-w <timeout>] [-c] [entry]
Help about help?
   help [<topic>]
Display command history
   history 
Load a file
   load [-r] [-v] [-m <varies>] [-c <channel_number>] 
        [-b <base_address>] <file_name>
Compare two blocks of memory
   mcmp -s <location> -d <location> -l <length> [-1|-2|-4]
Copy memory from one address to another
   mcopy -s <location> -d <location> -l <length> [-1|-2|-4]
Fill a block of memory with a pattern
   mfill -b <location> -l <length> -p <pattern> [-1|-2|-4]
Reset the system
   reset 
Display RedBoot version information
   version 
Display (hex dump) a range of memory
   x -b <location> [-l <length>] [-s] [-1|-2|-4]
RedBoot> 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值