
CP/M development environment setup - maglavaitss
https://vox.space/blog/113/cp-m-development-setup
======
mindcrime
A box from Jameco with a few Z80 chips, some SRAM and some EEPROMS showed up
on my doorstep yesterday morning. Yep, I'm going to take a stab at doing a
homebrew Z80 based machine. :-)

Assuming I get something useful built, I guess I'll try to get CP/M up and
running on it (it's that or try writing my own OS, I suppose), so this may be
very useful.

I know what you're thinking... "why, for the love of FSM, would you build an
8-bit microcomputer today?" In my case, it's partly for fun, and largely for
educational purposes. I've been a software guy my whole career, and while I've
dabbled with some hobby electronics stuff, I never really learned a lot about
the low level computer architecture stuff, and the hardware aspects. So I want
the understanding that comes from literally building a machine from IC's. I
want to understand more about how the data bus works, how I/O works, the timer
for the CPU, interrupts at the hardware level etc.

And interestingly enough... I've done some searching and have found some cool
projects where people have built Z80 machines and added things like USB
support, PS/2 keyboard support, SD card interfaces, etc. Not bad for a CPU
that's 30 some odd years out of date.

~~~
tluyben2
Cool, good luck. Blog about it :) It'll be a lot of fun indeed and it gives
you incredible magic powers of actually understanding computers.

I am currently reading Uzix[0] and the disassembly of Symbos[1] to do some OS
dev on Z80 machines which, in the end, will hopefully run on my own homebrew
hardware.

