Skip to contentSkip to conversation

qemu/slirp bootp.c bootp.h ip_icmp.h libslirp.h...

Qemu-devel Fabrice Bellard 4 participants 8 messages Jun 5, 2005 – Feb 8, 2006

lore
Share & tools
lore
#0 lore raw
#1 lore raw

Hello

On my WinXP host, I get a compile error in "udp.c" with the current QEMU version from the CVS. I use MinGW and MSYS (1.0.10). I was able to compile all versions of QEMU before.

Maybe, I'm too early and miss some updates which are on the way...

Andreas

gcc -Wall -O2 -g -fno-strict-aliasing -fomit-frame-pointer -I. -I/d/dev/QEMU/qemu/target-i386 -I/d/dev/QEMU/qemu -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/d/dev/QEMU/qemu/fpu -I/d/dev/QEMU/qemu/slirp -c -o slirp/udp.o /d/dev/QEMU/qemu/slirp/udp.c
d:/dev/QEMU/qemu/slirp/udp.c: In function `udp_emu':
d:/dev/QEMU/qemu/slirp/udp.c:428: warning: no semicolon at end of struct or union
d:/dev/QEMU/qemu/slirp/udp.c:428: parse error before '.' token d:/dev/QEMU/qemu/slirp/udp.c:405: warning: unused variable addrlen' d:/dev/QEMU/qemu/slirp/udp.c:429: warning: unused variable seqn' d:/dev/QEMU/qemu/slirp/udp.c:430: warning: unused variable message' d:/dev/QEMU/qemu/slirp/udp.c:431: warning: unused variable data_type' d:/dev/QEMU/qemu/slirp/udp.c:432: warning: unused variable `pkt_len' d:/dev/QEMU/qemu/slirp/udp.c: At top level:
d:/dev/QEMU/qemu/slirp/udp.c:433: warning: type defaults to int' in declaration of cu_head'
d:/dev/QEMU/qemu/slirp/udp.c:433: warning: data definition has no type or storage class
d:/dev/QEMU/qemu/slirp/udp.c:435: parse error before "switch" d:/dev/QEMU/qemu/slirp/udp.c:618: warning: type defaults to int' in declaration of cu_head'
d:/dev/QEMU/qemu/slirp/udp.c:618: conflicting types for cu_head' d:/dev/QEMU/qemu/slirp/udp.c:433: previous declaration of cu_head' d:/dev/QEMU/qemu/slirp/udp.c:618: `m' undeclared here (not in a function)
d:/dev/QEMU/qemu/slirp/udp.c:618: warning: data definition has no type or storage class
d:/dev/QEMU/qemu/slirp/udp.c:619: parse error before '->' token
make: *** [slirp/udp.o] Error 1

Quoted 22 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Fabrice Bellard
Sent: Sunday, June 05, 2005 7:12 PM
To: [email protected]
Subject: [Qemu-devel] qemu/slirp bootp.c bootp.h ip_icmp.h libslirp.h...

*This message was transferred with a trial version of CommuniGate(tm) Pro*
CVSROOT: /cvsroot/qemu
Module name: qemu
Branch:
Changes by: Fabrice Bellard <[email protected]>
05/06/05 17:11:42

Modified files:
slirp : bootp.c bootp.h ip_icmp.h libslirp.h
slirp_config.h udp.c udp.h

Quoted 5 lines

Log message:
64 bit fixes (initial patch by Gwenole Beauchesne)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/qemu/qemu/slirp/bootp.

c.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/qemu/qemu/slirp/bootp.h.diff?t
r1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/qemu/qemu/slirp/ip_icmp.h.diff
?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/qemu/qemu/slirp/libslirp.h.dif
f?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/qemu/qemu/slirp/slirp_config.h
.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/qemu/qemu/slirp/udp.c.diff?tr1
=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/qemu/qemu/slirp/udp.h.diff?tr1
=1.1&tr2=1.2&r1=text&r2=text

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

#2 lore raw

Le Sun, 05 Jun 2005 20:00:12 +0200, Andreas Bollhalder a écrit :

Quoted 7 lines

Hello

On my WinXP host, I get a compile error in "udp.c" with the current QEMU version from the CVS. I use MinGW and MSYS (1.0.10). I was able to compile all versions of QEMU before.

Maybe, I'm too early and miss some updates which are on the way...

s_addr is already in use in winsock2.h

8< --

struct in_addr {
        union {
                struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b;
                struct { u_short s_w1,s_w2; } S_un_w;
                u_long S_addr;
        } S_un;
#define s_addr  S_un.S_addr
#define s_host  S_un.S_un_b.s_b2
#define s_net   S_un.S_un_b.s_b1
#define s_imp   S_un.S_un_w.s_w2

#define s_impno S_un.S_un_b.s_b4
#define s_lh S_un.S_un_b.s_b3
};

8< --

I can built if I change the name.

udp.c.try renamed from udp.c +2 -2
@@ -425,7 +425,7 @@
 	uint32_t	d_addr;			// destination address
 	uint16_t	s_family;		// source family
 	uint16_t	s_port;			// source port
-	uint32_t	s_addr;			// source address
+	uint32_t	so_addr;			// source address
 	uint32_t	seqn;			// sequence number
 	uint16_t	message;		// message
 	uint16_t	data_type;		// data type
@@ -617,7 +617,7 @@
 				return;
 			cu_head = mtod(m, struct cu_header *);
 			cu_head->s_port = addr.sin_port;
-			cu_head->s_addr = our_addr.s_addr;
+			cu_head->so_addr = our_addr.s_addr;
 		}
 		
 		return;
Quoted 32 lines

Andreas

gcc -Wall -O2 -g -fno-strict-aliasing -fomit-frame-pointer -I.

(quoted diff) +0 -3
-I/d/dev/QEMU/qemu/target-i386 -I/d/dev/QEMU/qemu -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/d/dev/QEMU/qemu/fpu
-I/d/dev/QEMU/qemu/slirp -c -o slirp/udp.o /d/dev/QEMU/qemu/slirp/udp.c

d:/dev/QEMU/qemu/slirp/udp.c: In function `udp_emu':
d:/dev/QEMU/qemu/slirp/udp.c:428: warning: no semicolon at end of struct or union
d:/dev/QEMU/qemu/slirp/udp.c:428: parse error before '.' token d:/dev/QEMU/qemu/slirp/udp.c:405: warning: unused variable addrlen' d:/dev/QEMU/qemu/slirp/udp.c:429: warning: unused variable seqn' d:/dev/QEMU/qemu/slirp/udp.c:430: warning: unused variable message' d:/dev/QEMU/qemu/slirp/udp.c:431: warning: unused variable data_type' d:/dev/QEMU/qemu/slirp/udp.c:432: warning: unused variable `pkt_len' d:/dev/QEMU/qemu/slirp/udp.c: At top level:
d:/dev/QEMU/qemu/slirp/udp.c:433: warning: type defaults to int' in declaration of cu_head'
d:/dev/QEMU/qemu/slirp/udp.c:433: warning: data definition has no type or storage class
d:/dev/QEMU/qemu/slirp/udp.c:435: parse error before "switch" d:/dev/QEMU/qemu/slirp/udp.c:618: warning: type defaults to int' in declaration of cu_head'
d:/dev/QEMU/qemu/slirp/udp.c:618: conflicting types for cu_head' d:/dev/QEMU/qemu/slirp/udp.c:433: previous declaration of cu_head' d:/dev/QEMU/qemu/slirp/udp.c:618: `m' undeclared here (not in a function) d:/dev/QEMU/qemu/slirp/udp.c:618: warning: data definition has no type or storage class
d:/dev/QEMU/qemu/slirp/udp.c:619: parse error before '->' token make: *** [slirp/udp.o] Error 1

