MMC hard drive emulation?

discuss both original and modern hardware for the bbc micro/electron
Post Reply
User avatar
jonb
Posts: 2781
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

MMC hard drive emulation?

Post by jonb »

Quick question.

How difficult might it be to emulate a hard drive using a Turbo MMC or similar? The hardware must be capable (it's a mass storage device after all), but what about the firmware?

I recently got a SCSI2SD unit working with a SASI interface and I know that the BBC Micro hard drives were SASI, typically using the 1Mhz bus with a bridge board. But these must be like gold dust now, so I am wondering about modern, cost effective replacements.

Any ideas?

Cheers
JonB
duikkie
Posts: 2992
Joined: Fri Feb 07, 2014 3:28 pm
Contact:

Re: MMC hard drive emulation?

Post by duikkie »

not difficult , only a lot of work programming :), the beeb.mmb is a file. what slow MMC or similar do is reading and writting in a file.

the stucture of a harddrive is different. allso dos harddrives don't know about beeb use 512 bytes sectors and beeb 256 sectors. the the FAT maybe different.

but it is all in the programming , start with SMART SPI rom. there is in 3-drv(and 4-fat) a lot about FAT16 and FAT32 reading, but writing is and other cookie ( van Gaal english :D )
jonb wrote:Quick question.

How difficult might it be to emulate a hard drive using a Turbo MMC or similar? The hardware must be capable (it's a mass storage device after all), but what about the firmware?

I recently got a SCSI2SD unit working with a SASI interface and I know that the BBC Micro hard drives were SASI, typically using the 1Mhz bus with a bridge board. But these must be like gold dust now, so I am wondering about modern, cost effective replacements.

Any ideas?

Cheers
JonB
Last edited by duikkie on Wed Dec 23, 2015 8:14 am, edited 1 time in total.
User avatar
AndyF
Posts: 1276
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: MMC hard drive emulation?

Post by AndyF »

Would it not be easier to just use one of the IDE based units ? A modified ADFS rom and either then a real physical IDE drive or a CF / SD adaptor and card and you're done. :)

I don't (think) Retroclinic has these anymore as a 'standalone' unit although both JGH and Sprow have some diagrams on their sites so you could "build your own" if nothing else.

I could actually do with one thinking about it too.
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!
User avatar
danielj
Posts: 8541
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: MMC hard drive emulation?

Post by danielj »

I'd concur with Andy - that's the easiest method. The software's already written, and it appears to everything as "standard".

d.
User avatar
fordp
Posts: 1111
Joined: Sun Feb 12, 2012 9:08 pm
Location: Peterborough, England
Contact:

Re: MMC hard drive emulation?

Post by fordp »

I have a long list of things ahead of this but we will have ADFS working on SD Card at some point!
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!
duikkie
Posts: 2992
Joined: Fri Feb 07, 2014 3:28 pm
Contact:

Re: MMC hard drive emulation?

Post by duikkie »

a start point is 3-drv and 4-fat files from smart SPI rom, but you will end -up with a hole new rom.
by that time everybody has a Ch37X chip with USB connection on the tube or 1 MHZ port :)

SD and SPI SOOOOOOOOOOOOOOOOO 2015 :shock:
fordp wrote:I have a long list of things ahead of this but we will have ADFS working on SD Card at some point!
User avatar
fordp
Posts: 1111
Joined: Sun Feb 12, 2012 9:08 pm
Location: Peterborough, England
Contact:

Re: MMC hard drive emulation?

Post by fordp »

duikkie wrote:a start point is 3-drv and 4-fat files from smart SPI rom, but you will end -up with a hole new rom.
by that time everybody has a Ch37X chip with USB connection on the tube or 1 MHZ port :)

SD and SPI SOOOOOOOOOOOOOOOOO 2015 :shock:
We will see but my Tube port will be used for a second processor, with a1Ghz ARM on it ;)
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!
duikkie
Posts: 2992
Joined: Fri Feb 07, 2014 3:28 pm
Contact:

Re: MMC hard drive emulation?

Post by duikkie »

no problem if your 1ghz arm is not using &fef0 and &fef1 adress, we have chip that select other adress :)
fordp wrote:
duikkie wrote:a start point is 3-drv and 4-fat files from smart SPI rom, but you will end -up with a hole new rom.
by that time everybody has a Ch37X chip with USB connection on the tube or 1 MHZ port :)

