problems with hdparm in svn 15237/15261

Rob Landley rob at landley.net
Tue Jun 6 22:13:33 UTC 2006


On Friday 02 June 2006 2:05 pm, Ken McGuire wrote:
> Rats! I screwed up and didn't send this to the list, sorry, I'll blame it
> on my mailer.... ;>)
>
> The endian issue is still present on ppc in svn 15261. hopefully it can get
> dealt with befor the 1.2.0 release.
...
> > > 2) on ppc (ubuntu 5.10) with gcc 4.0.2
> > >
> > > "make clean defconfig busybox"
> > >
> > > builds without errors and the applets run, but hdparm produces
> > > incorrect results.
> >
> > Joy.
> >
> > >         Firmware Revision:  ADOC7AA6
> > >         Firmware Revision:  DACOA76A
> >
> > Sigh, the classic nuxi problem.
> >
> > http://www.catb.org/jargon/html/N/NUXI-problem.html
> >
> > I'll take a look this evening...
>
>  Thanks...

Ok, starting on line 584, of miscutils/hdparm.c, we have:

    if (BB_BIG_ENDIAN) {
        swab(id_supplied, buf, sizeof(buf));
        val = buf;
    } else val = id_supplied;

buf is uint16_t buf[256] and val is uint16_t *val.

So either:

A) BB_BIG_ENDIAN isn't set correctly for you,

B) swab() is acting like memcpy().

Any way you could track that down?  This seems fairly simple but I'm not 
spotting why it's happening...

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list