[0] [https://github.com/marioaugustorama/uzix-
kernel](https://github.com/marioaugustorama/uzix-kernel) [1]
[http://symbos.de/](http://symbos.de/)

Edit: forgot;
[https://github.com/EtchedPixels/FUZIX](https://github.com/EtchedPixels/FUZIX)

~~~
mindcrime
Thanks, and I will definitely write some of this up as I go and blog it.

------
cannam
The Research Machines 380Z
([http://www.theregister.co.uk/2013/11/13/archaeologic_the_res...](http://www.theregister.co.uk/2013/11/13/archaeologic_the_research_machines_380z_story/))
is the machine I'll always (happily) associate with CP/M. That article says
"even in 1982, the 380Z was a veteran", and that was still a couple of years
before I ever got to use one. My school had two of them in the mid-to-late-80s
that had long been seen as obsolete (having been replaced by a room of BBC
micros) but were still sitting around and that nobody else wanted to use. I
used to write text adventures and tank games on them and I had a plan for a
crude version of Lords of Midnight that I'm pretty sure never got anywhere. I
still have the floppies, though I very much doubt if they'd read any more.

Love the industrial design of the 380Z as well.

~~~
jackhack
>I still have the floppies, though I very much doubt if they'd read any more

I think you might be surprised. Those low-density floppies were remarkably
DURABLE.

I have a whole pile of 8" and 5.25" floppies from the late 1970s / early 80s
and even after decades of storage in less-than-ideal circumstances nearly all
of them worked the last time I fed them to a TRS80 or my old Apple ][ about 5
years ago. (I was just as surprised the computer power supplies were still
functional after this time, as electrolytic caps aren't exactly known for
their longevity).

Looking at code written when I was 12 is equal parts bemusement and cringe.
Text adventures, BBS (bulletin board systems), Video game copies of arcade
hits (space invaders in Basic. Donkey Kong in 6502 Assembly, A half-written
tempest clone...) all are terrible judged by today's standards, but I thought
they were amazing at the time.

Speaking of amazement, I have no idea how I was able to accomplish anything
without a search function, autocomplete, or google search. Just a blinking
block in a text editor.

~~~
digi_owl
At 12 i would have had the first clue about how to write either of those
games.

------
spullara
I still have a Commodore 128 that has a second Z80 CPU just for running CP/M.
Really weird in retrospect.

~~~
nsxwolf
Microsoft's first hardware product was a Z80 add on board for the Apple II,
which served the same purpose.

~~~
digi_owl
Even as late as the Amiga you got stuff like that. To this day you can
probably find a PPC based accelerator for all models.

I guess the close to the metal, with little to no memory protection barriers,
made these kinds of things easy to implement.

That said, some early GPUs were somewhat similar.

The 3DFX cards used pass through VGA cabling. And i personally owned a PowerVR
card that wrote rendered frames back to the graphics card over the PCI buss.

------
CodeWriter23
Toward the end of my CP/M days (~1986/87) we had debugger named DSD for
Dynamic Screen Debugger. Of course we take our modern IDEs for granted, but
back then, being able to step one instruction to the next on screen, with the
current instruction highlighted in inverse video, and all the registers and
flags displayed in a box in one corner of the screen was pretty unbelievable.

~~~
CodeWriter23
This is where I worked (link below), they gave me my first job coding when I
was 17. On the first page of the brochure, the card in the lower left was what
we called the dpc-816. It had a Z80 and an 80186 chip on it. The silver heat
sink covers the 80186 and the Z80 is just to the left, vertically oriented. I
worked on parts of the BIOS for it. Both the 8 and 16 bit BIOSes scanned for a
sequence, ESC Ctrl-\, which would switch the terminal from one CPU to the
other. Both CPUs could execute simultaneously on the same bus, with shared
RAM. They solved the arbitration problem very simply; they inverted the clock
from the 80186 and fed the inverted clock into the Z80. This way whichever CPU
was going for the bus first would pull the HLT pin on the other via some TTL
logic, so on the next rising edge of the clock, the other chip would stop.
When the bus cycle was complete, some TTL would drop the HLT pin.

[http://www.vintagecomputer.net/ace/ACEDiscovery500Ads.pdf](http://www.vintagecomputer.net/ace/ACEDiscovery500Ads.pdf)

------
t0mek
Some of the 5.25' floppy drives for the 8-bit Atari [1] had the Z80 CPU and it
was possible to run the CP/M on it. The Atari was serving as a terminal for
its own disk drive.

[1]
[http://www.retrobits.net/atari/indus.shtml](http://www.retrobits.net/atari/indus.shtml)

~~~
digi_owl
I seem to recall that the C64 floppy drive had as powerful internals as the
C64 itself.

~~~
macjohnmcc
Yes it had a 6502 in it.

------
facorreia
I used to develop applications in COBOL for CP/M microcomputers, then Dataflex
and then, for a short time, Turbo Pascal. Some customers ran inventory and
accounts receivable applications off floppy disks. Lots of manual data entry
too.

~~~
wila
DataFlex :) it's still around, but nowadays it supports less platforms.
There's still a unix/linux version (3.2) but that hasn't been updated in many
years.

The Windows version however is still going strong -version 18.2- and also
supports web.

I used to program in dBase and Turbo Pascal around that time, but mostly
skipped CP/M and started with that Microsoft clone albeit the IBM version.

~~~
facorreia
PC DOS.

~~~
wila
exactly.

------
FozzTexx_
Another alternative to building under an emulated CP/M environment is to
cross-build directly under Linux. If you need something that can assemble code
intended for LASM you can use this:
[http://www.insentricity.com/a.cl/259](http://www.insentricity.com/a.cl/259)

------
codewritinfool
I used to run CP/M on a couple of Vector Graphics MZ S-100 computers back in
the early 80's. I don't remember a ton about it, but I think I loved it.
Nostalgia is like that.

------
jnord
There is also the 8086 verson of CP/M, CP/M-86, which runs well within
VirtualBox.

------
arviewer
I still have an Intertec Superbrain here. The looks of it alone make it worth
keeping. It needs repairs, but I'm afraid the screen is dead (has stains on
it), and then it's probably over. I would like to be able to copy the 5.25"
disks, but how? I probably need an old DOS machine which can write to 3.5"
floppy or something... Hobby project for later! ;-)

Back in the 80s this was my machine, for Wordstart, Dbase II and Turbo Pascal
mostly. I was one of the only kids with such a machine, although soon the PC
would take over.

------
pjmlp
I remember ZX Spectrum +3 having support for CP/M.

Could only see it at a friend's place, given that I only had access to a Timex
2068 and a ZX Spectrum 48K, none of them suitable for CP/M.

~~~
Zardoz84
I had these machine, however, I never saw CP/M running it. As far I read, was
weird, as not had a 80 column mode and the CP/M for it, had a weird trick of
panning the screen so the user could see the right half of the 80 column
screen.

~~~
macjohnmcc
Much like the luggable Osborne Z-80 computer. It had a very tiny screen and
was not a full 80 columns.

------
PaulHoule
Heck, I remember using an emulator on a 286 PC clone to develop CP/M software
circa 1988.

