ExtremeElectronics / Pico-SD--IDE-interface--for-Rc2014

Pico SD - IDE interface - for Rc2014
GNU General Public License v3.0
6 stars 3 forks source link

CF conversion "bad magic" #3

Closed zomgugoff closed 1 month ago

zomgugoff commented 1 month ago

I realize you don't have a RomWBW device to test on, but I don't think this issue requires it for testing. I'm attempting to convert an image available in RomWBW's releases (hd1k_combo.img). I have this written to a CF card that I've used for a while. Dumping the CF card and creating the .ID file + SD image as per the very simple instructions, I am seeing an error in the boot log:

ide: cf: -: bad magic

We have a failure to allocate ide

I tried this using both the dump I made and the file from the archive(hd1k_combo.img). I thought it might be the diskdefs but I removed that file entirely with the premade images on your repo and it didn't throw this error. I wonder if the geometry of these drive images is different from when you created the images on your repo, causing them to not be recognized. Based on the diskdefs for the hd1k image (https://github.com/wwarthen/RomWBW/blob/master/Tools/cpmtools/diskdefs), the geometry appears to be a little different.

I wasn't sure if I should ask here or on the RomWBW repo, but I figured I'd start here as it appears to be related to the splitting of the first part of the image to the .ID file.

Any insight on what might be the issue? Also, what is the "iscf" flag in the rc2014.ini for? I assumed it would flag the image as being a CF dump but it didn't seem to fix the issue.

One other related question, would the diskdefs listed in that link work in the diskdefs file? I saw an extra "offset" line on each entry for the hd1k image and both "tracks" and "boottrk" entries don't follow the same convention as the ones in the image you provide.

ExtremeElectronics commented 1 month ago

Bad magic tells me that you either haven't got the correct ID file, or the CF card was not formatted with a compatible format.

If, as you say, the geometry is different, it is unlikely for the interface to work.

What id suggest is to use the working blank drive image you have and use disk tools to copy the contents to the working formatted image.

the diskdefs will only work with an image formatted in exactly the same way as the diskdefs specify.

The ISCF flag enables/disables the separate id file and "should" take its input from the first 1024 bytes of the CD image. But if that is of the wrong format, that won't help you.

ExtremeElectronics commented 1 month ago

Ive just been told that the latest WBW format is different from the one I created the images from.

"it seems like RomWBW no longer works on the SD card module.

The diskdefs file for v3.4.0 is quite different to the one in your GitHub https://github.com/wwarthen/RomWBW/blo

The version on your (this) GitHub works with older (v3.2.0) RomWBW versions. Older CF images kind of mostly work with 3.2.0 RomWBW but not reliably, although I could not get them to work at all from SD card "

I need to look further into this (when I can borrow a system to test and have the time )

zomgugoff commented 1 month ago

I would really appreciate that. Let me know if you want me to test anything.

ExtremeElectronics commented 1 month ago

