ZXMMC
emulation does not work. I tried to use HDF
image prepared with raw2hdf
which is recognized by DivIDE
emulation in the +3e
mode (e.g. CAT TAB
shows some geometry for it and I can use it as rootfs for Fuzix
). The same image is not visible at all when used with ZXMMC
emulation. Fuse compiled from git master commit 8deafe0e
.
I don't see any problem with ZXMMC emulation. Please, check that you are using the proper +3e ROMs for ZXMMC and options similar to:
fuse -m plus3e --zxmmc --zxmmc-file image.hdf --rom-plus3e-0 mmcen3e0.rom --rom-plus3e-1 mmcen3e1.rom --rom-plus3e-2 mmcen3e2.rom --rom-plus3e-3 mmcen3e3.rom
In case it fails, maybe it's something specific to your hdf file? Do you mind sharing (privately) with me to reproduce this error?
I do not have ROM files from your list. The only ROM files I've got are those shipped along with Fuse package in Gentoo Linux:
Also, the images I'm using are substantially big (4GB, 8GB), it can be hard to share. Yet it is easy to prepare one as the content does not really matter. Take one SD card with regular
DOS
partition table (asFuzix
understands onlyDOS
paritition tables), grab entire card's content (partition table and partitions) usingdd
command into a raw image file and useraw2hdf
fromfuse-utils
to createHDF
image out of it.That plus3e roms distributed by default are for the Simple 8-bit IDE interface. The plus3e author make specific ROMs for different interfaces. You should grab the mmc files:
http://www.worldofspectrum.org/zxplus3e/p3eroms.html
You could change the Fuse options to load that new roms, or rename to the same filename and replace them.
The 4 Gb image should work good. The 8 Gb image could fail. Could you at least specify the exact size of the hdf files? It should be trivial to rebuild that empty images.
Using ROM images downloaded from that page indeed helped a bit and now
CAT TAB
shows geometry of some empty ~512MB image I've prepared. Some problems unfortunately emerged still. I tried to make use of ~256MB image of real SD card, unfortunately, Fuse refused to start, stating the size of the card is unsupported (while DivIDE emulation had no problems working with the very same image). You can replicate the problem with empty image too:Then I tried to make use of ~3GB real SD card (3904897024 bytes raw image, which resulted in 3904897558 bytes hdf image) of Workbench +3e (with all of its substantial number of partitions its installer have created). Unfortunately, as I tried to use it, +3DOS has gone haywire and the +3e startup screen started to look as in attached image. As a result, no drives (either floppies or MMC) were accessible.
Last edit: Paul Osmialowski 2019-11-14
Thank you for the info! AFAIK you have these real cards:
MMC emulation use a virtual SDHC card between 512 Kb and 32 Gb. That's not realistic as SDSC card sizes ranges between 256 Kb and 2 Gb and SDHC card sizes ranges between 2 Gb and 32 Gb.
The number of blocks of SDHC cards should be multiple of 2^10 (512 Kb) and Fuse/libspectrum are strictly validating this size. Hence the problem with your 256 Mb card image.
Fuse should autodetect the card type and adjust the MMC emulation. That's doable but requires coding/testing. As a workaround, we could relax this validation and allow images not multiple of 2^10. With your 256 Mb card image, the last 512 blocks (256 Kb) would not be accesible.
Have you tested the HDF image available in Workbench +3e site? We would need concise steps to reproduce this error to know what's going on.
The first issue has an easy workaroud, it's sufficient to extend size of the raw image and fill it with zeros, e.g.:
The other issue, yes, I did try to use Workbench +3e preinstalled
.hdf
image and it seems to work properly. Also I managed to install Workbench +3e on empty ~2GB image formatted in Fuse.The only problems that remain are:
1. SD card image copied from the real thing can't be read properly (result seen on the screenshot attached previously)
2. The
Fuzix
bootloader can't findFuzix
partitions on SD card image grabbed from the real thing (where the same bootloader can find them; also they can be found withDivIDE
emulation). The author states it's a bug in Fuse.Last edit: Paul Osmialowski 2019-11-16
That's even better.
My gut tells me that if Workbench +3e works with a formatted image, the MMC commands work good and the problem could be with the data contained in the card or how is organised in sectors.
How did you partitioned the card? Which partion IDs do you used? You mentioned regular
DOS
partition table but +3e requiresIDEDOS
. It would be good to compare the partition table of the physical card and the empty blank image formatted in Fuse (high level) or the blocks itself (low level).Could you share an image via dropbox/onedrive/google drive? I could debug the MMC commands if necessary.
I know nothing about Fuzix. If you cand share an image and provide detailed steps to reproduce the problem I could have a look.
Now you mention it, the partitions you need with a 48k machine + DivIDE are quite different than a +3e machine + ZXMMC.
Last edit: Sergio Baldoví 2019-11-22
Hey, this is the misconception that also made me stuck for a while. I am using
extended IDEDOS scheme
, as described on those two pages: http://www.worldofspectrum.org/zxplus3e/sharingdisks.html and http://zxvgs.yarek.com/en-idedos.htmlWhat is not stated explicitely enough, is that we're dealing with two levels of partitioning here. Top level is the regular
DOS
partition table starting at sector 0, in which the first partition (of any type, as for+3DOS
it is not relevant) is the placeholder for the lower level (ofIDEDOS
) partitions withPLUSIDEDOS
partition table. What is relevant is where placeholder forIDEDOS
partitions starts. If+3e
firmware finds the disk image starts with theDOS
partition table, it looks forIDEDOS
partitions at sector 128 (Head 1 in the C/H/S scheme), otherwise it expectsIDEDOS
partitions to start at the sector 0.In order to force Linux's
fdisk
to place theIDEDOS
placeholder partition at sector 128, it must be started in theDOS
compatibility mode, e.g.:fdisk -c=dos /dev/sdb
.I'd cover next message with that, later today.
A new issue I've found is that mass storage driver for
CP/M Plus
byotivax
was supposed to supportZXMMC
interface since its 2017's version 1.4 (a.k.adriver v0.7
, the versioning of this thing is messy and distribution model is hopeless). I tried the only two versions I could possibly find (1.4 and 1.5) and all they both say isInterface: Not found
.Installation procedure is like this:
1. Download boot disk: http://fuzix.org/downloads/0.3/zx+3-boot-0.3.dsk.gz
2. Unpack boot disk:
gunzip zx+3-boot-0.3.dsk.gz
, should leavezx+3-boot-0.3.dsk
file.3. Download 32MB filesystem: http://fuzix.org/downloads/0.3/rootfs-z80-32.gz
4. Unpack filesystem:
gunzip rootfs-z80-32.gz
, should leaverootfs-z80-32
file.5. Create empty raw image (256MB should be sufficient):
DOS
partition table and partitions:Example
fdisk
session:What matters here is that there are two partitions, one of type
7e
and size of 65536 (1 + 65535) sectors for the filesystem and the other of type7f
and size of 8192 (1 + 8191) sectors for a swap. I've created one more partition starting at sector 128 and unused type19
that could be used as placeholder forIDEDOS
partitions (just remember to limit the number of cylinders used when formatting from+3DOS
).Remember to write the new partition table before leaving
fdisk
.7. Copy filesystem image to the
7e
-typed partition:Note that this operation should NOT change the size of the
256MB.rawimg
file.8. Convert raw image to an
HDF
image:fuse
, e.g.:A:
.DivIDE
:A:
you can see that the bootloader has found threeIDE
partitions:hda1
,hda2
andhda3
. At thebootdev:
prompt typehda2
.root
at thelogin:
prompt.shutdown
command and wait until it saysHalted.
, otherwise it will go through filesystem repair at subsequent boot time.On the real
+3e
with theZXMMC
interface, those partitions should be found as SD cards rather than IDE drives, yet still partitions should have names withhda
prefix, namely, one should observe following output:Last edit: Paul Osmialowski 2019-11-22
Thank you for the detailed explanation. I think the image creation and the partition layout are correct.
Booting a +3e machine with ZXMMC, block 0 (MBR) and block 128 (IDEDOS) are read and if there are IDEDOS partitions, blocks 129 and 130 are also read. I couldn't reproduce the error of the screnshot (+3DOS has gone haywire).
For debugging Fuzix, I've simplified the steps. Fuzix documentation states that supports +3 machines, so there is not need to mess with +3e machines:
1. Download boot disk: http://fuzix.org/downloads/0.3/zx+3-boot-0.3.dsk.gz
2. Download IDE image: http://fuzix.org/downloads/0.3/rc2014-0.3.ide.gz
3. Strip 1024 bytes from ide image:
dd if=0.3.ide of=0.3.raw ibs=1024 skip=1
4. Convert from raw image to HDF:
raw2hdf 0.3.raw 0.3.hdf
5. Start +3 machine:
fuse -m plus3 --zxmmc --zxmmc-file 0.3.hdf --plus3disk zx+3-boot.dsk
I see there is a problem initializing the SD card. CMD0 (GO_IDLE_STATE) command is issued but CMD 8 (SEND_IF_COND) never cames.
After the CMD0 command Fuzix does 21 reads. Fuse returns the R1 response and the latter 20 reads are floating bus.
The problem seems to be here:
https://github.com/EtchedPixels/FUZIX/blob/337485699af7f84a63bc73e6e3841c22b3ab47e0/Kernel/dev/devsd.c#L143
Fuzix is discarding the response of CMD0 - GO_IDLE command.
Previously this line was only active on CMD12 (STOP_TRANSMISSION) command, but was enabled by this refactoring:
https://github.com/EtchedPixels/FUZIX/commit/08a8d4a62165da1feca8529df033ca42978b54c8#diff-404eeab3bbef36bfc73d017fd814b76aL139
So it seems a bug in Fuzix. Although current code might work with real cards, IMO it is not safe to discard the first response.
Last edit: Sergio Baldoví 2019-11-24
Ok, mystery solved. I've written a simple program (attached) that prints IDEDOS partition table. For .hdf images it just needs to have 534 bytes of offset provided. The truth revealed itself: faulty image was not a card image, but the first partition on it (IDEDOS placeholder) that I took from one SD card to copy it to another. After some time (a week or so) I've forgotten about it and have made HDF image out of it. In effect, all IDEDOS partitions were pointed 128 sectors ahead.
I've introduced the change you've proposed on my local clone of the Fuzix repo and rebuilt the whole thing. It works in Fuse +3e with ZXMMC emulation now!
Last edit: Paul Osmialowski 2019-11-24
There's no bug then. This one can be closed now.
Great. BTW, there is other useful tool for IDEDOS images:
https://github.com/ZXSpectrumMirrors/zx-3e/blob/master/3e.c
Just for a reference, the response I have from Fuzix authors:
Thanks. Outstanding issues are:
Related
Bugs: #462
Bugs: #463