Provided by: libdsk-utils_1.5.9+dfsg-1_amd64 bug


       dskutil - Simple sector edtor for discs and disc images.


       dskutil  [-type  TYPE]  [-side  SIDE]  [-comp  COMP] [-dstep] [-retry COUNT] [-format FMT]


       dskutil is an interactive command-driven sector editor, patterned after the venerable CP/M
       sector  editor  DU90.  This  explains  some  of  its idiosyncracies, such as the fact that
       commands deal in logical track numbers but physical sector numbers.


       -type TYPE
              Determines which LibDsk driver is to be used to access the disc.

              auto    Select according to the disc image file. This is the default.

              dsk     Use the DSK (CPCEmu format) image driver.

              edsk    Use the extended version of the DSK format.

              floppy  Use the floppy driver.

              myz80   Use the hard disk (MYZ80 format) image  driver.   (This  format  cannot  be

              cfi     Use  the  CFI  (DOS  fdcopy  format)  image driver.  (This format cannot be

                      Use the ApriDisk image driver (from the utility of the same  name).   (This
                      format cannot be autodetected.)

              raw     Use the raw driver.

       -comp COMP
              Select  the  compression  method  used  on  the disc image file (has no effect when
              reading a floppy disc).

              auto    Detect from the first few bytes of the file. This is the default.

              sq      Huffman coded (SQ / USQ).

              gz      Gzipped (gzip / gunzip).

              bz2     Burrows-Wheeler compressed (bzip2 / bunzip2).

       -side SIDE
              Determines which side (0 or 1) of the source disc is to be scanned. If this  option
              is not present both sides will be scanned.

       -dstep Double-step  the  source  drive  (used  to  read  360k discs in 1.2Mb drives). Only
              supported by the Linux floppy driver.

       -retry COUNT
              Set the number of times to attempt a read/write/format in case of error.

       -format FMT
              Do not autodetect the disc format; use the named format. The format need only be an
              approximation to the actual format used by the disc.

       -first CYL
              Start scanning at the specified cylinder.

       -last CYL
              Scan up to and including the specified cylinder.


       The following single-letter commands are used. Operands in brackets such as [filename] are
       optional. Numeric inputs are shown as nn for decimal, and xx  for  hex.  In  either  case,
       prefixing the number with "#" selects the alternate number system.

       Multiple commands on a line are allowed, separated by semicolons.

       +[x]   Increase  the  current  sector  number  by  [x]  and  read  the  resulting  sector,
              incrementing the track if necessary.

       -[x]   Decrease  the  current  sector  number  by  [x]  and  read  the  resulting  sector,
              decrementing the track if necessary.

       #      Display the disc geometry for the current drive/disc image.

              View  and amend the geometry. "$" by itself shows all possible variables with their
              current values; "$variable" shows the value of one variable; and  "$variable=value"
              sets a new value. Note that changing the size of the sector with "$secsize=nn" will
              cause the current sector buffer and clip buffer to be cleared.

       =ascii Search for an ASCII string, starting at  the  current  sector.  Hex  codes  can  be
              included  in  the  ASCII  by surrounding them with angle brackets - for example, to
              search for the word "Hello" at the start of a line, you could use "=<0A>Hello". The
              search string is case-sensitive.

       <      Save the currently-loaded sector to a clip buffer.

       >      Restore the contents of the clip buffer to the current sector buffer.

       ?      Display a command summary.

              Dump  the contents of the sector buffer as ASCII. If from and to are included, then
              only values between those offsets will be shown.

              Change bytes in the current sector buffer. The offset and values are in hex.

              Replace bytes in the current sector buffer with an ASCII string. As  with  the  "="
              command, the ASCII can contain embedded hex bytes in angle brackets.

              The  same  as CH above, but fills the range from from to to with the byte sequence,
              repeating or truncating it as necessary.

              The same as CHfrom-to, except that the byte sequence is specified as ASCII.

              Dump the contents of the sector buffer as ASCII and hex.

       Gxx    Go to logical sector number xx

              Dump the contents of the sector buffer as hex.

              Save all "yanked" sectors (see Y below) to the specified  file.  This  also  clears
              them from memory.

              Open  a  new  drive  or  disc  image.  If this has a different sector size from the
              current sector size, the sector buffer and clip buffer will be cleared.

              Change geometry. N by itself re-runs the automatic probe; N  with  the  name  of  a
              geometry selects one of the formats known to LibDsk.

       R      (Re)read the current sector.

       Snn    Set the current sector number, and read.

       Tnn    Set the current track number. Does not read.

       V      Compare the contents of the sector buffer with the current sector on disc.

       W      Write the sector buffer to disc.

       X      Leave dskutil.

       Y      Append  the  current  sector  to  a  "yank" buffer. It can then be saved with the K

       Z[nn]  Sleep for nn seconds; if nn is not present, sleeps for one second.

       /nn    This must be the last command on a line. It repeats the preceding line nn times.


       On platforms with no sleep(3) function, the Z command works by busy-waiting.

       Commands are always input using fgets(3), even  when  the  host  system  provides  a  more
       sophisticated input method such as readline(3).

       While  the current feature set is a fairly good match for DU90 (less the features specific
       to the CP/M filesystem) it doesn't cover all the features of LibDsk.


       John Elliott <>.