# Sector window

A sector window (secwin) is a restricted window over a target drive. That window
has a first sector as well as a sector count.

The secwin is a drive [io/drive] and complies to its API. When a sector is
reference, the "first sector" number is added to that reference and passed on
to its target drive. When a request is made that go outside the secwin, we abort
with an "out of range" error. Example usage:

  mydrv newsecwin mysecwin
  42 4 mysecwin reframe
  1 here mysecwin readsector \ reads mydrv's sector 43 to here
  4 here mysecwin writesector \ out of range error!

## API

### Struct

extends Drive struct SecWin
  fields tgtdrv fsec
endstruct

tgtdrv  Target drive [doc/io/drive]
fsec    First sector of the window

### Words

newsecwin ( tgtdrv -- secwin )
  Create a new secwin targeting drive "tgtdrv", seccnt 1.

reframe ( fsec cnt secwin -- )
  Move window to "fsec" with "cnt" sectors.

fulldrv ( secwin -- )
  Move the window so that it spans the whole drive.