SD and SPI SOOOOOOOOOOOOOOOOO 2015 :shock:
We will see but my Tube port will be used for a second processor, with a1Ghz ARM on it ;)
User avatar
fordp
Posts: 1111
Joined: Sun Feb 12, 2012 9:08 pm
Location: Peterborough, England
Contact:

Re: MMC hard drive emulation?

Post by fordp »

duikkie wrote:no problem if your 1ghz arm is not using &fef0 and &fef1 adress, we have chip that select other adress :)

We will see but my Tube port will be used for a second processor, with a1Ghz ARM on it ;)
Yes but my ARM board already has USB, so there is no point adding another board for that!
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!
User avatar
DutchAcorn
Posts: 2314
Joined: Fri Mar 21, 2014 9:56 am
Location: Maarn, Netherlands
Contact:

Re: MMC hard drive emulation?

Post by DutchAcorn »

AndyF wrote:Would it not be easier to just use one of the IDE based units ? A modified ADFS rom and either then a real physical IDE drive or a CF / SD adaptor and card and you're done. :). ....
The strength of the MMC card system imo is the easy no-soldering super cheap hardware requirement. It would be fun to have something similar to the MMC but based on ADFS instead of DFS and simulating a harddisc.
Paul

Image
User avatar
jonb
Posts: 2781
Joined: Sat May 21, 2011 1:42 pm
Location: South Coast of England
Contact:

Re: MMC hard drive emulation?

Post by jonb »

That's the idea, Paul..! :D
User avatar
AndyF
Posts: 1276
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: MMC hard drive emulation?

Post by AndyF »

Now I'm confused :oops: from reading the replies to this. I'm just curious nothing more.

The usual IDE 'interface' lives in the 1MHz bus socket. The co-pro obviously lives in the Tube socket.

So where does this MMC unit usually plug in ? I've not looked at one before as I have a DataCentre for my 'transfer' requirements (and a serial cable and XFER for ADFS images but that's quite rare)

Does said MMC plug into the 1Mhz bus then or the user port ? 8-[
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!
User avatar
danielj
Posts: 8541
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: MMC hard drive emulation?

Post by danielj »

MMC = user port.

d.
duikkie
Posts: 2992
Joined: Fri Feb 07, 2014 3:28 pm
Contact:

Re: MMC hard drive emulation?

Post by duikkie »

or tube with ch375b chip :) look at my new 375b project :shock:
danielj wrote:MMC = user port.

d.
User avatar
hoglet
Posts: 9820
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: MMC hard drive emulation?

Post by hoglet »

Hi Ford,
fordp wrote:I have a long list of things ahead of this but we will have ADFS working on SD Card at some point!
I've been thinking a bit more about this.

I think the easiest way to achieve this is using IDE as an intermediate interface, to avoid having to do much (any?) software work.

I'm currently using the DataCentre IDE interface with a CF/IDE adapter and ADFS 1.33/ADFS1.53 and this combination seems to work well.

The ingredients you need for an SD based solution are:

1. A SDCard to IDE Adapter

e.g. http://www.ebay.co.uk/itm/44-Pin-Male-I ... 1393433975 (picked at random)
SD_IDE1.JPG
SD_IDE2.JPG
2. An 8-bit or 16-bit IDE Interface, of which there are several designed to choose from:

http://www.sprow.co.uk/bbc/beebide.htm
BEEBIDE_SPROW.jpg
http://mdfs.net/Info/Comp/BBC/IDE/
BEEBIDE_JGH.gif
http://www.retroclinic.com/acorn/bbcide/bbcide.htm
BEEBIDE_RC.jpg
Any of these designs could easily be added to BeebFPGA. The only hassle is making the phyical connections and the need for 3.3/5V voltage level conversion.

3. ADFS 1.33 (Model B)/ADFS 1.53 (Master)

Which is patched for IDE:
http://mdfs.net/Info/Comp/BBC/IDE/ADFS/IDEPatch.txt

Of course, all this is purely hypothetical.

Anyone ever actually tried using SD Cards via an IDE Adapter onto a Beeb?

Dave
User avatar
1024MAK
Posts: 10483
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: MMC hard drive emulation?

Post by 1024MAK »

