Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 02:14 24 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CP/M on nano

Author Message
zeitfest
Guru

Joined: 31/07/2019
Location: Australia
Posts: 375
Posted: 11:17am 02 Dec 2019
Copy link to clipboard 
Print this post

CP/M and various languages games etc running (slowly) on an arduino nano...
pretty amazing, even if just for the exercise

CP/M
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2285
Posted: 09:13pm 03 Dec 2019
Copy link to clipboard 
Print this post

i wonder what the performance is like?

this does give me an interesting idea, a 28-pin MX170 running a Z80 emulator written in C and CP/M on top of this. if one allows 8k of RAM for the emulator and C runtime, that leaves 56k of RAM for CP/M. the other 8k of the Z-80 address space can contain the BIOS.

onboard peripherals would be:
- the two hardware serial ports of the MX170 (one as the console),
- I2C could be used for RTC,
- SPI for SD card/file system,
- other spare pins as a general purpose 8-bit I/O port plus strobe/ack.

how cool would that be? a complete CP/M computer running on a single 28-pin DIP?

peter, geoff: would a Z80 emulator and the other odds-and-ends required fit into the 256k flash of an MX170? would there be enough flash left over to also hold a 56k ram image - thereby allowing just the single MX170 chip alone to boot to the CP/M command prompt?


cheers,
rob   :-)
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 02:04am 04 Dec 2019
Copy link to clipboard 
Print this post

Many years ago I tried implementing a Z80 emulator on the MX695 used in the Maximite.  It was rather clunky but it worked and turned the Maximite into a CP/M machine.  The problem was that I could not guarantee that CP/M and the other programs (like Microsoft BASIC) were in the public domain and for a magazine article that was essential.  Emulating the various display controllers was also an issue.

I cannot remember how much flash it used but I am sure the emulator would fit into 256K.

I grew up on CP/M but these days it seems incredibly limited and I would wonder why anyone would want to play with it (despite the nostalgia factor).  It is like wearing a hair shirt because you were forced to wear one as a child.

Geoff
Geoff Graham - http://geoffg.net
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2285
Posted: 05:23am 04 Dec 2019
Copy link to clipboard 
Print this post

it sits alongside the moderately usable Z80-MBC2 that several forum members have previously built:
https://hackaday.io/project/159973-z80-mbc2-4ics-homemade-z80-computer

and this much earlier linux on an atmega1284:
http://dmitry.gr/index.php?r=05.Projects&proj=07.+Linux+on+8bit
that is summed up thus: "uARM is certainly no speed demon. It takes about 2 hours to boot to bash prompt ("init=/bin/bash" kernel command line). Then 4 more hours to boot up the entire Ubuntu ("exec init" and then login). Starting X takes a lot longer. The effective emulated CPU speed is about 6.5KHz"


both the above are technical achievements, although of at best little practical use!     cool, like owning a jet fighter plane. but not cool like owning a fridge. of course, the MX170 running mmbasic is cool in both ways  


cheers,
rob   :-)
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 813
Posted: 08:31am 04 Dec 2019
Copy link to clipboard 
Print this post

Hi,

the Z80-MBC2 is really nice! It works very fine with Geoff's "ASCII Video Terminal" but very much better with a Pi Zero as graphic card (NOT a Pi Zero W!!!)

I also have CP/M running on a Duinomite. In the beginning I had big problems with the Micro-SD card.
Now I found a 16MB Micro SD card that works very well! Microsoft BASIC and Turbo Pascal 3.0 also work on the board.

Frank
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2285
Posted: 11:43am 04 Dec 2019
Copy link to clipboard 
Print this post

interesting Frank, the Z80 simulator appears to have been written by a fellow called Ken Segler, with a complete mplab-x pic32 project for it located here:
https://github.com/TheCodeman/z80pack-1.17-ksd-pic32

looks like there has been no activity for years, but i wonder if someone could just rip out the surplus bits (vga and keyboard support) and recompile for the MX170? as i said before, it is of almost no practical use, but nonetheless rather cool. imagine being able to hand someone a 28-pin DIP package and tell them it is a complete CP/M computer!

geoff: the licensing status of CP/M does indeed seem a little unclear - while widely accepted as now being 'open source', the letter from Lineo isn't quite so cut-and-dried:
"Let this email represent a right to use, distribute, modify, enhance and otherwise make available in a nonexclusive manner the CP/M technology as part of the "Unofficial CP/M Web Site" with its maintainers, developers and community"


cheers,
rob   :-)
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 813
Posted: 06:02pm 04 Dec 2019
Copy link to clipboard 
Print this post

@Rob:

Ken was in 2011 with the Z80 emulation in our forum.

The SD-Card Library would have to be replaced by that of this TRS-80  project. As I said, I had big problems with the SD card and Z80!
This TRS-80 emulation runs very nicely on a Duinomite.

It would be very nice to have a CP/M system on an MX170!

Does anyone know a comparable emulation of a PET2001? - that would be my dream!!!

Frank
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 07:14pm 05 Dec 2019
Copy link to clipboard 
Print this post

  Frank N. Furter said  @Rob:
Does anyone know a comparable emulation of a PET2001? - that would be my dream!!!
Frank


