All Projects → mengstr → cpm8266

mengstr / cpm8266

Licence: MIT license
Z80-CP/M2.2 emulation on ESP8266 NONOS SDK + the NoSDK from cnlohr

Programming Languages

c
50402 projects - #5 most used programming language
C++
36643 projects - #6 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to cpm8266

Convolutional-Pose-Machine-tf
Convolutional Pose Machine tensorflow implementation
Stars: ✭ 71 (-35.45%)
Mutual labels:  cpm
demo-emulator
Nintendo Game Boy emulator written in Go to be used in workshops about emulator programming
Stars: ✭ 41 (-62.73%)
Mutual labels:  emulation
UTM
Virtual machines for iOS and macOS
Stars: ✭ 16,904 (+15267.27%)
Mutual labels:  emulation
ArduZ80
The first Z80 emulation library for Arduino
Stars: ✭ 44 (-60%)
Mutual labels:  emulation
zemu
Ledger Nano Emulation/testing framework
Stars: ✭ 28 (-74.55%)
Mutual labels:  emulation
EmulationResources
Collection of resources for emulator developers
Stars: ✭ 80 (-27.27%)
Mutual labels:  emulation
Nes Snd Emu
NES / Famicom sound library, descended from blargg's Nes_Snd_Emu
Stars: ✭ 19 (-82.73%)
Mutual labels:  emulation
Cemu-UI
A user interface for the Wii U emulator, Cemu
Stars: ✭ 21 (-80.91%)
Mutual labels:  emulation
em400
MERA 400 emulator
Stars: ✭ 36 (-67.27%)
Mutual labels:  emulation
dingusppc
An experimental emulator
Stars: ✭ 106 (-3.64%)
Mutual labels:  emulation
queens-cpm
Eight Queen Puzzle - portable CP/M version, written on Commodore 128
Stars: ✭ 24 (-78.18%)
Mutual labels:  cpm
dust
A DS emulator written in Rust
Stars: ✭ 56 (-49.09%)
Mutual labels:  emulation
angrylion-rdp-plus
A low-level N64 video emulation plugin, based on the pixel-perfect angrylion RDP plugin with some improvements.
Stars: ✭ 143 (+30%)
Mutual labels:  emulation
android-hce-desfire
A HCE software implementation of the NXP Desfire NFC protocol in an Android app (to be used with Cyanogenmod HCE patch)
Stars: ✭ 30 (-72.73%)
Mutual labels:  emulation
pctation
PlayStation emulator & debugger in C++17
Stars: ✭ 103 (-6.36%)
Mutual labels:  emulation
poke.AI
An experimental AI that plays the 3rd gen Pokemon games - Winner of Judge's Choice Award for NUS Orbital Project
Stars: ✭ 39 (-64.55%)
Mutual labels:  emulation
MetropolisLauncher
A data-heavy Emulation & Gaming front-end for Windows
Stars: ✭ 35 (-68.18%)
Mutual labels:  emulation
6502.ts
Emulators for MOS 6502 based systems written in TypeScript
Stars: ✭ 50 (-54.55%)
Mutual labels:  emulation
chip-8
A CHIP-8 Emulator written in Haskell
Stars: ✭ 34 (-69.09%)
Mutual labels:  emulation
apint
Arbitrary precision integers library.
Stars: ✭ 23 (-79.09%)
Mutual labels:  emulation

cpm8266

Z80-CP/M 2.2 emulator running on ESP8266

Screenshot boot

What

This is my attempt to run CP/M 2.2 for Z80 softwares on an ESP8266. The CP/M machine have 64K RAM, 15 floppy drives @ 250KB each and an autobauding serial port as a console device.

Since the ESP8266 only have 96KB of Data RAM and even when runnig the "NONOS-firmware from Espressif the free heap, after the WIFI & TCP/IP stacks are loaded, is less than 48KB which was my minimum goal for CP/M RAM.

