How to Compile QEMU on Windows OS

I’ve some program written in MIPS architecture and decided to find whether it can be emulated using qemu. If it can’t be emulated, I also want to find out the causes and if it is possible to extend the functionality so that the program can be run in emulated environment.

The first task, is to compile from the source. So, here I will describe issues found in this activity, and how to resolve it. I hope others can have some benefit by this information and can duplicate the compiling process successfully.

qm01

Please refer to http://stackoverflow.com/questions/1710922/how-to-install-pkg-config-in-windows for resolving the above issue.

qm02

Refer to http://lassauge.free.fr/qemu/ to resolve zlib problem.

qm03

Again, refer to http://lassauge.free.fr/qemu/ for this issue.

qm04

pod2man is a perl script to create the documentation, it depends on $docs=yes variable, and in my configuration, it appears to be yes and requires perl.exe for windows in order to be executed. Install perl.exe for windows in C:\MSYS\1.0\bin and copies the related lib files to C:\MSYS\1.0\lib will resolve this issue.

qm05

The actual value MAPVK_VK_TO_VSC is 0 (zero) based on documentation given by windows OS, so the error can be eliminated by replacing the second argument of MapVirtualKey in gtk.c to 0 (zero).

qm06

The error is caused by make rule below:

qm07

The subdir-% is expanded to subdir-mips-softmmu and its accompanying object files to be checked. The $* denotes the make target directory, in this case it is evaluated to mips-softmmu.

To provide more information to the make process, I can add V=1 at the start of makefile at the qemu root directory, now I have:

qm08

So, the make file tries to process another make file inside mips-softmmu folder. Checking the makefile content on this directory reveals that it is only a symlink to D:\Projects\Qemu\Makefile.target.

Windows OS do not recognize linux style symlink, make file will cause the error. So, it is necessary to change symlink style to a normal make file as follows:

qm09

After that, there are no more incidents, and I have the compiled executable as follows:

qm10

If there is an error of dll not found, which is usually related to glib or gtk modules, retrieve the dll files from downloaded modules.

For glib, mine is glib_2.28.8-1_win32.zip. The location of dll files is on the bin folder of extracted glib module. And for gtk, my version is gtk+-bundle_2.24.10-20120208_win32.zip.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: