qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Windows compile errors
@ 2008-05-16  0:04 consul
  2008-05-16  0:15 ` Johannes Schindelin
  2008-05-16  0:38 ` [Qemu-devel] " Erik de Castro Lopo
  0 siblings, 2 replies; 12+ messages in thread
From: consul @ 2008-05-16  0:04 UTC (permalink / raw)
  To: qemu-devel

Current svn does not compile under MinGW. The patch below fixes the problem. 
Should the musicpal part go to a more generic header?

When running
qemu-system-arm -M n800 -m 130 -kernel c:\test\zImage -mtdblock 
c:\test\n800.img -show-cursor -serial vc -serial vc -serial vc -serial 
vc -usb -s

I'm getting
omap_l4ta_write: Bad register 0x6800a078
Uncompressing Linux................................................
........................................ done, booting the kernel.
then qemu crashes.

Index: slirp/slirp.h
===================================================================
--- slirp/slirp.h       (revision 4462)
+++ slirp/slirp.h       (working copy)
@@ -28,6 +28,7 @@
 typedef uint32_t u_int32_t;
 typedef uint64_t u_int64_t;
 typedef char *caddr_t;
+typedef int socklen_t;

 #define WIN32_LEAN_AND_MEAN
 # include <windows.h>
Index: hw/musicpal.c
===================================================================
--- hw/musicpal.c       (revision 4462)
+++ hw/musicpal.c       (working copy)
@@ -19,7 +19,9 @@
 #include "console.h"
 #include "audio/audio.h"
 #include "i2c.h"
-
+#ifdef _WIN32
+#define sleep Sleep
+#endif
 #define MP_ETH_BASE             0x80008000
 #define MP_ETH_SIZE             0x00001000

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH] Windows compile errors
  2008-05-16  0:04 [Qemu-devel] [PATCH] Windows compile errors consul
@ 2008-05-16  0:15 ` Johannes Schindelin
  2008-05-16  4:38   ` [Qemu-devel] " Alex
  2008-05-16  0:38 ` [Qemu-devel] " Erik de Castro Lopo
  1 sibling, 1 reply; 12+ messages in thread
From: Johannes Schindelin @ 2008-05-16  0:15 UTC (permalink / raw)
  To: consul; +Cc: qemu-devel

Hi,

On Thu, 15 May 2008, consul wrote:


> +#ifdef _WIN32
> +#define sleep Sleep
> +#endif

AFAIR sleep() takes seconds, while Sleep() takes milliseconds as an 
argument.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH] Windows compile errors
  2008-05-16  0:04 [Qemu-devel] [PATCH] Windows compile errors consul
  2008-05-16  0:15 ` Johannes Schindelin
@ 2008-05-16  0:38 ` Erik de Castro Lopo
  2008-05-16  4:23   ` [Qemu-devel] " Alex
  1 sibling, 1 reply; 12+ messages in thread
From: Erik de Castro Lopo @ 2008-05-16  0:38 UTC (permalink / raw)
  To: qemu-devel

consul wrote:

> Current svn does not compile under MinGW. The patch below fixes the problem. 
> Should the musicpal part go to a more generic header?

<snip>

> +typedef int socklen_t;

That might be OK on windows, but its probably not a good idea on
any other platform. Maybe surround it with "#ifdef _WIN32"?

Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"The happiness you have demanded is now mandatory."
    -- Jello Biafra

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Qemu-devel] Re: [PATCH] Windows compile errors
  2008-05-16  0:38 ` [Qemu-devel] " Erik de Castro Lopo
@ 2008-05-16  4:23   ` Alex
  0 siblings, 0 replies; 12+ messages in thread
From: Alex @ 2008-05-16  4:23 UTC (permalink / raw)
  To: qemu-devel

It's already in #ifdef'ed section

-- 
Alex.


"Erik de Castro Lopo" <mle+tools@mega-nerd.com> wrote in message 
news:20080516103805.36c4c796.mle+tools@mega-nerd.com...
> consul wrote:
>
>> Current svn does not compile under MinGW. The patch below fixes the 
>> problem.
>> Should the musicpal part go to a more generic header?
>
> <snip>
>
>> +typedef int socklen_t;
>
> That might be OK on windows, but its probably not a good idea on
> any other platform. Maybe surround it with "#ifdef _WIN32"?
>
> Erik
> -- 
> -----------------------------------------------------------------
> Erik de Castro Lopo
> -----------------------------------------------------------------
> "The happiness you have demanded is now mandatory."
>    -- Jello Biafra
>
>
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Qemu-devel] Re: [PATCH] Windows compile errors
  2008-05-16  0:15 ` Johannes Schindelin
@ 2008-05-16  4:38   ` Alex
  2008-05-16  9:44     ` Johannes Schindelin
  2008-05-16 10:15     ` Eduardo Felipe
  0 siblings, 2 replies; 12+ messages in thread
From: Alex @ 2008-05-16  4:38 UTC (permalink / raw)
  To: qemu-devel

