https://blog.steve.fi/having_fun_with_cp_m_on_a_z80_single_board_computer_.html Steve Kemp's Blog - Debian & Free Software About Archive Tags RSS Feed Having fun with CP/M on a Z80 single-board computer. 17 May 2021 14:00 In the past, I've talked about building a Z80-based computer. I made some progress towards that goal, in the sense that I took the initial (trivial steps) towards making something: * I built a clock-circuit. * I wired up a Z80 processor to the clock. * I got the thing running an endless stream of NOP instructions. + No RAM/ROM connected, tying all the bus-lines low, meaning every attempted memory-read returned 0x00 which is the Z80 NOP instruction. But then I stalled, repeatedly, at designing an interface to RAM and ROM, so that it could actually do something useful. Over the lockdown I've been in two minds about getting sucked back down the rabbit-hole, so I compromised. I did a bit of searching on tindie, and similar places, and figured I'd buy a Z80-based single board computer. My requirements were minimal: * It must run CP/M. * The source-code to "everything" must be available. * I want it to run standalone, and connect to a host via a serial-port. With those goals there were a bunch of boards to choose from, rc2014 is the standard choice - a well engineered system which uses a common backplane and lets you build mini-boards to add functionality. So first you build the CPU-card, then the RAM card, then the flash-disk card, etc. Over-engineered in one sense, extensible in another. (There are some single-board variants to cut down on soldering overhead, at a cost of less flexibility.) After a while I came across https://8bitstack.co.uk/, which describes a simple board called the the Z80 playground. The advantage of this design is that it loads code from a USB stick, making it easy to transfer files to/from it, without the need for a compact flash card, or similar. The downside is that the system has only 64K RAM, meaning it cannot run CP/M 3, only 2.2. (CP/M 3.x requires more RAM, and a banking/paging system setup to swap between pages.) When the system boots it loads code from an EEPROM, which then fetches the CP/M files from the USB-stick, copies them into RAM and executes them. The memory map can be split so you either have ROM & RAM, or you have just RAM (after the boot the ROM will be switched off). To change the initial stuff you need to reprogram the EEPROM, after that it's just a matter of adding binaries to the stick or transferring them over the serial port. In only a couple of hours I got the basic stuff working as well as I needed: * A z80-assembler on my Linux desktop to build simple binaries. * An installation of Turbo Pascal 3.00A on the system itself. + I used this to build some simple utilities. + There's a good overview of using turbopascal here which covers how to use/quit the editor, compile binaries, etc. Recent Posts * An installation of FORTH on the system itself. * 17 May 2021 + Which is nice. + Having fun with CP/M on a * A couple of simple games Z80 single-board computer. compiled from Pascal * 5 January 2021 + Snake, Tetris, etc. + Brexit has come * The Zork trilogy installed, * 1 November 2020 along with Hitchhikers + Archiving guide. Debian-Administration.org, for real I had some fun with a CP/M * 20 October 2020 emulator to get my hand back in + Offsite-monitoring, from things before the board my desktop. arrived, and using that I * 3 October 2020 tested my first "real" assembly + Writing an assembler. language program (cls to clear * 22 September 2020 the screen), as well as got the + Using a FORTH-like hang of using the wordstar language for something keyboard shortcuts as used useful within the turbo pascal * 16 September 2020 environment. + Implementing a FORTH-like language .. I have some plans for * 28 July 2020 development: + I'm a bit of a git (hacker?) * Add command-line history * 27 July 2020 (page-up/page-down) for the + Growing food is fun. CP/M command-processor. * 14 June 2020 * Add paging to TYPE, and + Writing a brainfuck allow terminating with Q. compiler. Nothing major, but fun changes that won't be too difficult to implement. Since CP/M 2.x has no concept of sub-directories you end up using drives for everything, I implemented a "search-path" so that when you type "FOO" it will attempt to run "A:FOO.COM" if there is no file matching on the current-drive. That's a nicer user-experience at all. I also wrote some Z80-assembly code to search all drives for an executable, if not found in current drive and not already qualified. Remember CP/M doesn't have a concept of sub-directories) that's actually pretty useful: B>LOCATE H*.COM P:HELLO COM P:HELLO2 COM G:HITCH COM E:HYPHEN COM I've also written some other trivial assembly language tools, which was surprisingly relaxing. Especially once I got back into the zen mode of optimizing for size. I forked the upstream repository, mostly to tidy up the contents, rather than because I want to go into my own direction. I'll keep the contents in sync, because there's no point splitting a community even further - I guess there are fewer than 100 of these boards in the wild, probably far far fewer! * My fork * The original Tags: cpm, retro, single-board computer, z80 | 2 comments Comments on this entry Peter Ehlert at 17:49 on icon 17 April 2021 https://www.sdi-bja.com/ Fascinating! My first personal computer at work was a Morrow Designs desktop CPM based machine. We used Basic programs for Land Surveying and Civil Engineering. Shortly later I bought my own for home use, but it was a Morrow Designs "luggable" with a tiny amber display and dual floppies. It was similar to the Osborn 1. It was very challenging. Enjoy your adventures Steve Kemp at 19:41 on 17 icon April 2021 https://steve.fi/ Thanks for sharing! I got started on the ZX Spectrum 48k machine, back in the 80s, where I did a fair bit of assembly-language stuff. But I didn't really ever use CP/M back then, apart from toying with systems belonging to other people. Add your comment Name: [ ] Email: [ ] Website: [ ] Your Comment [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [Post Comment] Your submission will be ignored if any of the fields are left blank, but your email address will never be displayed. Created by ephemeris. (c) Steve Kemp