RetroBrew Computers Forum
Discussion forum for the RetroBrew Computers community.

Home » RBC Forums » General Discussion » TinyZZ, a Z280 SBC (Exploring Z280)
TinyZZ, a Z280 SBC [message #4158] Fri, 26 January 2018 10:13 Go to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
Created a new topic to continue discussion from here: https://www.retrobrewcomputers.org/forum/index.php?t=msg& ;th=93&goto=4155&#msg_4155
I don't want to hijack the CPU280 thread, so this topic is about a different implementation of Z280, TinyZZ. It is not retro, is build from scratch. Since I have had no previous experiences with Z80 or its derivative chance are excellent the design won't end up where I wanted. The main design objective is CHEAP. It is a disposable computer to experiment with. I don't want to tear down experiments just to salvage and re-use the computer. To keep the cost down and setting up experiment easier, it will not have boot ROM or flash. It will boot out of CF. The UART bootstrap feature is used to boot up the first time and configure the CF. CPLD is large enough to have spare pins and logics to support experiments.

This is the pathfinder board. It has multiple ways of booting up and different RAM choices so I can learn and hopefully get smart along the way.
Re: TinyZZ, a Z280 SBC [message #4169 is a reply to message #4158] Sat, 27 January 2018 08:08 Go to previous messageGo to next message
mikemac is currently offline  mikemac
Messages: 250
Registered: March 2017
Senior Member
plasmo wrote

but I'm more interested in the multiprocessing feature of Z280. Question about memory size: 16meg DRAM is only $1 more expensive than 2 meg DRAM, but can anyone really use 16 meg DRAM?


I think you answered your own question as to why to use the 16MB DRAM: multiprocessing. It's a great way to suck up memory!



Mike
Re: TinyZZ, a Z280 SBC [message #4171 is a reply to message #4169] Sat, 27 January 2018 09:15 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
I want to try multiprocessing on multiprocessors, so each processor slice may have 2 megabyte of local memory, sharing 2 meg of global memory, and can reach into other processor's 2 meg local memory. With that scheme 16meg of memory can be partitioned into a 2-meg global memory and 7 local processor memories. This may be a better use of the 16 meg space. Another reason why each processor slice needs to be cheap.

[Updated on: Sat, 27 January 2018 09:16]

Report message to a moderator

Re: TinyZZ, a Z280 SBC [message #4176 is a reply to message #4171] Sat, 27 January 2018 12:55 Go to previous messageGo to next message
lowen is currently offline  lowen
Messages: 226
Registered: August 2016
Location: Western NC USA
Senior Member
The Z280 fully supports multiprocessor configurations, and that would be a really cool thing to try out. I haven't tried it, but it's documented in Chapter 10 of the Zilog manual. Figures 10-4 and 10-5 give block diagrams, and the text discusses the global bus concept using the /GREQ and /GACK signals. Now an SMP Z280 system; that would be cool.

--
Bughlt: Sckmud
Shut her down Scotty, she's sucking mud again!
Re: TinyZZ, a Z280 SBC [message #4178 is a reply to message #4176] Sat, 27 January 2018 15:47 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
I need to peruse Fritz's Z280 archive to find out more about the arbitration timing. Chapter 10 is an introduction to multiprocessor architecture. How does it handle instruction rerun, test-and-set, arbitration deadlock are the few details I need to have.

One step at a time, get it to boot off CF is the next step...
Re: TinyZZ, a Z280 SBC [message #4199 is a reply to message #4178] Mon, 29 January 2018 12:40 Go to previous messageGo to next message
lowen is currently offline  lowen
Messages: 226
Registered: August 2016
Location: Western NC USA
Senior Member
One minor note: the UART in the Z280 seems to run more stably, especially at higher baud rates, with a 12.288MHz clock (on the CPU280, we use the Z280's built-in oscillator and place a 24.576MHz crystal). The divisors for the standard baud rates are better. I think any multiple of 2.4576MHz should work well.

--
Bughlt: Sckmud
Shut her down Scotty, she's sucking mud again!
Re: TinyZZ, a Z280 SBC [message #4200 is a reply to message #4199] Mon, 29 January 2018 14:17 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
I have a 1/2 size programmable divisor clock (ECS-300) underneath the full size 24MHz oscillator. Right now it is programmed to generate 921KHz which is divided 16 to get 57.6K clock for the UART. What I plan to do is divide the 24MHz clock by 13 to get 1.846MHz which is pretty close to 115.2K X16.

I'm booting off UART quite reliably and testing the CF interface right now. This is what the board looks like now.
index.php?t=getfile&id=807&private=0
Re: TinyZZ, a Z280 SBC [message #4203 is a reply to message #4200] Mon, 29 January 2018 20:54 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
You guys probably knew all about it, but I just find this cool new Z280 instruction that is a perfectly fit for CF read/write:

	LD HL,1000h	; write CF data out to memory starting at 1000h
	LD C,CFdata	; reg C points to CF data reg
	LD B,0h		; count 256 16-bit data
getCFdat:
	INIW		; input 16-bit word from port (C) to (HL), increment HL, decrement B
	JP,NZ,getCFdat


One instruction (INIW) moves words from CF data register into memory pointed by HL, auto-incrementing. Loop it 256 times running in the cache and moving a sector worth of data. Bang, it is done. Cool!

[Updated on: Mon, 29 January 2018 20:57]

Report message to a moderator

Re: TinyZZ, a Z280 SBC [message #4204 is a reply to message #4203] Mon, 29 January 2018 21:27 Go to previous messageGo to next message
Andrew B is currently offline  Andrew B
Messages: 467
Registered: October 2015
Location: Near Redmond, WA
Senior Member
Administrator
That instruction (well, an 8-bit version of it) is on the Z80 as well. I was just reading up on it the other day.

[Updated on: Mon, 29 January 2018 21:28]

Report message to a moderator

Re: TinyZZ, a Z280 SBC [message #4208 is a reply to message #4204] Tue, 30 January 2018 04:50 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
Ha! You are absolutely right. The instruction was there all along. Z280 extends the instruction to word wide which is perfect for 16-bit wide CF interface. In fact, there is a better instruction, INIRW, which repeats until regB is zero, so I don't even need the looping JP NZ,xxx instruction. Very Cool.
Re: TinyZZ, a Z280 SBC [message #4209 is a reply to message #4208] Tue, 30 January 2018 06:57 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
I believe the CF interface is working. I can read/write/verify CF without problems. The UART bootstrapping is rock solid. So I'm at a crossroad: I can continue down the CF bootstrapping and replacing static RAM with SIMM72 DRAM, or I can port CP/M to this board. I'm leaning toward porting CP/M because it may test the board more thoroughly and also let me try Hector Peraza (hperaza) Z280 assembler ( https://www.retrobrewcomputers.org/forum/index.php?t=msg& ;amp ;th=93&goto=3700&#msg_3700). Right now I'm hand assembling the few Z280 extended instructions I needed.

If CP/M, which CP/M? I am following the long discussion on "Installing CP/M3 (Plus)..." on vcfed. This morning's post is #475 and it is not done yet! CP/M 3 sounds very intimidating. CP/M 2.2 seems more reasonable, is it? I'm downloading various manuals and binaries from cpm.z80.de, I assume that's the place to get code & manuals. Is "CPM_2_0_System_Alteration_Guide" the first manual I should be reading?

[Updated on: Tue, 30 January 2018 06:57]

Report message to a moderator

Re: TinyZZ, a Z280 SBC [message #4213 is a reply to message #4209] Tue, 30 January 2018 09:09 Go to previous messageGo to next message
rhkoolstar is currently offline  rhkoolstar
Messages: 276
Registered: October 2015
Senior Member
Hi Plasmo,

CP/M 3 is not intimidating. All you need is the CP/M plus system guide.(attached)

Also I would suggest checking my implementations on Z80, FPGA and Atmel located on my builder pages. https://www.retrobrewcomputers.org/doku.php?id=builderpages: rhkoolstar:start
All sources and building instructions are available. Always nice to start with a working system.

It is actually a quite clean modular system. Nothing much to it.

Rienk
  • Attachment: cpm3-sys.pdf
    (Size: 374.21KB, Downloaded 494 times)
Re: TinyZZ, a Z280 SBC [message #4214 is a reply to message #4213] Tue, 30 January 2018 09:14 Go to previous messageGo to next message
lowen is currently offline  lowen
Messages: 226
Registered: August 2016
Location: Western NC USA
Senior Member
The other advantage to doing CP/M 3 is that the port is already done for CP/M 3 for the CPU280. So that source code is available for comparison, even if the comments are mostly in German.

--
Bughlt: Sckmud
Shut her down Scotty, she's sucking mud again!
Re: TinyZZ, a Z280 SBC [message #4216 is a reply to message #4209] Tue, 30 January 2018 10:30 Go to previous messageGo to next message
Andrew B is currently offline  Andrew B
Messages: 467
Registered: October 2015
Location: Near Redmond, WA
Senior Member
Administrator
IF I were you, I think I'd go with CP/M 3. The documentation is very good. You can build an un-banked version that is not much more complicated than CP/M 2.2 to start with, then upgrade it to banked later.

On John M's S100computers.com site he has a complete (Z80-based) CP/M 3 BIOS implementation example. With that plus the manuals I was able to start modifying IDE and console I/O code in short order.
Re: TinyZZ, a Z280 SBC [message #4217 is a reply to message #4216] Tue, 30 January 2018 12:04 Go to previous messageGo to next message
rhkoolstar is currently offline  rhkoolstar
Messages: 276
Registered: October 2015
Senior Member
Actually, the banked version is not that hard. You basically only need to write the 'move' module, containing the move, xmove and bank routines.
My move.asm is only 50 lines long, including white space and comments.

That and you need to select the correct dseg and cseg segments for the code. The documentation is very clear on this.

Rienk
Re: TinyZZ, a Z280 SBC [message #4224 is a reply to message #4217] Tue, 30 January 2018 17:43 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
It looks like CP/M 3 is the winner of the People's Choice. Smile OK, I'll give it a try, Thanks.
Re: TinyZZ, a Z280 SBC [message #4231 is a reply to message #4224] Wed, 31 January 2018 18:00 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
Rienk,
As I was reading your builder page, ( https://www.retrobrewcomputers.org/doku.php?id=builderpages: rhkoolstar:start) I noticed at the end you mentioned "Following the FTDI 232 soap I found the following units based on the CP2102 chip to be cheaper and better"... So since I also had difficulties with FTDI 232R adapters lately, can you tell me your experiences?
Re: TinyZZ, a Z280 SBC [message #4234 is a reply to message #4231] Wed, 31 January 2018 23:49 Go to previous messageGo to next message
rhkoolstar is currently offline  rhkoolstar
Messages: 276
Registered: October 2015
Senior Member
FTDI was annoyed by the counterfeit chips that were around in a large volume (justified). But they decided to 'kill' these counterfeits with the next windows driver update, which was way over the top in my opinion. They tuned it down a bit, and now they seem to corrupt the data stream without disabling the chips. So I went looking for an alternative, and found the CP2102 based converters. I like them, because they are cheaper and they are 3v3 units, but 5v tolerant, so I don't need to check the voltage setting anymore.
I myself don't use windows drivers, so I was/am not affected by these malevolent drivers. All my FTDI, PL and CP chips work as intended.

The CP2102 boards generally come with a USB-A connector attached, so I de-solder the header, connect a 6 wire cable to the board and cover the board with shrink tube, turning it into a USB-plug. the other and of the cable (usually flat cable) is fitted with the appropriate connector, doing away with the clunky converters on the CPU-boards.

Rienk

[Updated on: Wed, 31 January 2018 23:58]

Report message to a moderator

Re: TinyZZ, a Z280 SBC [message #4257 is a reply to message #4234] Fri, 02 February 2018 13:49 Go to previous messageGo to next message
etchedpixels is currently offline  etchedpixels
Messages: 333
Registered: October 2015
Senior Member
I'd also vote for CP/M 3.

As well as being better documented you get a lot of nice features including 512 byte block sizes without BIOS extras and the ability to have big disks (although even with 16 user areas it's a bit difficult to manage without subdirectories!Wink. I'd agree start with the unbanked version then do the banked. There are a few nasties to watch (read carefully the rules about stacks and what you can and cannot bank), also make sure you define the magic set of CP/M offsets in one file and use them in another, otherwise your assembler will be smart, remove them from the relocations and the CP/M builder will fail to do the needed magic relocations.

To get the best use of memory you need to lay out the banked memory buffers by hand which is tedious but without that the tools do a pretty acceptable job.

There are patches to CP/M 3 for Y2K even.

[Updated on: Fri, 02 February 2018 13:50]

Report message to a moderator

Re: TinyZZ, a Z280 SBC [message #4272 is a reply to message #4257] Sun, 04 February 2018 08:09 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
fter receiving excellent recommendations to try CP/M 3, I started with CP/M 2.2 instead. Embarrassed This is because I find a file with CP/M2.2 CCP/BDOS sources in Z80 mnemonics on cpm.z80.de. The opportunity of working with source codes instead of binary image is too good to pass up. More importantly, the source codes are in Z80 so I don't have to struggle with 8080 assembly language. Well not entirely true, I still have to figure out the 8080 mnemonics because all the BIOS and utility examples are in 8080. It seems I've spent all my time translating and then figuring out mistakes in my translation! Mad

The advantage of starting with CCP/BDOS source is not have to worry about manipulating CF sector/track, pulling program out of boot track and putting them back, which is the main theme of the System Alteration Guide. Now I can incrementally add BIOS to CCP/BDOS sources and load the code to memory and execute. Wash, rinse & repeat. It is so much easier and I have a better understanding of what's happening when the code crashed.

The thing nagging at me all along was how to get CP/M 2.2 distro into CF in such way that the newly ported CCP/BDOS/BIOS can read and execute it. The solution was unexpected--unexpected for me, you guys probably knew all along: It dawned on me that CP/M 2.2 file format is compatible with CP/M68K 1..3, so I can use gkermit in the CP/M68K environment to transfer CP/M 2.2 distro into an empty drive then move the drive to the Z280 board. Since I used the same disk parameter block values for both CP/M68K and CP/M2.2, Z280 can read the CP/M 2.2 distro and execute them. Ha, that was easy!

I still have many loose ends and Z280 does have weird bugs above and beyond the OUTJMP. Nevertheless, I'm making progress.

Test CP/M TinyZ280
2/1/18
 
a>b:b>dirB: XSUB     COM : SUBMIT   COM : STAT     COM : READ     ME 
B: PIP      COM : LOAD     COM : ED       COM : DUMP     COM
B: DUMP     ASM : DSKMAINT COM : DISKDEF  LIB : DEBLOCK  ASM
B: DDT      COM : CPM      SYS : BIOS     ASM : ASM      COM
B: XXZ          : XY           : XZ          
b>statA: R/W, Space: 7476k
B: R/W, Space: 7780k


b>stat *.*
 Recs  Bytes  Ext Acc
   64     8k    1 R/W B:ASM.COM
   96    12k    1 R/W B:BIOS.ASM
   60     8k    1 R/W B:CPM.SYS
   38     8k    1 R/W B:DDT.COM
   80    12k    1 R/W B:DEBLOCK.ASM
   49     8k    1 R/W B:DISKDEF.LIB
   18     4k    1 R/W B:DSKMAINT.COM
   33     8k    1 R/W B:DUMP.ASM
    4     4k    1 R/W B:DUMP.COM
   52     8k    1 R/W B:ED.COM
   14     4k    1 R/W B:LOAD.COM
   58     8k    1 R/W B:PIP.COM
    1     4k    1 R/W B:READ.ME
   41     8k    1 R/W B:STAT.COM
   10     4k    1 R/W B:SUBMIT.COM
    6     4k    1 R/W B:XSUB.COM
    1     4k    1 R/W B:XXZ
    1     4k    1 R/W B:XY
   80    12k    1 R/W B:XZ
Bytes Remaining On B: 7780k

b>type xyThe file CPM22-B.ZIP contains the files from the distribution
disk for CP/M 2.2 for a XEROX 1800 system.
                     
b>dump xy
0000 54 68 65 20 66 69 6C 65 20 43 50 4D 32 32 2D 42
0010 2E 5A 49 50 20 63 6F 6E 74 61 69 6E 73 20 74 68
0020 65 20 66 69 6C 65 73 20 66 72 6F 6D 20 74 68 65
0030 20 64 69 73 74 72 69 62 75 74 69 6F 6E 0D 0A 64
0040 69 73 6B 20 66 6F 72 20 43 50 2F 4D 20 32 2E 32
0050 20 66 6F 72 20 61 20 58 45 52 4F 58 20 31 38 30
0060 30 20 73 79 73 74 65 6D 2E 0D 0A 00 00 00 00 00
0070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

b>pip*xx.txt=read.me
ÿ*xx.com=ddt.com
*^C

[Updated on: Mon, 05 February 2018 06:29] by Moderator

Report message to a moderator

Re: TinyZZ, a Z280 SBC [message #4273 is a reply to message #4158] Sun, 04 February 2018 08:15 Go to previous messageGo to next message
Andrew B is currently offline  Andrew B
Messages: 467
Registered: October 2015
Location: Near Redmond, WA
Senior Member
Administrator
The 'cpmtools' package has the ability to write a custom binary file to the first sectors of the disk images where the loader code is located.

So you can setup your disk parameters there and create bootable images directly from Windows or Linux.
Re: TinyZZ, a Z280 SBC [message #4283 is a reply to message #4273] Sun, 04 February 2018 15:00 Go to previous messageGo to next message
etchedpixels is currently offline  etchedpixels
Messages: 333
Registered: October 2015
Senior Member
Sweet... I've got a CP/M 3 BIOS or two in Z80 instruction format if you want. The SocZ80 BIOS is Z80, as is the CP/M 3 BIOS for the Microbee (which is to the land down under what the Commodore 64 is to the USA)
Re: TinyZZ, a Z280 SBC [message #4287 is a reply to message #4273] Sun, 04 February 2018 17:40 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
Andrew B wrote on Sun, 04 February 2018 09:15
The 'cpmtools' package has the ability to write a custom binary file to the first sectors of the disk images where the loader code is located.

So you can setup your disk parameters there and create bootable images directly from Windows or Linux.


I wasn't able to get cpmtools running in Windows Vista to write CF disk in CPM file format. So when I was porting CPM to Tiny68K, I have to make my own utility to copy CPM image from PC to Tiny68K's memory and then to its CF disk. I was wondering how I'm going to do this with Z280. Fortunately there is another easier way to do that.
Re: TinyZZ, a Z280 SBC [message #4288 is a reply to message #4283] Sun, 04 February 2018 17:41 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
etchedpixels wrote on Sun, 04 February 2018 16:00
Sweet... I've got a CP/M 3 BIOS or two in Z80 instruction format if you want. The SocZ80 BIOS is Z80, as is the CP/M 3 BIOS for the Microbee (which is to the land down under what the Commodore 64 is to the USA)


Yes, I'd love to see BIOS examples in Z80. I like Z80 mnemonics much better.

I understand CPM3 has sector blocking/deblocking build in. That should be much more efficient than my own newbie efforts at blocking/deblocking for CPM 2.2.
Re: TinyZZ, a Z280 SBC [message #4289 is a reply to message #4288] Mon, 05 February 2018 06:25 Go to previous messageGo to next message
lowen is currently offline  lowen
Messages: 226
Registered: August 2016
Location: Western NC USA
Senior Member
Ok, I need to apologize to Bill. I accidentally edited his message with the CP/M 2.2 results, when I thought I was replying! (I didn't know I had moderator ability in this thread! Oh no!). Andrew B, is there any way to roll back my mistaken edit? I think I have the notification email, and I think it has all the data..... I've got to be more careful before my coffee kicks in! EDIT: found the email, and will be restoring the message. Is there an emoji for 'egg in my face'?

My reply was that I really appreciated the progress that Bill has done; he's making great progress, and I applaud his tenacity in getting this done; after all, a hobby is doing what you enjoy doing, and if a CP/M 2.2 port is what you enjoy, then by all means go for it....


--
Bughlt: Sckmud
Shut her down Scotty, she's sucking mud again!

[Updated on: Mon, 05 February 2018 06:31]

Report message to a moderator

Re: TinyZZ, a Z280 SBC [message #4291 is a reply to message #4289] Mon, 05 February 2018 08:00 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
The trouble with doing electronics as hobby is that it is an undisciplined random walk. There may be a hazy goal somewhere out there, but the real fun is just walking around and picking up whatever interesting along the way. CP/M 3 sounds good and is where I want to be, but CP/M2.2 is just laying there looking interesting. My motivation for trying CP/M at this stage is to see how well my Z280 board can execute more complex programs. I found there are some "weirdness", but I don't know whether it is my hardware, my newbie Z80 software skill, or Z280 itself. I'm shipping your board this morning and start on documentation. Hopefully you can also try different software on it.
Re: TinyZZ, a Z280 SBC [message #4292 is a reply to message #4291] Mon, 05 February 2018 08:21 Go to previous messageGo to next message
lowen is currently offline  lowen
Messages: 226
Registered: August 2016
Location: Western NC USA
Senior Member
I liken owning a Z280 to owning an MG. You know there are quirks, and lots of maintenance, but it sure is a fun rig to drive (I don't own one, but I have driven one, just a long time ago and it was a friend's). If you enjoy tinkering it can be very fun.

And hobbies are about having fun, and gaining fulfilment, at least to me. I tend to jump around a lot as well, which I'm sure can be a bit frustrating to others at times... Anyway, looking forward to checking out your board.


--
Bughlt: Sckmud
Shut her down Scotty, she's sucking mud again!
Re: TinyZZ, a Z280 SBC [message #4296 is a reply to message #4292] Mon, 05 February 2018 22:15 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
I started a builder's page about TinyZ280 here:
https://www.retrobrewcomputers.org/doku.php?id=builderpages: plasmo:tinyz280

Some of the information are filled in (schematic, gerber files), but most are place holders for software, construction notes, engineering changes and CPLD equations.
Re: TinyZZ, a Z280 SBC [message #4315 is a reply to message #4296] Thu, 08 February 2018 07:24 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
I completed my builder page on TinyZ280 for now. It only cover Step 1, UART bootstrap. I updated the TinyLoad routine as well as cpm2.2 CCP/BDOS/BIOS. I've made some outrage shortcuts with CP/M 2.2 that will certainly met with disapproval from the CPM veterans, but I just want to check out the hardware and I'm pretty happy with how well CPM2.2 is running. So I'm leaving CPM for now and moving on to next phase of the Z280 hardware development.
Re: TinyZZ, a Z280 SBC [message #4323 is a reply to message #4315] Sun, 11 February 2018 06:05 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
I modified the CPLD code so Z280 can boot out of compact flash. The cold bootstrap code is small, 128 bytes, that copies a CF loader into memory and execute. My question is where to put the cold bootstrap code. The easiest location is in CF's first sector (track 0, sector 1). But there are so many different CF formats out there, I don't know what kind conflicts will result from a custom 128-byte data located in the boot sector. I did looked up Master Boot Record format and convinced myself that the Z280 cold bootstrap code is small enough to fit within the MBR structure. What about CP/M disk format? I think normally the CP/M loader is in the first 2 sectors, but is it reasonable to relocate CP/M loader to the 2nd and subsequent sectors of a CF?
Re: TinyZZ, a Z280 SBC [message #4324 is a reply to message #4323] Sun, 11 February 2018 07:05 Go to previous messageGo to next message
rhkoolstar is currently offline  rhkoolstar
Messages: 276
Registered: October 2015
Senior Member
CP/M reserves the first track(s) of the logical disk as system tracks (CP/M ignores these tracks completely), but the usage of those tracks is not defined. You can easily make a multi stage loader, (cold bootstrap - loader - CP/M system) fit in one CF 'track'

Rienk
Re: TinyZZ, a Z280 SBC [message #4327 is a reply to message #4324] Sun, 11 February 2018 10:41 Go to previous messageGo to next message
etchedpixels is currently offline  etchedpixels
Messages: 333
Registered: October 2015
Senior Member
For Fuzix I've been using the first sector as the boot/partition table block everywhere and the number of OS's that don't have the boot block there (or object) is about two (AmigaOS being the obvious one). It varies how much space there is in the sector for booting but it's a good place IMHO.

For CP/M as has been said you can lay it out how you like. For CP/M 3 the system track only holds the loader which is a kind of tiny CP/M subset that loads CP/M itself off the file system.
Re: TinyZZ, a Z280 SBC [message #4333 is a reply to message #4327] Wed, 14 February 2018 16:51 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
I think I have a working prototype of TinyZZ! The boot sector of the CF disk contains a small cold bootstrap code that loads program resides in sector 2 & 3 into memory and execute. The board in the picture has 4 megabyte of DRAM. It can handle 16 megabyte, which is the entire memory space of Z280 but that would be gross overkill, right? Is there even a way of using that much memory other than RAMdisk?

I tilt the board slightly so the SIMM memory is visible. The 4-meg SIMM module contains two HY5118164 which is a 1 meg x 16 DRAM. The actual TinyZZ will not have the SIMM socket. It will have just one HY5118164 soldered directly to the board giving it 2 megabyte of memory. It should be a small simple board consists of Z280, CPLD, 24MHz oscillator, 2meg DRAM, and CF adapter. Power consumption is around 350mA at 5V.

Now I'm ready to port CP/M 3 to it.
Re: TinyZZ, a Z280 SBC [message #4334 is a reply to message #4333] Thu, 15 February 2018 10:22 Go to previous messageGo to next message
etchedpixels is currently offline  etchedpixels
Messages: 333
Registered: October 2015
Senior Member
With 2MB of RAM MP/M can support 16 simultaneous users and have lots of spare resources for background jobs. Likewise historically a PDP-11 of similar power would have been considered well loaded with 2MB. Assuming you have 2MB of RAM then that's (assuming one bank for the OS) 31 simultaenous 64K+64K different split I/D processes plus 64K left over, and you'd get even more in that memory if multiple copies of the same program were running. On top of that the hardware supports virtual memory so in a virtual memory environment you'd need 2MB of *useful and current* data in the memory to hit a limit. So divide 12MHz by 30+ running tasks and ask if 1/30th of a processor per task is going to do any useful work, and for virtual memory the number would be even bigger!

So I agree you've got more than enough memory.

Alan



Re: TinyZZ, a Z280 SBC [message #4335 is a reply to message #4334] Thu, 15 February 2018 12:59 Go to previous messageGo to next message
wsm is currently offline  wsm
Messages: 232
Registered: February 2017
Location: AB, Canada
Senior Member
I agree that 2MB is more than enough memory for this TINY Z280.

Quote:
... ask if 1/30th of a processor per task is going to do any useful work ...

Not to be argumentative, but this only holds true for heavily compute bound systems. MP/M was primarily designed to allow for multiple users to share all the costly resources, including disks, either through direct connection or via CP/NET. In general, multi-user systems have a LOT of "think" time by the users and/or doing trivial tasks such as recording keystrokes into a buffer. The mainframe time-sharing systems of the early 70's could support hundreds of users while only running at a few MHz and 1 or 2MB of memory.

The TinyZZ has minimal serial ports to support multiple users. Without something like a multiplexor, the above question is actually whether two users would overload the system.
Re: TinyZZ, a Z280 SBC [message #4336 is a reply to message #4335] Thu, 15 February 2018 15:14 Go to previous messageGo to next message
etchedpixels is currently offline  etchedpixels
Messages: 333
Registered: October 2015
Senior Member
For a Z280 you have virtual memory this is not the case. The idle tasks can be swapped to disk with near enough no impact, so you really do need 30 plus active things.

For MP/M a naive implementation of Z280 would use memory for idle tasks, but even so if you have the maximum 16 users, each of them would have to be running a program on their terminal (maybe idling) *and* have another background task loaded to run out of memory. However the Z280 can do virtual memory transparently. You can put virtual memory *under* MP/M if you are crazy enough (although I seem to remember MP/Mjhad a 2MB limit anyway) and you are back to needing 30 active things to do.

The mainframe world works a bit differently. Not only do you have virtual memory (at some level) you also had very fast I/O subsystems that didn't interfere with the processor and also offloaded most of the work. That dramatically increases the amount of work you can do on a low speed processor. Some setups scaled to a lot of 'users' because they all ran the same application (or the OS was the application) others because input was form based (a smart terminal did all the thinking until you hit send) and almost nobody did much (airline booking for example). You also have a queueing theory problem. The longer it takes your job to run the more other people have finished thinking and started doing, the more they do that they more other people are no longer thinking and it collapses in a heap (usually they day before assignment submissions).

There is a world of difference between doing a CPU driven loop to copy bytes from the CF card and handling each character to send or receive versus the mainframe world'disk X put this list of blocks over there and ping me when you are half way down the work queue' / 'a user has completed filling in a form page and here it is'. The mainframe would be simultaneously swapping to disk, writing out cached data, reading in blocks it guessed will be needed and swapping in processes it wanted to run soon pretty much without CPU overhead. Meanwhile MP/M sucked when someone was copying disks or formatting them.

I've used a four CPU Honeywell L66 and with 60 students on it wasn't a pleasant experience.

There were reasons that towards the end people started to make 'multiuser' Z80 boxes with a single shared hard disk, master CPU and MP/M and a 64K CP/N card for each user linked by a "fast" message link for the network.

Alan
Re: TinyZZ, a Z280 SBC [message #4337 is a reply to message #4336] Thu, 15 February 2018 19:00 Go to previous messageGo to next message
wsm is currently offline  wsm
Messages: 232
Registered: February 2017
Location: AB, Canada
Senior Member
I find it interesting how different people's experience gives them different perspectives and I try to learn from that. For reference, besides playing with various micros, I was a systems programmer mostly in the IBM world with S/360-67, S/370's, 4300's & 9370's running various operating systems such as MTS, MFT, MVT, VS1 and MVS both for IT purposes and for real-time process control. My current micro development activities are with 33MHz Z180's using a variety of I/O including RAM disks, flash disks, IDE, SATA, USB etc. while trying to maximize performance.

I think one of our differences in approach is the reference to "CPU driven loop to copy bytes from the CF card". All my current development efforts are based on DMA for "disk" I/O and use multiple LRU buffers. Likewise, byte I/O is also fully interrupt driven with FIFO queues. The one thing that could improve this I/O model would be interleaved memory but discrete dual-ported and quad-ported RAM is both expensive and power hungry. Instead, I just use 10ns 16-bit RAM and CPLD-based DMA controllers. I've already designed my next generation board with an FPGA so it can use embedded DMA with embedded FIFO queues to minimize overhead while maximizing the useage of bus bandwidth.

Virtual memory certainly is very useful but as pointed out, swapping can lead to thrashing if the system isn't balanced. Similarly, if an MP/M system "sucked" when copying disks then I would suspect there is an issue with the scheduler, load balancing and possibly the I/O controller itself. Queueing theory also has a corollary that if you make response time too fast then the users will come to expect it and consequently introduce even more load.

Having worked with low-level 3270 "smart?" terminal data streams, I agree that they do reduce the number of interrupts but there is still a LOT of decoding and formatting that went on in the mainframe before the data was useable by the underlying application. FWIW - My S100 system uses a VDB-8024 display card and a Jade DD floppy controller both with embedded Z80's to offload some of the I/O processing.

As to the dedicated CPU per MP/M user: Besides the polled I/O issues, I believe a lot of that was also due to the high price of RAM in that era, the available instruction set and also some of the application languages. The Z80 can be VERY inefficient for floating point and in my experience there is about a 2.5 times performance difference between interpreted and compiled Basic.

Don't get me wrong, I do understand how multiple CPU's can enhance performance and I've already done basic testing on my own design using up to 16 Z180's at 33MHz connected to a base I/O processor for a possible total of 567MHz. Each of these slave processors is connected to the base processor via a 4KB dual-ported SRAM and there are interrupts in both directions.

With all that being said and back on track, I think the TinyZZ is a GREAT project to enable people to start playing with virtual memory, multi-user, etc. etc. for minimal expense. Kudos to Bill for developing it!!!
Re: TinyZZ, a Z280 SBC [message #4338 is a reply to message #4337] Thu, 15 February 2018 20:23 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
Indeed different experiences led to different approaches. My background in the 80's & 90's was embedded hard real-time navigation and guidance avionic computers. Beside the deterministic computation constraint, the others less hard constraint were smallness, low power & ruggedness. The multiprocessors (up to 15) were tightly coupled, shared memory design with no commercial operating system, just homebrew scheduler. Cost was not a constraint, but every piece of components must justify its place in weight, power & space. I've moved on to other less computational constrained but cost sensitive embedded computers later in my career, and the spartan mindset always stayed with me. It is not about what you designed in--it is what you designed out.

wsm wrote on Thu, 15 February 2018 20:00

With all that being said and back on track, I think the TinyZZ is a GREAT project to enable people to start playing with virtual memory, multi-user, etc. etc. for minimal expense. Kudos to Bill for developing it!!!

Thank you! Z280 really is an interesting processor with many modern features. I have not spent a lot of time with it, but I have not found serious problems so far. Most (all?Wink of the weirdness were my own faults. The internal peripherals seem to work well. The external memory & I/O are running full bus speed, zero wait and appear to work without "weirdness". I understand the DMA may be buggy and I've only used DMA for UART so far. There maybe surprises waiting for me out there still.
Re: TinyZZ, a Z280 SBC [message #4339 is a reply to message #4338] Fri, 16 February 2018 06:39 Go to previous messageGo to next message
etchedpixels is currently offline  etchedpixels
Messages: 333
Registered: October 2015
Senior Member
The MP/M system sucked when copying disks because it didn't have DMA, so it had to disable interrupts for each disk read/write. It's funny how things work out on these little systems. Will made Fuzix mostly poll the serial port when transmitting - because at higher baud rates we use today (ie not 300 baud) it actually cost more CPU cycles to process the transmit ready via interrupt than to just spin. Likewise a friend who had only of the early Unixes for PC (for 8088/6) discovered it used polling disk I/O via the BIOS firmware. He wrote his own custom interrupt and DMA driven XT hard disk driver - and it made no difference to performance because the DMA controller pretty much stopped the CPU getting to the memory. In fact on the PC/AT IBM amd clones mostly removed the hard disk interrupt.

The real masters of this were Apple. Even on the earlier Macintosh systems the CPU did all the floppy disk work. The localtalk connection ran at 230Kbits with nothing fancy UART wise. All of it was very clever design and a bit of smoke and mirrors. When in tight polling CPU required situations it carefully used what tiny bit of CPU was spare to make sure the most pointer still moved. So long as the mouse pointer moved users were happy. Localtalk likewise used a 3 byte header message to access the bus. Why 3 bytes - because the uart had a 3 byte FIFO. At 230Kbits the message had arrived before the 68000 actually woke up to the fact and looked, but that was fine - the header was followed by a short time delay so the CPU could realise it owned the next message and poll the UART for the data block.

On FP I think the big problem was a lot of CP/M stuff was 8080. Z80 can do FPU pretty passably but you need to be using both register sets and index registers to get the best results. 8080 FPU is just - painful. SDCC does single precision IEEE float pretty well on Z80 which is good enough for me.

But I digress

Tiny ZZ really interests me because it's a virtual memory based machine. Not just toy memory management but properly implemented. The Z800 was designed to run things like Unix. That makes it like the 80286 a very interesting target when playing with operating systems. Two serial ports should be fine as one of them can run TCP/IP especially given the DMA on the uart.

Alan
Re: TinyZZ, a Z280 SBC [message #4340 is a reply to message #4339] Fri, 16 February 2018 09:54 Go to previous messageGo to previous message
lowen is currently offline  lowen
Messages: 226
Registered: August 2016
Location: Western NC USA
Senior Member
Plasmo, I'm loving this thread.

The Z280 at 12MHz should be at least as fast as a high-end PDP-11 (say an 11/83 or even /93) and might even be encroaching on VAX-11/780 territory. I need to try out dhrystone on the CPU280.

As to memory size, I am actually planning on fully populating 16MB on my board. Fuzix/UZI280 would be interesting here. Alan, as far as time-sharing goes, it was not unusual for a PDP-11/83 to have 10-15 users, and that's with the J-11 clocked at 4.5MHz (crystal is 18MHz, but the microcycle is a quarter of the clock). Even the VAX-11/780 only ran at 5MHz.

Z280 with 16MB is nearly as useful as 68K with 16MB, in my opinion, even though it's not a flat 24-bit address space. In ways it should be more conducive to something like Fuzix since you have a real MMU, even though per-process space is limited to 64K (but so was the PDP-11's, right?). Now, maybe not for TinyZZ, but I could see a NUMA machine with 8 Z280's having say 1MB local each and 8MB global (or some other split, maybe even 2MB each and no gloabl) and run in a similar system-image way as an SGI Altix would. It would just be, to me at least, the ultimate coolness to say 'nah, this is an 8-Z280 box running' and watch people's faces contort trying to figure that out....

Z280 has built in DMA, and it works quite well in the CPU280 CP/M 3 implementation. It would be fun to look at the advantages versus the disadvantages for something like Fuzix. I wonder how the UZI280 kernel handled I/O?


--
Bughlt: Sckmud
Shut her down Scotty, she's sucking mud again!

[Updated on: Fri, 16 February 2018 10:50]

Report message to a moderator

Previous Topic: PIC TV clock
Next Topic: ECB 4MEM question


Current Time: Sat Mar 15 20:58:08 PDT 2025

Total time taken to generate the page: 0.00822 seconds