<rss version="2.0">
  <channel>
    <title>dsktool</title>
    <link>http://instiki.jamtronix.com/dsktool/show/HomePage</link>
    <description>An Instiki wiki</description>
    <language>en-us</language>
    <ttl>40</ttl>
    <item>
      <title>Installing dsktool</title>
      <description>&lt;p&gt;Before you can install dsktool.rb, ruby must be installed &amp;#8211; instructions on how to do this for most operating systems can be found at &lt;a href="http://www.ruby-lang.org/en/downloads/"&gt;http://www.ruby-lang.org/en/downloads/&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;once you have ruby installed, you can download, install and configure dsktool just by opening up a command window and running &lt;code&gt;gem install dsktool&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;If you are using &lt;a href="http://www.debian.org/"&gt;debian&lt;/a&gt; or &lt;a href="http://www.ubuntu.org/"&gt;ubuntu&lt;/a&gt;, then you will need to put &amp;#8220;sudo&amp;#8221; at the start of the command, like so:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;jonno@ubuntu:~$ sudo gem install dsktool
&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;If all goes well, you should see a response like so:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed dsktool-0.4.2
Installing ri documentation for dsktool-0.4.2...
Installing RDoc documentation for dsktool-0.4.2...
jonno@ubuntu:~$
&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;Now check that dsktool.rb is working by typing &lt;code&gt;dsktool.rb -v&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;You should be given a version number, like so:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;jonno@ubuntu:~$ dsktool.rb -v
dsktool.rb 0.4.2
jonno@ubuntu:~$
&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;if you are running ubuntu, and you get a &amp;#8216;command not found&amp;#8217; error when you run dsktool.rb, you will need to add the the gems &amp;#8216;bin&amp;#8217; directory to your default search path. To do this, to do this, edit the file called .bashrc in your home directory (using the text editor of your choice, e.g. nano or gedit), and at the bottom of that file add:&lt;/p&gt;


&lt;code&gt;    
    export PATH=$PATH:/var/lib/gems/1.8/bin
&lt;/code&gt;    

	&lt;p&gt;Then save .bashrc, and restart your terminal window.&lt;/p&gt;


	&lt;p&gt;You should now be able to run dsktool.rb.&lt;/p&gt;


	&lt;p&gt;Next: &lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/Getting+started+with+dsktool"&gt;Getting started with dsktool&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 20 Jul 2008 04:46:19 Z</pubDate>
      <guid>http://instiki.jamtronix.com/dsktool/show/Installing+dsktool</guid>
      <link>http://instiki.jamtronix.com/dsktool/show/Installing+dsktool</link>
    </item>
    <item>
      <title>Supported File Systems</title>
      <description>&lt;table&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;b&gt;File System&lt;/b&gt;&lt;/td&gt;
			&lt;td&gt;&lt;b&gt;Catalog&lt;/b&gt;&lt;/td&gt;
			&lt;td&gt;&lt;b&gt;Extract&lt;/b&gt;&lt;/td&gt;
			&lt;td&gt;&lt;b&gt;Init&lt;/b&gt;&lt;/td&gt;
			&lt;td&gt;&lt;b&gt;Add&lt;/b&gt;&lt;/td&gt;
			&lt;td&gt;&lt;b&gt;Delete&lt;/b&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/Apple+DOS"&gt;Apple DOS&lt;/a&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES &lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES &lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES &lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES&lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/ApplePascal"&gt;Apple Pascal&lt;/a&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES &lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES &lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &amp;#8211; &lt;/td&gt;
			&lt;td&gt; &amp;#8211; &lt;/td&gt;
			&lt;td&gt; &amp;#8211; &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/AppleProDOS"&gt;Apple Pro DOS&lt;/a&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES &lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES &lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &amp;#8211; &lt;/td&gt;
			&lt;td&gt; &amp;#8211; &lt;/td&gt;
			&lt;td&gt; &amp;#8211; &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;span class="newWikiWord"&gt;CP/M&lt;a href="http://instiki.jamtronix.com/dsktool/new/CP%2FM"&gt;?&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES &lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES &lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES &lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES&lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/NADOL"&gt;NADOL&lt;/a&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES &lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES &lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES &lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES &lt;/span&gt;&lt;/td&gt;
			&lt;td&gt; &lt;span class="caps"&gt;YES&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/table&gt;</description>
      <pubDate>Sun, 20 Jul 2008 03:53:49 Z</pubDate>
      <guid>http://instiki.jamtronix.com/dsktool/show/SupportedFileSystems</guid>
      <link>http://instiki.jamtronix.com/dsktool/show/SupportedFileSystems</link>
    </item>
    <item>
      <title>jonnosan</title>
      <description></description>
      <pubDate>Mon, 23 Jun 2008 21:59:22 Z</pubDate>
      <guid>http://instiki.jamtronix.com/dsktool/show/jonnosan</guid>
      <link>http://instiki.jamtronix.com/dsktool/show/jonnosan</link>
    </item>
    <item>
      <title>NIB File Format</title>
      <description>&lt;p&gt;A nib file is 232960 bytes long = 6656 bytes per track.&lt;/p&gt;


