<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Fri, 21 Sep 2007 00:16:33 +0100
From   : jgh@... (Jonathan Graham Harston)
Subject: Working out disk sizes...

>Message-ID: <46EA907D.1040209@...>
 
Jules Richardson <julesrichardsonuk@...> wrote:
> Armed with a BBC that's both DFS and ADFS-capable, what's the most painless
 
A BBC? Not a Master? In that case, OSWORD &7F will read MFM
formatted disks by adding 24 to the drive number[1]. DFS on the
Master neglects to pass the density select bit to the correct
bit in the drive control register.
 
> way of working out the geometry of an unknown floppy:
 
The geometry? Or just whether it is a DFS or ADFS disk?
 
>    1) Filesystem type, side 0 (DFS, ADFS, unknown)
 
To find the filesystem:
 
an ADFS filesystem always has a directory starting 512 bytes in,
so bytes &201-&204 and bytes &6FB-&6FE will contain "Hugo" and
byte &200 will match byte &6FA. Additionally, the first 512 bytes
contain the free space map, so checksumming them with
http://mdfs.net/Docs/Comp/BBC/Disk/ADFSSum will give a valid
checksum for a valid ADFS free space map.
 
An HADFS filesystem has a free space map &4600 bytes in, and the
bytes at &4608-&460F contain the bytes &00,"(C)JGH",&00
 
A DFS filesystem is difficult to determine empirically, as it
does not have any marker patterns. There are hints, such as:
- byte &105 contains (number of entries)*8, so the bottom three
bits will be zero.
- byte &106 have bit6 and bit 7 clear
- the catalogue entries may "look like" catalogue entries.
 
> catalogue data whether a disk (DFS or ADFS) was formatted 40 or 80 track?
 
The catalogue data will only tell you the size of the file system.
That is only loosely related to the number of physical or logical
tracks the disk was formatted to, or whether the disk is a 48tpi
disk or a 96tpi disk. By default, a DFS disk formatted with 40 tracks
will claim to have &190 sectors; a DFS disk formatted with 80 tracks
will claim to have &320 sectors. However, you cannot infer that a
filesystem size of &190 means that the disk is a 48tpi disk and has
40 tracks laid out on the disk. It could be a 96tpi disk with only
40 tracks laid out on it. It could be a 96tpi disk with 80 tracks
laid out on it, with a filesystem written to it claiming it has
only &190 sectors on it.
 
To find the geometry, you want to find the number of sides, the
number and ID of tracks on each side, the number and ID of sectors
on each track and the number of bytes in each sector.
 
To find the number of sides, try reading both sides.
To find the number of tracks, try reading as many tracks as
possible until you get a consistant 'sector not found'.
To find the number of sectors, read as many sector IDs as are
likely to fit on a single track - 64 is a good number. You can fit
a maximum of 26 128-byte FM sectors on a single track and about 50
128-byte MFM sectors.
 
> (JOOI, what was the definitive ADFS reference for the 8-bit machines? Whilst
 
"Advanced Disc Filing Syetem User Guide", Acorn Computers, part
number 0433-070. It's a 128-page A5 book with a black soft cover.
I have several available for sale at ukp5 each.
 
-- 
J.G.Harston - jgh@...                - mdfs.net/User/JGH
BBC IDE Hard Drive Interface - http://mdfs.net/Info/Comp/BBC/IDE
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>