sarah-walker-pcem / pcem

PCem
http://pcem-emulator.co.uk
GNU General Public License v2.0
1.55k stars 216 forks source link

Some bootable removable media images are not recognised as bootable on startup #268

Closed jimjamz closed 3 months ago

jimjamz commented 3 months ago

Describe the bug Some removable media (e.g. floppy disk) images, which are bootable, are not recognised as bootable on startup.

"Bad" raw image example: https://archive.org/download/debian_0.91/debian-0.91.tar/debian%2Fdebian-0.91%2Fdist%2Fbase%2Fbootdisk.gz (extract the raw image from the gzipped archive beforehand. Append the extension .ima for it to be recognised in PCem)

"Good" raw image example: https://archive.org/download/debian_1.1/Debian-1.1.tar/Debian-1.1%2Fmain%2Fdisks-i386%2F1996_6_16%2Fboot1440.bin (rename the extension .bin to .ima for it to be recognised in PCem)

To Reproduce Steps to reproduce the behaviour:

  1. Mount the bad image. Start the VM. The bad image is not booted upon startup. DISK FAILURE error.
  2. Eject and change media, selecting the bad image once again. Press a key within the VM to read again. Again, the image is not read.
  3. Repeat steps 1 and 2 with the good image. The good image is booted from at startup.

Expected behaviour I expected the bad image to be bootable, and for the VM to boot from the mounted image at startup.

Emulator configuration

Host machine

Additional context The bad image has been confirmed to be bootable by booting in from it within QEMU:

qemu-system-i386 -cpu 486 -machine type=pc -m 16 -boot order=ac -drive file=bootdisk.ima,if=floppy,format=raw -serial msmouse -vga std

ruben-balea commented 3 months ago

Hello, That "bad" image is from a 5.25" 1.2MB floppy, QEMU can autodetect the format of the images and change the floppy drive type on the fly, but PCem is like a real computer and the floppy drive selected in the configuration has to be compatible with the floppy image(s) you want to use.

3.5" 1.44MB drives can also deal with 3.5" 720KB floppies but some motherboards only support the earlier 3.5" 720KB floppy drive. 5.25" 1.2MB drives can also deal with most 5.25" floppies but some motherboards only support the earlier 5.25" 360KB floppy drive, but some motherboards may need to use the 5.25" 360KB drive to read some early floppies of low capacities like 160KB, although I remember this case from a real computer and it may have been a problem with the floppy drive and not with the motherboard or the BIOS.

floppy_type

Screenshot from 2024-08-11 16-38-36

Screenshot from 2024-08-11 16-36-35

jimjamz commented 3 months ago

Ah, that's a complete mistake on my part, sorry. I did not notice that the image I was using was that derived from a 5.25" disk. It is the only disk image set that I had not also physically tested out (i.e copied to physical 3.5" disks), which may have indicated the issue earlier. The accompanying documentation with that disk image set did not hint at the disks being of the larger, earlier format, so I had incorrectly assumed it was 3.5". The tell-tale sign I failed to notice earlier was the disk image file size (1.2MB instead of 1.4) Apologies for completely overlooking that, and thank you for the advice on using the correct drive type.

jimjamz commented 3 months ago

@ruben-balea had correctly pointed out my mistake that I overlooked the disk type and format which the image derived from.

ruben-balea commented 3 months ago

No problem :-)