{"id":25701440,"url":"https://github.com/mengstr/cpm8266","last_synced_at":"2025-04-30T03:39:10.900Z","repository":{"id":45681150,"uuid":"81635757","full_name":"mengstr/cpm8266","owner":"mengstr","description":"Z80-CP/M2.2 emulation on ESP8266 NONOS SDK + the NoSDK from cnlohr","archived":false,"fork":false,"pushed_at":"2017-04-10T15:48:16.000Z","size":2510,"stargazers_count":117,"open_issues_count":18,"forks_count":23,"subscribers_count":23,"default_branch":"master","last_synced_at":"2023-11-07T19:20:21.747Z","etag":null,"topics":["cpm","emulation","esp8266","sdk"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mengstr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-11T06:35:56.000Z","updated_at":"2023-11-05T17:57:29.000Z","dependencies_parsed_at":"2022-07-18T06:00:31.009Z","dependency_job_id":null,"html_url":"https://github.com/mengstr/cpm8266","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mengstr%2Fcpm8266","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mengstr%2Fcpm8266/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mengstr%2Fcpm8266/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mengstr%2Fcpm8266/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mengstr","download_url":"https://codeload.github.com/mengstr/cpm8266/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240599174,"owners_count":19826959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpm","emulation","esp8266","sdk"],"created_at":"2025-02-25T04:17:27.512Z","updated_at":"2025-02-25T04:17:28.315Z","avatar_url":"https://github.com/mengstr.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cpm8266\n\n## Z80-CP/M 2.2 emulator running on ESP8266\n\n ![Screenshot boot](/pic/boot1.png?raw=true \"Screenshot of EMON and boot of CP/M\")\n \n### What\n\nThis is my attempt to run CP/M 2.2 for Z80 softwares on an ESP8266.\nThe CP/M machine have 64K RAM, 15 floppy drives @ 250KB each and an\nautobauding serial port as a console device.\n\nSince the ESP8266 only have 96KB of Data RAM and even when runnig the \"NONOS-firmware \nfrom Espressif the free heap, after the WIFI \u0026 TCP/IP stacks are\nloaded, is less than 48KB which was my minimum goal for CP/M RAM.\n\nLuckily the nosdk8266 project from cnlohr solves the RAM issue. By using the\nit I get more than 80KB of heap which is more than enough for\nthe 64KB RAM in the Emulator. But this unfortunately comes with a cost -\nnamlely no wifi.  Not really a showstopper for me, but it would have been nice to\nbe able to just Telnet into the CP/M machine to connect to the emulated\nterminal. \n\nBut not all hope is lost for those who want wifi and telnet - I'm currently\npatching in an option to compile a version with about 36K RAM, wifi and one\nless floppy disk.\n\n ![Screenshot wifi/telnet](/pic/wifi36k.png?raw=true \"Connected over telnet\")\n\nThe 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.\n\n### Installing, Compiling and Running\n\nYou will need ESP-Open-SDK installed. If you don't already have it you can\nget it at https://github.com/pfalcon/esp-open-sdk. Just follow the\ninstallation instructions there and be prepared for a lengthy (but automated)\nprocess.\n\nI've only setup this for for Debian/Ubuntu but most dists should be fairly\nsimilar.\n\n**Unless you already have git installed you should install it**\n\n```apt-get install git```\n\n**Then install the prerequisites for pfalcon/esp-open-sdk**\n\n```\napt-get install make unrar-free autoconf automake libtool gcc g++ \napt-get install gperf flex bison texinfo gawk ncurses-dev \napt-get install libexpat-dev python-dev python python-serial \napt-get install sed git unzip bash help2man wget bzip2 libtool-bin\n```\n\n**Install the esp-open-sdk**\n\n```\ngit clone --recursive https://github.com/pfalcon/esp-open-sdk.git\ncd esp-open-sdk\nmake\nexport PATH=~/esp-open-sdk/xtensa-lx106-elf/bin:$PATH\ncd ..\n```\n\n**Install prerequisites for cpm8266**\n\n```\napt-get install z80asm cpmtools zip vim-common\n```\n\nThe vim-common is to get the xxd utility that some distros don't install by\ndefault. Thank you @drawkula for reporting this.\n\n**Clone the cpm8266 repo and config your environment**\n\nInstead of setting and exporting these environment variables you could change the settings in the top of the Makefile instead\n\n```\ngit clone https://github.com/SmallRoomLabs/cpm8266.git\ncd cpm8266/code\nexport ESP8266SDK=~/esp-open-sdk\nexport ESPTOOL=~/esp-open-sdk/esptool/esptool.py\nexport ESPPORT=/dev/ttyUSB0\n```\n\n**Compile the emulator and all cp/m disks and upload it to the ESP8266**\n\n```make full```\n\n**Connect to the emulator and boot into CP/M**\n\nRun 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.\n\nJust to get started you can install the \"screen\" package and use that as a serial terminal.\n\n```apt-get install screen```\n\nAnd then connect with:\n\n```screen /dev/ttyUSB0 9600```\n\nPress Enter twice to autobaud and boot into the CP/M.\n\n**To compile with the wifi option enabled**\n\nEither do a \n```BUILD=WIFI make full```\n\nor change the BUILD option in the Makefile.\n\nAfter 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.\n\n\n### Code folder contents:\n- *CPM22/* The Z80 assembly sources for CP/M 2.2\n- *disks/* Have sub-folders with the files to be put into the simulated disks\n- *dist/* Used to hold the file when creating the zipped binary distributions\n- *espbin/* SDK bin-files from Espresif to be uploaded in high flash \n- *include/* .h files from NoSDK\n- *ld/* Linker scripts\n- *nosdk/* Modified files from the NoSDK repo\n- *z80/* Modified files from the Z80 emulator repo \n\n\n\n### Acknowledgements and thanks\nI'm standing on the shoulders of a lot of really smart people here. Without\ntheir contributions I wouldn't even know where to start.\n\nPaul Sokolovsky _@pfalcon_ made the Esp-Open-SDK installer/setup. https://github.com/pfalcon\n\nLin Ke-Fong _@anotherlin_ made the Z80 Emulator. https://github.com/anotherlin\n\nCharles Lohr _@CNLohr_ created the NoSDK for the ESP8266. https://github.com/cnlohr\n\nTim Olmstead (RIP) for managing to free the CP/M sources from their owners http://www.cpm.z80.de/ \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmengstr%2Fcpm8266","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmengstr%2Fcpm8266","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmengstr%2Fcpm8266/lists"}