<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lallafa's Blog &#187; Amiga</title>
	<atom:link href="http://lallafa.de/blog/category/amiga/feed/" rel="self" type="application/rss+xml" />
	<link>http://lallafa.de/blog</link>
	<description>Personal Musings about the Commodore64, Macs and my other Hobby Projects</description>
	<lastBuildDate>Fri, 24 May 2013 07:31:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>plipbox 0.3 released</title>
		<link>http://lallafa.de/blog/2013/05/plipbox-0-3-released/</link>
		<comments>http://lallafa.de/blog/2013/05/plipbox-0-3-released/#comments</comments>
		<pubDate>Fri, 24 May 2013 07:30:09 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Amiga]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[plipbox]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=639</guid>
		<description><![CDATA[<p>It took quite a while but now a shiny new release of plibbox is available: The new version 0.3 is an AVR firmware and Amiga driver update and works on the same hardware as presented in 0.1 and 0.2.</p> <p>The major change in this release was motivated by Nitz76, one of my commenters in the <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2013/05/plipbox-0-3-released/">plipbox 0.3 released</a></span>]]></description>
			<content:encoded><![CDATA[<p>It took quite a while but now a shiny new release of <a title="plipbox" href="http://lallafa.de/blog/amiga-projects/plipbox/">plibbox</a> is available: The new version 0.3 is an AVR firmware and Amiga driver update and works on the same hardware as presented in 0.1 and 0.2.</p>
<p>The major change in this release was motivated by Nitz76, one of my commenters in the blog: plipbox firmware now implements a MAC bridge and no IP NAT gateway anymore (see this <a href="https://github.com/cnvogelg/plipbox/blob/master/doc/src/intro.md">technical introduction</a> for details on the differences). In short: While with the old firmware you created a point-to-point IP link from the Amiga to your plipbox and from there the traffic was NATed and routed to your local ethernet, the new approach directly presents an Ethernet card on the Amiga side and passes the Ethernet frames generated from the Amiga TCP/IP stack directly via PLIP to your local Ethernet.</p>
<p>This approach is much more compatible in your local network infrastructure as the NAT is avoided. The change required a larger rewrite of the SANA II driver and therefore I heavily modified the original MagPLIP implementation and renamed the new driver to <strong>plipbox.device</strong> (the new source code is now also hosted in the <a href="https://github.com/cnvogelg/plipbox/tree/master/amiga/src">plipbox source repository</a>). Please see the updated <a href="https://github.com/cnvogelg/plipbox/blob/master/doc/src/amiga.md">Amiga Setup</a> guide for installing this driver on the popular TCP/IP stacks including AmiTCP, Genesis, MiamiDX, and Roadshow.</p>
<p>The new MAC bridge made a lot of the TCP/IP code of plipbox obsolete and allowed me to shrink the firmware size considerably. Furthermore, setting up the firmware is <strong>zero-conf</strong> now, i.e. you don&#8217;t have to adjust any parameters for default operation.</p>
<p>This release now hosts all the <strong>docs on GitHub</strong> right next to the source. It is more convenient there to keep the docs in sync with the implementation and writing markdown is really fun! Another goodie in this release is the <strong>plipbox Emulator written in Python</strong> that allows to emulate a plipbox setup in FS-UAE. Its esoteric but really helpful for development: see my <a title="Emulating plipbox with FS-UAE" href="http://lallafa.de/blog/2013/05/emulating-plipbox-with-fs-uae/">previous log post</a> for details&#8230;</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2013/05/plipbox-0-3-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emulating plipbox with FS-UAE</title>
		<link>http://lallafa.de/blog/2013/05/emulating-plipbox-with-fs-uae/</link>
		<comments>http://lallafa.de/blog/2013/05/emulating-plipbox-with-fs-uae/#comments</comments>
		<pubDate>Wed, 22 May 2013 19:02:22 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Amiga]]></category>
		<category><![CDATA[Mac Stuff]]></category>
		<category><![CDATA[plipbox]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=628</guid>
		<description><![CDATA[<p>Recently, I had some time to spend and wanted to work on the plipbox project&#8217;s Amiga driver. Unfortunately, I only had my MacBook Pro with me and no Amiga or plipbox hardware.</p> <p>What does a SW developer do if the real hardware is not at hand?</p> <p>Yes, you write an emulator that represents the missing HW <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2013/05/emulating-plipbox-with-fs-uae/">Emulating plipbox with FS-UAE</a></span>]]></description>
			<content:encoded><![CDATA[<p>Recently, I had some time to spend and wanted to work on the <a title="plipbox" href="http://lallafa.de/blog/amiga-projects/plipbox/">plipbox</a> project&#8217;s Amiga driver. Unfortunately, I only had my MacBook Pro with me and no Amiga or plipbox hardware.</p>
<p>What does a SW developer do if the real hardware is not at hand?</p>
<p>Yes, you write an emulator that represents the missing HW in SW on a machine you have access to&#8230;</p>
<h3><span id="more-628"></span> Adding a Virtual Parallel Port Protocol in FS-UAE</h3>
<p>That said, I installed all required Amiga SW in a virtual environment in <a href="http://fs-uae.net">FS-UAE</a> on my Mac and soon I had my <strong>plipbox.device</strong> SANA II driver talking with the virtual parallel port in FS-UAE. What was missing now is a protocol that communicates the complete I/O state from FS-UAE to another process. Then I could write a standalone application that does emulate the plipbox firmware and plipbox.device in FS-UAE would be operational.</p>
<p>I defined a simple two-byte bi-directional protocol called <strong><a href="https://github.com/cnvogelg/fs-uae-gles/blob/chris-devel/vpar.md">vpar</a></strong> that communicates any change in the emulation of FS-UAE&#8217;s Amiga parallel port to an external process and also receives external changes for input lines from the process and realizes them in FS-UAE&#8217;s emulated parallel port.</p>
<p>Having a POSIX compatible system with pseudo-terminals (ptys) I devised the link between both processes as a simple file-open interface in FS-UAE and a pty in the plipbox emulator (Note: any other interprocess mechanism works here also but this one was very easy to add in FS-UAE).</p>
<p>The setup looks like this:</p>
<pre>        +----------+                                  +---------+
        | plipbox  |                                  | patched |
        | emulator |--(opens)--&gt; [PTY] &lt;--(file I/O)--| FS-UAE  |
        +----------+                                  +---------+
                    &lt;--------- vpar protocol --------&gt;</pre>
<p>All required changes to FS-UAE are available in my clone of the FS-UAE repository on <a href="https://github.com/cnvogelg/fs-uae-gles/tree/chris-devel">GitHub</a> in the `chris-devel` branch.</p>
<p>For the plipbox emulator application I chose my favorite script language Python. With it setting up the pty for inter-process communication and implementing the vpar protocol peer was done in a few hours.</p>
<h3>Setting up the Network</h3>
<p>Ok, the plipbox emulator in Python can now talk PLIP via vpar&#8217;s virtual parallel port. The next step is to add access to an Ethernet device on the lowest frame level for our plipbox emulator.</p>
<p>I had a look at the <a href="http://www.tcpdump.org">pcap</a> library that allows injecting packets into an existing adapter, but the Python bindings often lacked the inject feature of the library and so I dropped this idea.</p>
<p>Then I found a setup using a <a href="http://en.wikipedia.org/wiki/TUN/TAP">TAP</a> device to easily create and receive ethernet packets from a user space application. Combine this with a real ethernet adapter via an interface bridge and you have access to real ethernet with a simple TAP file I/O interface (opening /dev/tap0) from your application.</p>
<p>The setup looks like this:</p>
<pre>        +----------+              +---------+                +----------+
        | Real Eth |              | TAP     |                | plipbox  |
        | Adapter  |&lt;-- Bridge --&gt;| Adapter |&lt;-- File I/O --&gt;| emulator |
        +----------+              +---------+                +----------+
           en1         bridge0       tap0
           +----- OS net interfaces ----+</pre>
<p>For the real ethernet adapter I use a second USB ethernet adapter on my Mac that is not configured (IP: 0.0.0.0) but active (up) in Mac OS X. This way OS X does not use it and my emulator can use it exclusively.</p>
<p>Creating the TAP device and building the bridge with the real adapter is done with some sudo&#8217;ed system command right in the startup of the emulator.</p>
<p>Note: the TAP driver is not shipped with Mac OS X itself, but you can add it by installing the ones from the <a href="http://tuntaposx.sourceforge.net">TUN TAP OSX</a> project.</p>
<h3>Putting it all together</h3>
<p>On top of the vpar Python module I implemented the magPLIP protocol layer in an own Python class. Now all pieces to create the plipbox were available.</p>
<p>The plipbox main script sets up the vpar, magplip, and ethernet with TAP and interface bridge. In the main loop it does I/O multi-plexing with select() on the file descriptor for the vpar PTY and for the TAP file.</p>
<p>A packet arriving from TAP is filtered (i.e. multicast and unknown broadcasts are removed) similar to the real plipbox firmware and then delivered to the emulated Amiga via the vpar connection.</p>
<p>A packet incoming via PLIP is directly delivered to the local network and thus written to the TAP file.</p>
<p>That&#8217;s it! A working plipbox running as a Python script on my Mac&#8230; Similar to the firmware I added some optional debugging output to see the packet contents and to measure the timing and latency. Now I can develop and test the plipbox.device driver with the emulated environment&#8230;</p>
<h3>Sneak a Peek?</h3>
<p>The plipbox emulator will be shipped with the upcoming version 0.3 of plipbox. If you want to have a look already then head over to my <a href="https://github.com/cnvogelg/plipbox">GitHub</a> repository where all development takes place&#8230; Have a look in the <strong>python</strong> and <strong>doc</strong> dirs <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2013/05/emulating-plipbox-with-fs-uae/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vamos runs on Windows now</title>
		<link>http://lallafa.de/blog/2012/11/vamos-runs-on-windows-now/</link>
		<comments>http://lallafa.de/blog/2012/11/vamos-runs-on-windows-now/#comments</comments>
		<pubDate>Sun, 18 Nov 2012 18:18:22 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Amiga]]></category>
		<category><![CDATA[Mac Stuff]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[vamos]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=572</guid>
		<description><![CDATA[<p>User kyberias was so kind to port the native part of vamos (the m68k emulation) to Windows and send me his patches for inclusion. The port is now included in my source tree and Windows user can now enjoy using vamos on their platform, too. Have a look at the README.WIN for build instruction.</p> <p>With <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2012/11/vamos-runs-on-windows-now/">vamos runs on Windows now</a></span>]]></description>
			<content:encoded><![CDATA[<p>User <a href="https://github.com/kyberias">kyberias</a> was so kind to port the native part of vamos (the m68k emulation) to Windows and send me his patches for inclusion. The port is now included in my source tree and Windows user can now enjoy using vamos on their platform, too. Have a look at the <a href="https://github.com/cnvogelg/amitools/blob/master/README.WIN">README.WIN</a> for build instruction.</p>
<p>With Mac OS X and Linux/*nix support available since the beginning, vamos is now available on all major platforms.. Yay!</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2012/11/vamos-runs-on-windows-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>added new amitool: xdfscan</title>
		<link>http://lallafa.de/blog/2012/10/added-new-amitool-xdfscan/</link>
		<comments>http://lallafa.de/blog/2012/10/added-new-amitool-xdfscan/#comments</comments>
		<pubDate>Wed, 03 Oct 2012 15:41:34 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Amiga]]></category>
		<category><![CDATA[amitools]]></category>
		<category><![CDATA[Mac Stuff]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=557</guid>
		<description><![CDATA[<p>I added a new tool to amitools, my set of cross platform classic Amiga tools: xdfscan!</p> <p>What does this tool do?</p> <p>Its a disk image file scanner that inspects Amiga disk (.adf) or hard disk (.hdf) image files for AmigaOS OFS or FFS file systems. If such a file system is found then the scanner <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2012/10/added-new-amitool-xdfscan/">added new amitool: xdfscan</a></span>]]></description>
			<content:encoded><![CDATA[<p>I added a new tool to <a title="amitools" href="http://lallafa.de/blog/amiga-projects/amitools/">amitools</a>, my set of cross platform classic Amiga tools: <a title="xdfscan" href="http://lallafa.de/blog/amiga-projects/amitools/xdfscan/">xdfscan</a>!</p>
<p>What does this tool do?</p>
<p>Its a disk image file scanner that inspects Amiga disk (.adf) or hard disk (.hdf) image files for AmigaOS OFS or FFS file systems. If such a file system is found then the scanner runs a validator that does an in-depth check of the whole file system structure. If anything does not match or does not fulfill the file system specification then error or warning messages are generated. Warnings are usually not critical and the files on the image are all accessible, but error messages may hint to file corruption in the image. In the latter case it is advisable to recover the image by running a <a title="xdftool" href="http://lallafa.de/blog/amiga-projects/amitools/xdftool/">xdftool</a> repack command or by issuing a DiskSalv running on an emulator.</p>
<p>This tool either scans a single disk image file or scans through a full directory tree. The latter operation allows you to quickly scan your disk image collection with a single run&#8230;</p>
<p>Have fun scanning your disk collections for corrupt or even broken images&#8230; (I must admit that the scanner is really picky and it found some issues on images I believed that were running Ok for years on a real machine&#8230; So don&#8217;t panic if lots of warnings or errors are reported&#8230; AmigaOS is quite robust handling these disks without reporting trouble&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2012/10/added-new-amitool-xdfscan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>plipbox 0.2: added support for AVR-NET-IO board</title>
		<link>http://lallafa.de/blog/2012/09/plibox-0-2-added-support-for-avr-net-io-board/</link>
		<comments>http://lallafa.de/blog/2012/09/plibox-0-2-added-support-for-avr-net-io-board/#comments</comments>
		<pubDate>Sun, 02 Sep 2012 10:05:44 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Amiga]]></category>
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=548</guid>
		<description><![CDATA[ <p>I discovered a new board that is even more suitable for plipbox than the Arduino: It’s called the AVR-NET-IO and is available from german electronics distributor Pollin. Its fairly cheap (20 EUR for the kit) and you can also buy it pre-assembled (28 EUR). It contains all things we need: an AVR ATmega32, the <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2012/09/plibox-0-2-added-support-for-avr-net-io-board/">plipbox 0.2: added support for AVR-NET-IO board</a></span>]]></description>
			<content:encoded><![CDATA[<div>
<p><a href="http://lallafa.de/blog/wp-content/uploads/2012/07/plipbox-avrnetio.jpg"><img class="aligncenter size-medium wp-image-542" title="plipbox-avrnetio" src="http://lallafa.de/blog/wp-content/uploads/2012/07/plipbox-avrnetio-300x153.jpg" alt="" width="300" height="153" /></a>I discovered a new board that is  even more suitable for plipbox than the Arduino: It’s called the  AVR-NET-IO and is available from german electronics distributor Pollin.  Its fairly cheap (20 EUR for the kit) and you can also buy it  pre-assembled (28 EUR). It contains all things we need: an AVR ATmega32,  the right ethernet chip (ENC 28j60) and even the DB 25 connector for  the parallel port of the Amiga!</p>
<p>Only a single wire is missing to make it fully compatible to plipbox. But you can add this one easily…</p>
<p>I added support for this board to the firmware and with <a title="plipbox" href="http://lallafa.de/blog/amiga-projects/plipbox/">v0.2</a> I ship a  new firmware image just for this board… Besides adding the new board  nothing has changed in this release. So Arduino users can still stay at  v0.1 without any drawbacks.</p>
<p>See the plipbox <a title="plipbox hardware" href="http://lallafa.de/blog/amiga-projects/plipbox/plipbox-hardware/">hardware</a> and <a title="plipbox firmware" href="http://lallafa.de/blog/amiga-projects/plipbox/plipbox-firmware/">firmware</a> page for all details on the new board.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2012/09/plibox-0-2-added-support-for-avr-net-io-board/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>plipbox firmware 0.1 released</title>
		<link>http://lallafa.de/blog/2012/07/plipbox-firmware-0-1-released/</link>
		<comments>http://lallafa.de/blog/2012/07/plipbox-firmware-0-1-released/#comments</comments>
		<pubDate>Sun, 22 Jul 2012 15:30:30 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Amiga]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Mac Stuff]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=536</guid>
		<description><![CDATA[<p>The wait is over: the first firmware release of the plipbox project is available. Simply head over to my plipbox page and fetch your copy&#8230;</p> <p>The first release includes full DHCP support and statically configured Ethernet operation, so it should work on most local networks out there. With ARP and TCP/UDP/IP bridging in place, it <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2012/07/plipbox-firmware-0-1-released/">plipbox firmware 0.1 released</a></span>]]></description>
			<content:encoded><![CDATA[<p>The wait is over: the first firmware release of the plipbox project is available. Simply head over to my <a title="plipbox" href="http://lallafa.de/blog/amiga-projects/plipbox/">plipbox page</a> and fetch your copy&#8230;</p>
<p>The first release includes full DHCP support and statically configured Ethernet operation, so it should work on most local networks out there. With ARP and TCP/UDP/IP bridging in place, it has all essential features I envisioned for this project already available&#8230; And it really works well: I am already totally used to have my Amiga 500 in the network&#8230; (without thinking about starting a SLIP server first <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Now I hope that it works for you, too&#8230; just drop me a comment if you found bugs or have any remarks!</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2012/07/plipbox-firmware-0-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing plipbox</title>
		<link>http://lallafa.de/blog/2012/07/introducing-plipbox/</link>
		<comments>http://lallafa.de/blog/2012/07/introducing-plipbox/#comments</comments>
		<pubDate>Mon, 02 Jul 2012 18:12:20 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Amiga]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Mac Stuff]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=519</guid>
		<description><![CDATA[<p>My plip2slip project was the first attempt to build a cheap but quite powerful network adapter for my unmodified classic Amiga 500 to get it to the net. Its already a lot faster than a Paula based serial link but you need a host Mac/PC speaking SLIP to finally reach the Internet&#8230;</p> <p>The next level <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2012/07/introducing-plipbox/">Introducing plipbox</a></span>]]></description>
			<content:encoded><![CDATA[<p>My <a title="plip2slip" href="http://lallafa.de/blog/amiga-projects/plip2slip/">plip2slip</a> project was the first attempt to build a cheap but quite powerful network adapter for my unmodified classic Amiga 500 to get it to the net. Its already a lot faster than a Paula based serial link but you need a host Mac/PC speaking SLIP to finally reach the Internet&#8230;</p>
<p>The next level is called the <a title="plipbox" href="http://lallafa.de/blog/amiga-projects/plipbox/">plipbox</a> project: Starting from a similar setup with an Arduino board I now added a cheap Ethernet module that allows direct access to your local network. Here is a photo of the resulting device:</p>
<p><a href="http://lallafa.de/blog/wp-content/uploads/2012/07/plipbox.jpg"><img class="aligncenter size-medium wp-image-502" title="plipbox" src="http://lallafa.de/blog/wp-content/uploads/2012/07/plipbox-300x147.jpg" alt="" width="300" height="147" /></a></p>
<p>The parallel connector is connected to your Amiga and the Ethernet cable is connected to the network module. Now run a TCP Stack on your Amiga with a MagPLIP network device driver and you can reach the Internet from your Amiga via plipbox&#8230; (The third cable on the left is the USB Arduion serial port I use to configure the parameters of the device like IP addresses)</p>
<p><span id="more-519"></span>The project is not completed yet, but already at a stage where you can actually use it and play with it!</p>
<p>The hardware design is already completely done and really simple to reproduce. Have a look a the <a title="plipbox hardware" href="http://lallafa.de/blog/amiga-projects/plipbox/plipbox-hardware/">hardware page</a> for all the glory details.</p>
<p>On the software side there is still some clean up left to do but all basic things are working and I am already surfing the net with up to 50 KiB/s on my Amiga&#8230;</p>
<p>The complete source is open source (as usual!) and accessible on my GitHub repository: <a href="https://github.com/cnvogelg/plipbox">cnvogelg/plipbox</a>. There you can follow the development. Currently only the source is available. So you need to build your own firmware image with a gcc-avr toolchain. I&#8217;ll release pre-build firmware snapshots next.</p>
<p>Already done in firmware:</p>
<ul>
<li>two network interfaces modeled in plibpox:
<ul>
<li>internal PLIP point-2-point interface (192.168.0.1 fixed IP) (e.g. use 192.168.0.2 on your Amiga)</li>
<li>external Ethernet interface (either configurable fixed IP or via DHCP)</li>
</ul>
</li>
<li>serial terminal to configure all parameters</li>
<li>full IP (UDP + TCP) bridging between both interfaces</li>
<li>ARP support on Ethernet</li>
</ul>
<p>I hope you like the project and stay tuned for the first release&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2012/07/introducing-plipbox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CF card partitioning with rdbtool</title>
		<link>http://lallafa.de/blog/2012/04/cf-card-rdbtool/</link>
		<comments>http://lallafa.de/blog/2012/04/cf-card-rdbtool/#comments</comments>
		<pubDate>Fri, 06 Apr 2012 12:50:59 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Amiga]]></category>
		<category><![CDATA[amitools]]></category>
		<category><![CDATA[Mac Stuff]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=461</guid>
		<description><![CDATA[<p>Here is my little easter present for you: I finished the first release of rdbtool. &#8220;What&#8217;s that?&#8221; you may ask. It&#8217;s a new member of amitools, a family of cross-platform Classic Amiga tools I am developing. rdbtool is a command line utility that allows you to inspect, change or create new disk images or even <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2012/04/cf-card-rdbtool/">CF card partitioning with rdbtool</a></span>]]></description>
			<content:encoded><![CDATA[<p>Here is my little easter present for you: I finished the first release of <a title="rdbtool" href="http://lallafa.de/blog/amitools/rdbtool/">rdbtool</a>. &#8220;What&#8217;s that?&#8221; you may ask. It&#8217;s a new member of <a title="amitools" href="http://lallafa.de/blog/amitools/">amitools</a>, a family of cross-platform Classic Amiga tools I am developing. rdbtool is a command line utility that allows you to inspect, change or create new disk images or even real disks with Amiga&#8217;s RDB partitioning format. Its a companion tool to <a title="xdftool" href="http://lallafa.de/blog/amitools/xdftool/">xdftool</a> that handles Amiga&#8217;s file system in disk images or on the RDB partitions.</p>
<p>I had the idea for this tool while changing the CF flash card of my A1200. I removed the old card, had look at the files found there and wanted to retrieve files from there and then set up a new shiny card and build up partitions there. The current way to accomplish this, is to dump the card&#8217;s raw data from the block device and use this image as a RDB hard disk image in UAE to retrieve the files from there. Same thing with partitioning the new card: mount the block device or an empty image in UAE, run HDToolBox there, format partitions and copy files around in the virtual Amige environment&#8230; This works, but its a roundabout way. I wanted to have a nifty tool the works directly on my Mac&#8217;s Terminal&#8230; <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Read on to see how this task (and lots more!) can be achieved with rdbtool&#8230;</p>
<h4><span id="more-461"></span>Inspecting an old CF Card</h4>
<p>Ok, here we go: I unmount the CF card from the A1200 and insert it into my CF card USB reader on my Mac. Mac OS X tells me that it can&#8217;t find a valid file system on it (and that&#8217;s true for osx <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) &#8211; we ignore this and cancel the request to initalize (= format) it. First thing is now to find out the block device for this disk. On OS X I call a:</p>
<pre>&gt; diskutil list</pre>
<p>and it gives me:</p>
<pre>/dev/disk2
 #:                       TYPE NAME                    SIZE       IDENTIFIER
 0:                                                   *4.0 GB     disk2</pre>
<p>The empty Type Name gives you the hint that the partioning format is not recognized by OS X! So, it&#8217;s <strong>/dev/disk2</strong>&#8230; On Linux or other Posix systems the naming of raw block devices is slighty different (e.g. /dev/sd?). Just have a look at your system manuals (or dmesg) for details&#8230;</p>
<p>Now I use rdbtool to list the partition setup directly on the card:</p>
<pre>&gt; rdbtool /dev/disk2 info
PhysicalDisk:               0     7817     7880544  3.8Gi  heads=16 sectors=63
LogicalDisk:                2     7817     7878528  3.8Gi  rdb_blks=[0:2015,#2016] used=[hi=60,#61] cyl_blks=1008
Partition: #0 'CDH0'        2      103      102816   50Mi    1.31%  DOS3 bootable pri=0
Partition: #1 'DH0'       104      205      102816   50Mi    1.31%  DOS3
Partition: #2 'DH1'       206     2035     1844640  900Mi   23.41%  DOS3
Partition: #3 'DH2'      2036     3763     1741824  850Mi   22.11%  DOS3
Partition: #4 'DH3'      3764     3909      147168   71Mi    1.87%  DOS3
Partition: #5 'CDH1'     3910     3971       62496   30Mi    0.79%  DOS3
Partition: #6 'DH4'      3972     4124      154224   75Mi    1.96%  DOS3
Partition: #7 'DH5'      4125     5953     1843632  900Mi   23.40%  DOS3
Partition: #8 'DH6'      5954     7817     1878912  917Mi   23.85%  DOS3
FileSystem #0 DOS1 version=40.1 size=24588 seg_list_blk=0xb global_vec=0xffffffff</pre>
<p>Wow! Got a lot of partitions there&#8230; With the drive names (DH0, &#8230;) at hand you use xdftool to access the file system on each partition (I use -r option here to enable read-only mode &#8211; just for safety reasons):</p>
<pre>&gt; xdftool -r /dev/disk2 open part=DH1 + list
Games 1                                          VOLUME  --------  29.03.1993 11:35:33 t46 
  Disk.info                                         364  ----rw-d  29.03.1993 11:35:33 t47
...</pre>
<p>With the unpack command of <a title="xdftool" href="http://lallafa.de/blog/amitools/xdftool/">xdftool</a> I was able to easily recover all files of a partition into a directory structure on my Mac.</p>
<p>The info output also showed that a file system driver was also embedded in the RDB structure. You can use the <strong>fsget</strong> command to retrieve the Amiga loadSeg()able binary:</p>
<pre>&gt; rdbtool /dev/disk2 fsget 0 ffs</pre>
<p>0 is the number of the first and only file system driver on this disk and &#8220;ffs&#8221; is the local Mac file name for the binary:</p>
<pre>&gt; ls -la ffs
-rw-r--r--  1 chris  staff  24588  6 Apr 13:48 ffs
</pre>
<p>You can also have a closer look of the internals of the RDB structure with the <em>map</em> and <em>show</em> commands. Map shows the contents of the RDB area and describes the contents of each block (see rdbtool page for details) while show dumps all blocks describing the RDB:</p>
<pre>&gt; rdbtool /dev/disk2 map
000000:  RD P0 P1 P2 P3 P4 P5 P6 P7 P8 F0 F0 F0 F0 F0 F0
000016:  F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0
000032:  F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0
000048:  F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 -- -- --
...</pre>
<pre>&gt; rdbtool /dev/disk2 show
RigidDiskBlock(0):
 types:     5244534b/0 (valid: 5244534b/0)
 chksum:    0x7471bb06 (got) 0x7471bb06 (calc)
 valid:     True
 size:           64
 host_id:        7
 block_size:     512
 flags:          0x00000017
 badblk_list:    none
 part_list:      1
 fs_list:        10
 init_code:      none
...</pre>
<p>While working on a real disk you do not want to alter, it is advisable to either use the -r switch to enable <strong>read-only mode</strong> in rdbtool or simply copy the whole disk into a <strong>disk image</strong> and work on the image (if you have the disk space available, of course!):</p>
<pre>&gt; dd if=/dev/disk2 of=disk.rdb bs=512
&gt; rdbtool disk.rdb list</pre>
<p>That&#8217;s it for inspecting an existing RDB disk. Now let&#8217;s create an own, new one&#8230;</p>
<h5>Partitioning a new Disk</h5>
<p>Insert a shiny new CF card into your card reader. Typically some FAT file system already resides on a partition of the card. First thing is to remove the existing partioning layout. On OSX I do (for /dev/disk1):</p>
<pre>&gt; diskutil partitionDisk disk1 free none 100%</pre>
<p>Now rdbtool can access the disk. The first command we will issue is an<strong> init</strong>, it will create an empty RDB block on the disk. The info will show an empty layout:</p>
<pre>&gt; rdbtool /dev/disk1 init + info
PhysicalDisk:               0    61999     1984000  968Mi  heads=1 sectors=32
LogicalDisk:                1    61999     1983968  968Mi  rdb_blks=[0:31,#32] used=[hi=0,#1] cyl_blks=32</pre>
<p>A logical RDB disk is created automatically but no partition exist yet. So let&#8217;s add some! The <strong>add</strong> command adds a partition and only requires a size given either in percent (20%), bytes (2Mb), KiBytes (2Mib), or cylinders (20). If no start is given then the next free region on the logical disk is chosen:</p>
<pre>&gt; rdbtool /dev/disk1 add size=50Mib + add size=100Mib + fill + info
PhysicalDisk:               0    61999     1984000  968Mi  heads=1 sectors=32
LogicalDisk:                1    61999     1983968  968Mi  rdb_blks=[0:31,#32] used=[hi=3,#4] cyl_blks=32
Partition: #0 'DH0'         1     3200      102400   50Mi    5.16%  DOS3
Partition: #1 'DH1'      3201     9600      204800  100Mi   10.32%  DOS3
Partition: #2 'DH2'      9601    61999     1676768  818Mi   84.52%  DOS3
</pre>
<p>Note the <strong>fill</strong> command: It will create a partition to fill the remaining space on the logical disk.</p>
<p>You can alter settings of a partition with the <strong>change</strong> command: I use it to make the first partition bootable and set its priority:</p>
<pre>&gt; rdbtool /dev/disk1 change DH0 bootable pri=10 + info
...
Partition: #0 'DH0'         1     3200      102400   50Mi    5.16%  DOS3 bootable pri=10
...</pre>
<p>(See <a title="rdbtool" href="http://lallafa.de/blog/amitools/rdbtool/">rdbtool manual page</a> for more options). You can also pass these options to the add command in the previous step for a more compact usage of the tool.</p>
<p>The partition layout is already finished, the only thing I&#8217;d like to add to my RDB is the FFS file system driver restored from the old card (see above):</p>
<pre>&gt; rdbtool /dev/disk1 fsadd ffs + info
ERROR adding filesystem! (no space in RDB left)</pre>
<p>Oops! There is not enough space left for the file system. I have to recreate the RDB with more space reserved for the filesystem (see rdb_cyls = reserve a number of cylinders for RDB usage):</p>
<pre>&gt; rdbtool /dev/disk1 init rdb_cyls=2 + add size=50Mib bootable pri=10 + add size=100Mib + fill + fsadd ffs + info
PhysicalDisk:               0    61999     1984000  968Mi  heads=1 sectors=32
LogicalDisk:                2    61999     1983936  968Mi  rdb_blks=[0:63,#64] used=[hi=54,#55] cyl_blks=32
Partition: #0 'DH0'         2     3201      102400   50Mi    5.16%  DOS3 bootable pri=10
Partition: #1 'DH1'      3202     9601      204800  100Mi   10.32%  DOS3
Partition: #2 'DH2'      9602    61999     1676736  818Mi   84.52%  DOS3
FileSystem #0 DOS1 version=40.1 size=24588</pre>
<p>Voila! Everything set up in a single command <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>RDB work is done now! (See <a title="rdbtool" href="http://lallafa.de/blog/amitools/rdbtool/">rdbtool page</a> for lots of more commands available in this tool). Now let&#8217;s head over to <a title="xdftool" href="http://lallafa.de/blog/amitools/xdftool/">xdftool</a> and format the partitions:</p>
<pre>&gt; xdftool /dev/disk1 open part=dh0 + format System
&gt; xdftool /dev/disk1 open part=dh1 + format Work
&gt; xdftool /dev/disk1 open part=dh2 + format Data</pre>
<p>Now everything is partitioned and formatted for AmigaDOS use. Typically, you want to boot from the first partition, so its advisable to fill it now. In my case I used the pack command of xdftool to restore the Workbench files I recovered with unpack from my old card&#8230;</p>
<p>With this approach, setting up an Amiga disk drive on your Mac is done in seconds with rdbtool and xdftool. No need to boot up an emulator, just plain native tools <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  I hope you enjoyed this little introduction and find the tools as useful as I do&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2012/04/cf-card-rdbtool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xdftool updated</title>
		<link>http://lallafa.de/blog/2012/02/xdftool-updated/</link>
		<comments>http://lallafa.de/blog/2012/02/xdftool-updated/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 17:40:18 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Amiga]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[xdftool]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=447</guid>
		<description><![CDATA[<p>Since my last report on xdftool I have updated a few things:</p> added support for RBD/RDSK hdf images changed repack command to be more flexible added open/create commands for better control of disk image geometry <p>In the following I give you a short round up of all new features by giving you some examples&#8230;</p> 1. <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2012/02/xdftool-updated/">xdftool updated</a></span>]]></description>
			<content:encoded><![CDATA[<p>Since my last report on xdftool I have updated a few things:</p>
<ul>
<li>added support for RBD/RDSK hdf images</li>
<li>changed repack command to be more flexible</li>
<li>added open/create commands for better control of disk image geometry</li>
</ul>
<p>In the following I give you a short round up of all new features by giving you some examples&#8230;</p>
<h4><span id="more-447"></span>1. RDB Support</h4>
<p>One very nasty thing when working with HDF image files is the fact that the extension .hdf is actually used for two types of different disk images in the context of Amiga emulation.</p>
<p>The first type is a disk image like a big floppy disk dump, i.e. it only contains a number of blocks and on these blocks an Amiga file system (like OFS or FFS) is located. Thats the way a floppy handles data. But in comparison with a floppy disk, a HDF has no pre-defined or fixed size. You can use every size for a HDF if you like. Now the drawback with these images is that you do not know the disk geometry (given in cylinders, heads, and sectors) directly but only the total size in bytes or blocks. You have to apply some magic (here: algorithms) to deduce the correct geometry. So this type of disk image is only fully useable if you know the disk geometry as external information. I call this type a <strong>partition HDF image</strong> because this type of image can be created by extracting the contents of a disk partition into an image file.</p>
<p>The other type I call a <strong>whole disk HDF image</strong> because it stores the whole contents of the disk. This includes some blocks describing the paritions found on this disk. This information starts with a RDISK/RDB (Rigid Disk Block) and thus images containing paritioning informations on an Amiga called like this first block RDB. The RDB references information on all partitions and knowns how large they are, what disk geometry the use locally and what file systems reside on them. Additionally, each partition has a AmigaOS device name associated so you can address them on your Amiga (e.g. dh0, dh1, &#8230;). An RDB is typically set up on a blank disk with the HDToolBox program on AmigaOS (soon you can use amitools&#8217; rdbtool for that &#8211; but thats another story/blog post <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ).</p>
<p>I distuingish these two types by naming my images differently: partition HDFs with *.hdf and disk images with *.rdsk, but thats my personal approach and unfortonately not widely used.</p>
<p>I added support of these RDB images to xdftool fully transparently, i.e. you simply specify a *.hdf file of any of the two types and xdftool will do the right thing. If its a <strong>partition HDF</strong> then there is only one file system and you can work with this one immediately:</p>
<pre>&gt; xdftool wb31.hdf blkdev
cylinders:   1280
heads:       1
sectors:     32
block_bytes: 512
reserved:    2
bootblocks:  2
</pre>
<p>This command prints the disk geometry detected from the byte size of the disk image. If the detection went wrong you can specify the new <strong>open</strong> command and give the missing parameters:</p>
<pre>&gt; xdftool wb31.hdf open chs=640,2,32 + blkdev
cylinders:   640
heads:       2
sectors:     32
block_bytes: 512
reserved:    2
bootblocks:  2</pre>
<p>This forces a disk geometry of 10 cylinders, 2 heads and 32 sectors. Another approach is to still use auto-detection but guide it by giving the heads or/and sectors count:</p>
<pre>&gt; xdftool wb31.hdf open h=2 + blkdev
cylinders:   640
heads:       2
sectors:     32
block_bytes: 512
reserved:    2
bootblocks:  2</pre>
<p>With a <strong>RDB/RDSK whole disk image</strong> you do not need to specify any geometry as this information is stored in the RDB structure. The only thing you have to specify is what partition shall xdftool work on. As xdftool only works on file system level you have to choose the partition either by giving the device name of AmigaOS (e.g. dh0, dh1) or the index number (starting with 0 for the first partition):</p>
<pre>&gt; xdftool wb31.rdsk open part=dh1 + list</pre>
<p>This list the contents of the second partition on my wb31 whole disk image (being dh0 the first partition). If you do not specify a partition then xdftool automatically takes the first partition:</p>
<pre>&gt; xdftool wb31.rdsk list</pre>
<h4>2. New Create Command</h4>
<p>With the new open command in place I added a new <strong>create</strong> command to create empty disk images of a given size. For ADFs the size is pre-defined so you need no extra arguments:</p>
<pre>&gt; xdftool empty.adf create   # create empty (and unformatted) floppy disk image
</pre>
<p>but for a (partition) HDF you have to give the size. You can either give a size in bytes (with short cuts for M)ega G)iga&#8230; and &#8216;i&#8217; for KiBi units) and use the internal algorithm for disk geometry or directly specify &#8220;chs&#8221; (cylinder, heads, and sectors):</p>
<pre>&gt; xdftool empty.hdf create size=10Mi
&gt; xdftool empty.hdf create chs=10,1,32
&gt; xdftool empty.hdf create size=10Mi h=2</pre>
<p>In the last example you see that you can also hint the disk geometry algorithm and specify the heads count (similar to the open command above).</p>
<p>Note: you will need to format this image before usage</p>
<p>2nd Note: you cannot create a full RDB/RDSK image with xdftool. Use HDToolBox on your Amiga (or soon: rdbtool) for that!</p>
<p>Typically You use a create command followed by a format command to create a file system you can work with:</p>
<pre>&gt; xdftool new.adf create + format MyDisk
&gt; xdftool work.hdf create size=10Mi + format Work ffs</pre>
<p>As this is used very often the format can do an implicit create if you simply omit the create command. Then you have to specify the options for create with the format command:</p>
<pre>&gt; xdftool new.adf format MyDisk
&gt; xdftool work.hdf format Work size=10Mi ffs</pre>
<h4>3. Repack Command Changed</h4>
<p>With the rework done handling rdisk and hdf I had to change the existing repack command. In older xdftool version you specify a new image as argument and the given image on the xdftool command line was the source. This is now flipped:</p>
<pre>&gt; xdftool old.hdf repack new.hdf   # OLD syntax
&gt; xdftool new.hdf repack old.hdf  # NEW syntax</pre>
<p>I changed it to make its usage more versatile: You can give open like options (see above) in the repack command to specify the source image:</p>
<pre>&gt; xdftool new.hdf repack old.rdsk part=dh0  # repack first partition into new partition image
&gt; xdftool new.hdf repack old.hdf chs=10,2,32   # repack old image with given geometry</pre>
<p>(Note: if you get an error that the new image can&#8217;t created then either remove the existing file first or specify the -f force option). Now you can also create a new image with different size or layout and repack all data into it:</p>
<pre>&gt; xdftool new.hdf create size=10Mi + repack wb31.hdf  # move my wb disk into a larger image
&gt; xdftool disk.rdsk open part=dh0 + repack wb31.hdf # move my wb disk into a partition</pre>
<p>That&#8217;s it! Have Fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2012/02/xdftool-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mastering ADF/HDF Images with xdftool</title>
		<link>http://lallafa.de/blog/2012/01/mastering-adfhdf-images-with-xdftool/</link>
		<comments>http://lallafa.de/blog/2012/01/mastering-adfhdf-images-with-xdftool/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 21:28:43 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Amiga]]></category>
		<category><![CDATA[Mac Stuff]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=438</guid>
		<description><![CDATA[<p>My Amiga cross development environment on my Mac is getting really useful now: with vamos running the SAS C compiler I can create Amiga binaries with ease. With the binaries in place I want to try them on the real machine, too. For my trusty old Amiga 500, I still use disks to transfer the <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2012/01/mastering-adfhdf-images-with-xdftool/">Mastering ADF/HDF Images with xdftool</a></span>]]></description>
			<content:encoded><![CDATA[<p>My Amiga cross development environment on my Mac is getting really useful now: with<a title="Building a “real” Project on vamos running SAS C" href="http://lallafa.de/blog/2011/12/building-a-real-project-on-vamos-running-sas-c/"> vamos running the SAS C compiler</a> I can create Amiga binaries with ease. With the binaries in place I want to try them on the real machine, too. For my trusty old Amiga 500, I still use disks to transfer the data. So I create an ADF image with my files on it and either use my <a href="http://www.kryoflux.com/">kryoflux</a> setup to write a real disk or write a virtual HFE disk image on an SD card to be used with the <a href="http://hxc2001.free.fr/floppy_drive_emulator/">HXC2001 floppy emulator</a>.</p>
<p>While building the code is done automatically in a Makefile, the disk image creation still involves manual steps including launching an UAE emulator to create the disk image. Hmm, I thought, an ADF file mastering tool (like mkisofs is used for CDs) would be a great tool!! Adding this to my Makefile would fully automates my build cycle&#8230; I was aware of <a href="http://lclevy.free.fr/adflib/">ADFlib</a> as being the portable library for ADF manipulation and I had a look there, but I did not found a mastering tool. Some more googling didn&#8217;t show me a similar tool &#8211; so again &#8211; I was left on my own and had to create the tool myself <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>As a result <a title="xdftool" href="http://lallafa.de/blog/amitools/xdftool/"><strong>xdftool</strong></a> was born and added to my <a title="amitools" href="http://lallafa.de/blog/amitools/">amitools</a> tool set! I started writing a small tool using the Python binding of ADFlib to create an ADF image and copy files there. This worked really quickly but soon I found the limitations of this library: the mastering part is only partially supported and essential things like setting all meta infos of a file were missing (or I didn&#8217;t find them <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . In the end I dropped the ADFlib approach and started to build a FS library for Amiga OFS/FFS from scratch&#8230; Thanks to the excellent <a href="http://lclevy.free.fr/adflib/adf_info.html">ADF Disk Format FAQ </a> I soon had all necessary information available and some hours later the first code files written.</p>
<p>The lib is done now and included in amitools as &#8220;fs&#8221; module. In its first incarnation it already has an impressive feature set:</p>
<ul>
<li>full object-oriented API in Python</li>
<li>supports ADF and HDF containers</li>
<li>supports all OFS/FFS modes including international and dircache</li>
<li>read/write files/dir trees from/to host file system</li>
<li>multi-layer support: work on block level or on FS level</li>
<li>query and modify all parameters found in the file system including comments, protection flags and all time stamps in tick resolution</li>
<li>supports unpacking/packing/repacking of full images into host file system with meta db files to store information not available on host file system</li>
</ul>
<p>xdftool now supports all features of the library and while it started as a mastering tool for ADFs it is now a full featured command line tool to work with all kinds of ADF and HDF images&#8230; The remainder of this post gives you a short tutorial what you can do with xdftool:</p>
<p><span id="more-438"></span>First of all install xdftool. It is a part of amitools so have a look at my <a title="amitools" href="http://lallafa.de/blog/amitools/">amitools</a> page for installation details. It is handy to pack the top-level dir of amitools into your PATH so you have all tools available in your shell at any place.</p>
<p>In the following I will use a Workbench 3.1 disk image called wb31.adf which was taken from Cloanto&#8217;s Amiga Forever Pack. You can use any other disk image as well. Simply adjust the paths if necessary. Host files are taken from the top level directory of amitools.</p>
<p>This tutorial only shows a sub set of functions available in xdftool. Have a look at the <a title="xdftool" href="http://lallafa.de/blog/amitools/xdftool/">xdftool Homepage</a> for a full reference of commands.</p>
<h4>Look at a Disk</h4>
<pre>&gt; xdftool wb31.adf list
Workbench3.1                                    VOLUME  --------  06.07.1986 14:32:19 t08 
 C                                                 DIR  ----rwed  22.06.1991 02:13:25 t18 
 AddBuffers                                        444  --p-rwed  06.07.1986 14:39:06 t31 
 AddDataTypes                                     5880  --p-rwed  06.07.1986 14:39:06 t37 
 Assign                                           3220  --p-rwed  06.07.1986 14:39:06 t43 
 Avail                                             736  --p-rwed  06.07.1986 14:39:06 t49 
 BindDrivers                                      1420  ----rwed  06.07.1986 14:39:07 t04 
 Break                                             432  --p-rwed  06.07.1986 14:39:07 t16 
 ChangeTaskPri                                     460  --p-rwed  06.07.1986 14:39:07 t21 
 ConClip                                          2432  --p-rwed  06.07.1986 14:39:07 t29 
...
T                                                  DIR  ----rwed  22.06.1991 02:06:08 t25 
 Utilities                                         DIR  ----rwed  06.07.1986 14:39:05 t07 
 Clock                                           13856  ----rwed  06.07.1986 14:39:04 t31 
 Clock.info                                        590  ----rw-d  06.07.1986 14:39:04 t37 
 More                                            12752  --p-rwed  06.07.1986 14:39:04 t43 
 MultiView                                       28836  --p-rwed  06.07.1986 14:39:05 t01 
 MultiView.info                                    861  ----rw-d  06.07.1986 14:39:05 t11 
 Utilities.info                                    632  ----rw-d  06.07.1986 14:39:06 t14 
 WBStartup                                         DIR  ----rwed  06.07.1986 14:39:05 t19 
 WBStartup.info                                    632  ----rw-d  06.07.1986 14:39:06 t21 
Blocks:    data:     1496, fs:      199, sum:     1695, ratio=88.26, disk total:     1760
Bytes:     data:   765952, fs:   101888, sum:   867840, ratio=88.26, disk total:   901120
File:      data:   726742, ratio=94.88</pre>
<p>Ok, first command shows you whats on a disk! Note the calling convention in xdftool: always pass the image file name first then the command with parameters. You see the complete directory tree of the volume inside the disk image. Each entry shows you the size, protection flags, modification time stamps (with ticks) and if available the file comment. At the end a summary on block usage is given.</p>
<h4>Create a disk and write to it</h4>
<pre>&gt; xdftool mydisk.adf format MyDisk + boot install + list
MyDisk                                         VOLUME  --------  14.01.2012 21:49:13 t00 
Blocks:    data:        0, fs:        1, sum:        1, ratio=0.00, disk total:     1760
Bytes:     data:        0, fs:      512, sum:      512, ratio=0.00, disk total:   901120
File:      data:        0, ratio=0.00</pre>
<p>With this command creating an empty formatted image is a no-brainer&#8230; Note that you can combine multiple commands in a single call to xdftool by separating them with a plus sign. Creating a hard disk image is also very easy:</p>
<pre>&gt; xdftool myhd.hdf format Work 10M</pre>
<p>Here a size (or a disk geometry) needs to be specified.</p>
<p>You can put some files from your host on it with the &#8216;write&#8217; command:</p>
<pre>&gt; xdftool mydisk.adf write README + list
test                                            VOLUME  --------  14.01.2012 21:51:42 t00 
 README                                           3728  ----rwed  14.01.2012 21:51:42 t00 
Blocks:    data:        8, fs:        2, sum:       10, ratio=80.00, disk total:     1760
Bytes:     data:     4096, fs:     1024, sum:     5120, ratio=80.00, disk total:   901120
File:      data:     3728, ratio=91.02</pre>
<p>This will write the file README from the host&#8217;s current directory to the volume directory of the image. You can also write a full directory tree to the image:</p>
<pre>&gt; xdftool mydisk.adf write doc + list
test                                            VOLUME  --------  14.01.2012 21:53:20 t00 
 doc                                               DIR  ----rwed  14.01.2012 21:53:20 t00 
   xdftool.txt                                   18798  ----rwed  14.01.2012 21:53:20 t00 
Blocks:    data:       39, fs:        3, sum:       42, ratio=92.86, disk total:     1760
Bytes:     data:    19968, fs:     1536, sum:    21504, ratio=92.86, disk total:   901120
File:      data:    18798, ratio=94.14</pre>
<p>Now you can alter the protect flags, the modification time or set a comment:</p>
<pre>&gt; xdftool mydisk.adf protect doc rwe + time doc "12.01.1991 12:00:00 t11" + comment doc "my doc comment" + list
test                                            VOLUME  --------  14.01.2012 21:53:20 t00 
 doc                                               DIR  ----rwe-  12.01.1991 12:00:00 t11  my doc comment
   xdftool.txt                                   18798  ----rwed  14.01.2012 21:53:20 t00 
Blocks:    data:       39, fs:        3, sum:       42, ratio=92.86, disk total:     1760
Bytes:     data:    19968, fs:     1536, sum:    21504, ratio=92.86, disk total:   901120
File:      data:    18798, ratio=94.14</pre>
<p>With these commands at hand you can now easily write a Makefile entry that creates an ADF image and places all your files on it.</p>
<p>But xdftool can more:</p>
<h4>Unpacking and Packing Images</h4>
<p>The unpack command extracts all files and directories from a disk image and creates a corresponding directory structure on your host&#8217;s file system. Additionally a MetaDB file will be created with all flags of the Amiga file system that cannot be represented in the host file system, namely protect flags, timestamps with ticks and comments:</p>
<pre>&gt; xdftool wb31.adf unpack .
&gt; ls Workbench3.1*
Workbench3.1.blkdev    Workbench3.1.bootcode  Workbench3.1.xdfmeta

Workbench3.1:
C/              Devs.info       Expansion.info  Prefs/          S/              T/              WBStartup/
Classes/        Disk.info       L/              Prefs.info      System/         Utilities/      WBStartup.info
Devs/           Expansion/      Libs/           Rexxc/          System.info     Utilities.info</pre>
<p>You see a directory named after the volume inside the image was created with all files and dirs of the image. Additionally the MetaDB file *.xdfmeta, the boot code in *.bootcode and the description of the disk&#8217;s block device geometry *.blkdev was written.</p>
<p>With these files in place you can always recreate a new disk image that is equivalent to the original image (from the FS perspective):</p>
<pre>&gt; xdftool newimg.adf pack Workbench3.1 + list
Workbench3.1                                    VOLUME  --------  06.07.1986 14:32:19 t08 
 C                                                 DIR  ----rwed  22.06.1991 02:13:25 t18 
 AddBuffers                                        444  --p-rwed  06.07.1986 14:39:06 t31 
 AddDataTypes                                     5880  --p-rwed  06.07.1986 14:39:06 t37 
 Assign                                           3220  --p-rwed  06.07.1986 14:39:06 t43 
...
   MultiView.info                                  861  ----rw-d  06.07.1986 14:39:05 t11 
 Utilities.info                                    632  ----rw-d  06.07.1986 14:39:06 t14 
 WBStartup                                         DIR  ----rwed  06.07.1986 14:39:05 t19 
 WBStartup.info                                    632  ----rw-d  06.07.1986 14:39:06 t21 
Blocks:    data:     1496, fs:      199, sum:     1695, ratio=88.26, disk total:     1760
Bytes:     data:   765952, fs:   101888, sum:   867840, ratio=88.26, disk total:   901120
File:      data:   726742, ratio=94.88</pre>
<p>Note the correct time stamps and protect flags after packing&#8230;</p>
<p>With this approach you can quickly unpack an image, modify some files on your host file system and pack the image again.</p>
<p>Also mastering full images is now easy: create a Volume directory from scratch, place all your files in it and if you need special flags then write a *.xdfmeta file. Call xdftool pack to create your image. Done!</p>
<h5>Repacking Images</h5>
<p>Another nice operation in xdftool is repack: This essentially combines a unpack command on an existing image with a pack command on a new image. So you can rebuild the contents of the whole volume of the old image and write a fresh new FS structure. This will recreate the FS and re-aligns all file data blocks to be in one place. Originally this command helps me to test the integrity of amitools fs library but it may be useful for you, too:</p>
<pre>&gt; xdftool wb31.adf repack new.adf</pre>
<p>In combination with a hard disk image repack also allows you to create a larger target disk, so this command essentially allows you to &#8220;grow&#8221; your Amiga hard disk by repacking its image to a larger one:</p>
<pre>&gt; xdftool old.hdf repack new.hdf 10M
</pre>
<p>You can even repack a disk image into a hard disk image:</p>
<pre>&gt; xdftool wb31.adf repack wb31.hdf 10M</pre>
<p>That&#8217;s it&#8230; If you want to play more with xdftool have a look at the <a title="xdftool" href="http://lallafa.de/blog/amitools/xdftool/">xdftool page</a>!</p>
<p>Have Fun! And if you find bugs in the rather fresh code then please don&#8217;t hesitate to report them&#8230; Thanks!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2012/01/mastering-adfhdf-images-with-xdftool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
