problems with hdparm in svn 15237/15261
Ken McGuire
kenm at desertweyr.com
Tue Jun 6 15:35:22 PDT 2006
On 6 Jun 2006 at 18:13, Rob Landley wrote:
> 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.
>
I added a printf before the swab(...), and BB_BIG_ENDIAN is definately being
set.
I removed the test and busybox hdparm functioned properly. So the swab
doesn't seem to be needed. See Tito's post responding to my last post about
endianess:
Re: ok, what's the official take on "endianness"? and hdparm problem
...ken...
More information about the busybox
mailing list