Using QEMU for Embedded Systems Development, Part 3
2013-03-19 21:09
204 查看
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.
this FTP server, which has every version of U-Boot available. For this article, I got version 1.2.0 (
To begin, we must configure U-Boot for a particular board. We will use the same ARM Versatile Platform Baseboard (
previous article, so let’s run:
After configuration is done, compile the source code:
Find the size of the compiled U-Boot binary file (around 72 KB in my experience) with
2,
3). If not, then I suggest you read the last three articles.
Run some commands in U-Boot, to check if it is working:
Figure 1: U-Boot
The next step is to boot a small program from U-Boot. In the
previous article, we wrote a small bare-metal program — so let us use that.
We will create a flash binary image that includes
Compile the test program as shown below:
Now, our test program’s binary file and the
Our sample binary file is ready. Let’s combine it with
Calculate the starting address of the test program in the
Boot the flash image in QEMU:
Now verify the image address in U-Boot:
The image is present at the address
That’s all folks!
So let’s get started.
Download and compile U-Boot
U-Boot is released under a GPL licence. Download it fromthis 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:
versatilepb) we used in the
previous article, so let’s run:
ls -lh u-boot*— we will use it later in this article. I assume that you have set up QEMU, networking and the ARM tool chain, as explained in previous articles in this series (1,
2,
3). If not, then I suggest you read the last three articles.
Boot U-Boot in QEMU
Now we can boot the U-Boot binary in QEMU, which is simple. Instead of specifying the Linux kernel as the file to boot in QEMU, use the U-Boot binary:Figure 1: U-Boot
The next step is to boot a small program from U-Boot. In the
previous article, we wrote a small bare-metal program — so let us use that.
We will create a flash binary image that includes
u-boot.binand the bare-metal program in it. The test program from the last article will be used here again with some modification. As the
u-boot.binsize is around 72 KB, we will move our sample program upward in memory. In the linker script, change the starting address of the program:
u-boot.binmust be packed in a single file. Let’s use the
mkimagetool for this; locate it in the U-Boot source-code directory.
u-boot.binto create the final flash image file:
flash.binfile:
0x21C68. Boot it by executing the
bootmcommand:
相关文章推荐
- Using QEMU for Embedded Systems Development, Part 3
- Using QEMU for Embedded Systems Development, Part 1
- Using QEMU for Embedded Systems Development, Part 2
- Using QEMU for Embedded Systems Development, Part 1
- Using QEMU for Embedded Systems Development
- Software Development for Embedded Multi-core Systems: A Practical Guide Using Embedded Intel® Ar
- Using Caliburn.Micro (version 2) for WPF development
- Tips for using Oracle ADF (Application Development Framework)
- Suggestions for Using Execution Systems and Priorities
- Writing Stereoscopic Software for StereoGraphics® Systems Using Microsoft Windows® OpenGL
- Real-Time Concepts for Embedded Systems
- TCP/IP Lean: Web Servers for Embedded Systems (2nd Edition)
- Detection Algorithms for Communication Systems Using Deep Learning笔记
- Android using OpenGL ES for 2D development (introduction)
- Writing Efficient C Code for Embedded Systems
- Using an open debug interconnect model to simplify embedded systems design
- Xerces for C++ Using Visual C++, Part 2(转)
- Design Patterns for Embedded Systems in C
- Essential GNU Linker Concepts for Embedded Systems Programmers