Saving a file to the flash ROM drive?

141 views
Skip to first unread message

Robb Bates

unread,
Jun 10, 2025, 3:34:32 PM6/10/25
to RC2014-Z80
Is there any way to save a file to the Flash ROM drive from within CP/M?

Robb

Wayne Warthen

unread,
Jun 10, 2025, 3:39:28 PM6/10/25
to RC2014-Z80
Phil Summers enhanced the md.asm ROM/RAM disk driver to do exactly this.

Build a new ROM with MDFFENABLE set to TRUE.

Do be careful though.  This functionality is not commonly used and could potentially corrupt your ROM if anything goes wrong.  Also, it will be a bit slower than normal disk writes because the FLASH requires that a 4K block be erased and then rewritten for every sector write.

Thanks, Wayne

Robb Bates

unread,
Jun 10, 2025, 7:13:54 PM6/10/25
to RC2014-Z80
If I wanted to create a ZPM3 boot disk on the ROM disk, would this work just like any other disk?

i.e. For my little TinnyZ80, I'm not initially going to have a CF card and I want to be able to run ZPM3 from the ROM disk by default.

Robb

Wayne Warthen

unread,
Jun 11, 2025, 2:34:44 PM6/11/25
to RC2014-Z80
On Tuesday, June 10, 2025 at 4:13:54 PM UTC-7 Robb Bates wrote:
If I wanted to create a ZPM3 boot disk on the ROM disk, would this work just like any other disk?

i.e. For my little TinnyZ80, I'm not initially going to have a CF card and I want to be able to run ZPM3 from the ROM disk by default.

Not as currently configured.  The ROM and RAM disks use a disk layout that has no system tracks.  This is done to maximize the space available on them for files.  Attempting to use SYSCOPY to place a boot image on the ROM or RAM disk will fail with error "Non-system disk error".

This could all be changed with some work.

Thanks, Wayne

Robb Bates

unread,
Jun 11, 2025, 3:18:48 PM6/11/25
to RC2014-Z80
Is that something I could explore and figure out myself?  Maybe point me in the right direction?

Or is it too convoluted?

Looks like it has to do with building the ROM with cpm_wbw.sys into a certain ROM bank location?  And HBIOS copies part of that into RAM $8000 and transfers control to it.  i.e. just copying from ROM to RAM instead of from a disk boot sector to RAM?

Robb

Robb Bates

unread,
Jun 11, 2025, 3:43:01 PM6/11/25
to RC2014-Z80
And it looks like there is cpm_wbw.sys and zsys_wbw.sys.  Which explains why only cp/m and z-system can be booted from ROM.  I'm guessing you'd have to make a zpm3_wbw.sys and other versions in order to boot straight from the ROM.

Feature request time?

Robb

Wayne Warthen

unread,
Jun 11, 2025, 4:03:11 PM6/11/25
to RC2014-Z80
I think there is a simpler way.  As you know, CP/M 2.2 and ZSDOS both can boot straight from ROM.  They don't load from the ROM disk at all.  Those two system images are in the "code" portion of the ROM.  In theory, you could replace one of them with the ZPM loader.  The ZPM loader is in the file called ZPMLDR.SYS, but you need to strip off the first $600 bytes.  Then you need to look at the HBIOS build script and see where it embeds ZSYS and replace that with the ZPM loader.  You also need to adjust the table in romldr.asm so that ZSYS is loaded to the correct location and reflects the right size.  Finally, there may be an issue with where to find CPM.SYS.  The loader will need to look on the ROM disk drive.  So, the loader code may need to be adjusted to do that.

I know this is just an overview, but it is the best advice I can give you as a starting point with the time I have right now.

Thanks, Wayne

Robb Bates

unread,
Jun 11, 2025, 6:57:29 PM6/11/25
to RC2014-Z80
OK, I think I've seen most of what you mention during my digging.  I have a few EEPROMs.  I'll give it a shot.

Robb

Robb Bates

unread,
Jun 11, 2025, 7:43:49 PM6/11/25
to RC2014-Z80
Actually, I could just try this as an APP boot ROM I believe.

Robb

Wayne Warthen

unread,
Jun 12, 2025, 3:57:45 PM6/12/25
to RC2014-Z80
On Wednesday, June 11, 2025 at 4:43:49 PM UTC-7 Robb Bates wrote:
Actually, I could just try this as an APP boot ROM I believe.

Yes.  In fact, I just checked and the size available for a User Application in the current ROM layout is exactly the size required by zpmldr.bin.  Doing it this way is a good way to get this working quickly.

I saw your feature request in the RomWBW repository.  I will take a look at doing this, but it is not trivial to allow a user to configure any OS desired as the ROM boot OS.  I am overloaded right now, so it will be some time before I could look at the feature request.

I suggest you take a stab at using the User Application area for this.  Let me know if I can answer any questions.

By the way, have you noticed the ZPMLDR.COM application?  You can run that from regular CP/M 2.2 and tell it to load ZPM3 from the ROM disk.  That will allow you to work out the actual required contents of the ROM disk.  At a minimum, you will need CPM3.SYS and ZCCP.COM on there.

Thanks, Wayne

Wayne Warthen

unread,
Jun 12, 2025, 4:04:28 PM6/12/25
to RC2014-Z80
Now that I think about it, you could just copy ZPMLDR.COM, CPM3.SYS, and ZCCP.COM to the ROM disk on your existing system.  Then do a ROM boot of CP/M 2.2, go to the ROM disk, and run ZPMLDR.COM.  This should allow CPM3 to be launched with your existing ROM without using a real disk device.

Thanks, Wayne

Robb Bates

unread,
Jun 12, 2025, 4:06:08 PM6/12/25
to RC2014-Z80

I'm waiting for a part to arrive for my minimal system. I'm going to get regular CP/M 2.2 working first, then I'll try to get ZPM3 working off the ROM disk as a secondary launch. Then I'll work with the methods you suggest to get it running as you suggest. I'll certainly give feedback if/when I get it working. 

And the feature request obviously whenever you do come up for air, if you choose. Beggars can't be choosers.

Thanks, 
Robb
Reply all
Reply to author
Forward
0 new messages