Scor­pio News


January–March 1987, Volume 1, Issue 1

Page 25 of 63

Disk Formats and CP/M Disk Routines by M.W.T. Waters

(4, – eis article runs to some twenty plus pages in total. I have therefore split it up, and this is the first part, concentrating on the format that data Ee actually writeen onto disks in.)

Have you ever wondered about how CP/M stores avay its data, how the dicectory records relate to the filed on disk, what deteruines the miniaum and maximum File sizes or what determines disk size and the number of directory entries available?

There are several good books available about CP/M but none of them appear to Cater for the dabbler in operating system software or for the type of hacker” best described as an 80-808 user. The Digital Research handbooks contain all of gata required for jlement CP/M on a microcomputer but rarely explain WHY a particular disk parame yy, fe given # specific value or HOW fe fits into the great scheme of thin

I should mention here that I was introduced to computers when hackers were (mainly) electronics enthusiasts who built computer systems from scratch and Caught theneelves programming dy sheer hard work combined with more than 8

— Little trial’ and erroc These days, hacking seens to apply to juveniles (generaily) who illegally enter other peoples computer eystens and create a bed name for home computer users.

Most of the information contained in this article Ls available to the average ‘0-BUS user who 1a armed with @ disassenbler, the CP/M manuals and lots of time and patience (or as someone else put it, “Stupidity and sheer bloody nundedness").

Disks and disk formate

Before proceeding with an in-depth breakdon of CP/M, I shall describe, briefl} Floppy disks and floppy disk formats and thea go on to examine the di phyfitally vestven to the disk surface during formatting. The examples given Will be oriented towards the current Gemini 5.25" disk formats but will be Squally applicable ‘co any IBM 3740 or IBM 34 type disk format (eg Natcom)

A floppy disk consists of a disc of thin mylar (a flexible plastic) that has been costed on both aides with ferrous oxide; the same eateriel that 19 used to coat magnetic recording tape The disk surface itself is contained in and protected by a covering of some sort with cut-outs to allow access for the Fead/write head(s) of the disk drive Disks are available in four sizes: 8’, Sczst, 3.” ands” wien 825” being the most commonly used by microcomputer manufacturers. In the case of 8 and 5.25" diske, the covering (known a the envelope) ia made of cardboard while the other two sizes are protected by a Figid plastic case.

at a uniform speed (the Sirius

In use, the disk is rotated, usually. nicrocomputer being an exception) end date is written to or read from the ditk by one of tvo read/write heads similar to those used in tape recorders, floppy disks may be either single or double sided, Disk drives that are deeigned for Single sided opecacion only have one head while those designed for double sided ion have one head for each side of the disk However, with early 3’ disk to access the second side, it ie pecessary to remove it from the deive and physically turn it over. For ost disk operating systems (D0S’s) this Latter type of disk appears to be two separate disks joined back Co back,

From this point on, I shall only refer to 5.257 disks but the principles involved are very similar co the other types The disk surface is divided up into 4 number of tracks at the time of formatting; the number of tracks depending upon the disk size and the physical chacacteristics of the disk drive The read/write head ie permitted to access each track by stepping the head in or out under software control The disk is given a reference point in terms of

This is an OCR’d version of the scanned page and likely contains recognition errors.

Page 25 of 63