Paging in Z8S180 running ROMWBW loads as file under CP/M

113 views
Skip to first unread message

Nick Brok

unread,
Apr 25, 2020, 2:14:32 AM4/25/20
to retro-comp
Hi,

Question 1:

I have my scrumpel working now with the internal baudrate generator. It has 1 MB RAM and my monitorprogram with CP/M bootloader is moved into RAM (Bank 0).
As in romwbw I want to use paging. When I run CP/M my monitor program must be invisible. The monitor resides at 0x0100. But with paging I want to use monitor subroutines also under CP/M.
Can someone help me out with suggestions, examples, pitfalls etc.? Waine? Alan?
I know that the stack and variables must reside in common memory. I had in mind to use 0xf000-0xffff for this. Any help is appreciated.

Question 2:

The hardware used in Scrumpel is almost the same as the SC126, but the chip-select bits are different and it use another I/O address. (this I can change in the source of ROMWBW)
Is it possible to load the romwbw.com file under CP/M and that it runs in my lower RAM?

Greetings,

Nick

Douglas Miller

unread,
Apr 25, 2020, 8:45:32 AM4/25/20
to retro-comp
I don't have a strong opinion, myself. But many legacy CP/M machines did this sort of thing. The one I'm familiar with was the Kaypro. As you mention, any RAM that the ROM needs must be allocated high in memory. There are plenty of limitations to doing this. You've got to get the whole "dance" right with interrupts, stack pointers, memory mapping, etc.

The Z180 can make some of this easier, especially with it's DMA engine and MMU. But in order to execute the ROM code it needs to be mapped at the same logical address where it normally runs - unless you've written all the routines to be completely position-independent. I'm not sure on this hardware how the ROM is mapped in. If the Z180 MMU has full control over it, you may have more flexibility. If it's a flip-flop or latch bit that arbitrarily maps the ROM on top of logical address 0000, you have fewer options.

One thing to keep in mind is that the CP/M 3 BDOS, if the BIOS is optimal, will do disk I/O directly to/from userspace, and if the ROM is mapped in over that space you've got to deal with that conflict.

Wayne Warthen

unread,
Apr 25, 2020, 12:01:24 PM4/25/20
to retro-comp
On Friday, April 24, 2020 at 11:14:32 PM UTC-7, Nick Brok wrote:
Question 1:

I have my scrumpel working now with the internal baudrate generator. It has 1 MB RAM and my monitorprogram with CP/M bootloader is moved into RAM (Bank 0).
As in romwbw I want to use paging. When I run CP/M my monitor program must be invisible. The monitor resides at 0x0100. But with paging I want to use monitor subroutines also under CP/M.
Can someone help me out with suggestions, examples, pitfalls etc.? Waine? Alan?
I know that the stack and variables must reside in common memory. I had in mind to use 0xf000-0xffff for this. Any help is appreciated.

As Douglas says, this is entirely possible.  RomWBW uses 0xFE00-0xFFFF to do essentially the same thing.  Your CP/M adaptation will need to account for this.  It is hard to provide a concise list of suggestions.  I started off by doing a simple port of CP/M 2.2 with no paging.  Then I added a paged hardware BIOS.  Then I modified the OS to leverage the hardware BIOS.

 
Question 2:

The hardware used in Scrumpel is almost the same as the SC126, but the chip-select bits are different and it use another I/O address. (this I can change in the source of ROMWBW)

If your bank selection mechanism allows selection of 32K physical RAM banks into the lower 32K of CPU address space, then it should be straightforward to modify RomWBW to support your system.  There is a fairly small bit of code in the RomWBW proxy that handles paging.  You will see that it already has conditional assembly to handle several different bank selection mechanisms.  You would simply add yours.  You would essentially be porting RomWBW to your system.
 
Is it possible to load the romwbw.com file under CP/M and that it runs in my lower RAM?

I don't think so.  RomWBW is completely dependent on it's own hardware BIOS that requires that it own the system to handle paging.  It would be hard to fit the hardware BIOS and an OS into 32K.  Additionally, you would need to rewrite the entire memory paging mechanism and relocate a bunch of stuff to new addresses.

Good luck!

Wayne

Nick Brok

unread,
Apr 26, 2020, 12:24:21 AM4/26/20
to retro-comp
Hello Wayne,

About my question 2: So loading romwbw.com won't work. I thought to load it into the lower 512K RAM because I have RAM in stead of ROM... How does those romwbw.com files work then? I thought it could temporary replace your romwbw in ROM? This to try a new version without messing up your ROM in i.e sc126?
If I understand it quite well, romwbw.com uses routines from the romwbw in ROM to load... unfortunately... :-(

Your suggestion about CP/M using banking: I can try to rewrite a specific HWBIOS for my Scrumpel that fits in 32K. (Because my ROM size is limited to this size.) Unfortunately the pins of the FlashROM aren't assigned in the same way as a RAM chip..... Without changing the design I cannot use those flash ROMS.
So, if I want to use ROMWBW I have to write a program that loads the ROM image into my lower RAM from a SD card using a form of banking. (I have 2 SD-card slots,)
Modifying ROMWBW to Scrumpel's hardware isn't to difficult. The only difference is how my spi chipselect works..... I use the hardware SPI from the Z8S180.

This is only an idea.....perhaps still to difficult to realize.

But thanks for your hints.....

Still I hope that someone can provide some examples for banking in Z8S180.

Greetings,

Nick

Wayne Warthen

unread,
Apr 26, 2020, 12:54:04 AM4/26/20
to retro-comp
Hi Nick,

See below.

-Wayne


On Saturday, April 25, 2020 at 9:24:21 PM UTC-7, Nick Brok wrote:
About my question 2: So loading romwbw.com won't work. I thought to load it into the lower 512K RAM because I have RAM in stead of ROM... How does those romwbw.com files work then? I thought it could temporary replace your romwbw in ROM? This to try a new version without messing up your ROM in i.e sc126?
If I understand it quite well, romwbw.com uses routines from the romwbw in ROM to load... unfortunately... :-(

I misunderstood.  When you said lower RAM in your original question I thought you meant the lower 32K of CPU address space.  I now understand you meant the lower 512K of your 1024K physical RAM.  So, you definitely should be able to get RomWBW loaded in this scenario.

RomWBW doesn't really care about which banks it is loaded in.  You just need to define them in std.asm.  The ROM is not required to load RomWBW.  But you will need to write something to load it.

-Wayne

Mark T

unread,
Apr 26, 2020, 12:57:21 AM4/26/20
to retro-comp
I would expect it to be possible to have a bootloader in your 32k rom that copies the 512k of romwbw from sdcard into low 512k ram, then run the same as it would if this was in rom. Not sure if that was what you were planning.

Mark

Reply all
Reply to author
Forward
0 new messages