<Probably regrets saying this...>
I've got all the bits (currently forgot where I've put the IDE-SD adaptors though), it's on the list of things to do (but rather far down the list), but I have lots of other things I want to do first, so I have not got around to it yet.

Of course, if there was heaps of interest, I may change my mind.

Mark
User avatar
fordp
Posts: 1111
Joined: Sun Feb 12, 2012 9:08 pm
Location: Peterborough, England
Contact:

Re: MMC hard drive emulation?

Post by fordp »

I would like to implement IDE emulation on the Raspberry Pi Zero. A file on the Pi's Micro SD card can be used as a "Harddrive" with firmware running on the Pi emulating the IDE protocol. This will not work on the Matchbox LX9 as all of it's three address lines are in use but could be made to work on the BeebFPGA DE1 version as the extra 2 address lines (A3 and A4) can be utilised to fully decode the 32 bytes allocated to the Tube Interface.

The only modification to the ADFS IDE ROM that should be required is that the IDE interface would be accessed at say 0xFEF0-0xFEF7.

This needs both HDL and Firmware but should provide a very cost effective small compact solution and leave the 1MHz bus available for other uses.

This is just an idea at the moment.

A small modification would allow this system to work on the Matchbox LX9. This could involve just a cut track and a patch wire. I will leave you clever lot to guess the modification needed ;)

Edit: I love this page http://www.retroleum.co.uk/electronics- ... interface/
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!
User avatar
DutchAcorn
Posts: 2314
Joined: Fri Mar 21, 2014 9:56 am
Location: Maarn, Netherlands
Contact:

Re: MMC hard drive emulation?

Post by DutchAcorn »

hoglet wrote:Hi Ford,
fordp wrote:I have a long list of things ahead of this but we will have ADFS working on SD Card at some point!
I've been thinking a bit more about this.

I think the easiest way to achieve this is using IDE as an intermediate interface, to avoid having to do much (any?) software work.
That would probably work and meets the requirements: use an SD card for ADFS mass storage on the beeb. But it is 20x the price of the MMFS / SmartSPI solution and we miss out on a host of great threads discussing different smart adaptations of the ADFS file system.
Paul

Image
User avatar
hoglet
Posts: 9820
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: MMC hard drive emulation?

Post by hoglet »

DutchAcorn wrote: That would probably work and meets the requirements: use an SD card for ADFS mass storage on the beeb. But it is 20x the price of the MMFS / SmartSPI solution and we miss out on a host of great threads discussing different smart adaptations of the ADFS file system.
Funny you should say that. It felt like cop-out to me as well. :lol:

So a couple of hours ago I started reading JHG's commented disassembly of ADFS ;-)
http://mdfs.net/Info/Comp/BBC/ADFS/v150.zip

And comparing it with his IDE patch:
http://mdfs.net/Info/Comp/BBC/IDE/ADFS/

I have a cunning plan....

But I'm 95% sure it's not going to fit.

Dave
User avatar
fordp
Posts: 1111
Joined: Sun Feb 12, 2012 9:08 pm
Location: Peterborough, England
Contact:

Re: MMC hard drive emulation?

Post by fordp »

I of course like my idea.

I need to add zero extra stuff to do my virtual IDE so it costs, nothing!
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!
User avatar
fordp
Posts: 1111
Joined: Sun Feb 12, 2012 9:08 pm
Location: Peterborough, England
Contact:

Re: MMC hard drive emulation?

Post by fordp »

hoglet wrote:
DutchAcorn wrote: That would probably work and meets the requirements: use an SD card for ADFS mass storage on the beeb. But it is 20x the price of the MMFS / SmartSPI solution and we miss out on a host of great threads discussing different smart adaptations of the ADFS file system.
Funny you should say that. It felt like cop-out to me as well. :lol:

So a couple of hours ago I started reading JHG's commented disassembly of ADFS ;-)
http://mdfs.net/Info/Comp/BBC/ADFS/v150.zip

And comparing it with his IDE patch:
http://mdfs.net/Info/Comp/BBC/IDE/ADFS/

I have a cunning plan....

But I'm 95% sure it's not going to fit.

Dave
We only really need Hardisk access in the ROM not floppy access if that helps. Could the floppy code be loaded in to RAM with a star command?
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!
User avatar
hoglet
Posts: 9820
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: MMC hard drive emulation?

Post by hoglet »

