Efficient Embedded Software Development Using QEMU

Efficient Embedded Software Development Using QEMU

Efficient embedded software development using QEMU Pradyumna Sampath ABB Corporate Research Bhoruka Tech Park, 5th Floor, Block 1, Whitefield Road, Mahadevapura, Bangalore, Karnataka, India [email protected] Rachana Rao ABB Corporate Research Bhoruka Tech Park, 5th Floor, Block 1, Whitefield Road, Mahadevapura, Bangalore, Karnataka, India [email protected] Abstract Software based processor emulators have been around for a long time and predominantly used by developers of Operating Systems. With virtualization technology becoming more common and gaining in-processor support, these emulators have expanded to support several processor architectures and a richer feature set. Consequently, popular operating systems such as Linux have been adapted to run within virtual environments seamlessly. As part of the software development process, this virtualization technology has huge potential to increase product quality and developer efficiency. This paper looks at employing virtualization for in-house real-time application software development through QEMU, a popular open source emulator. It also details the process of establishing such an environment and looks at some of the advantages of such a development model for embedded systems. 1 Introduction development by decoupling it from the underlying hardware. Industrial Automation and Power technologies are characterized by extremely complex software sys- Traditionally, embedded software development tems which are in many cases very tightly coupled is inherently dependent on hardware availibility. with mechanical and electrical sub-systems. These Hardware development includes design, simulation systems tend to be safety and mission critical. De- and testing of hardware architecture, logic, circuit velopment of such systems is considerably time con- schematics and finally the PCB. This is a very time- suming. However, they are also charecterized by consuming process, often iterative and unpredictable long if not very long product lifecycles sometimes in due to dependency on factors like component avail- the order of fifteen years. The scope and complexity ability and vendor support. Software developers of software components in these industrial products usually cannot afford to wait for the entire hardware has gone up significantly over the years. Continu- design to be completed and the board to arrive on ous remodeling and development of software for the their desks before starting on application develop- enduring industrial automation systems, places con- ment. This would increase the product development siderable challenges of efficiency on the development time substantially which is unacceptable. Appli- environment and processes followed. This paper at- cation development as well as verification(testing) tempts to look at acceleration of embedded software should be well underway by the time the hardware is finalized and delivered to the software developers. acts as a mediator between the operating system and This is where system emulation and virtual environ- the underlying hardware. This method is faster than ments step in and save the day. With the various emulation, however the criteria is that the underlying advanced hardware emulators and virtual machines hardware must be supported by operating system. available today, embedded software developers can KVM and VMware are examples of full virtualiza- get a head start on their applications. tion solutions. Paravirtualization uses a hypervisor for shared access to the underlying hardware. This The ablility to develop applications for a hard- method offers the best performance. However, since ware without the physical device itself is a definitely the virtualization code is integrated into the operat- a big advantage. However, there are other advan- ing system itself, the guest operating systems have to tages provided by the emulator too. It can make a be modified for the hypervisor. Xen and User Mode safe and secure environment for the testing of new Linux are examples of paravitualization. and untried applications. Since modern emulators now support various kinds of hardware as well as different operating systems, the application can also 3 Our Setup be tested for scalability and reliability and not just functionality. This makes virutalized environments 3.1 Hardware very powerful and feasible testing platforms. Em- ulators also prove valuable in cases of kernel and The target for emulation is a custom board made by device driver development, where a small mistake ABB. This board is based on the Freescale Lite5200 can crash the entire operating system. Developing evaluation board[5]. The microprocessor on board and debugging drivers on an emulator, makes it sim- is the Freescale MPC5200B[6], a PowerPC embed- ilar to user-space applications, which at the worst ded processor based on the 400MHz MPC603e series can lead to the emulator crash. e300 core. It is provided with 64 megabytes of RAM (DDR) and 32 megabytes of flash memory. 3.2 Software 2 Virtualization and Emula- The target board is a part of time critical control sys- tors tems and hence there are real time constraints on the application response times[7]. To accomplish this, Since the term virtualization[1] was coined, over the target runs Linux kernel patched with the latest four decades ago, it has been defined many times rt-preempt patch[8]. As of now, the version running and in many different ways. Virtualization is bas- on the hardware is Linux 2.6.29.4-rt17. However, cially abstraction of one or more computer resources since the real time performance is not a criteria as to achieve the behaviour of the desired system. The of now, we have reverted to the non rt version of desired system here could be a high end grid com- the Linux kernel for this emulation. Hence, for the puter or a testing platform for a different archi- present time our requirements are limited to the tecture etc. In the beginning, the term emulation latest mainline kernel and also support for ethernet was usually used for virtualization using hardware. ports. Ethernet is needed by the application to be However, recently it has also become common to use run on the board emulator as well as for remote de- the term emulation in the software context. Emu- bugging of the application. lation[2] refers to the replication of functions of a system by another, so that the emulator acts similar Traditionally, development of embedded software to the emulated system. has been done on Windows host, cross-compiled and deployed on the target. In order to reduce the learn- There are various types of virtualizaton[3][4], de- ing curve for embedded developers, it is important pending on the system being virtualized and levels of that the host platform for this emulation be retained abstraction used to achieve it. Hardware emulation as Windows. refers to the virtualization of the required hardware on the host machine. It usually suffers from being slow, however the major advantage offered is the abil- 4 Choices ity to simultaenously develop software through sim- ulation, as the hardware is being developed. QEMU A few virtualization methods and solutions were and Bochs are examples of hardware emulators. Na- evaluated keeping the above needs in mind. Below is tive or Full virtualization uses a hypervisor which the list of the options considered. 4.1 Kernel Virtual Machine (KVM) • QEMU supports both x86-Windows and x86- Linux as host machines KVM[9] is a full virtualization solution for Linux on x86 hardware. It comes in the form on a loadable ker- • QEMU is an active open source project with a nel module which provides the virtualization infras- good developer community and support tructure as well as the processor specfic implementa- tions. KVM has been a part of the mainline kernel since 2.6.20 and is a very active open source project 5 Programming Embedded with a strong developer community. The PowerPC support however is still work in progress. Also there systems using QEMU is no support from Windows as the host machine. An effective IDE which provides for efficient applica- tion development consists of two main components 4.2 VMware Server VMware server[10] is a virtualization platfrom which 5.1 QEMU allows one to create and run virtual machines for dif- For the reasons mentioned above, QEMU is the sys- ferent operating systems on a Linux or Windows x86 tem emulator that was selected to emulate the ABB machine. It is partly open source. However, it does custom board for which applications need to be de- not support PowerPC emulation. veloped. The applications can be run and debugged on the QEMU emulator just as they would on the 4.3 Xen real board. The compilers and linkers used to build the source code also remain the same, i.e. the ap- The Xen[11] virtual machine monitor is a paravir- plication is compiled on the host machine for the tualization solution for x86 and PowerPC architec- Lite5200 target using cross-compilers (ELDK[14] on tures. The Xen hypervisor is the most privileged Linux and CodeSourcery Lite[15] on Windows) as layer, above which a wide range of guest operating usual. It is also possible to (remotely) debug the ap- systems can run concurrently. The guest operating plication running on QEMU from the host machine systems need to be modified to be able to run on using GDB. Xen. Also the PowerPC support does not extend to MPC603e core processors. 5.2 Eclipse 4.4 PearPC Eclipse is widely adapted as a development platform for embedded systems for many good reasons[16]. PearPC[12] is an architecture independent PowerPC One of the main reasons is that it is an open frame- platform emulator. This is an outdated project with work with a plugin architecture that enables easy no current developments ongoing. development and integration of a variety of soft- ware tools for embedded development. This is also 4.5 QEMU the reason why it supports usage of a number of Qemu[13] is an open source machine emulator writ- third party tools and interoperability between them, ten by Fabrice Bellard.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us