dskutil(1)

πŸ’Ύ dskutil β€” the sector editor that's lowkey iconic πŸ’…

okay bestie, so this is dskutil(1), and it lives in the Emulators section of the manual. she's a simple sector editor for discs and disc images, and honestly? she's giving vintage-but-thriving. ✨


✨ NAME ✨

dskutil β€” a simple sector editor for discs and disc images. (yes the original spells it "edtor", no we are not fixing it, we love her exactly as she is 🫢)


🌸 SYNOPSIS 🌸

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

πŸ¦‹ DESCRIPTION πŸ¦‹

So dskutil is an interactive, command-driven sector editor, and she's patterned after the venerable CP/M sector editor DU90. Which, yes, explains a lot of her little idiosyncracies β€” for example, the way that commands deal in logical track numbers but physical sector numbers. That's just her vibe, iykyk. πŸ’€


πŸ’– OPTIONS πŸ’–

  • -type TYPE β€” picks which LibDsk driver gets used to access the disc. Your choices, queen:
    • 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 β€” selects the compression method used on the disc image file. ngl this one has no effect when reading a floppy disc, so don't come for her.
    • 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 β€” decides which side (0 or 1) of the source disc gets scanned. If you don't pass this option, both sides get scanned. we love a thorough queen πŸ’…
  • -dstep β€” double-step the source drive (used to read 360k discs in 1.2Mb drives). Only supported by the Linux floppy driver. no cap.
  • -retry COUNT β€” sets how many times to attempt a read/write/format in case of error. she's persistent, she's resilient. 🫢
  • -format FMT β€” do not autodetect the disc format; use the named format instead. The format need only be an approximation to the actual format used by the disc. it's giving "close enough is fine, bestie".
  • -first CYL β€” start scanning at the specified cylinder.
  • -last CYL β€” scan up to and including the specified cylinder.

πŸ‘‘ COMMANDS πŸ‘‘

Here come the single-letter commands, and they are so much. Operands in brackets like [filename] are optional. Numeric inputs show up as nn for decimal and xx for hex β€” and in either case, prefixing the number with # selects the alternate number system. 😌

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

  • +[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. (iconic.)
  • $[variable[=value]] β€” view and amend the geometry. $ all 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. bye babes πŸ‘‹
  • 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. (the goodbye button, she's emotional about it 😭)
  • 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. nap queen. πŸ’œ
  • /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. she's trying her best okay.
  • Commands are always input using fgets(3), even when the host system provides a more sophisticated input method such as readline(3). not her choice, not her problem.
  • 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. no cap, that's just the truth.

🌈 AUTHOR 🌈

John Elliott <seasip.webmaster@gmail.com>. πŸ’–


okay that's the whole page bestie, and the sign-off goes like this: this is Version 1.5.9, dated 17 September 2018, and she lives in the Emulators section. slay, hydrate, and always remember to R before you W. βœ¨πŸŽ€πŸ¦‹