&lt;pre&gt;
TRACK      OFFSET (HEX)    OFFSET (DECIMAL)
$00             $0              0
$01             $1a00           6656
$02             $3400           13312
$03             $4e00           19968
$04             $6800           26624
$05             $8200           33280
$06             $9c00           39936
$07             $b600           46592
$08             $d000           53248
$09             $ea00           59904
$0a             $10400          66560
$0b             $11e00          73216
$0c             $13800          79872
$0d             $15200          86528
$0e             $16c00          93184
$0f             $18600          99840
$10             $1a000          106496
$11             $1ba00          113152
$12             $1d400          119808
$13             $1ee00          126464
$14             $20800          133120
$15             $22200          139776
$16             $23c00          146432
$17             $25600          153088
$18             $27000          159744
$19             $28a00          166400
$1a             $2a400          173056
$1b             $2be00          179712
$1c             $2d800          186368
$1d             $2f200          193024
$1e             $30c00          199680
$1f             $32600          206336
$20             $34000          212992
$21             $35a00          219648
$22             $37400          226304
&lt;/pre&gt;</description>
      <pubDate>Mon, 14 Jan 2008 09:56:37 Z</pubDate>
      <guid>http://instiki.jamtronix.com/dsktool/show/NIB+File+Format</guid>
      <link>http://instiki.jamtronix.com/dsktool/show/NIB+File+Format</link>
    </item>
    <item>
      <title>DSK File Format</title>
      <description>&lt;p&gt;A standard &lt;span class="caps"&gt;DSK&lt;/span&gt; file is 143360 bytes long.&lt;br /&gt;This is 35 tracks, each track is 4096 bytes.&lt;br /&gt;&lt;pre&gt;