#3 lore raw

Hello

This did it and I have it up and working. Thank a lot!!

Andreas

Quoted 73 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ronald
Sent: Monday, June 06, 2005 3:02 AM
To: [email protected]
Subject: [Qemu-devel] RE: qemu/slirp bootp.c bootp.h ip_icmp.h libslirp.h...

*This message was transferred with a trial version of CommuniGate(tm) Pro*
Le Sun, 05 Jun 2005 20:00:12 +0200, Andreas Bollhalder a écrit :

Quoted 3 lines

Hello

On my WinXP host, I get a compile error in "udp.c" with the

current QEMU

Quoted 1 line

version from the CVS. I use MinGW and MSYS (1.0.10). I was

able to compile

Quoted 3 lines

all versions of QEMU before.

Maybe, I'm too early and miss some updates which are on the way...

s_addr is already in use in winsock2.h

8< --

struct in_addr {
        union {
                struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b;
                struct { u_short s_w1,s_w2; } S_un_w;
                u_long S_addr;
        } S_un;
#define s_addr  S_un.S_addr
#define s_host  S_un.S_un_b.s_b2
#define s_net   S_un.S_un_b.s_b1
#define s_imp   S_un.S_un_w.s_w2

#define s_impno S_un.S_un_b.s_b4
#define s_lh S_un.S_un_b.s_b3
};

