MFX with a difference grows up

Posts related to the MFX Interface
Post questions about MFX and raise any issues or problems here
Martin A
Posts: 840
Joined: 09 Nov 2013 21:03

MFX with a difference grows up

Post by Martin A »

Elsewhere I wrote
Martin A wrote: 28 Jul 2024 14:40 Until someone converts CPM 3 to the MTX, it's just me showing off, there's no actual use for it!
Well it seems that someone was me!

Writing a CPM3 BIOS turned out to be a not so trivial process but it's mostly done now :) I also needed to re-write or at least tweak the MFX as well. I'm not finished there are some missing features I still plan to add, but it's basically usable as it it now, no no need to keep things under wraps.

To retain support for the traditional CPM 2.2 on the MTX, requires a separate boot rom for CPM3. Since MFX is already using rom pages 4,5 and 6, that meant re-programming the GAL to open up rom slot 3 as well. Other hardware changes are the RTC fitted to to the old VRAM socket and changes to the FPGA to provide acces to both the SPI clock and set up an off CPU memory buffer to support the banked memory.

While I was writing ROM code I also tweaked the boot screen to show the CPM 3 boot option and changed the colours to match the new red FPGA and black PCB
New style boot screen
New style boot screen
Img_5338-small.jpg (56.56 KiB) Viewed 78533 times
Under the current setup, CPM 2 has access to 4 of it's 8 meg partitions instead of 8. Where the 5th to 8th partitions used to be are the CPM3 partitions. This was done so that CPM 2 can still run HexTrain unaltered, it's not like the extra partitions were needed, they weren't even visible to SDX Basic.

Reset 3 boots into CPM 3, as with CPM 2 hitting enter will interrupt the boot process and put you into a small monitor. Whilst its based on Zmon from CPM 2 there are several differences for the MFX hardware, primarily there's no RS232 support.
With clock support
With clock support
Img_5339-small.jpg (46.22 KiB) Viewed 78533 times
Assuming the monitor is not entered CPM 3 boots up looking something like this. The BIOS is completely self contained, there are no drivers taking up valuable high memory. Eveything is contained within the standard banked memory arrangement. The BDOS takes 1.5k and the BIOS another 1.5k of high memory. Everything else is free for user programs, the rest of the BDOS and BIOS is in a separate memory bank and paged in as required.

The boot loader is kept as small as possible to remain within the first 128 bytes of the first sector. This means in in emergency I can actually boot CPM 3 with the CPM 2 boot rom.

More to come when I have some more photo's to add.
User avatar
Dave
Posts: 1327
Joined: 11 Aug 2012 18:16
Contact:

Re: MFX with a difference grows up

Post by Dave »

Great stuff!

Worthy of note is that MFX is now Y2K compliant and running CP/M 3.1 / CP/M Plus with date set to use UK region formatting :D

Also worth noting is that the time on Martin’s camera is wrong :lol:
acsi
Posts: 74
Joined: 16 May 2019 08:49

Re: MFX with a difference grows up

Post by acsi »

Nice work Martin
Martin A
Posts: 840
Joined: 09 Nov 2013 21:03

Re: MFX with a difference grows up

Post by Martin A »

As promissed a couple more screenshots:

The monitor
Dave mon
Dave mon
Img_5340-small.jpg (41.68 KiB) Viewed 78511 times
The monitor prompt takes advantage of the readable copy of the page port from the FPGA to display the memory configuration. Maybe not so useful now, but it was important while developing the banking support. Read/Write sector and the substitue command could be combined to help with patching (but only when I implement write, that's currently missing!). At the moment only booting to A is supported. Planned extensions are to allow booting off a set off backup system tracks on C and the restoring of the system on A from the copy on C.

Oh, yes the monitor is named after someone...

Time stamping
DIR B:[FULL]
DIR B:[FULL]
Img_5341=small.jpg (99.57 KiB) Viewed 78511 times
The test setup has time stamping enabled on drive B, this is the output fromt the extended CPM 3 directory command DIR B:[FULL]. Notice that although there are only 14 files, 22 directory entries are in use. 2 additional entries are used by the files that are over 32k in size, the remainder is the date stamping overhead. Each group of 3 files uses a 4th directory entry to store the timestamps.

Note, CPM3 doesn't use the A drive is the boot drive and the real drives start at B convention that the Memotech version of CPM2 uses. There are 8 partitions of 4 meg each from A to H, with the system booting off A. Drive C is intended to be the system backup, the other 6 partitions hand back 24k storage space by not having space allocated for system tracks.

Why C and not B ? becasue the "emergency" boot from the CPM2 boot room process expects the bootable drives to be in 8 meg steps. The B drive is invisible to that process.

Finally for now, CPM3 is a LOT bigger than CPM2. For this current build the bootloader, BIOS and BDOS are taking up over 20k of drive space, with the CCP and additional 4k on drive A. That's instead of CMP2's 6.5k for bootlaoder, BIOS, BDOS and CCP plus external drivers. However the banking means that despite that 61K is still available to user programs.
User avatar
1024MAK
Posts: 785
Joined: 24 Dec 2012 03:01
Location: Looking forward to summer, in Somerset, UK

Re: MFX with a difference grows up

Post by 1024MAK »

Nice 8-)