Track       Offset (HEX)    Offset (Decimal)
$00             $0              0
$01             $1000           4096
$02             $2000           8192
$03             $3000           12288
$04             $4000           16384
$05             $5000           20480
$06             $6000           24576
$07             $7000           28672
$08             $8000           32768
$09             $9000           36864
$0a             $a000           40960
$0b             $b000           45056
$0c             $c000           49152
$0d             $d000           53248
$0e             $e000           57344
$0f             $f000           61440
$10             $10000          65536
$11             $11000          69632
$12             $12000          73728
$13             $13000          77824
$14             $14000          81920
$15             $15000          86016
$16             $16000          90112
$17             $17000          94208
$18             $18000          98304
$19             $19000          102400
$1a             $1a000          106496
$1b             $1b000          110592
$1c             $1c000          114688
$1d             $1d000          118784
$1e             $1e000          122880
$1f             $1f000          126976
$20             $20000          131072
$21             $21000          135168
$22             $22000          139264
&lt;/pre&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 14 Jan 2008 09:53:26 Z</pubDate>
      <guid>http://instiki.jamtronix.com/dsktool/show/DSK+File+Format</guid>
      <link>http://instiki.jamtronix.com/dsktool/show/DSK+File+Format</link>
    </item>
    <item>
      <title>Home Page</title>
      <description>&lt;p&gt;dsktool.rb is a command line tool + libraries (all in ruby) for manipulating &lt;span class="caps"&gt;DSK&lt;/span&gt; format images used by Apple 2 emulators.&lt;/p&gt;


	&lt;h3&gt;How Tos&lt;/h3&gt;


	&lt;p&gt;&lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/Installing+dsktool"&gt;Installing dsktool&lt;/a&gt;&lt;br /&gt;&lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/Getting+started+with+dsktool"&gt;Getting started with dsktool&lt;/a&gt;&lt;br /&gt;&lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/CatalogingDiskImages"&gt;Cataloging Disk Images&lt;/a&gt;&lt;br /&gt;&lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/ExtractingFilesFromDiskImages"&gt;Extracting Files From Disk Images&lt;/a&gt;&lt;br /&gt;&lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/InitializingDiskImages"&gt;Initializing Disk Images&lt;/a&gt;&lt;br /&gt;&lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/AddingFilesToDiskImages"&gt;Adding Files To Disk Images&lt;/a&gt;&lt;/p&gt;


	&lt;h3&gt;Technical Details&lt;/h3&gt;


	&lt;p&gt;&lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/SupportedFileSystems"&gt;Supported File Systems&lt;/a&gt;&lt;br /&gt;&lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/DSK+File+Format"&gt;DSK File Format&lt;/a&gt;&lt;br /&gt;&lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/NIB+File+Format"&gt;NIB File Format&lt;/a&gt;&lt;/p&gt;


	&lt;h3&gt;External Links&lt;/h3&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://dsktool.rubyforge.org/doc/"&gt;RDoc Documentation&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://rubyforge.org/projects/dsktool"&gt;RubyForge project page&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;</description>
      <pubDate>Mon, 14 Jan 2008 09:47:15 Z</pubDate>
      <guid>http://instiki.jamtronix.com/dsktool/show/HomePage</guid>
      <link>http://instiki.jamtronix.com/dsktool/show/HomePage</link>
    </item>
    <item>
      <title>Adding Files To Disk Images</title>
      <description>&lt;p&gt;Currently (as of version 0.4.2) only &lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/NADOL"&gt;NADOL&lt;/a&gt; and &lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/Apple+DOS"&gt;Apple DOS&lt;/a&gt; images can have files added to them.&lt;/p&gt;


	&lt;p&gt;To add a file to an existing image, use the &amp;#8221;-a&amp;#8221; or &amp;#8221;&amp;#8212;add&amp;#8221; command, followed by the name of the file to add.&lt;/p&gt;


	&lt;p&gt;For Apple &lt;span class="caps"&gt;DOS&lt;/span&gt; files, the default file type is a &lt;span class="newWikiWord"&gt;Text File&lt;a href="http://instiki.jamtronix.com/dsktool/new/TextFile"&gt;?&lt;/a&gt;&lt;/span&gt;. If you wish to add some other file type, you can use the &amp;#8221;-t&amp;#8221; or &amp;#8221;&amp;#8212;filetype&amp;#8221;, followed by &lt;span class="caps"&gt;EITHER&lt;/span&gt; a single letter (A for &lt;span class="newWikiWord"&gt;AppleSoft BASIC File&lt;a href="http://instiki.jamtronix.com/dsktool/new/AppleSoft+BASIC+File"&gt;?&lt;/a&gt;&lt;/span&gt;, B for a &lt;span class="newWikiWord"&gt;Binary File&lt;a href="http://instiki.jamtronix.com/dsktool/new/BinaryFile"&gt;?&lt;/a&gt;&lt;/span&gt;, I for &lt;span class="newWikiWord"&gt;Integer BASIC File&lt;a href="http://instiki.jamtronix.com/dsktool/new/Integer+BASIC+File"&gt;?&lt;/a&gt;&lt;/span&gt;, T for &lt;span class="newWikiWord"&gt;Text File&lt;a href="http://instiki.jamtronix.com/dsktool/new/TextFile"&gt;?&lt;/a&gt;&lt;/span&gt;) or else a hex number that indicates the Apple &lt;span class="caps"&gt;DOS&lt;/span&gt; file type.&lt;/p&gt;


	&lt;p&gt;Example 1: adding a text file to an existing &lt;span class="caps"&gt;DOS&lt;/span&gt; image.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;jonno@ubuntu:~/disks$ echo "This is a test"&amp;gt; test.txt
jonno@ubuntu:~/disks$ dsktool.rb --add test.txt SCRATCH.DSK
jonno@ubuntu:~/disks$ dsktool.rb -c SCRATCH.DSK
SCRATCH.DSK
sector order:   physical
filesystem:     dos
 A 0256 HELLO
 T 0256 TEST.TXT
jonno@ubuntu:~/disks$ dsktool.rb -e test.txt SCRATCH.DSK
This is a test
jonno@ubuntu:~/disks$
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;Example 2: copying the &lt;span class="caps"&gt;HELLO&lt;/span&gt; file from an existing &lt;span class="caps"&gt;DOS&lt;/span&gt; image to a new image.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;jonno@ubuntu:~/disks$ dsktool.rb -e HELLO --raw -o HELLO ADT131.dsk
jonno@ubuntu:~/disks$ dsktool.rb --init dos33 --add HELLO -t A newdisk.dsk
jonno@ubuntu:~/disks$ dsktool.rb -e HELLO newdisk.dsk
10 PRINT CHR$ (4)"BRUN ADT" 
10
jonno@ubuntu:~/disks$
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;For Binary Files on Apple &lt;span class="caps"&gt;DOS&lt;/span&gt; images, you can use the &amp;#8221;-b&amp;#8221; or &amp;#8221;&amp;#8212;base&amp;#8221; to set the &amp;#8220;base address&amp;#8221; (the address where &lt;span class="caps"&gt;DOS&lt;/span&gt; will load the file into when the file is &lt;span class="caps"&gt;BLOA&lt;/span&gt;Ded or &lt;span class="caps"&gt;BRU&lt;/span&gt;Ned).&lt;/p&gt;


	&lt;p&gt;Example 3: adding a binary file to a &lt;span class="caps"&gt;DOS&lt;/span&gt; image, and setting the base address&lt;br /&gt;&lt;pre&gt;&lt;code&gt;jonno@ubuntu:~/disks$ dsktool.rb --add a.out --filetype B --base $2000 SCRATCH.DSK
