dskutil - Man Page
Simple sector edtor for discs and disc images.
Synopsis
dskutil [-type TYPE] [-side SIDE] [-comp COMP] [-dstep] [-retry COUNT] [-format FMT] DISKIMAGE
Description
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.
Options
- -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 autodetected.)
- cfi
Use the CFI (DOS fdcopy format) image driver. (This format cannot be autodetected.)
- apridisk
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.
Commands
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.
- $[variable[=value]]
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.
- A[from,to]
Dump the contents of the sector buffer as ASCII. If from and to are included, then only values between those offsets will be shown.
- CHoffset,value,value,value...
Change bytes in the current sector buffer. The offset and values are in hex.
- CAoffset,ascii
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.
- CHfrom-to,value,value,value...
The same as CH above, but fills the range from from to to with the byte sequence, repeating or truncating it as necessary.
- CAfrom-to,ascii
The same as CHfrom-to, except that the byte sequence is specified as ASCII.
- D[from,to]
Dump the contents of the sector buffer as ASCII and hex.
- Gxx
Go to logical sector number xx
- H[from,to]
Dump the contents of the sector buffer as hex.
- Kfilename
Save all "yanked" sectors (see Y below) to the specified file. This also clears them from memory.
- Lfilename[,type[,compression]]
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.
- N[geometry]
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 command.
- 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.
Bugs
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.
Author
John Elliott <seasip.webmaster@gmail.com>.