QEMU: Features, Architecture, and Debugging

amirali shambayati n.w
1 / 11
Embed
Share

QEMU is a versatile processor emulator that leverages dynamic binary translation for efficient performance. It supports various architectures, enables running virtual machines, and offers debugging capabilities through tools like GDB. Learn how to use QEMU for development and testing purposes.

  • QEMU
  • Emulator
  • Virtual Machines
  • Debugging
  • Development

Uploaded on | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Amirali Shambayati

  2. What is Qemu? A processor emulator Uses dynamic binary translation to achieve a reasonable speed. Easy to port on new host CPU architectures

  3. Features: Is able to run virtual machines Supports the emulation of various architectures including IA-32 (x86) PCs, x86-64 PCs, MIPS R4000, Sun's SPARC sun4m, Sun's SPARC sun4u, ARM development boards (Integrator/CP and Versatile/PB), SH4 SHIX board, PowerPC (PReP and Power Macintosh), ETRAX CRIS and MicroBlaze architectures. Uses a special format (qcow2) for virtual machines Only takes up disk space that the guest OS actually uses.

  4. Features(continued) Communication between host and guest Uses SMB server Disk images can be mounted on host system. Is able to boot Linux kernels without having to prepare a bootable image with a bootloader.

  5. TCG(Tiny Code Generator) Aims to remove the shortcoming of relying on a particular version of GCC or any compiler. The whole translation task consists of two parts: blocks of target code (TBs) being rewritten in TCG ops - a kind of machine-independent intermediate notation. Compiling notations for the host's architecture by TCG. 1. 2. Optional optimization passes are performed between them.

  6. Using Qemu for debugging purpose Two approaches we experienced: Using eclipse CDT with Qemu Using gdb with qemu 1. 2. We encountered with a problem, by using eclipse. Apparently, it s possible to set breakpoint before running kernel code, only by using hardware breakpoint, and eclipse CDT doesn t support it. We decided to use gdb, directly, as an alternative.

  7. Prepare eclipse-qemu A good step by step instruction for preparing eclipse- qemu interaction, is written here: http://www.minoraddition.com/2011/02/11/linux-kernel- development-and-debugging-using-eclipse-cdt http://issaris.blogspot.com/2007/12/download-linux- kernel-sourcecode-from.html

  8. How to run Qemu sudo qemu -s -S -hda linux-0.2.img -append "root=/dev/sda" -kernel /mnt/build/linux- 2.6/arch/x86/boot/bzImage The -s option is a shorthand for -gdb tcp::1234 The -S option stops the CPU to start at startup The -hda option indicates image disk s name The -append option indicates the disk which kernel is in. The -kernel indicates the address of kernel image, built after compiling. Qemu.org has some ready disk images. Building a disk image and setup an OS on, is also possible.

  9. Using gdb as debugger GDB is the standard debugger for the GNU software system. It is a portable debugger that runs on many Unix-like systems and works for many programming languages, including Ada, C, C++, FreeBASIC, Free Pascal and Fortran.

  10. Running GDB gdb is built in kernel, and it can be run by entering gdb command in terminal. 2. Target remote localhost:1234 Indicates the port which gdb should hear qemu on. 3. Symbol-file vmlinux Indicates image file which gdb should read symbol tables from. 1.

  11. Some useful gdb commands: C Continue running code. hbreak filename.c:line number Setting hardware breakpoint

More Related Content