jonno@ubuntu:~/disks$ dsktool.rb -c SCRATCH.DSK
SCRATCH.DSK
sector order:   physical
filesystem:     dos
 B 0512 A.OUT
 A 0256 HELLO
 T 0256 TEST.TXT
jonno@ubuntu:~/disks$
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 31 Dec 2007 12:54:52 Z</pubDate>
      <guid>http://instiki.jamtronix.com/dsktool/show/AddingFilesToDiskImages</guid>
      <link>http://instiki.jamtronix.com/dsktool/show/AddingFilesToDiskImages</link>
    </item>
    <item>
      <title>Extracting Files From Disk Images</title>
      <description>&lt;p&gt;The -e or&amp;#8212;extract option extracts a single file from a disk image.&lt;/p&gt;


	&lt;p&gt;The extracted file will either be displayed on the screen, or it can be written to a file by using the &amp;#8221;-o&amp;#8221; or &amp;#8221;&amp;#8212;output&amp;#8221; command to specify a filename to extract the file into.&lt;/p&gt;


	&lt;p&gt;Example 1: &amp;#8211; Cataloging a &lt;span class="caps"&gt;DOS 3&lt;/span&gt;.3 disk and then showing a Text file &lt;br /&gt;&lt;pre&gt;&lt;code&gt;jonno@ubuntu:~/disks$ dsktool.rb -c computist_starter_kit_v2.02.dskcomputist_starter_kit_v2.02.dsk
sector order:   physical
filesystem: dos
 T 0256 CAPTURE
 T 0768 CHANGES
 B 0256 CHECKBIN
 B 0256 CHECKSOFT
 A 2560 COMPUTIST'S STARTER KIT 2.02
 A 5376 CONTROLLER WRITER
 A 4352 CORE DISK SEARCHER
 B 0512 CSAVER
 A 9472 DISKEDIT
 B 1024 DOC VIEWER
 T 7936 DOC.CONTROLLER WRITER
 B 4352 DOC.CORE DISK SEARCHER
 B 13312 DOC.DISKEDIT
 B 7168 DOC.DOS ALTERER
 B 23552 DOC.SUPER IOB
 B 11264 DOC.THE NIBBLER
 A 7680 DOS ALTERER
 T 0256 FAST.CON
 B 0256 IOB.OBJ0
 T 0512 NEWSWAP.CON
 B 0256 OBJ.LINE 10
 B 0256 OBJ.TITLE SEQUENCE
 B 1024 PIC.TITLE
 B 0256 SEARCH.OBJ
 T 0512 STANDARD.CON
 T 0256 START
 A 3840 SUPER IOB
 T 0512 SWAP.CON
 A 4352 THE NIBBLER
jonno@ubuntu:~/disks$ dsktool.rb -e changes computist_starter_kit_v2.02.dsk
    In the starter kit, there have been some changes. These changes are listed below.

1...The differences between version 2 and version 2.01 is that in
the print routine prompts in version 2 asked for left and right
margins, and version 2.01 now asks for left and right indent.
It (version 2.01) now asks for maximum characters per line and it
also shows what should normally be entered for this. It also
shows the usual number of lines per page.

2...The differences between version 2.01 and 2.02 is that the
program "Controller Writer" and its document file are now
included on the Starter Kit.