fordp wrote: We only really need Hardisk access in the ROM not floppy access if that helps. Could the floppy code be loaded in to RAM with a star command?
It would help, and I guess if we had to loose it we could. But the floppy code is actually quite useful for accessing real DOS floppies from DOSPLUS. Otherwise, getting new software onto the DOS hard disc is a right pain.

I'm not sure having a second filesystem in RAM is workable in DosPlus (for example). This kind of requires a single ADFS file system I think (and does drive mapping within this).

The first thing I was going to do was to convert Jonathan's ADFS 1.50 disassembly back into BeebASM source with proper labels, so things are able to move around, and it's easy to re-build. Then take stock of how much space there is, and what we could take out.

Looking at the way IDE has been patched in place of the SCSI code, all that needs to be emulated for SD is READ (&08) and WRITE (&0A), and we have this code already in MMFS.

What I'm not sure about is whether to keep the FAT file system layer on the SD Card, or not.

If we keep it, then one SD Card could have a BEEB.MMB file on it (for SmartSPI, MMFS, etc) and a SCSI<N>.DAT file for each hard drive of four hard disks.

On the other hand, with DOSPLUS you end up with a DOS file system wrapped in an ADFS file system wrapped in a FAT file system, which sounds like a sure recipe for blocks getting written to the wrong place.

Plus, I'm not 100% sure how good the FAT code is in MMFS, and whether it does a proper job of dealing with a fragmented file. I kind of suspect not (but I may be doing Martim M a dis-service here).

Dave
User avatar
fordp
Posts: 1111
Joined: Sun Feb 12, 2012 9:08 pm
Location: Peterborough, England
Contact:

Re: MMC hard drive emulation?

Post by fordp »

hoglet wrote: Plus, I'm not 100% sure how good the FAT code is in MMFS, and whether it does a proper job of dealing with a fragmented file. I kind of suspect not (but I may be doing Martim M a dis-service here).

Dave
I seem to remember reading that it does not support fragmentation and has to be pretty much the first thing added to the card, but we can live with that I think.
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!
User avatar
hoglet
Posts: 9820
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: MMC hard drive emulation?

Post by hoglet »

hoglet wrote: The first thing I was going to do was to convert Jonathan's ADFS 1.50 disassembly back into BeebASM source with proper labels, so things are able to move around, and it's easy to re-build. Then take stock of how much space there is, and what we could take out.
Well, that took a bit longer than I expected, but I now have a cleanish version of the source for ADFS 1.50 in BeebASM format, that assembles and matches the original ROM:
https://github.com/hoglet67/ADFS/blob/m ... dfs150.asm

So now the real fun begins.

Dave
SteveF
Posts: 812
Joined: Fri Aug 28, 2015 9:34 pm
Contact:

Re: MMC hard drive emulation?

Post by SteveF »

At the risk of making an obvious suggestion, if you're worried about space in the ROM, could you make the 'MMC ADFS' use the MMC read/write code in the MMFS ROM? I note that some versions of ADFS appear to use the DFS ROM to handle floppy access, according to http://mdfs.net/System/ROMs/Filing/Disk/Acorn/versions. I can appreciate this might not work - especially since 'MMC ADFS' probably wants a separate area of the MMC card to use compared to regular MMFS - but I thought I'd mention it.

I do think this would be a very cool thing to have, however it's done, so I'm delighted to see you are attempting it. I can at least make encouraging noises if nothing else. :-)
User avatar
Wookie
Posts: 342
Joined: Sat Aug 27, 2005 11:06 am
Location: Lost in a fog of PSU capacitor smoke
Contact:

Re: MMC hard drive emulation?

Post by Wookie »

One thing that I never understood was why if your running SCSI, drives 0-3 become the hard discs and the floppies move to drives 4-7, but if you only have floppies then 0-3 point to the floppy drives.

Surely it would be easier and better to always leave 0-3 as floppy drives and add 4-7 as hard discs when available ?

After all that is exactly what Acorn did with the later 32bit machines 0-3 were always the floppy drives and 4-7 were always hard drives IIRC.
cheers Wookie
Overclocked StrongARM RiscPC + Viewfinder
Overclocked Arm3 8MB A310 + vidc extender
BBC Master with Matchbox CoPro
BBC B+ 64K
My original Electron from 1985 with Slogger MasterRam/Turbo,AP1,AP2 rom, AP3+4 & New AP6
User avatar
1024MAK
Posts: 10483
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: MMC hard drive emulation?

