Using QEMU for Embedded Systems Development, Part 3
http://www.linuxforu.com/2011/08/qemu-for-embedded-systems-development-part-3/
Using QEMU for Embedded Systems Development, Part 3
By Manoj Kumar on August 1, 2011 in Coding, Developers · 4 Comments
It's time to u-boot
This is the last article of this series on QEMU. In the previous article, we worked on bare-metal programming, and discussed the need for a bootloader. Most GNU/Linux distros use GRUB as their boot-loader (earlier, LILO was the choice). In this article, we will test the famous U-Boot (Universal BootLoader).
In embedded systems, especially in mobile devices, ARM processor-based devices are leading the market. For ARM, U-Boot is the best choice for a bootloader. The good thing about it is that we can use it for different architectures like PPC, MIPS, x86, etc. So let’s get started.
Download and compile U-Boot
U-Boot is released under a GPL licence. Download it from this FTP server, which has every version of U-Boot available. For this article, I got version 1.2.0 (u-boot-1.2.0.tar.bz2). Extract the downloaded tar ball and enter the source code directory:
# tar -jxvf u-boot-1.2.0.tar.bz2
# cd u-boot-1.2.0
To begin, we must configure U-Boot for a particular board. We will use the same ARM Versatile Platform Baseboard (versatilepb) we used in the previous article, so let’s run:
# make versatilepb_config arch=ARM CROSS_COMPILE=arm-none-eabi-
Configuring for versatile board...
Variant:: PB926EJ-S
After configuration is done, compile the source code:
# make all arch=ARM CROSS_COMPILE=arm-none-eabi-
for dir in tools examples post post/cpu ; do make -C (expr $(stat -c%s u-boot.bin) + 65536)
0x21C68
Boot the flash image in QEMU:
# qemu-system-arm -M versatilepb -nographic -kernel flash.bin
Now verify the image address in U-Boot:
Versatile # iminfo 0x21C68
## Checking Image at 00021c68 ...
Image Name:
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 136 Bytes = 0.1 kB
Load Address: 00100000
Entry Point: 00100000
Verifying Checksum ... OK
The image is present at the address 0x21C68. Boot it by executing the bootm command:
Versatile # bootm 0x21C68
## Booting image at 00021c68 ...
Image Name:
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 148 Bytes = 0.1 kB
Load Address: 00100000
Entry Point: 00100000
OK
Starting kernel ...
Hello Open World
That’s all folks!
Acknowledgement
This article is inspired by the following blog post: “U-boot for ARM on QEMU“.
阅读(283) | 评论(0) | 转发(0) |
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
Using QEMU for Embedded Systems Development, Part 3
By Manoj Kumar on August 1, 2011 in Coding, Developers · 4 Comments
It's time to u-boot
This is the last article of this series on QEMU. In the previous article, we worked on bare-metal programming, and discussed the need for a bootloader. Most GNU/Linux distros use GRUB as their boot-loader (earlier, LILO was the choice). In this article, we will test the famous U-Boot (Universal BootLoader).
In embedded systems, especially in mobile devices, ARM processor-based devices are leading the market. For ARM, U-Boot is the best choice for a bootloader. The good thing about it is that we can use it for different architectures like PPC, MIPS, x86, etc. So let’s get started.
Download and compile U-Boot
U-Boot is released under a GPL licence. Download it from this FTP server, which has every version of U-Boot available. For this article, I got version 1.2.0 (u-boot-1.2.0.tar.bz2). Extract the downloaded tar ball and enter the source code directory:
# tar -jxvf u-boot-1.2.0.tar.bz2
# cd u-boot-1.2.0
To begin, we must configure U-Boot for a particular board. We will use the same ARM Versatile Platform Baseboard (versatilepb) we used in the previous article, so let’s run:
# make versatilepb_config arch=ARM CROSS_COMPILE=arm-none-eabi-
Configuring for versatile board...
Variant:: PB926EJ-S
After configuration is done, compile the source code:
# make all arch=ARM CROSS_COMPILE=arm-none-eabi-
for dir in tools examples post post/cpu ; do make -C (expr $(stat -c%s u-boot.bin) + 65536)
0x21C68
Boot the flash image in QEMU:
# qemu-system-arm -M versatilepb -nographic -kernel flash.bin
Now verify the image address in U-Boot:
Versatile # iminfo 0x21C68
## Checking Image at 00021c68 ...
Image Name:
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 136 Bytes = 0.1 kB
Load Address: 00100000
Entry Point: 00100000
Verifying Checksum ... OK
The image is present at the address 0x21C68. Boot it by executing the bootm command:
Versatile # bootm 0x21C68
## Booting image at 00021c68 ...
Image Name:
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 148 Bytes = 0.1 kB
Load Address: 00100000
Entry Point: 00100000
OK
Starting kernel ...
Hello Open World
That’s all folks!
Acknowledgement
This article is inspired by the following blog post: “U-boot for ARM on QEMU“.
相关热门文章
给主人留下些什么吧!~~
评论热议
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通