jonno@ubuntu:~/disks$
&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For &amp;#8220;tokenised&amp;#8221; files (&lt;span class="newWikiWord"&gt;Applesoft Basic&lt;a href="http://instiki.jamtronix.com/dsktool/new/ApplesoftBasic"&gt;?&lt;/a&gt;&lt;/span&gt;, &lt;span class="newWikiWord"&gt;Integer Basic&lt;a href="http://instiki.jamtronix.com/dsktool/new/IntegerBasic"&gt;?&lt;/a&gt;&lt;/span&gt;,[[SCASM],&lt;span class="newWikiWord"&gt;NADOL Files&lt;a href="http://instiki.jamtronix.com/dsktool/new/NADOL+Files"&gt;?&lt;/a&gt;&lt;/span&gt;), the default behavior is to detokenise the file (i.e. into the format that it would show in if you did a &lt;span class="caps"&gt;LIST&lt;/span&gt; command on the Apple).&lt;/p&gt;


	&lt;p&gt;Example 2 &amp;#8211; displaying the &amp;#8220;HELLO&amp;#8221; &lt;span class="newWikiWord"&gt;Applesoft Basic&lt;a href="http://instiki.jamtronix.com/dsktool/new/ApplesoftBasic"&gt;?&lt;/a&gt;&lt;/span&gt; file from a deprotected &amp;#8220;Temple of Apshai&amp;#8221; disk image:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;jonno@ubuntu:~/disks$ dsktool.rb -e hello  http://jamtronix.com/dsks/apshai.dsk.gz
5 REM  TEMPLE 20920
6 REM  MODIFIED FOR TITLES
20 POKE 103,1: POKE 104,96
25 POKE 24576,0
30 PRINT CHR$ (4)"RUN TITLE" 
jonno@ubuntu:~/disks$
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;If for some reason, it is desired to have the original file extracted unaltered then the &amp;#8221;-r&amp;#8221; or &amp;#8221;&amp;#8212;raw&amp;#8221; option can be added to the &amp;#8221;&amp;#8212;extract&amp;#8221; command.&lt;/p&gt;


	&lt;p&gt;Example 3 &amp;#8211; extracting the &amp;#8220;HELLO&amp;#8221; &lt;span class="newWikiWord"&gt;Applesoft Basic&lt;a href="http://instiki.jamtronix.com/dsktool/new/ApplesoftBasic"&gt;?&lt;/a&gt;&lt;/span&gt; file from a deprotected &amp;#8220;Temple of Apshai&amp;#8221; disk image into a raw file:&lt;br /&gt;&lt;pre&gt;
