Go Down

Topic: CP/M computer on Arduino Nano 3.0 (Read 2701 times) previous topic - next topic

FoxyLab

#15
Mar 25, 2017, 08:55 pm Last Edit: Mar 25, 2017, 09:02 pm by FoxyLab
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!

spcrngr

This is very impressive, nice work!

FoxyLab


FoxyLab

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

FoxyLab

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.

FoxyLab

I added an LRC-checksum for the memory data when writing/reading to the SD-card. While failures were not.

FoxyLab

I made the input from the console more versatile - through interrupts - to connecting the PS/2 keyboard in the future + added a command R monitor to reset the Arduino.
Also i did 200 runs of the memory test (added a command to the monitor) - failures not detected:

FoxyLab

Using emulation of address and data buses, as well as internal registers (W, Z, ACT, TMP), made emulation of microoperations as close as possible to the "iron" processor + with #define made the emulation code much more visible. The new code is already laid out on GitHub.

FoxyLab

According to the test results, the random access time to the emulated memory card was about 7 milliseconds.

FoxyLab

Because of the use of caching, the average access time with sequential access to memory is about 80 microseconds.
I used the BASIC test (in the TINYBASIC interpreter) to evaluate the effect of the cache on performance in the real task:

(The size of the cache line is 64 bytes)
Number of cache lines runtime (seconds)
2 .................................... 345
4 ................................... 155
6 .................................... 80
8 .................................... 60

FoxyLab

#25
Apr 19, 2017, 09:40 pm Last Edit: Apr 19, 2017, 09:45 pm by FoxyLab
I ran the Ada language compiler on my Arduino !!!

Compilation of the program TOWERS.ADA for solving the problem of the "Hanoi Tower":


Running the compiled program TOWERS.COM:

FoxyLab

Changed the approach to emulating the floppy disks - allocated on the SD card the area for storing the contents of 100 floppy disks and with the monitor command Z i "insert" a floppy disk into one of the drives A, B, C or D
(for example, the ZB02 command mounts a floppy disk with the number 02 in drive B)

The numbers of "inserted" floppies are stored in the Arduino EEPROM and are restored when the emulator is restarted.

FoxyLab

#27
Apr 27, 2017, 08:05 pm Last Edit: Apr 30, 2017, 07:35 am by FoxyLab
I made an emulation of the memory management device (MMU) with switching banks, which allowed access to 512 KByte of memory.
I divided the address space 0x0000 ... 0xFFFF into 16 blocks (with numbers from 0x0 to 0xF) of 4 KByte in size. Each block can be mapped to one of 8 banks (the size of the bank is 64 KByte). The correspondence of banks to blocks is determined by the values ​​(bank numbers from 0 to 7) in a set of 16 registers (only bank 0 is active when the emulator is started).
To specify the bank number for a specific block, two output commands are used in the port:
OUT D0, block number
OUT D1, banknumber
Also, you can use the YXY monitor command to switch the X memory unit to the Y memory bank.

FoxyLab


FoxyLab

cpm4nano Mk II
(used an adapter to connect a microSD-card)

Go Up