apple2 disk image manipulation commandline tool
Go to file
2021-08-01 14:19:26 -04:00
.github/workflows Create codeql-analysis.yml 2021-07-23 09:08:34 -04:00
.vscode add a couple disks 2021-07-10 21:09:57 -04:00
basic lint fixes 2021-07-31 23:14:55 -04:00
bin todos and lint fixes; added hermit 2021-07-31 22:44:04 -04:00
cmd debug: made it a counter rather than boolean 2021-08-01 14:19:26 -04:00
data nits: missed a couple of comments keeping lint happy 2021-08-01 13:22:10 -04:00
disk debug: made it a counter rather than boolean 2021-08-01 14:19:26 -04:00
dos3 debug: made it a counter rather than boolean 2021-08-01 14:19:26 -04:00
errors add a couple disks 2021-07-10 21:09:57 -04:00
helpers more lints, removed woz 2021-07-31 23:49:22 -04:00
img Add logo 2017-03-16 23:12:07 -04:00
prodos debug: made it a counter rather than boolean 2021-08-01 14:19:26 -04:00
supermon debug: made it a counter rather than boolean 2021-08-01 14:19:26 -04:00
testdata major refactor 2021-07-31 22:10:44 -04:00
types debug: made it a counter rather than boolean 2021-08-01 14:19:26 -04:00
.gitignore Make Travis build github releases on tags 2016-11-13 22:09:03 -05:00
.golangci.yml more lints, removed woz 2021-07-31 23:49:22 -04:00
.travis.yml travis: use default go version 2017-01-26 21:55:58 -06:00
build add a couple disks 2021-07-10 21:09:57 -04:00
go.mod major refactor 2021-07-31 22:10:44 -04:00
go.sum major refactor 2021-07-31 22:10:44 -04:00
LICENSE Initial commit 2016-10-28 21:20:20 -04:00
main.go debug: made it a counter rather than boolean 2021-08-01 14:19:26 -04:00
next debug: made it a counter rather than boolean 2021-08-01 14:19:26 -04:00
notes.org catalog working for all types, reorder added 2021-07-12 16:27:13 -04:00
README.md debug: made it a counter rather than boolean 2021-08-01 14:19:26 -04:00
script_test.go major refactor 2021-07-31 22:10:44 -04:00
writetest.asm add a couple disks 2021-07-10 21:09:57 -04:00
writetest.mon add a couple disks 2021-07-10 21:09:57 -04:00

diskii

Note: diskii is not stable yet! I don't expect to remove functionality, but I'm still experimenting with the command syntax and organization, so don't get too comfy with it.

Seagull Srs Micro Software

diskii-the-tool is a commandline tool for working with Apple II disk images. Given that AppleCommander already does everything, it's not terribly necessary. It is, however, mine. Minor benefits (right now) are binaries you can copy around (no Java needed), support for Super-Mon symbol tables on NakedOS disks, and creation of "Standard Delivery" disk images.

diskii-the-library is probably more useful: a library of disk-image-manipulation code that can be used by other Go programs.

diskii's major disadvantage is that it mostly doesn't exist yet.

Build Status Report Card GoDoc

It rhymes with “whiskey”.

Discussion/support is on the apple2infinitum Slack (invites here).

Examples

Get a listing of files on a DOS 3.3 disk image:

diskii ls dos33master.dsk

… or a ProDOS disk image:

diskii ls ProDOS_2_4_2.po

… or a Super-Mon disk image:

diskii ls Super-Mon-2.0.dsk 

Reorder the sectors in a disk image:

diskii reorder ProDOS_2_4_2.dsk ProDOS_2_4_2.po

Goals

Eventually, it aims to be a comprehensive disk image manipulation tool, but for now only some parts work.

The library code aims (a) to support the commandline tool operations, and (b) to replace the "read and write disk images" code of the goapple2 emulator.

Current disk operations supported:

Feature DOS 3.3 ProDOS NakedOS/Super-Mon
basic structures
ls
dump
put
dumptext
delete
rename
put
puttext
extract (all)
lock/unlock
init
defrag

Installing/updating

Assuming you have Go installed, run go get -u github.com/zellyn/diskii

You can also download automatically-built binaries from the latest release page. If you need binaries for a different architecture, please send a pull request or open an issue.

Short-term TODOs/roadmap/easy ways to contribute

My rough TODO list (apart from anything marked (✗) in the disk operations matrix is listed below. Anything that an actual user needs will be likely to get priority.

  • Make put accept load address for appropriate filetypes.
  • Fix golint errors
  • Implement GetFile for prodos
  • Implement PutFile for prodos
  • Implement Delete for Super-Mon
  • Implement Delete for DOS 3.3
  • Implement Delete for ProDOS
  • Add and implement the -l flag for ls
  • Make OperatorFactory.SeemsToMatch more sophisticated for ProDOS
  • Make OperatorFactory.SeemsToMatch more sophisticated for DOS 3.3
  • Make OperatorFactory.SeemsToMatch more sophisticated for NakedOS
  • Build per-platform binaries for Linux, MacOS, Windows.

Related tools

Notes

Disk formats

  • .do
  • .po
  • .dsk - could be DO or PO. When in doubt, assume DO.
Physical Sectors DOS 3.2 Logical DOS 3.3 Logical ProDOS/Pascal Logical CP/M Logical
0 0 0 0.0 0.0
1 1 7 4.0 2.3
2 2 E 0.1 1.2
3 3 6 4.1 0.1
4 4 D 1.0 3.0
5 5 5 5.0 1.3
6 6 C 1.1 0.2
7 7 4 5.1 3.1
8 8 B 2.0 2.0
9 9 3 6.0 0.3
A A A 2.1 3.2
B B 2 6.1 2.1
C C 9 3.0 1.0
D 1 7.0 3.3
E 8 3.1 2.2
F F 7.1 1.1

Note: DOS 3.2 rearranged the physical sectors on disk to achieve interleaving.

RWTS - DOS

Sector mapping: http://www.textfiles.com/apple/ANATOMY/rwts.s.txt and search for INTRLEAV

Mapping from specified sector to physical sector:

00 0D 0B 09 07 05 03 01 0E 0C 0A 08 06 04 02 0F

So if you write to "T0S1" with DOS RWTS, it ends up in physical sector 0D.

Commandline examples for thinking about how it should work

diskii ls dos33.dsk diskii --order=do ls dos33.dsk diskii --order=do --system=nakedos ls nakedos.dsk