OK as a start (not proved as a solution yet. take a look at (https://github.com/ExtremeElectronics/Pico-SD--IDE-interface--for-Rc2014/tree/main/ROM%20WBW%20SD) The newer SD image works (with my borrowed) RC2014 running RomWBW HBIOS v3.4.0 although its not been massively well tested. yet.

If you have an image from a CF card in RC2014 standard (Grant Searle) hard disk image format (see diskdefs) you "should" be able to just replace the img file (and change the rc2014.ini to point to the new image

zomgugoff commented 1 month ago

I don't have a CF card in the standard image format. I'm using the hd1k_combo.img provided in the RomWBW release. Not sure many people are using the standard image with RomWBW.

ExtremeElectronics commented 1 month ago

The RC2014 SD card interface was designed to use the images for the RC2014 CF card as it was built as an alternative for the IDE CF card. I believe the hd1k_combo.img is a ROMWBW specific format.

Checking the diskdefs it looks like a VERY different format, so the only option would be to copy your files using CPM tools from one img file to the other.

zomgugoff commented 1 month ago

Maybe @wwarthen can speak to the reason for the differences in the format. I was under the impression it was made to allow for 1024 files/directory, but it may have been to allow booting several OS's.

Is supporting that format something you would be willing to do?

ExtremeElectronics commented 1 month ago

Maybe at some time, I'd have to reverse engineer a file I have little or no info on, I'm not going to say never, but certainly not soon, I'm too busy.

wwarthen commented 1 month ago

This is surprising. I am having no problems with either the hd512_combo.img or hd1k_combo.img file taken directly from the RomWBW build. I am using the CPMIDE.id file from the new "2024" folder in this GitHub. Set iscf to 0.

@zomgugoff, you mentioned you were trying to convert the hd1k_combo image. No conversion of any kind should be needed. Just use the file as-is. Make sure your system is running the v3.4 or v3.4.1 ROM image from RomWBW. When do you see this error? When you boot your system? Is this in the trace output?

I sent an email to Derek with what I believe are the correct diskdefs. They are different for hd512 or hd1k, but I provided both. I don't think the curent diskdefs in the 2024 zip file are correct (for either RomWBW format), but I think that would only affect Fast File Transfer.

For more information on the two different disk layouts used by RomWBW, see the RomWBW User Guide, Section 4.6 Hard Disk Layouts.

Thanks!

Wayne

ExtremeElectronics commented 1 month ago

OK, I'd assumed that the images direct from your build wouldn't work as they aren't in Grants RC2014 format. But to be fair that wasn't my aim for today.

I need to try this for myself.

and Yes I VERY much doubt FFS will work without the correct diskdefs.

zomgugoff commented 1 month ago

I did not try using a direct dump of the CF card. I was working from the prior instructions which involved splitting the first 1024 bytes from the image. It does indeed boot with an unedited dump.

Sorry about the confusion.

ExtremeElectronics commented 1 month ago

No as long as you have the correct .ID file the img should just work .

The Id file is a throwback to the origins of the IDE code. Some images had this attached to the front. I made the decision to remove it to make it easier to swap img files around.

I probably need to make this more clear in the ReadMe

wwarthen commented 1 month ago

Hi @zomgugoff,

I did not try using a direct dump of the CF card. I was working from the prior instructions which involved splitting the first 1024 bytes from the image. It does indeed boot with an unedited dump.

Ah, OK, excellent. I'm just glad it is now working because I was really struggling to understand what the issue could be. I find it extremely convenient to just grab the latest hd1k_combo.img disk image file from new RomWBW builds and copy it to the Pico SD card. Simple and easy update!

Thanks, Wayne

ExtremeElectronics commented 1 month ago

A number of updates.

FFS now works "better" with the diskdefs, the embedded cpmtools used for FFS didn't like skew, so I've rewritten it without. Also the mbedded CMP tools didn't have enough space for the larger directories, also fixed.

Plus Experimentally, I've added support for a second image as IDE1 by adding a line in the RC2014.ini idefile1 = "another.img" (not supported at all by FFS)

You need to re-flash the pico with the .UF2 in the root of the git (e.g not the release) for this and the improved FFS support.

wwarthen commented 1 month ago

Nice work!

I have updated to the new .uf2 file and it is recognizing two IDE disk image files as advertised.

However, I am seeing an odd behavior. It is acting like both IDE drives are actually pointing to the first IDE disk image specified. In other words, referencing either the master or slave seems to access the "idefile" drive and neither reference the "idefile1" drive.

I was initially thinking it was a RomWBW issue, but I recreated the setup with a true IDE interface that had two disks attached. The true hardware setup checked out fine.

Thanks,

Wayne

ExtremeElectronics commented 1 month ago

Wayne,
Found it (I think) would you mind trying the new UF2 and see if that's fixed it.

https://github.com/ExtremeElectronics/Pico-SD--IDE-interface--for-Rc2014/blob/main/z80disk.uf2

    A:=MD0:0
    B:=MD1:0
    C:=IDE0:0
    D:=IDE0:1
    E:=IDE0:2
    F:=IDE0:3
    G:=IDE1:0
    H:=IDE1:1
    I:=IDE1:2
    J:=IDE1:3

C: and G: on mine are definitely different now. I assume you were seeing these (and D-H, E-I etc) as the same on my previous version ?

wwarthen commented 1 month ago

All fixed. Works perfectly. Thank you!

ExtremeElectronics commented 1 month ago

All sorted

zomgugoff commented 1 month ago

I just got to try the updates. Also working good with my 1GB CF dump + FAT partition. Thank you for getting this functional again.