Mark

PS it is a bit risky using the name "Dave" in association with computer systems, as you open the airlock to these references :lol:

PPS No disrespect intended towards the real Dave :D
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Autumn is here. Bye bye summer 2024...

Not as many MTXs as Dave! :lol:
User avatar
gunrock
Posts: 276
Joined: 28 Oct 2020 21:17

Re: MFX with a difference grows up

Post by gunrock »

Wow! This is pretty damn good. :shock:

Question: given that paging is implemented what's to stop larger than 61k programs being written? Nothing; this is on the writer of said programs to handle the paging?

Also question two: can we expect the new BIOS to be back ported to existing MFX systems (FPGA firmware and ROM updates needed of course)? Of course the RTC support will be missing but that's not a showstopper.
Steve G
Danish Memotech MTX 512, MFX and loving it
Martin A
Posts: 840
Joined: 09 Nov 2013 21:03

Re: MFX with a difference grows up

Post by Martin A »

gunrock wrote: 22 Jan 2025 21:37Question: given that paging is implemented what's to stop larger than 61k programs being written?
The lack of any CALL 0005 functions that access memory banking.

The banked memory setup gives the system more room to add new functions. Time stamping isn't a trivial process for a start :) and all the other benefits of CPM 3 don't come free. The banking allows for both maximun size TPA and the extra featutes over CPM 2.

The Memotech 59K system has it's top of memory at 59k, above that is some buffers and the hardware drivers copied from rom. Take 6.5K off that for the CPM 2 system and the TPA is around 53k, so 61K actually available is quite nice!
gunrock wrote: 22 Jan 2025 21:37can we expect the new BIOS to be back ported to existing MFX systems
Replacing the ROM, GAL and FPGA bitstream isn't a trivial process for most users, potentially that would requre 2 or 3 different programmers. The soloution for older MFX systems is have a CPM 2 program that loads the CPM3 BDOS and BIOS into memory and then kills off CPM2 and takes over. NB That potentially works for Rememotech as well as the SD and video hardware are similar enough.

That will need a new SD image with the CPM 3 partitions and utilities. but no chnages to the hardware. The older MFX won't support the clock, which means the memory occupied by the time functions can be re-purposed as buffer for the interbank memory transfers that on the larger MFX are done via hardware in the FPGA. It might be a little bit slower, but that's only teeny tiny fractions of a second.

[edit] The test version of the "legacy FPGA" code is running and though the interbank bank move code spends a bit longer on setup, the actual transfer time per byte is the same as the FPGA version.
User avatar
gunrock
Posts: 276
Joined: 28 Oct 2020 21:17

Re: MFX with a difference grows up

Post by gunrock »

Sounds like a good middle ground, Martin.
Steve G
Danish Memotech MTX 512, MFX and loving it
Martin A
Posts: 840
Joined: 09 Nov 2013 21:03

Re: MFX with a difference grows up

Post by Martin A »

The proof of concept "GO3.COM" is written and seems to be working OK.

I don't have a Cyclone2 equipped MFX here for testing, so I used the Cyclone2 DE1 running ReMemotech instead!
DE1 running ReMemotech and CPM3
DE1 running ReMemotech and CPM3
Img_5345-small.jpg (76.94 KiB) Viewed 78349 times
Not only does GO3 seem to work as expected, it's working at 25MHz.

Now with that distraction out of the way :D it's back to figuring out how to incorporate partition support into all 3 stages of the regular boot process.
stephen_usher
Posts: 341
Joined: 27 Nov 2016 19:58

Re: MFX with a difference grows up

Post by stephen_usher »

Seeing as CPM3 on other platforms often had incompatible disk formats to CPM2 on the same machine, is there a reason for keeping the old restrictions in the original BIOS?
Post Reply