Hard disk organization
LDOS reads and writes raw hard drive data in 256-byte sectors. When addressing a sector, software provides a 10-bit cylinder and 8-bit sector number. Thus each logical hard drive can have up to 1024 cylinders of up to 256, 256-byte sectors each, totalling as much as 64MB.
Files are allocated in groups of 32 sectors known as granules or clusters, each of 8KB size. So each cylinder can have up to 8 granules, and must have a number of sectors that's a multiple of 32. Each LDOS hard disk directory can hold up to 256 files.
As shipped, M3SE's disks are organized as follows:
Drive :0 -- Hard disk, 170 cylinders 8 heads, 10.625 MB Drive :1 -- Hard disk, 170 cylinders 8 heads, 10.625 MB Drive :2 -- Hard disk, 170 cylinders 8 heads, 10.625 MB Drive :3 -- Hard disk, 170 cylinders 8 heads, 10.625 MB Drive :4 -- Hard disk, 170 cylinders 8 heads, 10.625 MB Drive :5 -- Hard disk, 174 cylinders 8 heads, 10.875 MB Drive :6 -- First floppy drive Drive :7 -- Second floppy drive
Note that the entire 64MB accessible by LDOS is used. If you wish to reorganize the drives--for example to access more than two floppy drives--be aware that LDOS attempts to double the size of each granule on disks with more than 203 cylinders; this is highly discouraged and may cause LDOS and other software to fail. Furthermore it's advisable to have as many hard drives as acceptable due to the limit of 256 files per logical drive.
Although solid-state disks like M3SE's CF cards don't contain physical read/write heads or rotating disk platters, the original terminology is retained. A disk drive has some number of data cylinders. A cylinder consists of one or more tracks, each corresponding to a drive head. A track/head holds some number of data sectors. In the case of LDOS, each head or track corresponds to one 8KB granule of 32 sectors.
Compact Flash memory cards each contain a controller that emulates an IDE (Integrated Drive Electronics) electromechanical disk drive, also known as PATA (Parallel AT Attachment). IDE, when addressed in C/H/S (Cylinder/Head/Sector) mode, appears very similar to the MFM controllers that LDOS can access using the RSHARD driver package from Misosys. Similar, but not identical; there are some important differences.
MFM uses an 8-bit data bus, but IDE is 16 bits wide. Although the M3SE FPGA can access both bytes of the data bus, sector data is only written and read on the LSB, thus wasting half the space on the CF card. Furthermore, LDOS uses 32 sectors per track, whereas IDE can have up to--and CF cards usually have--63 (not 64) sectors per track. M3SE uses only the first 32 sectors of eack track, again wasting nearly half (31/63) of the remaining disk space. This wasted disk space is not a problem with modern CF cards. The 2GB card supplied with M3SE, for example, can hold up to six complete 64MB hard disk images even though so much of the space is unused.
MFM drives can have up to 8 heads, but IDE allows for 16--and CF cards usually emulate 16 heads. Rather than waste this space, M3SE's hard disk adapter contains a register that allows heads 0-7 or 8-15 to be selected. The same register can be used to address cylinders beyond the first 1024.
Back to the main page