Luckily the nosdk8266 project from cnlohr solves the RAM issue. By using the it I get more than 80KB of heap which is more than enough for the 64KB RAM in the Emulator. But this unfortunately comes with a cost - namlely no wifi. Not really a showstopper for me, but it would have been nice to be able to just Telnet into the CP/M machine to connect to the emulated terminal.

But not all hope is lost for those who want wifi and telnet - I'm currently patching in an option to compile a version with about 36K RAM, wifi and one less floppy disk.

Screenshot wifi/telnet

The 36K RAM wifi/telnet option works kinda ok, but it only leaves about 5.9K free memory in MBASIC. And it is also too small run Turbo Pascal or the classic Ladder game.

Installing, Compiling and Running

You will need ESP-Open-SDK installed. If you don't already have it you can get it at https://github.com/pfalcon/esp-open-sdk. Just follow the installation instructions there and be prepared for a lengthy (but automated) process.

I've only setup this for for Debian/Ubuntu but most dists should be fairly similar.

Unless you already have git installed you should install it

apt-get install git

Then install the prerequisites for pfalcon/esp-open-sdk

apt-get install make unrar-free autoconf automake libtool gcc g++ 
apt-get install gperf flex bison texinfo gawk ncurses-dev 
apt-get install libexpat-dev python-dev python python-serial 
apt-get install sed git unzip bash help2man wget bzip2 libtool-bin

Install the esp-open-sdk

git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
cd esp-open-sdk
make
export PATH=~/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
cd ..

Install prerequisites for cpm8266

apt-get install z80asm cpmtools zip vim-common

The vim-common is to get the xxd utility that some distros don't install by default. Thank you @drawkula for reporting this.

Clone the cpm8266 repo and config your environment

Instead of setting and exporting these environment variables you could change the settings in the top of the Makefile instead

git clone https://github.com/SmallRoomLabs/cpm8266.git
cd cpm8266/code
export ESP8266SDK=~/esp-open-sdk
export ESPTOOL=~/esp-open-sdk/esptool/esptool.py
export ESPPORT=/dev/ttyUSB0

Compile the emulator and all cp/m disks and upload it to the ESP8266

make full

Connect to the emulator and boot into CP/M

Run any serial terminal emulator set to 8N1 at any standard speed between 300 and 115200 baud. To run any full screen CP/M programs you should have VT100/ANSI terminal emulation.

Just to get started you can install the "screen" package and use that as a serial terminal.

apt-get install screen

And then connect with:

screen /dev/ttyUSB0 9600

Press Enter twice to autobaud and boot into the CP/M.

To compile with the wifi option enabled

Either do a BUILD=WIFI make full

or change the BUILD option in the Makefile.

After the full re-compile and upload of all disks you can connect via telnet port 23 (the default telnet port) after the red led (on the NodeMCU board) goes off. The led is lit as long as the wifi has not received the ip address via DHCP.

Code folder contents:

  • CPM22/ The Z80 assembly sources for CP/M 2.2
  • disks/ Have sub-folders with the files to be put into the simulated disks
  • dist/ Used to hold the file when creating the zipped binary distributions
  • espbin/ SDK bin-files from Espresif to be uploaded in high flash
  • include/ .h files from NoSDK
  • ld/ Linker scripts
  • nosdk/ Modified files from the NoSDK repo
  • z80/ Modified files from the Z80 emulator repo

Acknowledgements and thanks

I'm standing on the shoulders of a lot of really smart people here. Without their contributions I wouldn't even know where to start.

Paul Sokolovsky @pfalcon made the Esp-Open-SDK installer/setup. https://github.com/pfalcon

Lin Ke-Fong @anotherlin made the Z80 Emulator. https://github.com/anotherlin

Charles Lohr @CNLohr created the NoSDK for the ESP8266. https://github.com/cnlohr

Tim Olmstead (RIP) for managing to free the CP/M sources from their owners http://www.cpm.z80.de/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].