Skip to contentSkip to conversation

QEMU News: Win32 Port

Qemu-devel Fabrice Bellard 12 participants 23 messages Mar 31, 2004 – Apr 3, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

I commited an experimental win32 port of QEMU. I did not test it yet, but it compiles. It is based on Kazu port, but I made heavy modifications to minimize the number of ifdefs and to factorize the "dyngen" utility code.

In order to compile it, look at http://www.h7.dion.ne.jp/~qemu-win/PortingTips-en.html.

Feel free to submit any patches, in particular for audio, network redirector or native GUI for win32.

Note that I won't accept any patch to make it compile with MSVC. You must use MSYS/MinGW in order to compile the win32 port of QEMU.

Fabrice.

#1 lore raw
Quoted 5 lines · Fabrice Bellard

Hi,

I commited an experimental win32 port of QEMU. I did not test it yet, but it compiles. It is based on Kazu port, but I made heavy modifications to minimize the number of ifdefs and to factorize the "dyngen" utility code.

In order to compile it, look at http://www.h7.dion.ne.jp/~qemu-win/PortingTips-en.html.

I should not have given this URL because Cygwin is _not_ needed to compile QEMU. Instead use the following steps (taken from the FFmpeg project doc):

* Install the current versions of MSYS and MinGW from http://www.mingw.org/. You can find detailed installation instructions in the download section and the FAQ.

* Download the MinGW development library of SDL 1.2.x (SDL-devel-1.2.x-mingw32.tar.gz) from http://www.libsdl.org. Unpack it in a temporary place, and unpack the archive i386-mingw32msvc.tar.gz in the MinGW tool directory. Edit the sdl-config script so that it gives the correct SDL directory when invoked.

* Extract the current CVS version of QEMU.

* Start the MSYS shell (file 'msys.bat').

* Change to the QEMU directory and launch './configure' then 'make'. If you have problems using SDL, verify that 'sdl-config' can be launched from the MSYS command line.

Fabrice.

#2 lore raw
Quoted 11 lines · Fabrice Bellard
Quoted 7 lines

I commited an experimental win32 port of QEMU. I did not test it yet, but it compiles. It is based on Kazu port, but I made heavy modifications to minimize the number of ifdefs and to factorize the "dyngen" utility code.

In order to compile it, look at
http://www.h7.dion.ne.jp/~qemu-win/PortingTips-en.html.

I should not have given this URL because Cygwin is _not_ needed to compile QEMU. Instead use the following steps (taken from the FFmpeg project doc):

I guess cross-compiling for Windows from a linux host isn't supported? These are the problems I stumble over when I try to do just that:
* The SDL probe in 'configure' uses the host's CC instead of the target CC, causing the probe to fail.
* After hacking around that, it appears that dyngen is compiled as a .exe instead of a host binary, causing Wine to launch whenever dyngen is used in the build process.
* -lutil is used for final linking, but libutil.a is a component of glibc, and I didn't dare trying to build it for Windows (does that even work? :) It doesn't even seem to be needed -- removing the '-lutil' causes a qemu.exe to be built anyway.

After qemu.exe is built, it doesn't seem to work. It does run, but simply refuses to output anything:

F:\>qemu.exe

F:\>

cheers,
Lennert

#3 lore raw

I am working on doing a cross compile right now...

