linux-mips
[Top] [All Lists]

Re: Mangled struct hd_driveid with MIPSEB.

Subject: Re: Mangled struct hd_driveid with MIPSEB.
From: Ken Aaker <kaaker@silverbacksystems.com>
Date: Thu, 16 May 2002 10:07:02 -0500
Cc: linux-mips@oss.sgi.com
References: <3CE2C834.2010302@silverbacksystems.com> <3CE3578C.CF29A2D6@mips.com>
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2
The problem with the difference isn't that it's byte swapped, its that the byte swapping isn't respecting the data types inside the structure. It fixes all of the "short" entities, but it re-orders the fields that happen to be two chars next to each other, and the "shorts" that are part of the two "ints" for lba capacity and capacity values are in the wrong order, even though the bytes within the "shorts" are in the right order. So, when the fixup code in ide.h is run, the values are still wrong.


old ----
0070: 3f0010fc fb000001 80ac7e03 00000704   "?.........~....."
0080: 03007800 78007800 78000000 00000000   "..x.x.x.x......."
new---
0070: 003ffc10 00fb0100 ac80037e 00000407   ".?.........~...."
0080: 00030078 00780078 00780000 00000000   "...x.x.x.x......"

proper--- (after fix up).
0070: 003f00fb fc100001 037eac80 00000407   ".?.......~......"
0080: 00030078 00780078 00780000 00000000   "...x.x.x.x......"


Ken


<Prev in Thread] Current Thread [Next in Thread>