A Overview Floppy discs are flat discs made from a similar material to cassettetape, and are magnetised to store information. Floppy discs and discdrives come in many different sizes and formats. The most popular sizesnow are 5.25 inch and 3.5 inch, but 8 inch discs are still available. There are three things which determine how much information a disc canstore; the number of tracks supported by the disc drive, whether the discdrive is single or double sided, and the recording density. Information is written on to floppy discs in a series of concentricbands, or tracks. Most disc drives will be able to read and write 80 ofthese tracks, but some older drives may only support 40 tracks. An 80track disc will store twice as much information as a 40 track disc. Double sided disc drives have two read/write heads, one on each side ofthe disc, and so are able to record twice as much information as a singlesided drive, which has only one read/write head. Note: single sided discscannot be inverted to use the reverse side of the disc, except for 3.5inch discs. The recording density determines how much information can be stored oneach track of a disc. Single density recording allows 10 sectors of 256bytes each to be recorded on a typical disc, whereas double densityrecording allows up to 18 sectors per track. The Intel 8271 Floppy Disc Controller chip which HDFS is designed to workwith can only read and write single density discs. HDFS is designed towork with single or double sided, 40 or 80 track disc drives. The amountof information which can be stored on a disc is given in the table below.		Sides:	Single	Double	Tracks:	 40	 100k	 200k		 80	 200k	 400kB Installation When you have inserted the HDFS ROM and turned the machine on, you shouldsee a message like:	BBC Computer 32K	Hierarchical DFS	BASIC	> This message indicates that the HDFS is selected as the current filingsystem. It is possible to have the DNFS installed as well as the HDFS . Inthis case, the ROM in the higher priority socket will take control bydefault. If the HDFS is in the lower priority socket, it may be selectedby the key combination H-BREAK. The DNFS may be selected by pressingD-BREAK . The HDFS also allows commands to be prefixed by 'H', so it canalso be selected unambiguously by the command *HDISC. There are several link switches at the bottom right hand corner of thekeyboard PCB; some of these can be used to set options to HDFS. Links 3and 4 are used to set the disc drive characteristics, and links 1 and 2are used to set the default stepping configuration. The disc drive timinglink positions are:	 Link Step Settle Head	 3 4  time  time  load	 1 1   4     16     0	 1 0   6     16     0	 0 1   6     50    32	 0 0  24     20    64 The drive stepping configuration links are:	 Link	 1 2 Action	 1 0 Double stepping enabled	 0 1 Single stepping enabled	 0 0 Automatic double stepping enabledC Command Summary This section contains a list of the HDFS commands and their syntax. ACCESS afsp (LXWR) ATTRIB fsp (load exec) (len) (LXWR) BUILD fsp (A) CLOSE COMPACT (dsp) (D) COPY <fsp fsp/afsp dsp> (C) CREATE fsp (load exec) (len) (LXWR) (D) DEDIT (drv) start (+) ((+) (R) DELETE fsp DFIND (drv) start (+) <string/{hex}> DIR (dsp) DISC DISK DRIVE drv (S/D/A) (C) DUMP fsp ENABLE EXTEND fsp FEDIT fsp (offs) (R) FFIND fsp (offs) <string/{hex}> FORMAT drv <40/80> <X/A> <S/D> (skew) FREE (dsp) GOIO addr INFO afsp KEYS LIB (dsp) MEDIT start (+) ((+) (R) MFIND start (+) <string/{hex}> MODE dec MOVE start (+) addr READ (drv) addr start (+) (D) RENAME <fsp fsp/afsp dsp> (C) ROMS TITLE string (dsp) TYPE fsp (C) VDU <string/{((+/-) (,/;) VERIFY drv <40/80> <X/A> <S/D> WILD :$^.*? WIPE afsp (A) WRITE (drv) addr start (+) (D)D 8271 commands This section describes the operations supported by the 8271 floppy disccontroller chip. These commands can be sent to the 8271 using the OSWORD&7F call, where the operation code must have &40 added to it. Refer to the8271 FDC data sheet for more information. Some of the commands in thetable below operate on multiple sectors; for these commands, the sectorsmust all be on the same track. Other data transfer commands operate onsingle sectors only. The commands supported by the 8271 FDC are: Command		Op   P1     P2      P3        P4          P5Scan multi		00 Track  Sector  Len/Sec  Scan step  Field lengthScan deleted multi	04 Track  Sector  Len/Sec  Scan step  Field lengthWrite			0A Track  SectorWrite multi		0B Track  Sector  Len/SecWrite deleted		0E Track  SectorWrite deleted multi	0F Track  Sector  Len/SecRead			12 Track  SectorRead multi		13 Track  Sector  Len/SecRead deleted		16 Track  SectorRead deleted multi	17 Track  Sector  Len/SecRead track ID		1B Track     0     NumIDVerify deleted		1E Track  SectorVerify deleted multi	1F Track  Sector  Len/SecFormat multi		23 Track  Gap 3   Len/Sec      Gap 5      Gap 1Seek			29 TrackRead status		2CSpecify		35  What  Step/    Settle/     Load/				  Track     Track      TrackWrite register		3A  Reg.   DataRead register		3D  Reg.The parameters for these commands, and their meanings are:Track		This is the track number (normal range 0-79)Sector		This is the start sector on the track (normal range 0-9)Len/Sec	Bits 0-4 indicate the number of sectors accessed (0-9) Bits		5-7 are sector size (2 for 256 byte sectors)NumID		This is the number of ID fields to transfer.Scan step	Bits 6-7 indicate the scan condition (0 EQ, 1 GEQ, 2 LEQ)		Bits 0-5 are the offset to the next sector in a multi scan.Field length	This is the number of bytes to compare when scanning.Gap 1		This is the formatting gap between the last sector and the		index mark.Gap 3		This is the syncronisation field formatting gap.Gap 5		This is the formatting gap between the ID field and sector.What		This value indicates what the other parameters in the		command mean. The values &10 and &18 load surface zero and		one bad tracks, and &0D sets the drive parameters.Step		This is the disc step rate.Settle		This is the disc head settle time. Load Bits 0-3 are the		head load time, Bits 4-7 are the index unload count.Reg.		This is the register number to read or write.Data		This is the data to read or write to a register. The result byte returned by the 8271 contains the result value of thecommand. Bit 5 of the result is a flag which indicates that deleted datawas found on the disc. Bits 1-4 contain a completion code which indicateswhat the final status of the command was: 00 Good completion or scan not met 02 Scan met equal 04 Scan met not equal 08 Clock error 0A Late DMA 0C ID CRC error 0E Data CRC error 10 Drive not ready 12 Write protect 14 Track 0 not found 16 Write fault 18 Sector not found Note that the scan commands do not behave as specified in the 8271 datasheet. The memory address of the scan key is not automatically reset eachtime the scan repeats, and so the scan key should be duplicated throughouta memory buffer the same size as the number of sectors being scanned. Thisbehaviour is the same under DNFS and HDFS.E Catalogue FormatThe format of HDFS and Acorn (DNFS) catalogues differ slightly. Thecatalogue formats are similar enough that HDFS discs can be cataloguedusing DNFS, but no changes should be made to them. There are two sectorsallocated to each catalogue:Sector 0: Bytes   Data DNFS		HDFS	     0	   Title char 1		b7: Sectors bit 10	    1-7    Title chars 2-8	     8	    Filename char 1	b7: Start sec bit 10	     9	    Filename char 2	b7: Length bit 18	     A	    Filename char 3	     B	    Filename char 4	b7: Directory	     C	    Filename char 5	b7: Not readable	     D	    Filename char 6	b7: Not writable	     E	    Filename char 7	b7: Not executable	     F	    Directory char		b7: Locked		b7: Not deletableSector 1: Bytes    Data DNFS		HDFS	    0-3	    Title chars 9-12	     4	    Cycle number	Key number	     5	    Entries*8	     6	    b0-1: Sectors bits 8-9		    b2:   0		b2: Disc sides 1/2		    b3:   0		b3: 1		    b4-5: Auto-boot option		    b6-7: 0	     7	    Sectors bits 0-7	    8-9	    Load address bits 0-15	    A-B	    Exec address bits 0-15	    C-D	    Length bits 0-15	    E b0-1: Start sector bits 8-9	      b2-3: Load address bits 16-17	      b4-5: File length  bits 16-17	      b6-7: Exec address bits 16-17	    F	    Start sector bits 0-7F Memory UsageF.1 Zero page Several zero page areas are used by HDFS. The NMI workspace from &A0 to&A7 is used when the NMI area is claimed for disc transfers. The operatingsystem scratch workspace from &AC to &AF is used for parsing commands.The filing system scratch workspace from &B0 to &BF is used as the mainzero page workspace. The contents are used during HDFS command execution,but are not held over between commands. The zero page filing systemworkspace from &C0 to &CF is fully used while HDFS is active. This area should not be changed by user programs:	C0-C3	Drive information table	C4-C5	Directory start sector	C6   	Copy of current drive	C7	Last drive accessed	C8-C9	Command line parameters	CA	Last catalogue type	CB	Root key of last drive	CC	Tube flag	CD	Message flag (*OPT 1 value)	CE	Number of retries (*OPT 2 value)	CF	Sideways ROM number (*OPT 3 value)F.2 NMI workspace The NMI workspace in &D00-&D9E is claimed for disc and memory transfers.The NMI allocation regime is non-greedy; the workspace is returned to itsprevious owner as soon as possible. The zero page NMI workspace is alsoused when the NMI workspace is claimed.F.3 Absolute workspace The absolute workspace in &E00-&11FF is claimed for use by mostoperations. HDFS is greedy about absolute workspace; it will not releasecontrol of the absolute workspace until requested by another claimant.Absolute workspace addresses &E00-&FFF are used to hold a copy of thecurrent catalogue. This copy is used instead of reading the catalogue fromthe disc if the disc is still spinning when an operation is started. Theabsolute workspace in &1000-&11FF is used for various purposes:	1000-101F Scratch filename 1	101F-103F Scratch filename 2	1040-105F Current directory	1060-107F Current library	1080-1083 Copy of drive information table	1084-1089 Character table	108A-108F File handle table	1090-109F Command workspace	10A0-10DF String space	10E0-10F5 File info workspace	1100-1115 Open file info 1	1116-112B Open file info 2	112C-1141 Open file info 3	1142-1157 Open file info 4	1158-116D Open file info 5	116E-1183 Open file info 6	11A0-11AF OSGBPB workspace	11B3-11FF Open file workspaceF.4 Private workspace Seven pages of private workspace are allocated; these will usually befrom &1200-&17FF . The first six pages are used to keep memory buffers foropen files. The last page of private workspace, which is usually inaddresses &1800-&18FF, is used for a copy of vital information which isnormally kept in the absolute workspace &1000-&11FF. This is used when thefiling system is shut down and re-activated. This memory page contains: 00-1F Current directory 20-3F Current library 40-43 Drive table 44-49 Character table 4A-4F File handle table 50-65 Open file info 1 66-7B Open file info 2 7C-91 Open file info 3 92-A7 Open file info 4 A8-BD Open file info 5 BE-D3 Open file info 6 D4    Private workspace validity flagG Benchmarks The benchmarks in the tables below indicate how the performance of HDFScompares to DNFS. There are four columns in each table; the first threecolumns are results for HDFS operating on a native HDFS root directory, asingle level sub-directory, and an Acorn format directory . The finalcolumn contains results for Acorn's DNFS 1.20. All of the times shown arein seconds, most of them timed over 10 repetitions. All of the tests wereperformed on discs formatted with a skew of 3.G.1 SAVE 32KIn this test, &8000 bytes were saved to a file. Several variants of thistest were performed. In the tables below, 'IO' indicates that the data wastaken from the I/O processor, and 'Tube' indicates that the data was takenfrom the second processor. The keyword 'Spun' indicates that the disc wasspinning when the test started, so the drive start-up time is not countedin the timing. The word 'Stop' indicates that the disc was stopped whenthe test was started, and the word 'New' indicates that a new file entrywas used, rather than writing over an old file.		HDFS	HDFS	HDFS	DNFSSAVE 32K	root	sub-dir	acorn	1.20IO, Spun	4.52	4.66	3.83	3.84IO, Stop	4.82	5.06	4.43	4.40Tube, Spun	4.54	4.62	3.83	3.87Tube, Stop	4.73	5.17	4.42	4.49IO, Spun, New	4.39	4.81	3.84	3.72IO, Stop, New	4.73	5.04	4.43	4.33Tube, Spun, New 4.41	4.83	3.84	3.75Tube, Stop, New 4.85	5.11	4.44	4.37G.2 LOAD 32K This test measured the time taken to load &8000 bytes from a file.		HDFS	HDFS	HDFS	DNFSLOAD 32K	root	sub-dir	acorn	1.20IO, Spun	3.44	4.03	3.44	3.43IO, Stop	4.39	4.70	4.30	4.31Tube, Spun	3.80	4.04	3.80	3.43Tube, Stop	4.39	4.70	4.30	4.31G.3 OPEN The time taken to open a file was measured by this test. There are threevariants on this test, "In" (open for input only) "Out" (open for outputonly) and "Update" (open for input and output).		HDFS	HDFS	HDFS	DNFSOPEN		root	sub-dir	acorn	1.20In, Spun	0.01	0.40	0.00	0.01In, Stop	0.50	0.75	0.59	0.54Out, Spun	0.39	0.79	0.39	0.19Out, Stop	0.91	1.15	0.99	0.74Update, Spun	0.01	0.39	0.01	0.00Update, Stop	0.50	0.74	0.58	0.55G.4 BPUT 32K This test measured the time taken to write &8000 bytes into a file, oneat a time. There is one variant on this test, where the second processor'sfast BPUT call was used.		HDFS	HDFS	HDFS	DNFSBPUT 32K	root	sub-dir	acorn	1.20Out		54.32	54.36	54.33	55.02Up		76.04	75.75	76.28	76.03Fast, Out	28.80	29.23	28.42	29.41Fast, Update	49.92	49.75	50.46	50.00G.5 BGET 32K The time taken to read &8000 bytes from a file one at a time was measuredby this test.		HDFS	HDFS	HDFS	DNFSBGET 32K	root	sub-dir	acorn	1.20Get		52.70	52.50	52.71	52.86G.6 MOVE This test measured how fast the sequential file pointer can be moved.		HDFS	HDFS	HDFS	DNFSMOVE		root	sub-dir	acorn	1.20Out		29.15	29.87	29.81	29.60Up		29.80	29.87	29.80	29.26G.7 GBPB There were two variants of this test, where &8000 bytes were read orwritten to a file using the OSGBPB call.		HDFS	HDFS	HDFS	DNFSGBPB		root	sub-dir	acorn	1.20Read, IO	29.11	29.17	29.12	29.24Read, Tube	29.14	29.17	29.11	29.24Write, IO	29.28	29.40	29.28	29.27Write, Tube	29.27	29.39	29.27	29.28G.8 SHIFT This test measured how fast the sequential file pointer could be movedwhile performing file operations.		HDFS	HDFS	HDFS	DNFSMOVE2 		root	sub-dir	acorn	1.20Read		0.40	0.48	0.40	0.39Write		0.62	0.68	0.62	0.62