The first hurdle was dyngen.exe. It ran fine for me with wine, though (I am using crossover office version of wine though... don't know if that matters).

Alternatively I posted a patch to this list which will allow you to generate an op.h which has the binary code in it as source code in op.h so you can generate the op.h on Linux and use it in the mingw build. Kludgy but works.

Now I'm working on building SDL. I'll post here with instructions once I get everything working... I can't imagine this should be too hard...

-- John.

#4 lore raw
Quoted 3 lines · John R. Hogerhuis

The first hurdle was dyngen.exe. It ran fine for me with wine, though (I am using crossover office version of wine though... don't know if that matters).

(It doesn't matter, runs fine with regular wine.)

Quoted 2 lines

Now I'm working on building SDL. I'll post here with instructions once I get everything working... I can't imagine this should be too hard...

Seemed rather straightforward to me..

--L

#5 lore raw
In reply to Lennert Buytenhek

I get the same behavior... qemu that is built just silently exits, with no output.

The SDL probe can be fixed by moving it down just after cc is redefined to include the cross compiler prefix.

I did the same thing you did and removed the -lutil prefix to get the last step to compile.

There does seem to be one more issue in the install for the main Makefile... it wants to copy a the qemu-mkcow utility but the TOOLS macro is already set to nothing because CONFIG_WIN32 is defined.

Some details:

I am using the following to build SDL:

./configure --host=i586-mingw32msvc --disable-nasm --prefix=/home/john/projects/SDL-1.2.7

I added /home/john/projects/SDL-1.2.7 to beginning of my path so that sdl-config would be found there.

Then I configured QEMU to make the cross compiler prefix under the --enable-mingw32 option to match my compiler. I ran

./configure --enable-mingw32 --prefix=/home/john/projects/qemu make install

qemu.exe gets created in i386-softmmu

I copied qemu.exe and SDL.dll from the SDL build to my vmware Win2K, and upon running it fails as described above.

I wonder if I am missing copying over some library to the windows box.

-- John.

Quoted 44 lines · Lennert Buytenhek
Quoted 11 lines · Fabrice Bellard
Quoted 7 lines

I commited an experimental win32 port of QEMU. I did not test it yet, but it compiles. It is based on Kazu port, but I made heavy modifications to minimize the number of ifdefs and to factorize the "dyngen" utility code.

In order to compile it, look at
http://www.h7.dion.ne.jp/~qemu-win/PortingTips-en.html.

I should not have given this URL because Cygwin is _not_ needed to compile QEMU. Instead use the following steps (taken from the FFmpeg project doc):

I guess cross-compiling for Windows from a linux host isn't supported? These are the problems I stumble over when I try to do just that:
* The SDL probe in 'configure' uses the host's CC instead of the target CC, causing the probe to fail.
* After hacking around that, it appears that dyngen is compiled as a .exe instead of a host binary, causing Wine to launch whenever dyngen is used in the build process.
* -lutil is used for final linking, but libutil.a is a component of glibc, and I didn't dare trying to build it for Windows (does that even work? :) It doesn't even seem to be needed -- removing the '-lutil' causes a qemu.exe to be built anyway.

After qemu.exe is built, it doesn't seem to work. It does run, but simply refuses to output anything:

F:\>qemu.exe

F:\>

cheers,
Lennert

_______________________________________________
Qemu-devel mailing list
[email protected]
http://mail.nongnu.org/mailman/listinfo/qemu-devel

#6 lore raw
In reply to Lennert Buytenhek

Well, I tried running the cross-compiled qemu.exe from an MSYS prompt and it did run. Something special about the MSYS environment that makes it work... different DLLS? Environment variables? Dunno. Anyway, it won't load the bios.

$ ./qemu --cdrom ./MorphixCombined-LightGUI-0.4-1.iso
-L/home/Administrator/pc-bios
qemu: could not load PC bios
'C:/msys/1.0/home/Administrator/pc-bios/bios.bin'
#7 lore raw
In reply to Fabrice Bellard

So at one point and who should post a story to Slashdot or another news site about Kazu's port? I'd personally call this newsworthy. And it could bring a spike of new interest to the project that could help get the remaining drivers knocked out, and probably even more interest for QEMU generally.

-- John.

#8 lore raw
Quoted 5 lines · John R. Hogerhuis

So at one point and who should post a story to Slashdot or another news site about Kazu's port? I'd personally call this newsworthy. And it could bring a spike of new interest to the project that could help get the remaining drivers knocked out, and probably even more interest for QEMU generally.

Before making an "official" announce, it is better to wait for the 0.5.3 release as it contains big improvements compared to the 0.5.2 (I will release it before the end of the week).

Fabrice.

#9 lore raw

Re: [Qemu-devel] QEMU News: Win32 Port - Release Schedule

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

come to this - is there a way to tighten the release schedule in order to have new versions come out more frequently?
this would allow distributors to build up-to-date packages of qemu, and we might even be in the news every month.
personally, i don't like building from cvs, since you can never know if it will even compile. the old gentoo-issue, you know. packages made by people with a better understanding of things than i (and many others) have, would compile, so we would have a lot more people testing qemu and providing feedback.
if you believe that a release is compileable but not quite release-worthy, you could for example name it 0.5.3pre1 or something like that.

i just believe that more releases mean more testers and more publicity.

my €0.02

Quoted 5 lines · Fabrice Bellard

Before making an "official" announce, it is better to wait for the 0.5.3 release as it contains big improvements compared to the 0.5.2 (I will release it before the end of the week).

Fabrice.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAa8g81nTg39QS/TsRAgZ0AJ9sDG6bGm1Drn5EUzRchvLHGZjnngCfaIAq rcviDbIdQhoN183YeVPbemE=
=kNzo
-----END PGP SIGNATURE-----

#10 lore raw

Re: [Qemu-devel] QEMU News: Win32 Port - Release Schedule

Quoted 7 lines · Rudi Lippert

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

come to this - is there a way to tighten the release schedule in order to have new versions come out more frequently?
this would allow distributors to build up-to-date packages of qemu, and we might even be in the news every month.

I hardly belive that any distribution will include QEMU, since there are over dozens of patents covering this area and I don't see any Linux distributions running to pay those patents fees to IBM, Intel, VMWare, Connectix (Microsoft)..

Thanks,
Hetz

#11 lore raw

Re: [Qemu-devel] QEMU News: Win32 Port - Release Schedule

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 4 lines · you

I hardly belive that any distribution will include QEMU, since there are over dozens of patents covering this area and I don't see any Linux distributions running to pay those patents fees to IBM, Intel, VMWare, Connectix (Microsoft)...

gentoo does include qemu since january. maybe a different thing since they don't provide binaries or ship the software on cd. they just mirror the sources.
then, again, i'm not an expert when it comes to software patents. i just know they're useless.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAa9IH1nTg39QS/TsRAtG6AJ45EdYrMe6fJFysPV/07KDpKHmXJQCgghtZ 4y5Awa+p9Ip65qJ1J9ei7q4=
=I/uV
-----END PGP SIGNATURE-----

#12 lore raw

Re: [Qemu-devel] QEMU News: Win32 Port - Release Schedule

In reply to Hetz Ben Hamo

Qemu is in Debian unstable, the only distro that counts ;-) . And Bochs, plex86 as well. Can't speak for other distros, since I don't use them. Anyway there are quite a few Debian based distros the most well known (besides Debian itself) being Knoppix, Morphix... gasp, Lindows even.

Anyway, until the lawsuit comes, patents aren't really an issue. Believe me IBM probably has a patent on every nook and cranny of an operating system, but unless they decide to go out and sue someone it doesn't matter. Most companies keep a patent portfolio to prevent other companies from suing them (of course the government should change the law to completely do away with software patents).

Also if you're an engineer the going wisdom is that you shouldn't go looking for patents either, as willful infringement is a whole different ballgame in the eyes of the law...

-- John.

#13 lore raw

Re: [Qemu-devel] QEMU News: Win32 Port - Release Schedule

In reply to Hetz Ben Hamo
Quoted 4 lines · Hetz Ben Hamo

I hardly belive that any distribution will include QEMU, since there are over dozens of patents covering this area and I don't see any Linux distributions running to pay those patents fees to IBM, Intel, VMWare, Connectix (Microsoft)..

I don't understand a thing to these patent issues (and I would be very
interested by an explanation as qemu is released under GPL like license), but I can assure you that qemu 0.5.2 is know in debian sarge. That's where I get my version.

Cheers,

Gaël

#14 lore raw

Re: [Qemu-devel] QEMU News: Win32 Port - Release Schedule

In reply to Hetz Ben Hamo

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

anyway, the point of this is: users are testers. dummy-users are good testers ;o)
the more the better.
i believe releases are the way to get qemu known, and i don't think anyone will oppose.
so the question is whether it is possible to get more frequent releases. fabrice?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAa+fC1nTg39QS/TsRAq3pAJ9/6sVAWgsw2BNRnhlDo5+qmcAR/QCfYzSO Oa2+ElF181n+f85Ickj3z7g=
=zLoI
-----END PGP SIGNATURE-----

