[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Disk Format
In article <3kpf4o$387@senator-bedfellow.MIT.EDU>,
Paul H Bauer <pbauer@ATHENA.MIT.EDU> wrote:
> I am trying to find out the physical arrangement of data and directory
> information on a disk partition and where it is located on the disk.
On an unpartitioned disk (e.g. a small hard drive, or a floppy), the
logical block numbers correspond to the physical block numbers. The
boot block is at physical block 0, the directory starts at physical
block 2, etc.
In detail, the first few blocks on a ProDOS volume are:
0 Boot block (boot code)
1 Unused (can contain Apple /// boot code on a 5.25" disk)
2-5 Root directory
6-N Volume Bitmap (free space list)
The first entry in the root directory contains the volume name and
size in blocks. The size of the volume directory is determined by the
number of blocks on the disk. One block is required in the volume
bitmap for every 4096 disk blocks (8 bits per byte times 512 bytes
per block).
The data area starts immediately after the bitmap. Subdirectories,
file data blocks and file index blocks are scattered throughout the
remainder of the disk.
On a partitioned disk (assuming we are talking about Apple's SCSI
partitioning), physical block 0 contains the "device descriptor map",
which is used to locate Macintosh device drivers. The partition table
starts at physical block 1, with one block per partition (there are
usually several unused blocks at the end of the partition table, to
allow for more partitions to be added). The partition table is
regarded as a partition, and requires one entry in the partition
table. Every user partition (e.g. ProDOS or HFS volume), device
driver and free area also requires an entry.
Each subsequent partition is a contiguous range of blocks on the
drive, starting immediately after the previous partition.
When you access a partitioned drive from ProDOS or GS/OS, you never get
to see the DDM or partition map - you can only see the logical blocks
within the partitions. If you ask for block 0, you will get logical
block 0 of the partition, which contains the boot code as normal.
Accessing the DDM or partition map requires special calls to the
device driver or SmartPort firmware. This is much easier under GS/OS
with Apple's drivers, because they have provided calls for this purpose.
Under ProDOS-8 with an Apple high-speed SCSI card, the only way to read
the partition map is to use the "Generic SCSI" call to do a direct SCSI
READ operation on the appropriate physical block range. This is NOT
easy, and requires the technical reference manual for the HS SCSI
card, and documentation on the SCSI command set.
With the original Apple SCSI card, it is even harder, because you have
to download code to do the SCSI READ into the memory of the SCSI card,
and arrange for it to be run from there.
I have no idea how you could access the partition map with a RamFAST
(either from GS/OS or using the SmartPort firmware).
--
David Empson
dempson@actrix.gen.nz
Snail mail: P.O. Box 27-103, Wellington, New Zealand