Mounting an XDF in *nix

Started by neko68k, August 08, 2016, 04:51:37 AM

Previous topic - Next topic

neko68k

It is possible to mount XDF images in linux, etc. by patching the first byte of the file from 0x60 to 0xEB.

Something like this should work in recent Ubuntu style systems. This assumes a directory in CWD called xdf exists. Change diskimage.xdf accordingly. Make sure your image is actually an XDF and not a DIM. This technique does not work with DIM images.


Patch and mount:
#printf '\xEB' | dd conv=notrunc of=diskimage.xdf bs=1 seek=0
#losetup /dev/loop0 diskimage.xdf;\
#mount /dev/loop0 ./xdf -t msdos -o "fat=12"


When you're done:
#umount ./xdf
#losetup -d /dev/loop0
#printf '\x60' | dd conv=notrunc of=diskimage.xdf bs=1 seek=0


Change filesystem label:
#dosfslabel /dev/loop0 "LABEL      "

famiac

Wow that's actually pretty cool. So would you do this mainly for file transfers?

neko68k

I guess you could. I was using it to build some disk images for a project. I wanted something that'd work in a Makefile.