paulhagstrom/dsk2po

Converted disks crash on boot

Closed this issue · 5 comments

I have various .dsk and .do images that boot fine on AppleWin.
I have a BOOTI that requires prodos order images, so I tried various images that I have with commands like:

python dsk2po.py mydisk.do -> which seemed to succeed and produced mydisk.do.po

When I try to boot these on the booti it crashes out at a machine language prompt.

When I boot the same images on AppleWin, they work.

Your tool was specifically linked to from the booti site. Do you have any idea what is going on?

I'm (trying) to convert Dos 3.3 images (dsk/do) to prodos order so I can run them on the booti. I've tried converting plain vanilla things like the System master disk that comes with the Apple ][.

My suspicion is that what's actually happening is that some of your dsk files are in ProDOS order. The ".dsk" extension is really ambiguous about sector order, so it is usually DOS order but can occasionally be found in ProDOS order. The ".do" and ".po" extensions were supposed to disambiguate (though this little script pair uses ".dsk" to mean ".do").

The crashing on boot symptom is a pretty common one for dsk/do/po files that are in the wrong order, since it loads track 0 sector 0 and executes it, but everything loaded after that is nonsense. I did check to be sure that po2dsk reverses what dsk2po does.

So, I think what's happened is that you have some dsk files that are in ProDOS-order but boot in AppleWin because AppleWin likely uses some heuristics to figure out what order the sectors are in and adjusts itself. Meaning that for those disks you can probably copy them to the Booti device without converting the order and they'd work.

That seems more likely than a systematic bug in the scripts, mostly because the scripts are so simple there's not many places a bug can hide. Though if you want to post an image that's causing trouble I can take a look at it.

Thank you for the quick response.

I gave it a go with the originals, and instead of booting, the BOOTI just sits on the Apple ][ boot screen. It's as if it isn't finding a copy of DOS to load.

To work around Github not liking the filetype, I changed the extension of these two uploads. Rename back to Master.dsk and Math.do
Master.txt
Math.txt

I tried to test this out on one of my own Booti cards but ran into some unrelated trouble (I need to update the firmware I think, and I managed to get it stuck in Smartport mode on a II+ so now I need to figure out how to undo that or swap it into a IIGS or something to regain access to the configuration menu). Whatever. I did not succeed.

BUT it did lead me to realize that what you're trying to do is not something that the Booti card can actually do. The Booti card is a block device, and DOS 3.3 is hardcoded to work with the Disk II controller specifically, not with block devices like hard drives. So, ProDOS disks can boot because they're block-device-aware, but DOS 3.3 disks (even if their sectors are in "ProDOS order") cannot. So I think actually what you're seeing is probably expected. It's either trying to execute garbage (sectors read in in the wrong order) or read further data using a card that isn't there.

The Booti documentation is not super clear on this point, though it is in there. It's not a general purpose floppy emulator, but rather a block device emulator (which is in general more flexible, but misses one big use case: all the disks that have use of the Disk II controller hard-coded into them). So I think actually everything is ok, it's just a readjustment of expectations of what the Booti card can accomplish.

Ah! I will try converting one of my disks to ProDOS (I think there is a utility on the ProDos disk) and see if that works. Thank you for sending me down a better path. I'll report back on how that turns out in case anyone stumbles across this thread.

I got this working and thought I'd capture the overall solution:
0 - I used a Floppy EMU device to extract my old (37 years old) programs I wrote when I was a kid off of physical 5.25" Dos 3.3 floppy disks that, amazingly, still worked after all these years. This resulted in DSK images on my PC.
1 - You must use a ProDos image (not just pro-dos order, but a disk image that boots to prodos)
2 - I used CiderPress to extract the Applesoft apps from the Dos 3.3 dsk images
3 - I used CiderPress to add the extracted files to a ProDos disk image (I used a ProDos master disk image I found online)
4 - I made sure the ProDos disk image was in ProDos order by running Paul's dsk2po.py on it (the image wasn't in ProDos order for some reason and initially crashed on boot)
5 - I copied the image to a USB that I then put in the Booti
6 - I booted the Apple, chose 'C' to configure, selected my image into slot 1, and did 'x' to boot
7 - I booted into ProDos. I then exited to Basic, did a CAT, saw the programs I had added with to the image with Ciderpress. Happiness.
I should say that the Applesoft apps I'm running don't attempt to do any disk access, so there are no problems trying to access the ProDos disk using Dos 3.3 calls. So this works fine for my simple apps that I wanted to run.