Mastering ADF/HDF Images with xdftool

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 data. So I create an ADF image with my files on it and either use my kryoflux setup to write a real disk or write a virtual HFE disk image on an SD card to be used with the HXC2001 floppy emulator.

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… I was aware of ADFlib 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’t show me a similar tool – so again – I was left on my own and had to create the tool myself 😉

As a result xdftool was born and added to my amitools 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’t find them ;). In the end I dropped the ADFlib approach and started to build a FS library for Amiga OFS/FFS from scratch… Thanks to the excellent ADF Disk Format FAQ I soon had all necessary information available and some hours later the first code files written.

The lib is done now and included in amitools as “fs” module. In its first incarnation it already has an impressive feature set:

  • full object-oriented API in Python
  • supports ADF and HDF containers
  • supports all OFS/FFS modes including international and dircache
  • read/write files/dir trees from/to host file system
  • multi-layer support: work on block level or on FS level
  • query and modify all parameters found in the file system including comments, protection flags and all time stamps in tick resolution
  • supports unpacking/packing/repacking of full images into host file system with meta db files to store information not available on host file system

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… The remainder of this post gives you a short tutorial what you can do with xdftool:

Continue reading