> AFAIR sleep() takes seconds, while Sleep() takes milliseconds as an
> argument.
>

You are right. Perhaps this is a better patch:

Index: slirp/slirp.h
===================================================================
--- slirp/slirp.h       (revision 4462)
+++ slirp/slirp.h       (working copy)
@@ -28,6 +28,7 @@
 typedef uint32_t u_int32_t;
 typedef uint64_t u_int64_t;
 typedef char *caddr_t;
+typedef int socklen_t;

 #define WIN32_LEAN_AND_MEAN
 # include <windows.h>
Index: hw/musicpal.c
===================================================================
--- hw/musicpal.c       (revision 4462)
+++ hw/musicpal.c       (working copy)
@@ -19,6 +19,9 @@
 #include "console.h"
 #include "audio/audio.h"
 #include "i2c.h"
+#ifdef _WIN32
+#define sleep(x) (Sleep(x * 1000))
+#endif

 #define MP_ETH_BASE             0x80008000
 #define MP_ETH_SIZE             0x00001000

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] Re: [PATCH] Windows compile errors
  2008-05-16  4:38   ` [Qemu-devel] " Alex
@ 2008-05-16  9:44     ` Johannes Schindelin
  2008-05-16 16:00       ` [Qemu-devel] " consul
  2008-05-16 10:15     ` Eduardo Felipe
  1 sibling, 1 reply; 12+ messages in thread
From: Johannes Schindelin @ 2008-05-16  9:44 UTC (permalink / raw)
  To: Alex; +Cc: qemu-devel

Hi,

On Thu, 15 May 2008, Alex wrote:

> +#ifdef _WIN32
> +#define sleep(x) (Sleep(x * 1000))
> +#endif

It is common to say "Sleep((x) * 1000)" to prevent errors, such as when 
you write "sleep(1000 + 0);"

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] Re: [PATCH] Windows compile errors
  2008-05-16  4:38   ` [Qemu-devel] " Alex
  2008-05-16  9:44     ` Johannes Schindelin
@ 2008-05-16 10:15     ` Eduardo Felipe
  1 sibling, 0 replies; 12+ messages in thread
From: Eduardo Felipe @ 2008-05-16 10:15 UTC (permalink / raw)
  To: qemu-devel

2008/5/16 Alex <void@aleksoft.net>:
>
> > AFAIR sleep() takes seconds, while Sleep() takes milliseconds as an
> > argument.
> >
>
> You are right. Perhaps this is a better patch:
>
> Index: slirp/slirp.h
> ===================================================================
> --- slirp/slirp.h       (revision 4462)
> +++ slirp/slirp.h       (working copy)
> @@ -28,6 +28,7 @@
>  typedef uint32_t u_int32_t;
>  typedef uint64_t u_int64_t;
>  typedef char *caddr_t;
> +typedef int socklen_t;
>
>  #define WIN32_LEAN_AND_MEAN
>  # include <windows.h>

There's no need to explicitly typedef socklen_t, it is already done in
ws2tcpip.h:

--- slirp/slirp.h	Mon May 12 19:44:40 2008
+++ slirp/slirp.h	Mon May 12 19:44:05 2008
@@ -32,6 +32,7 @@
 #define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 # include <winsock2.h>
+# include <ws2tcpip.h>
 # include <sys/timeb.h>
 # include <iphlpapi.h>

Regards,
Edu

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Qemu-devel] Re: Re: [PATCH] Windows compile errors
  2008-05-16  9:44     ` Johannes Schindelin
@ 2008-05-16 16:00       ` consul
  2008-05-16 16:16         ` andrzej zaborowski
  2008-05-16 16:29         ` [Qemu-devel] " Jan Kiszka
  0 siblings, 2 replies; 12+ messages in thread
From: consul @ 2008-05-16 16:00 UTC (permalink / raw)
  To: qemu-devel


"Johannes Schindelin" <Johannes.Schindelin@gmx.de> wrote in message
news:alpine.DEB.1.00.0805161043540.30431@racer...
> It is common to say "Sleep((x) * 1000)" to prevent errors, such as when
> you write "sleep(1000 + 0);"
>

I think this may be not a right thing to do anyway. How does the sleep help 
here? does the musicpal_init run in a separate thread?
/*
* Wait a bit to catch menu button during U-Boot start-up
* (to trigger emergency update).
*/
sleep(1);

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] Re: Re: [PATCH] Windows compile errors
  2008-05-16 16:00       ` [Qemu-devel] " consul
@ 2008-05-16 16:16         ` andrzej zaborowski
  2008-05-16 16:29         ` [Qemu-devel] " Jan Kiszka
  1 sibling, 0 replies; 12+ messages in thread
From: andrzej zaborowski @ 2008-05-16 16:16 UTC (permalink / raw)
  To: qemu-devel