8< --

I can built if I change the name.

udp.c.try renamed from udp.c +1 -1
@@ -425,7 +425,7 @@
 	uint32_t	d_addr;			// destination address
 	uint16_t	s_family;		// source family
 	uint16_t	s_port;			// source port
-	uint32_t	s_addr;			// source address
+	uint32_t	so_addr;			// 

source address

udp.c.try renamed from udp.c +1 -1
 	uint32_t	seqn;			// sequence number
 	uint16_t	message;		// message
 	uint16_t	data_type;		// data type
@@ -617,7 +617,7 @@
 				return;
 			cu_head = mtod(m, struct cu_header *);
 			cu_head->s_port = addr.sin_port;
-			cu_head->s_addr = our_addr.s_addr;
+			cu_head->so_addr = our_addr.s_addr;
 		}
 
 		return;
Quoted 5 lines

Andreas

Quoted 11 lines

Review

Quoted 4 lines

gcc -Wall -O2 -g -fno-strict-aliasing -fomit-frame-pointer -I.

(quoted diff) +0 -3
-I/d/dev/QEMU/qemu/target-i386 -I/d/dev/QEMU/qemu -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/d/dev/QEMU/qemu/fpu
-I/d/dev/QEMU/qemu/slirp -c -o slirp/udp.o 

/d/dev/QEMU/qemu/slirp/udp.c

Quoted 2 lines

d:/dev/QEMU/qemu/slirp/udp.c: In function `udp_emu':
d:/dev/QEMU/qemu/slirp/udp.c:428: warning: no semicolon at

end of struct

Quoted 3 lines

or union
d:/dev/QEMU/qemu/slirp/udp.c:428: parse error before '.' token d:/dev/QEMU/qemu/slirp/udp.c:405: warning: unused variable

`addrlen'

Quoted 2 lines
Quoted 2 lines

d:/dev/QEMU/qemu/slirp/udp.c:429: warning: unused variable `seqn' d:/dev/QEMU/qemu/slirp/udp.c:430: warning: unused variable

`message'

Quoted 3 lines
Quoted 1 line

d:/dev/QEMU/qemu/slirp/udp.c:431: warning: unused variable

`data_type'

Quoted 1 line

d:/dev/QEMU/qemu/slirp/udp.c:432: warning: unused variable

`pkt_len'

Quoted 2 lines
Quoted 2 lines

d:/dev/QEMU/qemu/slirp/udp.c: At top level:
d:/dev/QEMU/qemu/slirp/udp.c:433: warning: type defaults to `int'

in

Quoted 6 lines
Quoted 2 lines

declaration of `cu_head' d:/dev/QEMU/qemu/slirp/udp.c:433: warning: data definition

has no type or

Quoted 3 lines

storage class
d:/dev/QEMU/qemu/slirp/udp.c:435: parse error before "switch" d:/dev/QEMU/qemu/slirp/udp.c:618: warning: type defaults to `int'

in

Quoted 3 lines
Quoted 3 lines

declaration of cu_head' d:/dev/QEMU/qemu/slirp/udp.c:618: conflicting types for cu_head' d:/dev/QEMU/qemu/slirp/udp.c:433: previous declaration of

`cu_head'

Quoted 18 lines
Quoted 1 line