#15 lore raw

Re: [Qemu-devel] QEMU News: Win32 Port - Release Schedule

Quoted 5 lines · Rudi Lippert

anyway, the point of this is: users are testers. dummy-users are good testers ;o) the more the better.
i believe releases are the way to get qemu known, and i don't think anyone will oppose. so the question is whether it is possible to get more frequent releases. fabrice?

No, because making a release takes time and because QEMU is not mature enough. Of course, anyone is free to make daily CVS snapshots available on a web site.

Fabrice.

#16 lore raw

Re: [Qemu-devel] QEMU News: Win32 Port - Release Schedule

In reply to Rudi Lippert
Quoted 2 lines

this would allow distributors to build up-to-date packages of qemu, and we might even be in the news every month.

IMHO, using Qemu, we can run a small compilation farm and build our own packages.

At present, I am building a small farm for the pgAdmin III project
(http://www.pgadmin.org) precisely to compile RPMs and other packages.

Cheers,
Jean-Michel

#17 lore raw

Re: [Qemu-devel] QEMU News: Win32 Port - Release Schedule

In reply to Rudi Lippert
Quoted 1 line · Rudi Lippert

i just believe that more releases mean more testers and more publicity.

Yeah, but if doing releases take cycles out of Fabrice, I would certainly prefer him working on QEMU rather than doing releases :-)

