# Drive I/O

The drive struct offers a unified API to read and write to mass storage. It does
so in blocks of bytes of a definite size which we call "sector". Sectors in the
drive API are organized in a linear manner (LBA, Logical Block Addressing). If
the underlying mass storage driver interfaces with a CHS (cylinder, head,
sector) system, it's the driver's responsibility to convert LBA to CHS.

Constants:

DRIVESZ  Size in bytes of a drive struct

Fields:

secsz   size in bytes of each sector read and written by the driver.
        It's often 512.
seccnt  Number of sectors in the drive

Methods:

readsector ( sec dst drv -- )
  Read sector "sec" in memory address "dst", which needs to be a buffer at least
  "secsz" in size.

writesector ( sec src drv -- )
  Write sector "sec" from memory address "src".

Words:

newdrive ( 'readsector 'writesector secsz seccnt -- drv )
  Create a new drive struct with the specified values/methods.