Post by 1024MAK »

No, if the ideas department had been working, the user would/could have defined which drive identifier (logical name/number/letter) would map to each drive (or partition). :D

Mark
SteveF
Posts: 812
Joined: Fri Aug 28, 2015 9:34 pm
Contact:

Re: MMC hard drive emulation?

Post by SteveF »

Wookie wrote:One thing that I never understood was why if your running SCSI, drives 0-3 become the hard discs and the floppies move to drives 4-7, but if you only have floppies then 0-3 point to the floppy drives
I seem to remember reading something in a review back in the day which suggested this was so "badly written software" which insisted on doing *MOUNT 0 could be moved to a hard drive (presumably, provided you didn't mind it scribbling all over your root directory instead of running from where you put it). This seems fairly improbable - how much software was written to work specifically with ADFS, but only from floppies? - but I thought I'd share anyway.
User avatar
hoglet
Posts: 9820
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: MMC hard drive emulation?

Post by hoglet »

I've spent a bit more time on this, enough now to realize I have underestimated the amount of work involved #-o

On the plus side, I've folded the last few versions of JHG's ADFS IDE Patches into the source tree now:
https://github.com/hoglet67/ADFS/commits/master
I've also been able to able to verify that these generate ROMs with the right MD5 checksums.

What's interesting is there are at least five versions of "ADFS 1.53" in circulation, built using different versions of the IDE Patch. Here are the MD5 checksums.

Code: Select all

IDE Patch 1.16 - C0362A03740BC6D224C858D609990E67
IDE Patch 1.17 - CA5B3D96DB9756F70F06E69401F286F5
IDE Patch 1.18 - 28446E16801959962B0D868D068DC2A9
IDE Patch 1.19 - 94434348454DD06263BAC54D5D0D0280
IDE Patch 1.20 - 99FE92A80130C05366706532A20A0463
All of these show up as ADFS 1.53 in the *HELP, which doesn't help.

I had rather simplistically hoped to just be able to reuse the MMC driver code from MMFS, but that's actually quite challenging to do, because it's derived from DFS, and the workspace layout of ADFS is very different.

What I have so far is also about 1K too large, and so I don't think I'm going to be able to retain the floppy drivers.
SteveF wrote:At the risk of making an obvious suggestion, if you're worried about space in the ROM, could you make the 'MMC ADFS' use the MMC read/write code in the MMFS ROM? I note that some versions of ADFS appear to use the DFS ROM to handle floppy access, according to http://mdfs.net/System/ROMs/Filing/Disk/Acorn/versions. I can appreciate this might not work - especially since 'MMC ADFS' probably wants a separate area of the MMC card to use compared to regular MMFS - but I thought I'd mention it.
That's an interesting idea. Anyone know if the approved "approved" way of doing this would be via DFS's OSWORD 7F? Would that even work? (I'm thinking multiple file systems, clashing workspace, etc.) I wonder how this works on the Master?
SteveF wrote: I do think this would be a very cool thing to have, however it's done, so I'm delighted to see you are attempting it. I can at least make encouraging noises if nothing else. :-)
Thanks! But my motivation level is dropping significantly, given how cheap IDE/SD Adapters are, and the fact this only looks possible by loosing floppy support.

Dave
User avatar
fordp
Posts: 1111
Joined: Sun Feb 12, 2012 9:08 pm
Location: Peterborough, England
Contact:

Re: MMC hard drive emulation?

Post by fordp »

Hi Dave,

I would guess that most people will want both ADFS(new version) and MMFS support so I would say there is no need to have it totally standalone. Maybe the MMFS can at least do the FAT stuff and initialising the SDCard if that helps. I think targeting only the Master in the first instance may help too?

I noticed there is stuff in there to allow loading directly in to screen memory (i.e. switching to a screen mode where the memory is in the first 32K), we could loose that. You would just have to select the correct screen mode before loading.

There are lots of people on here I am sure that are willing to help out in squeezing the code in.

EDIT: Would it not be possible load the floppy code in the workspace. This for me is mostly about running Panos and the ARM Copro.

This is a very worthy project, fingers crossed!
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!
Post Reply

Return to “8-bit acorn hardware”