CP/M computer on Arduino Nano 3.0

Greetings to all lovers of Arduino and old school computing! Nostalgia for the eight-bit computers of my youth led me to this project :slight_smile: - CP/M 2.2 computer from ... what would you think? ... Arduino Nano 3.0!

For weeks two or three I made the i8080 processor emulator for Arduino Nano (it passes the test from MICROCOSM) and adapted the CP / M.
The main problem - Arduino has only 2 (!) KB of RAM. But we also have an SD card - I made a 4-line cache (32 bytes) to this card, and the card itself emulated all 64 KB of RAM. Although I applied the most primitive cache management algorithm, the speed of work is not so bad.
At the same time, this card also emulates four floppy disks.

Here's the quick-and-dirty prototype of my work:

Yes, I did not use the adapter for the card, I inserted it into the connector of the cable from the five-inch drive. :slight_smile:

To communicate with a computer, I use a terminal program (in the future I plan a PS/2 keyboard and an LCD screen or connect to a TV).

Here is a screenshot of the memory check:

CP/M Download:

CPU Test:

DIR command:

My first program in BASIC for the past twenty (!)))) years:

(I launched TinyBASIC).

Are you interested in such a project?

{Claps}. Bravo!

Groove:
{Claps}. Bravo!

Thanks a lot!

That is great!
Another person (i think it was on here) used a Mega1284, which was probably easier relatively speaking. One thing-there is a VGAout library somewhere. You might be able to output to a vga screen and have a command line!

Isaac96:
That is great!
Another person (i think it was on here) used a Mega1284, which was probably easier relatively speaking. One thing-there is a VGAout library somewhere. You might be able to output to a vga screen and have a command line!

Many thanks! I plan to add PS/2 keyboard and LCD screen (or TV-out - but this required additional microcontroller as VGA-controller).

Awesome. That sounds amazing. Please post when that is complete.

I uploaded on YouTube realtime video of my project in action:

Simply awesome!!!

But why didn't you use a SPI RAM extension?

Where is the source? :wink:
Would like to give it a try..
Very interesting to use a 64kb area on sd card to mimick ram memory.
I assume the 4 floppy images are dd-ed on 4 partitions of the sd card?

Please keep this code as a separate (version 1) project, before you introduce ps/2 kb und display.

thx,

Peter

thomai:
Simply awesome!!!

But why didn't you use a SPI RAM extension?

Thanks!
In future probably as an option (Ferroelectric RAM).

petersieg:
Where is the source? :wink:
Would like to give it a try..
Very interesting to use a 64kb area on sd card to mimick ram memory.
I assume the 4 floppy images are dd-ed on 4 partitions of the sd card?

Please keep this code as a separate (version 1) project, before you introduce ps/2 kb und display.

thx,

Peter

  1. I will uploaded source in my GitHub repository - I believe, by the beginning of next week.
  2. I use 4 GB SDHC Card, so i trade free space for simplifying - i write one line cache at the beginning of each sector (64 bytes of 512 bytes) (cache has 8 lines of 64 bytes) -> 65536/64 sectors to all RAM.
  3. No, i dont use partitions on SD Card - raw read/write only.

Thx. Would be glad if you upload also your sd card image so that one can write it directly with dd on a card.

Peter

petersieg:
Thx. Would be glad if you upload also your sd card image so that one can write it directly with dd on a card.

Peter

O.K.

I've got stm32duino (stm32F103zet6 board) with 64kB internal and 512kB of external sram (wired via FSMC). The 512kB of sram could be used for the heap. I can allocate the 64kB of CP/M's RAM with malloc() in that 512kB space easily.
So I may try to run your code on it, when available..
FYI:
External sram on stm32duino

pito:
I've got stm32duino (stm32F103zet6 board) with 64kB internal and 512kB of external sram (wired via FSMC). The 512kB of sram could be used for the heap. I can allocate the 64kB of CP/M's RAM with malloc() in that 512kB space easily.
So I may try to run your code on it, when available..
FYI:
External sram on stm32duino

Thanks!
But my target was Nano. For fun i plan in future connect Nano to 32+32 KBytes Ferroelectric RAM (FRAM) (~1.2$ on eBay) as option.

I uploaded very draft source code of my project to Github:
https://github.com/Dreamy16101976/cpm4nano

I did the emulation of ports 0 and 1 in Altair-style and run Altair TinyBASIC without (!) CP/M. He works quick!

This is very impressive, nice work!

spcrngr:
This is very impressive, nice work!

Thank you very much!

To simplify the configuration of the CP/M for the current RAM size, I extracted the CCP and BDOS images from MOVCPM.COM and analyzed (using the program, of course) the differences between this template image and the real image of the system with 62 KByte. The result is the project getcpm - https://github.com/Dreamy16101976/getcpm
When you run getcpm.exe, you need to specify the memory size in kilobytes (XX) and the desired serial number of the CP/M system (6 bytes in hexadecimal, YYYYYYYYYYYY), after the configuration is done, the CPMXXK.SYS file is created and its eight-bit checksum is specified:

The program, using the CPMDIFF.SYS file, corrects the addresses in the CPM00K.SYS file by configuring CCP and BDOS for the specified amount of RAM:

The program itself is written on Go and compiled by the command go build getcpm.go

I found and fixed an error in INR M/DCR M emulation.
Now the TYPE command works correctly!!!
The emulator is almost ready to use widely.
I will write instructions on how to prepare a SD-card for use in the emulator.