CP/M release with Kerberos support

60 views
Skip to first unread message

Carsten Elton Sørensen

unread,
Aug 29, 2017, 6:31:38 AM8/29/17
to kerberos-midi
Hi all,

I've been hacking a bit on CP/M for the C128 and have added Kerberos SRAM support to it. You now get a fast 128k RAM disk on drive M (like a REU 128k), when you boot this release with a Kerberos cart attached.

To use it, select option "H: Hardware reset / Kerberos off" and then boot the CP/M image you can find at https://csoren.github.io/c128cpm/

If you want to hack on CP/M, this repo may also be a good starting point, as everything is set up for compiling from the command line straight away.

Have fun!
Carsten Elton Sørensen

Frank Buss

unread,
Aug 29, 2017, 7:26:28 AM8/29/17
to kerberos-midi
That's interesting that it works. I tested it with the 2 MHz mode, but so far not from the Z80, glad that it works and thanks for your work.

Carsten Elton Sørensen

unread,
Aug 29, 2017, 8:40:46 AM8/29/17
to kerberos-midi
I could have delegated some of the work to the 8502, but you're right, everything is handled on the Z80. Since Kerberos lives in the IO area, we have to use the IO port instructions to access the SRAM, but it all works fine.

Frank Buss

unread,
Aug 29, 2017, 11:07:34 AM8/29/17
to kerberos-midi
It might be even possible to store the boot program in flash and copy some programs to the RAM disk on start, e.g. as a special EasyFlash mode image, which starts the C128 mode (you can see an example how I do this with C128 PRG files in the flash slots). But it would be necessary to start the Z80 after the C128 was started, don't know if this is possible. This would allow super fast booting and program starting from the RAM disk without any real disk drive access.

Carsten Elton Sørensen

unread,
Aug 29, 2017, 2:35:23 PM8/29/17
to kerberos-midi
Running CP/M with the RAM disk as a system drive is pretty attractive, not least because of fast booting. Switching between the Z80 and 8502 can be done at any time, it's a well documented process.

I'm not too familiar with the internals of how CP/M is bootstrapped from the boot sector (yet), but I strongly suspect it should be possible to embed CPM+.SYS in a regular C128 .prg so it doesn't take up 26k of precious RAM disk space. As it's only loaded once and then stays resident this would be a priority. Populating the RAM disk could possibly be done by the same .prg.

Can a C128 .prg span more than one bank, ie. be bigger than 64k? And can Kerberos handle those? I'm not sure it's necessary, I don't think I'd want to fill up the RAM disk as it's pretty useful as a scratch space, which many programs use.

Frank Buss

unread,
Aug 29, 2017, 4:08:16 PM8/29/17
to kerberos-midi
A C128 PRG which contains the CP/M boot program would be cool. And you wouldn't need to write anything special for Kerberos for it, because I did already all the tricks for starting a C128 PRG. I guess you could test and debug it in VICE with a CP/M which uses a REU for easier development, and then just change the external RAM access.

A PRG can only be 64k max. But there are two areas reserved for two virtual cartridge disks in the Kerberos flash, from $10000 to $6ffff, and the Kerberos App already has the ability to upload D64 images to these areas ("Disk tools" tab). Don't know, if this is compatible with CP/M disks, but if it works, maybe you could use this as one two sided ROM system disk, or if you don't mind some more work, as a virtual writable flash disk, as I started already very roughly for the C64 mode. I know, my developer documentation could be better for this, but at least in C64 mode you can just enable the ROM emulation at $8000 with "CART_CONTROL = CART_CONTROL_EXROM_LOW | CART_CONTROL_GAME_HIGH;" and then selecting which 8k area of the flash you will see with the FLASH_ADDRESS_EXTENSION register (see main_menu.c). This should make the ROM disk implementation easy.

Carsten Elton Sørensen

unread,
Sep 11, 2017, 3:39:08 AM9/11/17
to kerberos-midi
I have CPM+.SYS in .prg format, yay! It took a bit of disassembling the Z80 BIOS to understand exactly what was needed to start CP/M this way, but it all worked out in the end. CP/M boot time is reduced by at least 15 seconds, depending on drive type, so it's already quite helpful.

Next is writing a flash disk driver for CP/M. I think I'm going to skip the two disk thing completely and just treat the area as one large disk. It's easier for the CP/M side and there's no wasted space. You should be able to init and copy files to it from CP/M once the driver is done. Booting off it will require some more work, unless I simply make it drive A if the flash disk is present.


Carsten Elton Sørensen

unread,
Sep 11, 2017, 3:43:29 AM9/11/17
to kerberos-midi
"Depending on drive type" is of course not true. I meant to include some example boot times but decided against it as the improvement is what matters and forgot to delete that part.

Carsten Elton Sørensen

unread,
Sep 11, 2017, 5:17:38 AM9/11/17
to kerberos-midi
On Tuesday, August 29, 2017 at 10:08:16 PM UTC+2, Frank Buss wrote:
work, as a virtual writable flash disk, as I started already very roughly for the C64 mode. I know, my developer documentation could be better for this, but at least in C64 mode you can just enable the ROM emulation at $8000 with "CART_CONTROL = CART_CONTROL_EXROM_LOW | CART_CONTROL_GAME_HIGH;" and then selecting which 8k area of the flash you will see with the FLASH_ADDRESS_EXTENSION register (see main_menu.c). This should make the ROM disk implementation easy.

Well, okay this won't work in C128 mode. EXROM and GAME have no particular function, they simply become extra IO lines. Are there any other ways I can get at the flash memory? It doesn't look like it to me. What I would really like to do is add function ROM functionality to the CPLD, but if it's already nearly full it may not be possible.

Carsten Elton Sørensen

unread,
Sep 11, 2017, 5:54:11 AM9/11/17
to kerberos-midi
Aha! It looks like I should be able to access it in Easyflash mode. ROML and ROMH map to the function ROM select lines in C128 mode. Actually, proper function ROM support may not be far off. Firstly, flash disk support in CP/M though :)

Adding one head to Kerberos at a time ...
Reply all
Reply to author
Forward
0 new messages