Questions on porting to Z80 Membership Card kit

Discussion about other targets
Post Reply
Knarfian
New member
Posts: 1
Joined: Mon Oct 29, 2018 3:37 pm

Questions on porting to Z80 Membership Card kit

Post by Knarfian »

Hi,

I've finished building this kit http://www.sunrise-ev.com/z80.htm
And now I've been looking at porting Z88DK to it.

The 2-board configuration has firmware support for a serial console, so I'd like to hook that in.
(There is no need for file I/O in this configuration - the 3-board version can use CP/M instead, but I think that might be a separate port, later)

I started by looking at the "embedded" target (using the new library), and the examples that come with it.
As I understand it, the difference being, I want a RAM-based model, while trying to hook up the serial routines like the examples do.
(I plan to just use the built-in XMODEM or HEX file upload to transfer the binaries to the target)

However, I have a few questions:

1) This page https://www.z88dk.org/wiki/doku.php?id= ... t_embedded
says the "embedded" target is now renamed "z80", but if I use that target instead, the embedded examples seem to break?

2) Aside from this, should I be making my own z80mc target using the "new" clib, or just trying to use the embedded (or z80) one with some #pragmas, etc.?

3) Most of the recent porting work announced on this forum seems to center around the "classic" clib, should I be looking at starting there instead?

There seem to be too many options, and I'm just trying to sort through them all.

Thanks,
Frank
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

Knarfian wrote:1) This page https://www.z88dk.org/wiki/doku.php?id= ... t_embedded
says the "embedded" target is now renamed "z80", but if I use that target instead, the embedded examples seem to break?
I would have to see what your compile line was and what examples you are trying. "embedded" exists in both the classic and newlib (deprecated in favour of +z80 in newlib). In classic, embedded is somebody's z80 embedded computer that was submitted many years ago. In newlib it was taken as the name for a generic z80 computer and then deprecated in favour of +z80 because there's a need for a generic target for different processors like the z180 and rabbits, and naming the generic target after the processor seemed to make sense.
2) Aside from this, should I be making my own z80mc target using the "new" clib, or just trying to use the embedded (or z80) one with some #pragmas, etc.?
As soon as you want specialized code available in the z88dk library itself then making a specific target makes sense. For example you want to add serial drivers and have that integrated into printf/scanf so making a target makes sense. Quite often embedded systems don't bother integrating into stdio so they just use the c stdlib and have their own custom code for io.. in this case the generic target is perfectly fine. (In the library we do try to maintain both ways btw - a low level driver for devices and then a higher level built on that to integrate into stdio. This makes that code optionally available as fast & simple or complete & full-featured which the programmer can choose between).
3) Most of the recent porting work announced on this forum seems to center around the "classic" clib, should I be looking at starting there instead?
For embedded systems I would go newlib.. you have more control over things. newlib has not yet integrated file io into stdio; instead some targets have low level disk functions implemented (built on top of a native operating system) and some embedded systems are using ChanFatFS for file io instead. So you can fprintf to a serial device, eg, but you cannot fprintf to a disk device except by way of what ChanFatFS, etc, allow (and these may require you to sprintf into a buffer that is sent in a write operation). Classic does have disk io integrated but it does depend on an underlying operating system to do the device io. Besides that classic has some things like graphics routines that are not in newlib. Newlib also has a few things not in classic.

cpm exists as a target in both classic and the newlib. It's hw independent so you should be able to compile for cpm and it will just work on your system. Again, newlib has not integrated file io whereas classic has for the cpm target. Choosing one or the other is a swicth on the compile line.
Post Reply