I've been trying NitrOS-9 EOU Beta 3 (6809, under MAME 0.199) and it looks like creating a file on a floppy from OS-9 makes the floppy unreadable by ToolShed's "os9 dir" command.
I used ToolShed 2.2 (under Ubuntu 14.04) to create a new 80-track floppy image (on my Linux system): os9 format example.dsk -ds -t80 -e -9
I successfully tested that I can read its (empty) directory: os9 dir example.dsk,
I started MAME 0.199 on EOU with the new floppy image as the 2nd floppy: -flop1 68emu.dsk -hard1 68sdc.vhd -flop2 example.dsk
I typed DOS and got to the /DD prompt, where I typed "cd /d1", then "build file1", then I entered 3 short lines of text.
I successfully checked the new file with "list file1".
At that point, whether or not I shutdown MAME, giving the "os9 dir example.dsk," command under Linux fails with these error messages:
dir: error 216 opening 'example.dsk,.'
dir: error 216 opening 'example.dsk,'
Anonymous
Hi Pierre, can you please attach a zipped disk image?
I reproduced the steps Pierre explained. And I reproduced the problem. After MAME quits the disk appears corrupt. Toolshed will no longer display the directory. Looking into the specifics now.
But as an aside: MAME will read in the entire disk image on startup and will not write to the native file until the emulation quits.
Attached is the corupt (?) disk image.
After the build command, I ran md5sum under Linux on the floppy image before and after closing MAME, and got the same signature.
To be noted: the modified floppy image is 2 bytes longer than it was right after "os9 format" created it.
Now that you've reproduced the problem, I assume you won't need my disk images.
MAME adds a 2-byte JVC header [http://tlindner.macmess.org/?page_id=86] when it saves the image. I would consider this a bug in MAME that it adds a header without asking on an image that didn't already have one. If you strip the two bytes, the image will be readable from toolshed again.
The irony of this situation is not lost on me.
lol
Intriguing... Is there a story behind this?
Should this bug be reported to mame-dev?
I confirm that removing the first 2 bytes fixes the issue. I used this command under Linux:
dd if=example.dsk of=fixed.dsk ibs=1 skip=2
Thanks for your help.
Yes, please report the bug to mame-dev. I am working on a fix: https://github.com/tlindner/mame/tree/fix_os9_dsk
but it is not working yet.
https://github.com/mamedev/mame/pull/4925
Closing this as wontfix since the bug was in MAME, and has been fixed there thanks to Tim.