"Qemu" qemu how to play

Source: Internet
Author: User

1. Compiling QEMU
It is not recommended to use automatic installation, manually compiled. QEMU source code quality is very high, what environment can be compiled.
TAR-XZVF qemu.tar.gz
mkdir Build-qemu
CD Build-qemu
chmod +x. /qemu/configure
.. /qemu/configure--prefix=/home/turf/software/qemu/tools--target-list=ppc-softmmu,ppc-linux-user--enable-debug-- ENABLE-DEBUG-TCG--enable-debug-info
Here target-list the executable file of the target platform that needs to be compiled, the default is all platform, at the same time, in order to support debugging, Enable-debug and so on.
After configure, Build-qemu generates the required. C and. h file link files, as well as makefile. In fact, Build-qemu is a project that can be debugged using the IDE (in the case of CDT, import Debugging).
Make && make install

2. Run Qemu
.. /TOOLS/QEMU-PPC [XXX] Program
Use the QEMU-PPC--help to see the supported command-line options. Here are some of the main uses:
(1)-L Path:path use absolute path, indicating the location of the dynamic link library, such as C library (compile time is strongly recommended that everyone static compilation, so that the simulation memory will not appear inexplicable error);
(2)-CPU model: Specify the CPU model, use QEMU-PPC-CPU? Can list the supported CPUs, the CPU for PPC is not very different, there are great classes. The concrete realization has the difference;
(3)-singlestep: Main command, QEMU uses TCG technology to interpret target model instructions as host instructions, build functions, and get results after execution. The default is to block interpretation, singlestep to a single instruction interpretation;
(4)-D logfile: The path of the generated log file, using the absolute path;
(5)-D options: Create the type of log file, the type of support visible source code. The main use of out_asm,in_asm,exec,cpu here:
1) Out_asm: The host explains the instructions;
2) In_asm: command of the target machine;
3) EXEC: the state of execution;
4) the state of CPU:CPU;
The unmodified version of QEMU generates a lot of log information, focusing on the error message. (such as unsupported system calls, processor exception states, and so on.) )
Basically as shown:


3. Import QEMU into CDT and debug breakpoint.
This step is key to reading or modifying the QEMU source code. The IDE I chose is the Eclipse CDT.
File->import->existing projects into Workspace-next, such as.

Select root directory choose the Build-qemu folder and click Finish. Such as

Then, you can build normally. Because QEMU execution may require many additional parameters, it is easier to specify the following:
Run->debug Configuration. Add the selected parameters to arguments.

The main debugging is to set breakpoints and observe log.

4. Build the LXR for QEMU cross-index.
This is definitely a tool to read the source code, at least saving my reading comprehension of qemu half the time. LXR is primarily the existence of a keyword index in the database, and then helps you build cross-index.
Can Baidu Linux LXR has an online website to read the Linux source code sharp weapon. So how to build a local LXR.
LXR version is very important, I choose to be 1.2.0. There's a lot of bugs in this stuff, and it's all Perl compiled. It is also troublesome to get up.
dependent libraries and installation instructions can be found in Lxr/doc/install. The configuration options are also described. Depending on the software capture to include:
(1) Perl5.10
Apt-get Install Cpanminus
Cpanm DBI
Cpanm File::mmagic
(2) Apache2
Apt-get Install Apache2
(3) MySQL
(4) Swish-e (or glimpse) to help search for the vegetarian.
Perform./genxref--checkonly can check for dependent software.
Perform the./scripts/configure-lxr.pl-v configuration of the LXR. Configuration completion will generate Apache Conf and initdb.sh. It is recommended that you choose M in the mutiple tree and single tree.
Executes the./custom.d/initdb.sh initialization of the required database.
Generate Index. (Note that the source code save path is saved to the specified folder under configuration, and the folder name is changed to the version number).
Restart Apache Daemon after throwing the apache-lxrserver.conf into the corresponding Apache Conf folder.
Build well after accessing through the browser, as shown in.

"Qemu" qemu how to play

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.