From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 26749 invoked from network); 11 Oct 1998 20:05:20 -0000 Received: from mail.redhat.com (199.183.24.239) by mail2.redhat.com with SMTP; 11 Oct 1998 20:05:20 -0000 Received: from ellpspace.math.ualberta.ca (michal@ellpspace.math.ualberta.ca [129.128.88.19]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id PAA13668 for ; Sun, 11 Oct 1998 15:59:41 -0400 Received: (from michal@localhost) by ellpspace.math.ualberta.ca (8.8.8/8.8.8) id NAA03073 for axp-list@redhat.com; Sun, 11 Oct 1998 13:59:37 -0600 From: Michal Jaegermann Message-Id: <199810111959.NAA03073@ellpspace.math.ualberta.ca> Subject: Re: Problem booting Samsung 164UX ("Ruffian") MB - SOLUTION! To: axp-list@redhat.com Date: Sun, 11 Oct 1998 13:59:36 -0600 (MDT) In-Reply-To: <199810111936.PAA00624@adder.cs.Virginia.EDU> from "Greg Lindahl" at Oct 11, 98 03:36:00 pm Content-Type: text Greg Lindahl wrote: > > > unsigned long hidden; /* hidden sectors (unused) */ > > unsigned long total_sect; /* number of sectors (if sectors == 0) */ > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > Some days I wonder how anything ever runs on the Alpha! There is quite a bit of software around written a bit cleaner. :-) In many cases these cleanup jobs started many years before the first Alphas showed on a horizon (I know, as I have some personal contributions into that :-). Most likely the qouted code is derived from some MS-DOS documentation. On 16-bit machine if you will declare the above as 'unsigned int' you will get sizeof 2 and you will come out short (pun intended :-). A trailing 'unsigned short boot_sign' at the structure end is also not guaranteed to give you always 16-bits so a signature may end up in a wrong place even if you have chances of survival on a "little endian" machine. What is more - without '__atribute__((packed))' you do not have a shadow of guarantee that a layout of the whole structure is without holes (C Standard says so and "packed" is GNU-ism) so you may screw all this up anyway. Linux kernel headers are quite a bit more careful. A code with hidden layout assumptions like quoted is a major portability PITA. Big sigh! I knew that there was a good reason not to use "mkdosfs" on Alpha (and not a real need as well :-). Michal