&lt;code&gt;jonno@ubuntu:~/disks$ dsktool.rb -e hello  -o hello.bin --raw http://jamtronix.com/dsks/apshai.dsk.gz
jonno@ubuntu:~/disks$ hexdump -C hello.bin
00000000  64 00 14 60 05 00 b2 20  54 45 4d 50 4c 45 20 32  |d..`... TEMPLE 2|
00000010  30 39 32 30 00 2e 60 06  00 b2 20 4d 4f 44 49 46  |0920..`... MODIF|
00000020  49 45 44 20 46 4f 52 20  54 49 54 4c 45 53 00 41  |IED FOR TITLES.A|
00000030  60 14 00 b9 31 30 33 2c  31 3a b9 31 30 34 2c 39  |`...103,1:.104,9|
00000040  36 00 4e 60 19 00 b9 32  34 35 37 36 2c 30 00 63  |6.N`...24576,0.c|
00000050  60 1e 00 ba e7 28 34 29  22 52 55 4e 20 54 49 54  |`....(4)"RUN TIT|
00000060  4c 45 22 00 00 00 4c 00  00 00 00 00 00 00 00 00  |LE"...L.........|
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000100
jonno@ubuntu:~/disks$

&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;Next: &lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/InitializingDiskImages"&gt;Initializing Disk Images&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 31 Dec 2007 12:08:28 Z</pubDate>
      <guid>http://instiki.jamtronix.com/dsktool/show/ExtractingFilesFromDiskImages</guid>
      <link>http://instiki.jamtronix.com/dsktool/show/ExtractingFilesFromDiskImages</link>
    </item>
    <item>
      <title>Apple DOS</title>
      <description>&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Apple_DOS"&gt;http://en.wikipedia.org/wiki/Apple_DOS&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 31 Dec 2007 12:07:01 Z</pubDate>
      <guid>http://instiki.jamtronix.com/dsktool/show/Apple+DOS</guid>
      <link>http://instiki.jamtronix.com/dsktool/show/Apple+DOS</link>
    </item>
    <item>
      <title>Apple Pro DOS</title>
      <description>&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Apple_ProDOS"&gt;http://en.wikipedia.org/wiki/Apple_ProDOS&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 31 Dec 2007 12:06:22 Z</pubDate>
      <guid>http://instiki.jamtronix.com/dsktool/show/AppleProDOS</guid>
      <link>http://instiki.jamtronix.com/dsktool/show/AppleProDOS</link>
    </item>
    <item>
      <title>Apple Pascal</title>
      <description>&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Apple_Pascal"&gt;http://en.wikipedia.org/wiki/Apple_Pascal&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 31 Dec 2007 12:06:05 Z</pubDate>
      <guid>http://instiki.jamtronix.com/dsktool/show/ApplePascal</guid>
      <link>http://instiki.jamtronix.com/dsktool/show/ApplePascal</link>
    </item>
    <item>
      <title>Initializing Disk Images</title>
      <description>&lt;p&gt;To create a new &lt;span class="caps"&gt;DSK&lt;/span&gt; image, use the &amp;#8221;-I&amp;#8221; or &amp;#8221;&amp;#8212;init&amp;#8221; commands. You must specify the file system to be used. As of version 0.4.1, only &lt;span class="caps"&gt;DOS 3&lt;/span&gt;.3 and &lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/NADOL"&gt;NADOL&lt;/a&gt; file systems can be created, and the &lt;span class="newWikiWord"&gt;Sector Ordering&lt;a href="http://instiki.jamtronix.com/dsktool/new/SectorOrdering"&gt;?&lt;/a&gt;&lt;/span&gt; will always be &amp;#8220;physical&amp;#8221;.&lt;/p&gt;


	&lt;p&gt;Example 1 &amp;#8211; creating an uncompressed &lt;span class="caps"&gt;DOS 3&lt;/span&gt;.3 &lt;span class="caps"&gt;DSK&lt;/span&gt;:&lt;br /&gt;&lt;pre&gt;
&lt;code&gt;jonno@ubuntu:~/disks$ dsktool.rb -I dos33 test.dsk
jonno@ubuntu:~/disks$ ls -l test.dsk
-rw-r--r-- 1 jonno jonno 143360 2007-12-30 20:51 test.dsk
jonno@ubuntu:~/disks$
&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;Example 2 &amp;#8211; creating a compressed &lt;span class="caps"&gt;DOS 3&lt;/span&gt;.3 &lt;span class="caps"&gt;DSK&lt;/span&gt;:&lt;br /&gt;&lt;pre&gt;
&lt;code&gt;jonno@ubuntu:~/disks$ dsktool.rb --init dos33 test.dsk.gz
jonno@ubuntu:~/disks$ ls -l test.dsk.gz
-rw-r--r-- 1 jonno jonno 7290 2007-12-30 20:53 test.dsk.gz
jonno@ubuntu:~/disks$
&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;Example 3 &amp;#8211; creating an uncompressed &lt;span class="caps"&gt;NADOL DSK&lt;/span&gt; and cataloging it.&lt;br /&gt;&lt;pre&gt;
&lt;code&gt;jonno@ubuntu:~/disks$ dsktool.rb -cI nadol nadoltest.po
nadoltest.po
sector order:   physical
filesystem:     nadol
 16128 NADOL
jonno@ubuntu:~/disks$

&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;Next: &lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/AddingFilesToDiskImages"&gt;Adding Files To Disk Images&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 31 Dec 2007 12:03:24 Z</pubDate>
      <guid>http://instiki.jamtronix.com/dsktool/show/InitializingDiskImages</guid>
      <link>http://instiki.jamtronix.com/dsktool/show/InitializingDiskImages</link>
    </item>
    <item>
      <title>Getting started with dsktool</title>
      <description>&lt;p&gt;Once you&amp;#8217;ve finished &lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/Installing+dsktool"&gt;Installing dsktool&lt;/a&gt;, the first thing to learn is how to get help.&lt;br /&gt;type &amp;#8220;dsktool.rb -h&amp;#8221; for a list of all commands dsktool understands.&lt;/p&gt;


	&lt;p&gt;Here&amp;#8217;s what happens when try it with the curent version (0.4.2):&lt;br /&gt;&lt;pre&gt;&lt;code&gt;jonno@ubuntu:~$ dsktool.rb -h
dsktool.rb

Synopsis
--------
Manipulate DSK format files (as used by Apple 2 emulators)

Usage
-----
dsktool.rb [switches] &amp;lt;filename.dsk&amp;gt;

 -a | --add FILENAME       (*) add file
 -b | --base BASE          use BASE as address to load Binary File
                           this will add 2 bytes to the start of file
                           BASE should be a hex number
                           (can be prefixed with $, 0x, or nothing)
 -B | --bootcode FILENAME  FILENAME gets written to track 0, sector 0
                           FILENAME should be compiled to run at $0801
                           FILENAME can be up to 4Kb in size.
 -c | --catalog            display catalog
 -d | --dump FILENAME      hex dump
 -D | --diskdump           hex dump of entire disk
      --delete FILENAME    (*) delete named file
 -e | --extract FILENAME   extract file by name (either to stdout,
                           or file specified by --output)
 -h | --help               display this message
 -I | --init FILESYSTEM    initialise the disk with the specified filesytem
                           DSK will be created if it doesn't exist.
                           FILESYSTEM can be : prodos,dos33,nadol,pascal,none
 -l | --list FILENAME      monitor style listing (disassembles 65C02 opcodes)
 -o | --output FILENAME    specify name to save extracted file as
 -r | --raw                don't convert files to ASCII
 -S | --showtrace          show full stack trace on any error
 -t | --filetype FILETYPE  file type for file being added.
                           Can be a single letter (A/I/B/T) or number.
                           Default for DOS 3.3 is 0x00 (Text)
 -T | --tokenise           (*) tokenise input file before adding
 -v | --version            show version number
 -x | --explode            extract all files

  (*) options marked with an asterisk are only available for
      file systems that have READ/WRITE support.

       Currently supported filesystems:
               Apple Pascal         (read only)
               DOS 3.3              (READ/WRITE)
               NADOL                (READ/WRITE)
               ProDOS 8             (read only)

       Supports 16 sector DSK images
       files with extension .gz will be read &amp;#38; written using gzip
       input files can be URLs

examples:

       dsktool.rb -c http://jamtronix.com/dsks/apshai.dsk.gz
       dsktool.rb --list fid -o fid.lst DOS3MASTR.dsk
       dsktool.rb --extract "COLOR DEMOSOFT" DOS3MASTR.dsk
       dsktool.rb -e HELLO -o HELLO.bas DOS3MASTR.dsk
       dsktool.rb -x DOS3MASTR.dsk.gz -o /tmp/DOS3MASTR/
       dsktool.rb --add STARTUP -T nadol.po
       dsktool.rb --add c:\src\dosdemo\a.out -t B -b $2000 dosdemo.dsk
       dsktool.rb --init dos33 new_dos_disk.dsk.gz
       dsktool.rb --I none -B /tmp/a.out demo1.dsk

jonno@ubuntu:~$
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;Most commands have both a &amp;#8220;short&amp;#8221; form, consisting of one dash followed by single letter, and a &amp;#8220;long&amp;#8221; form consisting of two dashes followed by a full word. For example, the help command can be accessed either by &amp;#8221;-h&amp;#8221; or &amp;#8221;&amp;#8212;help&amp;#8221;.&lt;/p&gt;


	&lt;p&gt;Next: &lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/CatalogingDiskImages"&gt;Cataloging Disk Images&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 31 Dec 2007 11:52:03 Z</pubDate>
      <guid>http://instiki.jamtronix.com/dsktool/show/Getting+started+with+dsktool</guid>
      <link>http://instiki.jamtronix.com/dsktool/show/Getting+started+with+dsktool</link>
    </item>
    <item>
      <title>Cataloging Disk Images</title>
      <description>&lt;p&gt;The catalog command is accessed with either &amp;#8221;-c&amp;#8221; or &amp;#8221;&amp;#8212;catalog&amp;#8221;.&lt;/p&gt;


	&lt;p&gt;Here is an example, showing the contents of an &lt;a href="http://adtpro.sourceforge.net/"&gt;ADTPro&lt;/a&gt; disk image:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;jonno@ubuntu:~/ADTPro-1.0.3/disks$ dsktool.rb --catalog ADTPRO-1.0.3.PO
ADTPRO-1.0.3.PO
sector order:   physical
filesystem:     prodos
volume name:    ADTPRO.1.0.3
 12544   SYS : $2000    ADTPRO
 13428   SYS : $2000    ADTPROAUD
 15365   SYS : $2000    ADTPROETH
 10240   SYS : $2000    BASIC.SYSTEM
 16509   SYS : $0       PRODOS
  1220   BAS : $801     STARTUP
jonno@ubuntu:~/ADTPro-1.0.3/disks$

&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;Here&amp;#8217;s another example, which demonstrates that dsktool can access images hosted remotely (by providing the full &lt;span class="caps"&gt;URL&lt;/span&gt;) and also how dsktool can handle images compressed with &lt;a href="http://en.wikipedia.org/wiki/Gzip"&gt;gzip&lt;/a&gt; :&lt;br /&gt;&lt;pre&gt;
&lt;code&gt;jonno@ubuntu:~/ADTPro-1.0.3/disks$  dsktool.rb -c http://jamtronix.com/dsks/apshai.dsk.gz
http://jamtronix.com/dsks/apshai.dsk.gz
sector order:   physical
filesystem:     dos
 B 0256 ASCII
*B 2304 DATA1
*B 2304 DATA2
*B 2304 DATA3
*B 2304 DATA4
*A 13312 DM
 A 0256 HELLO
 A 0256 HELLO.OLD
*A 17408 INN
*B 0768 OBJ.1
*B 5888 OBJ.2
 B 2304 SHAPE1
 B 2304 SHAPE1.OLD
 B 2304 SHAPE2
 B 2304 SHAPE2.OLD
 B 2304 SHAPE3
 B 2304 SHAPE3.OLD
 B 2304 SHAPE4
 B 2304 SHAPE4.OLD
 B 2560 TEMPLE OF APSHAI RWTS
*A 4352 TITLE
 B 0512 TITLESHAPES
jonno@ubuntu:~/ADTPro-1.0.3/disks$
&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;Next: &lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/ExtractingFilesFromDiskImages"&gt;Extracting Files From Disk Images&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 30 Dec 2007 11:33:42 Z</pubDate>
      <guid>http://instiki.jamtronix.com/dsktool/show/CatalogingDiskImages</guid>
      <link>http://instiki.jamtronix.com/dsktool/show/CatalogingDiskImages</link>
    </item>
    <item>
      <title>NADOL</title>
      <description>&lt;h3&gt;NADOL &amp;#8211; Nibbles Away Disk Optimized Language&lt;/h3&gt;


	&lt;p&gt;&lt;span class="caps"&gt;NADOL&lt;/span&gt; is a &lt;span class="caps"&gt;DOS&lt;/span&gt; and interpreted language created for the &amp;#8220;Nibbles Away &lt;span class="caps"&gt;III&lt;/span&gt;&amp;#8221; disk copy utility.&lt;/p&gt;


	&lt;p&gt;&lt;span class="caps"&gt;NADOL&lt;/span&gt; images are 35 track, 16 sector. In order to use these images in &lt;a class="existingWikiWord" href="http://instiki.jamtronix.com/dsktool/show/AppleWin"&gt;Apple Win&lt;/a&gt;, you &lt;strong&gt;must use the .po file extension&lt;/strong&gt;. I have not tested under other emulators.&lt;/p&gt;


	&lt;p&gt;&lt;span class="caps"&gt;A NADOL&lt;/span&gt; disk has a catalog at track $00, sector $03 to track $00, sector $09&lt;/p&gt;


	&lt;h3&gt;CATALOG &lt;span class="caps"&gt;FORMAT&lt;/span&gt;&lt;/h3&gt;


Each entry in the catalog consists of $10 bytes, which are:
	&lt;ul&gt;
	&lt;li&gt;$00-$0B &amp;#8211; filename &amp;#8211; if file is deleted, first byte will be $FF. If first byte is $00, this catalog slot is empty.&lt;/li&gt;
		&lt;li&gt;$0C-$0D &amp;#8211; filesize (low byte first)&lt;/li&gt;
		&lt;li&gt;$0E &amp;#8211; track of track sector list sector&lt;/li&gt;
		&lt;li&gt;$0F &amp;#8211; sector of track sector list sector&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h3&gt;TRACK/SECTOR &lt;span class="caps"&gt;LIST FORMAT&lt;/span&gt;&lt;/h3&gt;


	&lt;p&gt;pairs of track/sectors in order. up to 128 entries (assumes that no file can be &gt; 128 sectors)&lt;/p&gt;


	&lt;h3&gt;SECTOR &lt;span class="caps"&gt;USAGE BITMAP&lt;/span&gt;&lt;/h3&gt;


	&lt;p&gt;The sector usage bitmap is at Track $00, Sector $2, from bytes $20 .. $65&lt;/p&gt;


	&lt;p&gt;There are two bytes for each track. The first (low) byte records usage of sectors $00..$07, the second (high) byte records usage of sectors $08..$0F. The high order bit represents the lowest sector (i.e. bit 7 in the low byte represents sector $00, bit 0 in the high byte represents sector $0F). If the bit is set, that means the sector is in use.&lt;/p&gt;


	&lt;h3&gt;External links:&lt;/h3&gt;


	&lt;p&gt;&lt;a href="http://www.textfiles.com/apple/DOCUMENTATION/nibbles.away.iii.txt"&gt;http://www.textfiles.com/apple/DOCUMENTATION/nibbles.away.iii.txt&lt;/a&gt;&lt;br /&gt;&lt;a href="http://boutillon.free.fr/Underground/Cours/Nibbles/Nibbles.html#REF"&gt;Deckard&amp;#8217;s &lt;span class="caps"&gt;NADOL&lt;/span&gt; page (site is in french, scanned documents are english)&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 30 Dec 2007 10:35:31 Z</pubDate>
      <guid>http://instiki.jamtronix.com/dsktool/show/NADOL</guid>
      <link>http://instiki.jamtronix.com/dsktool/show/NADOL</link>
    </item>
  </channel>
</rss>