And, frankly, as long as QEMU does not boot Win2K and WinXP reliably, there is no need to do too much publicity (to not have a horde of newbies coming here complaining about Windows not booting properly).

Lionel (who always uses CVS for projects he follows closely :-) )

Signature · 1 line
		 Lionel Ulmer - http://www.bbrox.org/
#18 lore raw

Re: [Qemu-devel] QEMU News: Win32 Port - Release Schedule

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Re: [Qemu-devel] QEMU News: Win32 Port - Release Schedule" (Lionel Ulmer, Thursday 01 April 2004 14:26):

Quoted 5 lines · Rudi Lippert
Quoted 1 line

i just believe that more releases mean more testers and more publicity.

Yeah, but if doing releases take cycles out of Fabrice, I would certainly prefer him working on QEMU rather than doing releases :-)

i agree. that's why i asked whether it was possible.

Quoted 3 lines

And, frankly, as long as QEMU does not boot Win2K and WinXP reliably, there is no need to do too much publicity (to not have a horde of newbies coming here complaining about Windows not booting properly).

you're probably right.
"win2k is not working" is not really a valuable bug report... -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAbBwt1nTg39QS/TsRAr62AJ42V6mnGYCBBXwYbYjpVvXIta8/WQCeOXsY NCdxc8c4rt+naR+uwGU6a7g=
=TeEI
-----END PGP SIGNATURE-----

#19 lore raw

Re: [Qemu-devel] QEMU News: Win32 Port - Release Schedule

In reply to Lionel Ulmer
Quoted 9 lines · Lionel Ulmer
Quoted 1 line · Rudi Lippert

i just believe that more releases mean more testers and more publicity.

Yeah, but if doing releases take cycles out of Fabrice, I would certainly prefer him working on QEMU rather than doing releases :-)

And, frankly, as long as QEMU does not boot Win2K and WinXP reliably, there is no need to do too much publicity (to not have a horde of newbies coming here complaining about Windows not booting properly).

ReactOS works sweet though. I think qemu might make quite a chance to be the successor to bochs in release packages of ReactOS.

Mark

#20 lore raw

Re: [Qemu-devel] QEMU News: Win32 Port - Release Schedule

Quoted 7 lines · Mark IJbema
Quoted 6 lines · Lionel Ulmer
Quoted 1 line · Rudi Lippert

i just believe that more releases mean more testers and more publicity.

Yeah, but if doing releases take cycles out of Fabrice, I would certainly prefer him working on QEMU rather than doing releases :-)

Quoted 6 lines
Quoted 3 lines

And, frankly, as long as QEMU does not boot Win2K and WinXP reliably, there is no need to do too much publicity (to not have a horde of newbies coming here complaining about Windows not booting properly).

ReactOS works sweet though. I think qemu might make quite a chance to be the successor to bochs in release packages of ReactOS.

Unfortunately it freezes after about 5 minutes. qemu 0.5.2

Which is a bit of a pain.

Quoted 8 lines

Mark

_______________________________________________
Qemu-devel mailing list
[email protected]
http://mail.nongnu.org/mailman/listinfo/qemu-devel

