Closed erichelgeson closed 7 months ago
Wow. +1 :+1:
This would also be useful for #219. DingusPPC emulates a raw SCSI device, so the existing boot images do not work because they only have the HFS partition, they would also need to be wrapped with the partition map and SCSI driver.
https://diskjockey.onegeekarmy.eu/help/technicalinfo/ has some details as to how Disk Jockey operates, will need to track down the details of the partition map.
I can probably help :)
@erichelgeson I've merged in your PR and deployed it -- Mini vMac-based instances on infinitemac.org can now have .hda files dragged in and are able to mount them successfully.
@OneGeekArmy if you have any code or tips to share about formatting the partition table or embedding the driver I would appreciate it, otherwise I'll see what I can figure out.
Via my chat with @OneGeekArmy
This file contains a minimum header to get going with a single HFS partition, currently configured for a 1MB device image.
Things you need to change to make it dynamic: Offset
0x0004
: the 4 bytes are the size of the device in blocks, in big endian, including this minimum header (which is 96 blocks in size). So, for a 2048 blocks volume, the value here is 2144 (0x00000860). Offset0x060C
: the 4 bytes here are the size of the HFS partition, in blocks, in big endian. In this minimum header, the value is 2048 (0x00000800). Offset0x0654
: put in the same value you put in 0x060CYour HFS partition must start at offset
0xC000
(49152). Note that an HFS partition starts with 2 empty blocks (full of zeroes) for an eventual boot block (a leftover from the floppy days).The
0x4244
magic number identifying the HFS volume should therefore appear at offset0xC400
(50176).
Wish I could help more right now but I'm a little tied up with some family issues. Sorry about this.
You can find datastructures in libhfs - https://github.com/JotaRandom/hfsutils/blob/master/libhfs/apple.h
I also made a ImHex Pattern if you want to poke around in a hex editor https://gist.github.com/erichelgeson/138ff8420917e99be57b6ce615f3400b
I implemented an initial version of this - when exporting the "Saved HD" there is now an option to save it as a device image/.hda file:
Disk Jockey at least appears to be happy with the generated file, let me know if you're able to test it with BlueSCSI or other hardware.
I own a SCSI2SD and a PiSCSI with a range of old 68K and PPC Macs, if any of those are required for testing. Mac models I own include a Mac Plus, a Mac IIci, a few beige PowerMacs, a few G3 and a MDD G4.
Closing this out -- based on @RonsCompVids's demo this appears to work https://www.youtube.com/watch?v=2KCb7tuE9Io
This might be unrelated: macOS version of SheepShaver only connects the first HFS partition of a device image. Is it the same with Infinite Mac version? I suppose it doesn't matter if you never connect an image with multiple HFS partitions.
Regarding the partition map, you can use my dumpvols.sh script to dump that info.
A device based image is an image that is bit for bit what would be on a real device, eg, it has a partition map, SCSI driver, and HFS partition. The new
SavedHD
feature would make building disk images for devices such as the BlueSCSI easy as one could boot up and install or download software and export it right to their SD card. Many people struggle setting up these emulators on their computer.I saw your patch to minivmac to allow ISO support, and have modified it to also allow booting a device image https://github.com/mihaip/minivmac/pull/1. That should mean all emulators in this project could now handle these types of images.
I believe what we'd need to do next to allow this is to, on export, build a partition map, inject a scsi driver, and then append the hfs partition. @OneGeekArmy might be able to give us a few pointers as this is what his DiskJockey app does.