;--------------------------
;     From: Chris Stubbs
;  Subject: Reading MAC floppy's on the IBM PC

 Only the 800K disks use a variable speed floppy. That's how they fit 800K on a
720K disk. The 1.44MB disks are the same. The only disks you'll be able to read
are the 1.44MB disks. Here's an example program to check if it's a Mac disk and
tell you its name.

; Try to read the sector three times
mov cx, 0003h

try:
push cx
mov ax, 0201h
mov bx, 0200h ; Put sector in ES:BX
mov cx, 0003h ; Read sector 3
mov dx, 0000h
int 13h ; BIOS disk Services
pop cx
jnc Success
loop try
jmp done

success:
es:
cmp byte ptr [200h],"B" ; Look for Mac Disk signature
jne done
es:
cmp byte ptr [201h],"D"
jne done

mov dx,225h ; Offset of BX + 25h
mov si,dx
nextchar:
mov al,[si]
mov ah,0eh
cmp byte ptr [si],0

je done
int 10h ; Display character
inc si
jmp nextchar

done:
mov ah,4ch
int 21h ; QUIT

 The first two sectors are the boot blocks.  There's nothing interesting for a
program that reads Macintosh disks there. Next sector is the Volume information
Block. The first two bytes are "BD". That's what I check for in my program.
Then at offset 25h, the title of the disk. The Volume Info Block contains
pointers to the Volume Bitmap, The Extents tree, and the Catalog tree. The
Volume bitmap comes right after the Volume Info Block. The Volume Bitmap
contains a bit representing every sector. A 1 means used and a 0 means unused.
Often, a sector not in use will be marked as in use here(just like lost
clusters). After the bitmap usually is the extents tree header. It tells you
things about the extents tree like its size and depth. The extents tree keeps
track of fragmented pieces of files. After some unused Extents tree sectors
comes the Catalog tree header. It describes the Catalog tree depth, etc. Then
comes the catalog tree. It has the names of all the files on the disk. It can
store up to three file fragments for each fork of the file. The forks are the
Mac's way of keeping Data and resources separate.