Signature · 8 lines
Wesley Parish
* * *
Clinersterton beademung - in all of love.  RIP James Blish
* * *
Mau e ki, "He aha te mea nui?"
You ask, "What is the most important thing?"
Maku e ki, "He tangata, he tangata, he tangata."
I reply, "It is people, it is people, it is people."
#21 lore raw

[Qemu-devel] FreeBSD port (was: QEMU News: Win32 Port)

In reply to Fabrice Bellard
Quoted 3 lines · On Thu, 01 Apr 2004 02:06:30 +0200 Fabrice Bellard <[email protected]> wrote:

Before making an "official" announce, it is better to wait for the 0.5.3 release as it contains big improvements compared to the 0.5.2 (I will release it before the end of the week).

I would send the latest cleaned up version of my FreeBSD patch if I hadn't problems with CVS. It seems that the savannah server is down. Is anyone else experiencing this?

I tought including FreeBSD port (actually it should work on NetBSD and OpenBSD, too) in the next release would be great. I will keep trying to get CVS working.

Maku

#22 lore raw
In reply to Fabrice Bellard

Hello,

Quoted 4 lines · Fabrice Bellard

I commited an experimental win32 port of QEMU. I did not test it yet, but it compiles. It is based on Kazu port, but I made heavy modifications to minimize the number of ifdefs and to factorize the "dyngen" utility code.

This is a patch for current CVS.

A patch of dyngen.c is only for cc_table. It is in op.c, so a location of cc_table[CC_OP].compute_c() in op_update_inc_cc function has a offset value from a head of .data section not a head of cc_table. So it needs to modify addend.

In vl.c, O_BINARY needs to read binary file.

timeKillEvent ends timer.

To test the program, apply this patch, make and type at i386-softmmu directory if linux.img is at the top of qemu source code:

i386-softmmu$ ./qemu.exe -L ../pc-bios --hda ../linux.img

Double hyphen needs to set hard disk image.

If there is not texi2html at make, type at the top of source code:

qemu$ touch qemu-doc.html

There is a problem. Keybord layout is wrong in Japanese. I can not type in Linux.

Have fun,
kazu

dyngen.c +13 -0
diff -ur qemu.org/dyngen.c qemu/dyngen.c
@@ -1215,6 +1215,19 @@
                         error("unsupported i386 relocation (%d)", type);
                     }
 #elif defined(CONFIG_FORMAT_COFF)
+					char *temp_name;
+					int j;
+					EXE_SYM *sym;
+					temp_name = get_sym_name(symtab + *(uint32_t *)(rel->r_reloc->r_symndx));
+					if(!strcmp(temp_name, ".data")) {
+						for (j = 0, sym = symtab; j < nb_syms; j++, sym++) {
+							if (strstart(sym->st_name, sym_name, NULL)) {
+								addend -= sym->st_value;
+							}
+						}
+					}
+
+
                     type = rel->r_type;
                     switch(type) {
                     case DIR32:
vl.c +8 -2
diff -ur qemu.org/vl.c qemu/vl.c
@@ -238,7 +238,7 @@
 int load_image(const char *filename, uint8_t *addr)
 {
     int fd, size;
-    fd = open(filename, O_RDONLY);
+    fd = open(filename, O_RDONLY | O_BINARY);
     if (fd < 0)
         return -1;
     size = lseek(fd, 0, SEEK_END);
@@ -645,6 +645,7 @@
     }
 }
 
+static MMRESULT timerID;
 static void init_timers(void)
 {
     rt_clock = qemu_new_clock(QEMU_TIMER_REALTIME);
@@ -653,7 +654,7 @@
 #ifdef _WIN32
     {
         int count=0;
-        MMRESULT timerID = timeSetEvent(10,    // interval (ms)
+        timerID = timeSetEvent(10,    // interval (ms)
                                         0,     // resolution
                                         host_alarm_handler, // function
                                         (DWORD)&count,  // user parameter
@@ -695,6 +696,10 @@
 #endif
 }
 
+void quit_timers(void)
+{
+		timeKillEvent(timerID);
+}
 /***********************************************************/
 /* serial device */
 
@@ -2134,5 +2139,6 @@
     }
     term_init();
     main_loop();
+	quit_timers();
     return 0;
 }