Ditto :)
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2285
Posted: 11:54pm 05 Dec 2019
Copy link to clipboard 
Print this post

  Frank N. Furter said  Does anyone know a comparable emulation of a PET2001? - that would be my dream!!!


that would be a far more daunting task - to emulate a full system like a PET would require generating a video output, and accurately emulating all the other hardware that sits around the CPU. a bit beyond the abilities of an MX170 methinks.

with CP/M, basically all one needs (aside from the Z80 emulator) is a serial port for the console and to trap disk I/O calls to the BIOS.

having said this, there are a few projects involving static recompilation out there. one such example provides for the core of microsoft 8-bit basic on a number of different platforms. see:
https://github.com/mist64/cbmbasic

essentially, you take an 8k ROM image from your favourite 1980's home computer, and translate the machine code (using an automated process) into calls to C equivalents of the machine instructions. you then go through the C code by hand and patch anything that hits hardware outside of the CPU. it is rather cool from a technical perspective, but not as useful as mmbasic in the real-world.


cheers,
rob   :-)
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 813
Posted: 08:13am 06 Dec 2019
Copy link to clipboard 
Print this post

Hi,

I found this code on the net. In the near future I want to run this code on an Odroid-Go with a buddy who is a software developer...

You are right! In the real world MMBASIC makes much more sense!

@jman: Have you tried the TRS-80 emulation on a Duinomite? It takes some getting used to, but it's a lot of fun!

Frank
 
cosmic frog
Senior Member

Joined: 09/02/2012
Location: United Kingdom
Posts: 278
Posted: 11:07am 06 Dec 2019
Copy link to clipboard 
Print this post

I tried the TRS-80 (MaximiteTRS80.hex) file on my home built Maximite but all I get is a black screen. Just can't see what I'm doing wrong.  
When I reflash back with the Maximite (ColourMM_MMBasic_V4.5C.hex) everything works ok.

Dave.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 813
Posted: 11:39am 06 Dec 2019
Copy link to clipboard 
Print this post

Hi Dave,

I have not tried the "MaximiteTRS80.hex" only the "OlimexDuinomiteMiniTRS80.hex" on a Duinomite Mega.
Is your home built Maximite a Colour Maximite?
I think there were some small differences between the UBW32 Colour Maximite and the "normal" Colour Maximite... - You should check the schematics again.

Have you copied ALL files to a FAT formatted SD card? There are some files that the emulator needs! - have you ever tried another card? I have only used a 2GB SD card so far...

Frank
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 06:16pm 06 Dec 2019
Copy link to clipboard 
Print this post

  cosmic frog said  I tried the TRS-80 (MaximiteTRS80.hex) file on my home built Maximite but all I get is a black screen. Just can't see what I'm doing wrong.  
When I reflash back with the Maximite (ColourMM_MMBasic_V4.5C.hex) everything works ok.

Dave.


@ Frank Yes but on a UBW32 using Mick's PCB.

Hi
The issue here is the bootloader. Use the attached bootloader (The UBW32 version)
Flash with a PIC3. Once done MMBasic and the TRS80 can be used via the normal USB upload method.

Regards
Jman



UBW32_HIDBoot_MX795.zip
 
cosmic frog
Senior Member

Joined: 09/02/2012
Location: United Kingdom
Posts: 278
Posted: 07:21pm 06 Dec 2019
Copy link to clipboard 
Print this post

Hi Frank. Yes it's a colour Maximite built around the mx695 chip but I've also got a UBW32 spare so I will try that this weekend.

@jman. I will also try your file.

Thanks. Dave.
 
cosmic frog
Senior Member

Joined: 09/02/2012
Location: United Kingdom
Posts: 278
Posted: 10:30pm 09 Dec 2019
Copy link to clipboard 
Print this post

I finally set up my UBW32 and got the TRS80 to boot up, but it just sits on a screen that says MEM SIZE_ and the keyboard doesn't seem to work.
Any ideas?
I've checked all my wiring and all seems ok.
Any help would be appreciated.
Thanks.

Dave.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 813
Posted: 07:56am 10 Dec 2019
Copy link to clipboard 
Print this post

Hi Dave,

the one with MEM SIZE already looks quite good! Normally you just have to press RETURN now...
Have you tried another PS/2 keyboard?

Frank
 
cosmic frog
Senior Member

Joined: 09/02/2012
Location: United Kingdom
Posts: 278
Posted: 08:56am 10 Dec 2019
Copy link to clipboard 
Print this post

  Frank N. Furter said  Hi Dave,

the one with MEM SIZE already looks quite good! Normally you just have to press RETURN now...
Have you tried another PS/2 keyboard?

Frank


I haven't tried one yet, that was going to be my next test. I also thought about trying another mem card, the one I'm using now is an old 1gig.
I'll let you know how I get on.

Many thanks.

Dave.
 
cosmic frog
Senior Member

Joined: 09/02/2012
Location: United Kingdom
Posts: 278
Posted: 12:05pm 10 Dec 2019
Copy link to clipboard 
Print this post

Ok, I got it to work. Turns out it was a bad wire on the keyboard power connector and now it runs great!
Not sure why it wouldn't work on the MX695 chip, maybe there are some differences other than the CAN BUS.

Thanks again for everyone's help.

Dave.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 813
Posted: 12:13pm 10 Dec 2019
Copy link to clipboard 
Print this post

       

Frank
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024