dskutil man page

dskutil — Simple sector edtor for discs and disc images.


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


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.

Select according to the disc image file. This is the default.
Use the DSK (CPCEmu format) image driver.
Use the extended version of the DSK format.
Use the floppy driver.
Use the hard disk (MYZ80 format) image driver. (This format cannot be autodetected.)
Use the CFI (DOS fdcopy format) image driver. (This format cannot be autodetected.)
Use the ApriDisk image driver (from the utility of the same name). (This format cannot be autodetected.)
Use the raw driver.
-comp COMP

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

Detect from the first few bytes of the file. This is the default.
Huffman coded (SQ / USQ).
Gzipped (gzip / gunzip).
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.
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.

Increase the current sector number by [x] and read the resulting sector, incrementing the track if necessary.
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.
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.
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.
(Re)read the current sector.
Set the current sector number, and read.
Set the current track number. Does not read.
Compare the contents of the sector buffer with the current sector on disc.
Write the sector buffer to disc.
Leave dskutil.
Append the current sector to a "yank" buffer. It can then be saved with the K command.
Sleep for nn seconds; if nn is not present, sleeps for one second.
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 <jce@seasip.demon.co.uk>.


Explore man page connections for dskutil(1).