Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!sdd.hp.com!samsung!ernie.viewlogic.com!mobius!greg From: greg@mobius.Viewlogic.COM (Gregory Larkin) Newsgroups: comp.os.minix Subject: The continuing saga of Minix 'ar' on the SPARC Keywords: Almost there.... Message-ID: <1991Jan9.151828@mobius.Viewlogic.COM> Date: 9 Jan 91 20:18:28 GMT Sender: news@viewlogic.com (News Administrator) Reply-To: greg@mobius.Viewlogic.COM (Gregory Larkin) Organization: Viewlogic Systems, Inc., Marlboro, MA Lines: 49 Well, the fight continues to get a SPARC executable to read a Minix .a file. Thanks to all Minixers who replied to my original post! I now get the little-endian vs. big-endian concept. So, once I got that down, I thought "all I have to do is swap bytes when I read from the .a file". Well, yes and no. I am able to swap the bytes containing the magic number, so the file will be recognized correctly. However, when the first header structure is read out of the .a file, most everything in it does not come in correctly. Here's the struct for .a header: struct ar_hdr { char ar_name[14]; long ar_date; char ar_uid; char ar_gid; int ar_mode; long ar_size; }; ar_name seems to be Ok. In this case, I am trying to unarchive h.a in the src/h directory. The first file is "callnr.h". This comes out fine. The problem is, ar_size is set to some huge number (much more than the 1683 bytes it should be). So, when ar(1) tries to seek to the next header, it runs off the end of the file. The other structure elements seem to be corrupted, as well. Is there some sort of special swapping of bytes I should do within the structure or should I swap the bytes of the structure as a whole?? This is close enough to working (I think) that I really don't want to go back to Minix and unarchive all of the .a files and then tar the contents. It would work, but hey, it's more fun trying to get this to work. If anyone has any more hints for me, I would love to hear them! -- Greg Larkin (ASIC Engineer) Viewlogic Systems, Inc. (The CAE Company) 293 Boston Post Road West ____________________________________________ Marlboro, MA 01752 |"This is a fragile ball we are living on; | 508 480 0881 x321 |it's a miracle and we are destroying it.."| Email: greg@Viewlogic.COM |Peter Garrett, Midnight Oil | --------------------------------------------