Subject: bug #1
To: Bob Nestor <rnestor@augustmail.com>
From: Jake Luck <netbsd@10k.org>
List: port-macppc
Date: 03/14/2000 19:59:22
this came purely by accident when i am doing some internal consistancy
check, according to the Inside Mac on the Apple WebSite.
TYPE Block0 =
PACKED RECORD
sbSig: Integer; {device signature}
sbBlkSize: Integer; {block size of the device}
sbBlkCount: LongInt; {number of blocks on the device}
sbDevType: Integer; {reserved}
sbDevId: Integer; {reserved}
sbData: LongInt; {reserved}
sbDrvrCount: Integer; {number of driver descriptor entries}
ddBlock: LongInt; {first driver's starting block}
ddSize: Integer; {size of the driver, in 512-byte blocks}
ddType: Integer; {operating system type (MacOS = 1)}
ddPad: ARRAY [0..242] OF Integer; {additional drivers, if any}
END;
-> "SCSI.h" in Universal Headers 3.3 defines
struct Block0 {
unsigned short sbSig;
unsigned short sbBlkSize;
unsigned long sbBlkCount;
unsigned short sbDevType;
unsigned short sbDevId;
unsigned long sbData;
unsigned short sbDrvrCount;
unsigned long ddBlock;
unsigned short ddSize;
unsigned short ddType;
unsigned short ddPad[243];
};
the correct pascal interpretation for [0..242] IS 243 units. However, that
puts the entire structure size to be 516 bytes rather than 512 bytes,
larger thank a 512 block, if someone happens to do
unsigned char buffer[512];
read(fd, &buffer, sizeof(Block0));
it is going to bite, no?
-jake