rallepalaveev / Prodos-4MB-NVRAM-Drive

A card with 4MB NVRAM for Apple ][ compatible computers which is a ProDOS compliant R/W device
Other
10 stars 0 forks source link

How to generate the 'restore' image from a 4MB .po image? #1

Closed buserror closed 1 year ago

buserror commented 1 year ago

So I have a 4MB card on the way, whoohoo... I'm playing with gsport at the minute, getting my head around what I need to do to install 'my' custom image. Seems the 4MB_v42.po image is Prodos, but with an extra bit of bootloader (?) -- and it is split into 17 folders on the .hdv file with the tools, and that is the way to flash a whole new image to the card. Am I wrong? How do you 1) install that bootloader to the .po image and 2) generate the multiple files in the .hdv image?

I created an issue so it's easier for anyone else trying the same!

rallepalaveev commented 1 year ago
  1. The v42 boot loader is 512 bytes long and must be placed at addresses $00200-$003FF. So if a 4MB disk image is created de novo, the firmware must be put in that location using a HEX editor - I use AXE.
  2. To split the .PO image I used a linux command: split -b 16k --suffix-length=3 --numeric-suffixes=1 --additional-suffix="#062000" /path-to-file/filename.po then add the resulting files to the .HDV image On the other hand - the NVRAM Tools contain a program to back-up the contents of the NVRAM Drive, which will back it up to the 256 files on the .HDV image.
buserror commented 1 year ago

So I have now a new 4MB image with gsos 6.0.4 hooray. Boots fine in gsport.

But, I can't find that 512 byte bootloader (you mention AXE, whats that?), do I have to copy it from the existing file? Also, 'split' creates me a bunch of files, but certainly not in a Prodos disk, in the proper directories and that "additional suffix" is not there on your original disk.

I'm really trying to be positive here. There's zero source, or reference to source... there's files on that 'tool' disk that clearly access the card to dump/copy/write but all in binary, ZERO documentation, what are you expecting people to actually do with these cards? I thought my use case was pretty simple really.

Basically what I want to know is how that .HDV file was created.

jr0dsgarage commented 1 year ago

I loaded an .hdv via the FloppyEmu. The same thing could be done using ADTPro's VEDRIVE - load a 2nd image that contains the files you want to put into the NVRAM drive.

I then used the A2Desktop installation that came pre-installed, and just used drag+drop to move all the files from that 2nd disk image into the NVRAM drive.

You can, if necessary, delete everything that's already installed into the NVRAM drive, including the A2Desktop files, before you move your own files over.

I then used a utility called Cat.Doctor to sort the directory so that my desired .SYSTEM file loads first when the computer boots.

I also don't know how and end-user would go about programming the card with a pre-existing .HDV (even if it has been hacked to include the firmware).

rallepalaveev commented 1 year ago

Hi,

  1. The boot loader can be taken from one of the .po files I have in the repo.
  2. The files created are just 16kB chunks of the .PO file. The extension is needed so that when you replace the respective files in the .HDV files, these new files are recognized as binary files with start location$2000. I use CiderPress for that.
  3. The file was created with CiderPress in the way described. The card can be copied to and from with Copy+ while in the system.
  4. To reprogram with a new PO file, which has the boot loader included in block 1, it has to be split in 16kB chunks, then updated in the .HDV file in the respective locations and then mount the .HDV, using another emulator and then restore the card.

PS: I have updated the NVRAM tools to not have to hack the .PO file or have to split it in 16kB pieces. In .HDV file there is a IMAGE.PO file which should be replaced with the new image then a restore to be performed. Best practice would be to extract the .PO file, update it with an editor like CiderPrress and then return it to the .HDV file. Works on an emulator, I need to find time to test on a card, will post results here.

buserror commented 1 year ago

Thanks guys, it's now a bit clearer how to generate that image. I'll extract the bootloader and 'splice' it in, and I'll see how to generate a new .hdv -- I'm on linux so I'm trying 'AppleCommander'. Turns out GSOS 'good' install takes about 3.1MB (without a lot of the extra drivers, no printers etc) so that leaves me >900KB for other stuff to fill up 4MB.