免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1132 | 回复: 0
打印 上一主题 下一主题

用软件arm 仿真器运行uClinux- - [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-03-07 14:38 |只看该作者 |倒序浏览

Getting started with uClinux
By David McCullough
davidm@snapgear.com
With linux enjoying growing success in the embedded space, more and more people are looking to experiment with embedded linux and how suitable it is for their application. Unfortunately this usually requires a large investment in time to get Linux running on a platform that resembles the target hardware for the application. More often than not this investment in time is suitable deterent to investigating the linux option any further. Even more so in deeply embedded environments where uClinux is likely to be found. This paper will look at software only options (emulators) available to run the uClinux operating system. uClinux is a version of Linux for CPUs without virtual memory or an MMU (Memory Management Unit) and is typically targeted at deeply embedded systems with very little memory or permanent storage.
Why use an Emulator to run uClinux ?
The great thing about the emulators discussed here is that they are free. This make it possible to get started with uClinux and see how it sizes up for the cost of a few downloads, allowing the user to become familiar with the tools and the environment before taking the step of recommending that the next project should use Linux. The quality and reliability of the development tools can be measured before hand which is a huge advantage in pre-project planning. There is nothing worse than finding out the development tools are not up to scratch some time after committing to a delivery date.
If possible, an emulator that closely resembles the preferred target CPU should be chosen. This gives the advantage of testing the development tools and in turn, receiving hard data on memory requirements and flash ROM requirements. In some circumstances development can begin on the emulator even before real hardware is available. A good example is the Leox Project which has done most of it's uClinux work using the TSIM emulator:
Debugging can also be a much simipler task in the virtual enviroment of an emulator. It is possible to totally control the CPU emulation allowing access to debugging information that may not be possible with real hardware. An emulator can trace memory accesses and code execution at the finest level helping to find that elusive bug in the software or operating system.
Emulators can allow the developers to experiment with different performance options and their effect on usability. Something that may be useful when determining performance requirements of the target hardware. Emulators can also help to determine flash and memory requirements. All of this can be useful information early in the development process.
Criteria for choosing an emulator
When choosing an emulator there are a number of things to consider. Firstly, a good emulator choice should closely emulate the target CPU that may be under consideration, and if possible, be developed using the same tools. This will greatly increase the relevance of any work done in the emulator.
The closer an emulator is to the target hardware the better. This means emulating serial ports, timers and other devices found on the target hardware.
Debugging options should be considered. While learning a new operating system a full source level debugger can be an important part of understanding the system startup sequence. Any knowledge gained here will easily transferr to debugging skills on real hardware when it becomes available. Where a full source debug option is not available, instruction/address tracing can be useful and can normaly be added to the emulator if nothing else is available.
One of the biggst shortfalls of the emulators available to run uClinux is the absence of real network device emulation. Although it is possible to run networking on emulated serial ports using PPP or SLIP, it would be much more interesting to have an emulated network device. Emulation of commonly used embedded network devices would be particularly interesting and only requires someone to take the time to implement.
What choices are there
A search on the net for an emulator will reveal a huge list of possibilities. Only two of the endless possibilities will be discussed in some detail here. These emulators are already well supported by uClinux and offer a good coverage for embedded options CPU targets. A more comprehensive list will be provided later.
This first emulator, indeed the emulator that helped to create the first uClinux versions is Xcopilot. Xcopilot is a PalmPilot emulator that runs under Unix/X11. It offers emulation of the timer, serial ports, touch pad and LCD display along with Motorola 68000 emulation (m68k).
The second emulator is the ARMulator which is part of the GNU debugger, gdb. Currently the ARMulator offers a serial console along with many possible ARM emulations including big endian, little endian and thumb emulations.
Getting Xcopilot
Xcopilot can be obtained from many places. The most up to date source for using Xcopilot with uClinux is the version in CVS on cvs.uclinux.org.
cvs -d:pserver:anonymous@cvs.uclinux.org:/var/cvs login
Just press enter at the password prompt, and then run:
cvs -d:pserver:anonymous@cvs.uclinux.org:/var/cvs checkout xcopilot
Otherise a reasonably recent version can be downloaded from:

http://www.uclinux.org/pub/uClinux/utilities/xcopilot-0.6.6-uc0.tar.gz
Compiling Xcopilot is straight forward:
./configure
make
make install
Providing all the correct libraries are in place, the result will be an Xcopilot that is ready to use.
A copy of the m68k-elf-tools will be required to build uClinux kernels and binaries for Xcopilot. These can be obtained from:

http://www.uclinux.org/pub/uClinux/m68k-elf-tools/
Follow the instructions for installing the pre-compiled binaries, or for the keen, build the tools from the source provided.
Getting the GDB/ARMulator
The GDB/ARMulator for use with uClinux is available from:

http://www.uClinux.org/pub/uClinux/utilities/armulator/
This page contains all the information needed to build gdb for use with the ARMulator and uClinux. There is even a selection of pre-compiled uClinux binaries that can be run in the ARMulator once it is built and installed.
A copy of the arm-elf-tools will be required to build uClinux kernels and binaries for the GDB/ARMulator. These can be obtained from:

http://www.uclinux.org/pub/uClinux/arm-elf-tools/
Again, follow the instructions for installing the pre-compiled binaries, or build them from the source provided.
Getting/Building the uClinux Source
The easiest way to get started with the uClinux source is to grab the full uClinux distribution sources from:

http://www.uclinux.org/pub/uClinux/dist/
This is a rather large file that provides both 2.0.39 and 2.4.17 kernels along with a good selection of applications, most of which have been ported to uClinux. It also provides pre-canned configurations for both Xcopilot and the GDB/ARMulator that can be selected from the config menu.
The mechanism for building for either target is essentially the same, only the target selection is different.
First extract the uClinux-dist tarball:
gunp

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/14053/showart_82169.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP