carlo.andreoli@tiscali.it | 1 Mar 11:06 2006
Picon

Re: Printing bogus values in ne2000_asic_ioport_read()/ ne2000_receive()

Regarding the bogus numbers occasionally printed, you can see that the 
leading
ffs are printed when the character has its bit7 set to 1. This occurs 
because in
      printf("%02x ", s[i]);
the expected argument for %02x is an integer, and since the actual 
argument is
a (signed) character, the compiler promotes it to an integer extending 
the sign bit.
You can simply write instead
      printf("%02x ", (unsigned char)s[i]);
and the problem should disappear, since in this case the promotion to 
an integer
adds non-significative 0s that are ignored when printig

Carlo

----Messaggio originale----
Da: kumrao2003 <at> yahoo.com
Data: 25/02/2006 19.29
A: <qemu-devel <at> nongnu.org>
Ogg: [Qemu-devel] Printing bogus values in ne2000_asic_ioport_read()/	
ne2000_receive()

Hi,
I am using QEMU in one of my research projects. I
landed in a problem where I see bogus numbers being
printed when I printed the packet/each word that is
received from ne2000.

(Continue reading)

Tao Huang | 1 Mar 13:39 2006
Picon

one line patch for hw/pl110.c

diff -u -r1.2 pl110.c
--- hw/pl110.c  6 Feb 2006 16:05:19 -0000       1.2
+++ hw/pl110.c  1 Mar 2006 12:35:07 -0000
 <at>  <at>  -321,6 +321,7  <at>  <at> 
         n = (offset - 0x200) >> 2;
         s->raw_pallette[(offset - 0x200) >> 2] = val;
         pl110_update_pallette(s, n);
+        return;
     }
     switch (offset >> 2) {
     case 0: /* LCDTiming0 */
Paul Brook | 3 Mar 00:58 2006

Re: one line patch for hw/pl110.c

On Wednesday 01 March 2006 12:39, Tao Huang wrote:
> diff -u -r1.2 pl110.c
> --- hw/pl110.c  6 Feb 2006 16:05:19 -0000       1.2
> +++ hw/pl110.c  1 Mar 2006 12:35:07 -0000
>  <at>  <at>  -321,6 +321,7  <at>  <at> 
>          n = (offset - 0x200) >> 2;
>          s->raw_pallette[(offset - 0x200) >> 2] = val;
>          pl110_update_pallette(s, n);
> +        return;
>      }
>      switch (offset >> 2) {
>      case 0: /* LCDTiming0 */

Applied, thanks.

Paul
Anderson Lizardo | 1 Mar 23:18 2006
Picon

qemu regression 0.7.2 -> 0.8.0 (ARM user emulation)

Hi,

I was having some issues with the latest qemu (ARM user emulation),
which I tracked down to the following reduced test case:

#include <stdio.h>
int main(void)
{
        float a, b;
        a = 0.1f;
        b = 0.8f;
        printf("a < b: %d\n", (a < b));
        return 0;
}

Compile it with an ARM cross-compiler and run it with "qemu-arm". It
should print

a < b: 1

for qemu 0.7.2 and

a < b: 0

for 0.8.0. Obviously, the first one is right.

Tested with the following setup:
qemu 0.7.2/0.8.0
arm-linux-gnu-gcc (GCC) 3.4.5
glibc 2.3.5
(Continue reading)

Fabrice Bellard | 2 Mar 22:52 2006

qemu configure

CVSROOT:	/sources/qemu
Module name:	qemu
Branch: 	
Changes by:	Fabrice Bellard <bellard <at> savannah.gnu.org>	06/03/02 21:52:18

Modified files:
	.              : configure 

Log message:
	suppressed invalid test

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/qemu/configure.diff?tr1=1.82&tr2=1.83&r1=text&r2=text
Alessandro Iurlano | 2 Mar 11:40 2006
Picon

Re: Printing bogus values in ne2000_asic_ioport_read()/ ne2000_receive()

Il giorno sab, 25/02/2006 alle 10.29 -0800, Umamaheswararao Karyampudi
ha scritto:
> In ne2000_receive(), I copied the packet received to a
> static char [] and printed the packet using
>  static void print_packet(char *s, int len)
> {
>   int i,j;
>   for (i=0;i<len;i++) {
>       if (i%20 == 0)
>           printf("\n");
>       printf("%02x ", s[i]);
>   }
>           printf("\n");
> }
> And some bytes it prints as fffffffff<last byte>
> instead of just the last byte.
> For eg:
> 52 54 00 12 34 56 00 ffffffff 4f 0a 46 05 08 00 45 00
> 00 ffffff80 00 00
> 40 00 40 01 ffffffbc 2b ffffffc0 ffffffa8 fffffffe
> fffffffe ffffffc0 ffffffa8 ff
> 

Maybe it's just a sign problem. Try declaring the s[] buffer as unsigned
char instead of just char.

Hope this helps,
Alessandro
(Continue reading)

Chris Wilson | 2 Mar 00:22 2006

Re: Printing bogus values in ne2000_asic_ioport_read()/ ne2000_receive()

Hi Umamaheswararao,

> In ne2000_receive(), I copied the packet received to a
> static char [] and printed the packet using
> static void print_packet(char *s, int len)
> {
>  int i,j;
>  for (i=0;i<len;i++) {
>      if (i%20 == 0)
>          printf("\n");
>      printf("%02x ", s[i]);
>  }
>          printf("\n");
> }
> And some bytes it prints as fffffffff<last byte>
> instead of just the last byte.
> For eg:
> 52 54 00 12 34 56 00 ffffffff 4f 0a 46 05 08 00 45 00
> 00 ffffff80 00 00
> 40 00 40 01 ffffffbc 2b ffffffc0 ffffffa8 fffffffe
> fffffffe ffffffc0 ffffffa8 ff

You are using signed chars, and they are being sign-extended to signed 
ints, which fills the remaining (upper) bits with 1's. When formatted as 
hex, they no longer fit into two characters, because the upper bits are 
not zeroes. So printf prints the full 32 bits.

Try using "unsigned char *s" in the prototype instead of just "char *s" 
and see if that helps.

(Continue reading)

Fabrice Bellard | 3 Mar 02:54 2006

qemu/target-i386 helper.c

CVSROOT:	/sources/qemu
Module name:	qemu
Branch: 	
Changes by:	Fabrice Bellard <bellard <at> savannah.gnu.org>	06/03/03 01:54:40

Modified files:
	target-i386    : helper.c 

Log message:
	x86_64 stack alignment fixes - x86_64 32 bit syscall fix

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/qemu/target-i386/helper.c.diff?tr1=1.63&tr2=1.64&r1=text&r2=text
Brian Wheeler | 3 Mar 20:28 2006
Picon

Re: Printing bogus values in ne2000_asic_ioport_read()/ ne2000_receive()

On Sun, 2006-02-26 at 10:01 -0800, Umamaheswararao Karyampudi wrote:
> Hi,
> I am using QEMU in one of my research projects. I
> landed in a problem where I see bogus numbers being
> printed when I printed the packet/each word that is
> received from ne2000.
> 
> In ne2000_receive(), I copied the packet received to a
> static char [] and printed the packet using
>  static void print_packet(char *s, int len)
> {
>   int i,j;
>   for (i=0;i<len;i++) {
>       if (i%20 == 0)
>           printf("\n");
>       printf("%02x ", s[i]);
>   }
>           printf("\n");
> }
> And some bytes it prints as fffffffff<last byte>
> instead of just the last byte.
> For eg:
> 52 54 00 12 34 56 00 ffffffff 4f 0a 46 05 08 00 45 00
> 00 ffffff80 00 00
> 40 00 40 01 ffffffbc 2b ffffffc0 ffffffa8 fffffffe
> fffffffe ffffffc0 ffffffa8 ff
> 

Just guessing, but is it a signed/unsigned thing?  All of the ffffffxx
values are above 0x7f...
(Continue reading)

Umamaheswararao Karyampudi | 3 Mar 23:33 2006
Picon

Re: Printing bogus values in ne2000_asic_ioport_read()/ ne2000_receive()

Thanks Carlo. Now it works after changing it to . and Thanks all for the replies.

Uma
"carlo.andreoli <at> tiscali.it" <carlo.andreoli <at> tiscali.it> wrote:

Regarding the bogus numbers occasionally printed, you can see that the
leading
ffs are printed when the character has its bit7 set to 1. This occurs
because in
printf("%02x ", s[i]);
the expected argument for %02x is an integer, and since the actual
argument is
a (signed) character, the compiler promotes it to an integer extending
the sign bit.
You can simply write instead
printf("%02x ", (unsigned char)s[i]);
and the problem should disappear, since in this case the promotion to
an integer
adds non-significative 0s that are ignored when printig
Carlo

----Messaggio originale----
Da: kumrao2003 <at> yahoo.com
Data: 25/02/2006 19.29
A:
Ogg: [Qemu-devel] Printing bogus values in ne2000_asic_ioport_read()/
ne2000_receive()

Hi,
I am using QEMU in one of my research projects. I
landed in a problem where I see bogus numbers being
printed when I printed the packet/each word that is
received from ne2000.

In ne2000_receive(), I copied the packet received to a
static char [] and printed the packet using
static void print_packet(char *s, int len)
{
int i,j;
for (i=0;i
if (i%20 == 0)
printf("\n");
printf("%02x ", s[i]);
}
printf("\n");
}
And some bytes it prints as fffffffff
instead of just the last byte.
For eg:
52 54 00 12 34 56 00 ffffffff 4f 0a 46 05 08 00 45 00
00 ffffff80 00 00
40 00 40 01 ffffffbc 2b ffffffc0 ffffffa8 fffffffe
fffffff e ffffffc0 ffffffa8 ff





Tiscali ADSL 4 Mega Flat
Naviga senza limiti con l'unica Adsl a 4 Mega di velocità a soli 19,95 € al mese!
Attivala subito e hai GRATIS 2 MESI e l'ATTIVAZIONE.
http://abbonati.tiscali.it/banner/middlepagetracking.html?c=webmailadsl&r=http://abbonati.tiscali.it/adsl/sa/4flat_tc/&a=webmail&z=webmail&t=14


_______________________________________________
Qemu-devel mailing list
Qemu-devel <at> nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel
;i++)> <at> nongnu.org>

Yahoo! Mail
Use Photomail to share photos without annoying attachments.
_______________________________________________
Qemu-devel mailing list
Qemu-devel <at> nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Gmane