On 16/05/2008, consul <void@aleksoft.net> wrote:
>  "Johannes Schindelin" <Johannes.Schindelin@gmx.de> wrote in message
>  news:alpine.DEB.1.00.0805161043540.30431@racer...
>
> > It is common to say "Sleep((x) * 1000)" to prevent errors, such as when
>  > you write "sleep(1000 + 0);"
>  >
>
>
> I think this may be not a right thing to do anyway. How does the sleep help
>  here? does the musicpal_init run in a separate thread?
>  /*
>  * Wait a bit to catch menu button during U-Boot start-up
>  * (to trigger emergency update).
>  */
>  sleep(1);

I understand this was meant to give the user time to press a key on
the keyboard after realeasing enter when running qemu from command
line, and before the emulation starts.  Yes, it's hack but I merged it
because it was quite obvious and the harm from removing it is minor.

Regarding the n800 breakage, I mentioned earlier that it's broken
without a patch posted on this list.  I'll try to come with something
to make it work out of the box.

Regards

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Qemu-devel] Re: [PATCH] Windows compile errors
  2008-05-16 16:00       ` [Qemu-devel] " consul
  2008-05-16 16:16         ` andrzej zaborowski
@ 2008-05-16 16:29         ` Jan Kiszka
  2008-05-17  2:17           ` Alex
  1 sibling, 1 reply; 12+ messages in thread
From: Jan Kiszka @ 2008-05-16 16:29 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 965 bytes --]

consul wrote:
> "Johannes Schindelin" <Johannes.Schindelin@gmx.de> wrote in message
> news:alpine.DEB.1.00.0805161043540.30431@racer...
>> It is common to say "Sleep((x) * 1000)" to prevent errors, such as when
>> you write "sleep(1000 + 0);"
>>
> 
> I think this may be not a right thing to do anyway. How does the sleep help 
> here? does the musicpal_init run in a separate thread?
> /*
> * Wait a bit to catch menu button during U-Boot start-up
> * (to trigger emergency update).
> */
> sleep(1);

This opens a window after the virtual LCD popped up and before the guest
starts to boot so that the user can hit a special key. With the real
device, you would hold down that button before powering on the hardware,
but that won't work with QEMU... :)

Anyway, my bad. I thought Windows understands basic POSIX (at least it
was once certified for it ;) ) - no, I didn't thought at all.

Is there no official delay wrapper in QEMU?

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Qemu-devel] Re: [PATCH] Windows compile errors
  2008-05-16 16:29         ` [Qemu-devel] " Jan Kiszka
@ 2008-05-17  2:17           ` Alex
  2008-05-17 12:22             ` Jan Kiszka
  0 siblings, 1 reply; 12+ messages in thread
From: Alex @ 2008-05-17  2:17 UTC (permalink / raw)
  To: qemu-devel

"Jan Kiszka" <jan.kiszka@web.de> wrote in message 
news:482DB664.9090205@web.de...
>This opens a window after the virtual LCD popped up and before the guest
>starts to boot so that the user can hit a special key. With the real
>device, you would hold down that button before powering on the hardware,
>but that won't work with QEMU... :)

Sorry for my ignorance, but won't a command line switch better fulfill this 
purpose?
Then if you really want the popup, you can show it from a launcher script 
before
even starting qemu...

Alex. 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Qemu-devel] Re: [PATCH] Windows compile errors
  2008-05-17  2:17           ` Alex
@ 2008-05-17 12:22             ` Jan Kiszka
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Kiszka @ 2008-05-17 12:22 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 986 bytes --]

Alex wrote:
> "Jan Kiszka" <jan.kiszka@web.de> wrote in message 
> news:482DB664.9090205@web.de...
>> This opens a window after the virtual LCD popped up and before the guest
>> starts to boot so that the user can hit a special key. With the real
>> device, you would hold down that button before powering on the hardware,
>> but that won't work with QEMU... :)
> 
> Sorry for my ignorance, but won't a command line switch better fulfill this 
> purpose?
> Then if you really want the popup, you can show it from a launcher script 
> before
> even starting qemu...

That's basically true, and it used to be my first idea as well. But at
that time, I didn't like to add yet another special-purpose switch to
the long list of existing ones.

I still do not like the idea of patch vl.c with MusicPal specifics. But
now I dug out and polished some per-machine-options patch of mine. On
top of it, I have written a fix for the MusicPal, see following postings.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-05-17 12:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-16  0:04 [Qemu-devel] [PATCH] Windows compile errors consul
2008-05-16  0:15 ` Johannes Schindelin
2008-05-16  4:38   ` [Qemu-devel] " Alex
2008-05-16  9:44     ` Johannes Schindelin
2008-05-16 16:00       ` [Qemu-devel] " consul
2008-05-16 16:16         ` andrzej zaborowski
2008-05-16 16:29         ` [Qemu-devel] " Jan Kiszka
2008-05-17  2:17           ` Alex
2008-05-17 12:22             ` Jan Kiszka
2008-05-16 10:15     ` Eduardo Felipe
2008-05-16  0:38 ` [Qemu-devel] " Erik de Castro Lopo
2008-05-16  4:23   ` [Qemu-devel] " Alex

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).