[Rpcemu] Using RiscPC IDE diskimage as hd4.hdf

Mark Adams mark147m at gmail.com
Sun Jan 24 02:51:48 PST 2010


Hmm... sounds vaguely familiar.

I created an hd4.hdf directly (actually via a hack to a web server app
running on the Risc PC rather than using 'dd') and the emulator didn't like
it.  I forget the exact symptoms.  I did write some notes at the time about
my analysis and solution though:

"
On my Risc PC, the hard disc is set up for LBA addressing.  This emulator
does not seem to handle that correctly and apart from at the start of the
disk, returns the wrong sectors, so the disc appears corrupt.

The solution is to disable LBA mode which can be done by clearing byte
0x00000dba in the disc image to zero (previously 0x01).  This is in the
controller's private area of the boot sector.  Unfortunately, this breaks
the checksum for the boot sector (0x00000c00) and if it's wrong, ADFS
assumes some other sort of disc geometry that means it gets even worse.

However, the way the checksum works, it is insensitive to bytes moving
around if the bytes in between are zero.  So, we can move the 0x01 byte
earlier in the sector to byte 0x00000db0 where it is harmless.
"

So, you could investigate that option, or you could investigate a bit
further and try to fix the emulator code.  I seem to remember having a look
and concluding that the IDE driver was already a bit of a mess and decided
that a workaround was the easier option at the time.

Note: I have a feeling you may find the byte I refer to at 0xfba rather than
0xdba if you made the image using dd on the entire disk, you'll have to
check.

Note 2: my drive was around 2 Gbytes in size.  If your disk is a very
different size, you may have different issues connected with the various IDE
size limits and the mitigation strategies for them.

My system is working fine following the change.

Would be interested to know how you get on.

Regards,

Mark


2010/1/24 Phil Morris <phil.2608 at btconnect.com>

>  Hello
>
>
>
> I seem to be having a bit of a ‘virtualisation frenzy’ at the moment which
> has strayed dangerously to my old RiscPC (which still works of course)…
>
>
>
> I have ubuntu x86 and am building/running rpcemu happily.
>
>
>
> I have imaged my old RiscOS HDD (Conner CFS1275A) by plugging it in to my
> PC and using ‘dd’ to dump a complete disc image.
>
>
>
> I want to simply call this image hd4.hdf and have rpcemu boot from it but
> the emulator complains that the disc is not understood ?
>
>
>
> Has anyone else done this ? Are there any bug fixes in this area ?
>
>
>
> To my surprise I found that ubuntu includes native support for ADFS, so :
>
>
>
> Sudo mount –o loop –t adfs hd4.adf /mnt
>
>
>
> Actually works and allows me to see the disc image so it seems that the
> image file is ok (although copying to rpcemu hd4 via hostfs loses filetypes)
>
>
>
> Of course rpcemu works when it creates its own hd4.hdf file (using HForm
> etc).
>
>
>
> This implies to me that there is a bug of sorts in the ide driver that is
> masked when it is used to write and read a disk image but is evident when
> you try to read a previously created image.
>
>
>
> Thanks for any help/advice you can give.
>
>
>
> Phil.
>
>
>
>
>
> _______________________________________________
> Rpcemu mailing list
> Rpcemu at riscos.info
> http://www.riscos.info/cgi-bin/mailman/listinfo/rpcemu
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riscos.info/pipermail/rpcemu/attachments/20100124/2ec6dfff/attachment.htm>


More information about the Rpcemu mailing list