Windows compile errors
PATCH 1/1 Windows compile errors
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 gettingomap_l4ta_write: Bad register 0x6800a078
Uncompressing Linux................................................ ........................................ done, booting the kernel. then qemu crashes.
slirp.h (working copy) renamed from slirp.h (revision 4462) +1 -0
@@ -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>
musicpal.c (working copy) renamed from musicpal.c (revision 4462) +3 -1
@@ -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
Hi,
musicpal.c (working copy) line 24
Quoted 3 lines · consul
musicpal.c (working copy) renamed from musicpal.c (revision 4462) +3
-0+#ifdef _WIN32 +#define sleep Sleep +#endif
AFAIR sleep() takes seconds, while Sleep() takes milliseconds as an argument.
Ciao,
Dscho
Quoted 3 lines
AFAIR
sleep()takes seconds, whileSleep()takes milliseconds as an argument.
You are right. Perhaps this is a better patch:
slirp.h (working copy) renamed from slirp.h (revision 4462) +1 -0
@@ -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>
musicpal.c (working copy) renamed from musicpal.c (revision 4462) +3 -0
@@ -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
Hi,
musicpal.c (working copy) line 24
Quoted 3 lines · Alex
musicpal.c (working copy) renamed from musicpal.c (revision 4462) +3
-0+#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
"Johannes Schindelin" <[email protected]> wrote in message news:alpine.DEB.1.00.0805161043540.30431@racer...
Quoted 3 lines
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);
Quoted 8 lines · consul
"Johannes Schindelin" <[email protected]> wrote in message news:alpine.DEB.1.00.0805161043540.30431@racer...
Quoted 3 lines
It is common to say "
Sleep((x) * 1000)" to prevent errors, such as when you write "sleep(1000 + 0);"
Quoted 7 lines
I think this may be not a right thing to do anyway. How does the sleep help
here? does themusicpal_initrun 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
Quoted 6 lines · consul
"Johannes Schindelin" <[email protected]> wrote in message news:alpine.DEB.1.00.0805161043540.30431@racer...
Quoted 3 lines
It is common to say "
Sleep((x) * 1000)" to prevent errors, such as when you write "sleep(1000 + 0);"
Quoted 7 lines
I think this may be not a right thing to do anyway. How does the sleep help here? does the
musicpal_initrun 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
"Jan Kiszka" <[email protected]> wrote in message
news:[email protected]...
Quoted 4 lines
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.
Quoted 7 lines · Alex
"Jan Kiszka" <[email protected]> wrote in message
news:[email protected]...Quoted 4 lines
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... :)
Quoted 5 lines
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
2008/5/16 Alex <[email protected]>:
Quoted 12 lines
Quoted 4 lines
AFAIR
sleep()takes seconds, whileSleep()takes milliseconds as an argument.You are right. Perhaps this is a better patch:
Index:
slirp/slirp.h
===================================================================
slirp.h (working copy) line 34
Quoted 7 lines
slirp.h (working copy) renamed from slirp.h (revision 4462) +1
-0@@ -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.h +1 -0
@@ -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
Quoted 2 lines · consul
Current svn does not compile under MinGW. The patch below fixes the problem. Should the musicpal part go to a more generic header?
<snip>
Quoted 1 line
+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
Signature · 5 lines
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"The happiness you have demanded is now mandatory."
-- Jello BiafraIt's already in #ifdef'ed section
Signature · 5 lines
Alex. "Erik de Castro Lopo" <[email protected]> wrote in message news:[email protected]...
Quoted 23 lines
Quoted 3 lines · consul
Current svn does not compile under MinGW. The patch below fixes the problem.
Should the musicpal part go to a more generic header?<snip>
Quoted 1 line
+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
Signature · 5 lines
----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- "The happiness you have demanded is now mandatory." -- Jello Biafra