d:/dev/QEMU/qemu/slirp/udp.c:618: `m' undeclared here (not

in a function)

Quoted 1 line

d:/dev/QEMU/qemu/slirp/udp.c:618: warning: data definition

has no type or

Quoted 2 lines

storage class
d:/dev/QEMU/qemu/slirp/udp.c:619: parse error before '->'

token make: ***

Quoted 2 lines

[slirp/udp.o] Error 1

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

#4 lore raw

[Qemu-devel] Writing to ROM-Range 0xC800-EFFF

In reply to Ronald

Hello

What does I need to change in the source code of QEMU that it would be possible to enable write access to the ROM adresses from 0xC800 up to 0xEFFF ? For instance, "UMBPCI.SYS"
(http://www.uwe-sieber.de/umbpci_e.html) can made this range accessible for direct access if no BIOS-ROM is using it. The original chipset which QEMU emulate (Intel 440FX) does allow this, but in QEMU, it won't work.

Any ideas ?

Andreas

#5 lore raw

Re: [Qemu-devel] Writing to ROM-Range 0xC800-EFFF

Quoted 10 lines · Andreas Bollhalder

Hello

What does I need to change in the source code of QEMU that it would be possible to enable write access to the ROM adresses from 0xC800 up to 0xEFFF ? For instance, "UMBPCI.SYS"
(http://www.uwe-sieber.de/umbpci_e.html) can made this range accessible for direct access if no BIOS-ROM is using it. The original chipset which QEMU emulate (Intel 440FX) does allow this, but in QEMU, it won't work.

Quoted 4 lines

Any ideas ?

Andreas

I'd recommend looking at i440fx_init() in hw/pci.c as a starting point.

Also see if you can modify the constant IO_MEM_ROM.

Signature · 2 lines
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
#6 lore raw

Re: [Qemu-devel] Writing to ROM-Range 0xC800-EFFF

Hello Jim

Thank you for the tips. I will have a look into it. Would be nice if QEMU could allow us to enable write access to the BIOS memory range (shadow RAM) which isn't in use.

Andreas

Quoted 22 lines · Jim C. Brown
Quoted 10 lines · Andreas Bollhalder

Hello

What does I need to change in the source code of QEMU that it would be possible to enable write access to the ROM adresses from 0xC800 up to 0xEFFF ? For instance, "UMBPCI.SYS"
(http://www.uwe-sieber.de/umbpci_e.html) can made this range accessible for direct access if no BIOS-ROM is using it. The original chipset which QEMU emulate (Intel 440FX) does allow this, but in QEMU, it won't work.

Quoted 4 lines

Any ideas ?

Andreas

I'd recommend looking at i440fx_init() in hw/pci.c as a starting point.

Also see if you can modify the constant IO_MEM_ROM.

#7 lore raw

[Qemu-devel] QEMU freeze with "Servicing hardware INT=0x08"

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

Hello

I'm using QEMU 0.8.0 CVS under Windows. In the x86 version, one of my DOS application freezes QEMU amd I have to close it.

I enabled the debugging with "-d in_asm,op_opt". At the end of the log file, I have over 1770 times the entry stating that QEMU is serving Int 0x08.

Is this because the DOS application is poorly written or could this be a problem of QEMU ?

What debug options are the best to use in my case ?

Thanks for your opinions.

Andreas

- ----------------
IN:
0x0000cd0a: repnz scas %es:(%di),%ax

AFTER FLAGS OPT:
0x0000: jnz_ecxw 0x0
0x0001: goto_tb1 0x174b6e0
0x0002: movl_eip_im 0xdbc
0x0003: movl_T0_im 0x174b6e1
0x0004: exit_tb
0x0005: movl_T0_EAX
0x0006: movl_A0_EDI
0x0007: andl_A0_ffff
0x0008: addl_A0_seg 0x40
0x0009: lduw_user_T1_A0
0x000a: cmpl_T0_T1_cc
0x000b: movl_T0_Dshiftw
0x000c: addw_EDI_T0
0x000d: decw_ECX
0x000e: set_cc_op 0xf
0x000f: jz_subw 0x1
0x0010: goto_tb0 0x174b6e0
0x0011: movl_eip_im 0xdba
0x0012: movl_T0_im 0x174b6e0
0x0013: exit_tb
0x0014: end

- ----------------
IN:
0x0000cd0c: jne 0xcd8b

AFTER FLAGS OPT:
0x0000: setz_T0_cc
0x0001: jnz_T0_label 0x0
0x0002: goto_tb0 0x174b720
0x0003: movl_eip_im 0xe3b
0x0004: movl_T0_im 0x174b720
0x0005: exit_tb
0x0006: goto_tb1 0x174b720
0x0007: movl_eip_im 0xdbe
0x0008: movl_T0_im 0x174b721
0x0009: exit_tb
0x000a: end

- ----------------
IN:

0x0000cd8b:  addw   $0x1,1114
0x0000cd90:  adcw   $0x0,1116
0x0000cd95:  jmp    0xccd6

AFTER FLAGS OPT:
0x0000: movl_A0_im 0x45a
0x0001: addl_A0_seg 0x70
0x0002: movl_T1_im 0x1
0x0003: lduw_user_T0_A0
0x0004: addl_T0_T1
0x0005: stw_user_T0_A0
0x0006: update2_cc
0x0007: movl_A0_im 0x45c
0x0008: addl_A0_seg 0x70
0x0009: movl_T1_im 0x0
0x000a: lduw_user_T0_A0
0x000b: set_cc_op 0x7
0x000c: adcw_user_T0_T1_cc
0x000d: goto_tb0 0x174b760
0x000e: movl_eip_im 0xd86
0x000f: movl_T0_im 0x174b760
0x0010: exit_tb
0x0011: end

- ----------------
IN:

0x0000ccd6:  mov    $0x8001,%ax
0x0000ccd9:  or     %ax,%ax
0x0000ccdb:  jmp    0xcd6c

AFTER FLAGS OPT:
0x0000: movl_T0_im 0x8001
0x0001: movw_EAX_T0
0x0002: movl_T1_EAX
0x0003: movl_T0_EAX
0x0004: orl_T0_T1
0x0005: movw_EAX_T0
0x0006: update1_cc
0x0007: set_cc_op 0x17
0x0008: goto_tb0 0x174b7a0
0x0009: movl_eip_im 0xe1c
0x000a: movl_T0_im 0x174b7a0
0x000b: exit_tb
0x000c: end

- ----------------
IN:

0x0000cd6c:  pop    %di
0x0000cd6d:  mov    %dx,%ds
0x0000cd6f:  lret

AFTER FLAGS OPT:
0x0000: movl_A0_ESP
0x0001: andl_A0_ffff
0x0002: addl_A0_SS
0x0003: lduw_user_T0_A0
0x0004: addw_ESP_2
0x0005: movw_EDI_T0
0x0006: movl_T0_EDX
0x0007: movl_seg_T0_vm 0x6c
0x0008: movl_A0_ESP
0x0009: andl_A0_ffff
0x000a: movl_T1_A0
0x000b: addl_A0_seg 0x60
0x000c: lduw_user_T0_A0
0x000d: andl_T0_ffff
0x000e: jmp_T0
0x000f: addl_A0_im 0x2
0x0010: lduw_user_T0_A0
0x0011: movl_seg_T0_vm 0x4c
0x0012: addw_ESP_4
0x0013: movl_T0_0
0x0014: exit_tb
0x0015: end

- ----------------
IN:
0x00008c02: jne 0x8c09

AFTER FLAGS OPT:
0x0000: setz_T0_cc
0x0001: jnz_T0_label 0x0
0x0002: goto_tb0 0x174b820
0x0003: movl_eip_im 0x399
0x0004: movl_T0_im 0x174b820
0x0005: exit_tb
0x0006: goto_tb1 0x174b820
0x0007: movl_eip_im 0x394
0x0008: movl_T0_im 0x174b821
0x0009: exit_tb
0x000a: end

- ----------------
IN:

0x00008c09:  pop    %bx
0x00008c0a:  jmp    0x8c13

AFTER FLAGS OPT:
0x0000: movl_A0_ESP
0x0001: andl_A0_ffff
0x0002: addl_A0_SS
0x0003: lduw_user_T0_A0
0x0004: addw_ESP_2
0x0005: movw_EBX_T0
0x0006: goto_tb0 0x174b860
0x0007: movl_eip_im 0x3a3
0x0008: movl_T0_im 0x174b860
0x0009: exit_tb
0x000a: end

Servicing hardware INT=0x08

... 1770 times repeated

Servicing hardware INT=0x08
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFD6kaEkyKr2gmercERAlv/AKCS6Yt0Zvd/amFAYkYvv2jK91DXrACfd0rv V0CkkLrB4vxWstfeZ9q/lgY=
=juM5
-----END PGP SIGNATURE-----