View Full Version : CP/M for the 6502... no joke !
Peter Smith
April 21st, 2008, 03:40 PM
Sometimes it takes years until something happened.
Richard A. Leary programmed 1989 a CP/M-80 clone for the 6502 ... for his homebrew 6502-cpu card plugged in a S-100 based system. Not really many owns such an exotic hardware.
Now decades later he followed a newsgroup thread and mentioned his software. I was interested in publishing something about it, so I offered him some webspace. I also mentioned my collection of CP/M-80 stuff for the C64, which is also a bit exotic (but less than his own S-100 based hardware of course).
Then he decided to port his CP/M clone to the C64 - no additional hardware cartridge needed.
Since a few weeks in runs ! His 6502 CP/M version is named DOS/65.
More information at http://www.z80.eu/dos65.html
See you.
carlsson
April 22nd, 2008, 12:59 AM
Interesting! I suppose there are plans to port this operating system to other 6502 home computers as well? Then it gets really exciting, to have some form of binary compatible DOS for Commodore/Apple/Atari/BBC and so on.
tezza
April 22nd, 2008, 01:48 AM
Yes, very interesting and pretty cool. CP/M has always been equated with the Z80.
Great (and weird) to see a typical CP/M directory listing on the C64 screen in the supplied link.
Tez
Bill_Loguidice
April 22nd, 2008, 08:06 AM
Very cool. I'm surprised it took this long, since it obviously wasn't impossible.
MikeS
April 22nd, 2008, 08:19 AM
Yeah, I followed its resurrection on the CP/M newsgroup; an interesting novelty to be sure, but what are you going to do with it? AFAIK there's not an awful lot of 6502 CP/M application software out there...
m
Bill_Loguidice
April 22nd, 2008, 08:54 AM
Yeah, I followed its resurrection on the CP/M newsgroup; an interesting novelty to be sure, but what are you going to do with it? AFAIK there's not an awful lot of 6502 CP/M application software out there...
m
The vast majority of classic computer projects are novelties as far as I'm concerned, with no practical value. Sometimes I wish these talented people would focus their energies into something that is actually practical, but that's not the way these things work. Things are often done when one is moved to actually do them, with practicality well at the bottom of the list...
tezza
April 22nd, 2008, 11:31 PM
The vast majority of classic computer projects are novelties as far as I'm concerned, with no practical value. Sometimes I wish these talented people would focus their energies into something that is actually practical, but that's not the way these things work. Things are often done when one is moved to actually do them, with practicality well at the bottom of the list...
Yes, I guess many of the things we do for lesuire have no practical value. But then, why should that be a priority? Why do people build 8 bit home computers nowadays? Or overclock a 486? Or program in Assembly? Or solve an old Infocom game? :)
It's done for the intellectual challenge and although it can have practical spinoffs (like learning a lot about the nuts and bolts, which can be applied elsewhere), the satisfaction of achievement is often enough.
Tez
MikeS
April 23rd, 2008, 07:37 AM
Absolutely; I didn't mean to imply that it was pointless - most of what we spend our time on is just for fun or the learning experience, but I am curious as to just what you would actually run on a 6502 CP/M system. I was a little bit involved with the project to port CP/M to a Tandy M100 which isn't very useful in a practical sense either, but at least with an 8085 CPU there's a slightly better chance that some applications will actually run on it.
So, other than the 'cool' factor, what *could* you do with your 6502 CP/M machine?
m
carlsson
April 24th, 2008, 08:56 AM
You could get application programmers all over the world to write new programs to run in DOS/65. If the operating system runs on a half dozen different 6502 computers and has an exchangable binary format, it is more likely to see at least some applications. As long as it only runs on the C64, I'd consider it a proof of concept, despite the computer sold X million copies.
The concept is far from new. Have a look at www.6502.org (http://www.6502.org) and you'll find several proof of concept operating systems, and some which try to be practically useable, like André Fachat's (http://www.6502.org/users/andre/) CS/A65 computer and his GeckOS. I believe there are more operating systems that like, which try to mimic CP/M, MS-DOS, UNIX or whatever, without claiming to be a perfect port.
MikeS
April 24th, 2008, 09:08 AM
I'd think that one of the biggest stumbling blocks to running on different 6502 systems would be that most of them have memory-mapped I/O somewhere in the middle of RAM instead of a separate I/O space, and they also often have ROMs taking up RAM space.
How many 6502 systems do you know of that have access to 64K of contiguous RAM without any hardware modifications?
m
carlsson
April 24th, 2008, 09:15 AM
Not sure, but do you really need 64K of user space? As an alternative, applications could be written in a higher level language, or at least position independent machine code, and then compiled/assembled for the target computer in question. The OS could supply a bunch of #defines and labels which the application can call, just that the programs no longer would be binary compatible.
Are Z80 computers generally more alike eachother as regarding the memory map? I understand they tend to have I/O ports (OUT nnn,mmm) so that is one issue less. After all, some dedicated Z80 based computers can be loaded with CP/M without being intended to be CP/M computers to start with.
CP/M User
April 24th, 2008, 03:02 PM
I've heard of Richard A. Leary though not his 6502 crack at CP/M, perhaps it should be call the Richard A. Leary system?
Too many quobbles over what CP/M stands for! :-D
MikeS
April 24th, 2008, 06:47 PM
Not sure, but do you really need 64K of user space? As an alternative, applications could be written in a higher level language, or at least position independent machine code, and then compiled/assembled for the target computer in question. The OS could supply a bunch of #defines and labels which the application can call, just that the programs no longer would be binary compatible.
Are Z80 computers generally more alike eachother as regarding the memory map? I understand they tend to have I/O ports (OUT nnn,mmm) so that is one issue less. After all, some dedicated Z80 based computers can be loaded with CP/M without being intended to be CP/M computers to start with.
----------
No, you don't need 64K; I think the theoretical minimum is around 28K but that wouldn't let you actually *do* anything; to be practical, 48K is pretty well the minimum, but of course it depends on the intended application.
Of course you could write a program in a high-level language and compile it to run on whatever CPU/memory map etc. you like, but that's not the point. The whole point of CP/M (and MS/PC-DOS for that matter) is to present a standard interface to the application software so that the same binary code will run on different configurations (just like a program written for a PC with floppy disks, 256K and a mono text monitor will still run on a Pentium with IDE HDs, 512MB and a SVGA monitor). Video can be a problem, since screen control & cursor movement codes can vary widely among systems where some can use serial terminals while others can have memory-mapped displays, all with varying widths & no. of lines, but as a general rule CP/M will run on any 8080 or Z80 system with appropriate RAM and I/O. People have installed CP/M on Printer Buffers and similar bare-bones systems consisting of just a CPU, some RAM and I/O.
Like DOS, the CP/M memory map is fairly standard; the hardware-specific BIOS is at the top of available memory, the command processor and I/O interfaces and drivers are below the BIOS, page 0 is usually reserved for OS variables and the application software is usually located starting at 0100H and up to the bottom of the OS.
And yes, unlike the 6502 etc., the 8080 & Z80 have an I/O map separate from the system memory as do most of the Intel processors (don't forget that CP/M was actually written for the 8080 processor) so that most 6502 systems would either have to reserve some RAM space for I/O or have some mechanism to switch I/O for RAM as required.
It would have been a great idea back in the day, if it had caught on and software had been written that could run equally well on an Apple or a PET or even a 6502 S-100 system, but I don't think a great deal of useful software will be written for it today...
mike
Mike Chambers
April 28th, 2008, 07:37 AM
that is pretty cool. so i guess not too much longer before i'm running CP/M on my NES. :p
carlsson
April 28th, 2008, 08:15 AM
Razz if you want, but the original Contiki 1.0 or at least a pre-release was under development to be ported to the NES. I can't recall if the cc65 or any other C compiler supports the Ricoh 2A03, but it is pretty much a 6502. I think there was a memory constraint and no known networking software anyhow that halted the port.
I believe Contiki 1.1 became more modular, with dynamically loaded drivers and applications. While those are generated at compile-time, frankly I don't know if it would be possible to load binaries from a sister platform. Even if the memory map varies from machine to machine, it should be possible to write applications that only take conditional branches, make all addressing through zeropage or perhaps are dynamically rewritten while loaded to run on a given machine.
Mike Chambers
April 28th, 2008, 08:43 AM
Razz if you want, but the original Contiki 1.0 or at least a pre-release was under development to be ported to the NES. I can't recall if the cc65 or any other C compiler supports the Ricoh 2A03, but it is pretty much a 6502. I think there was a memory constraint and no known networking software anyhow that halted the port.
I believe Contiki 1.1 became more modular, with dynamically loaded drivers and applications. While those are generated at compile-time, frankly I don't know if it would be possible to load binaries from a sister platform. Even if the memory map varies from machine to machine, it should be possible to write applications that only take conditional branches, make all addressing through zeropage or perhaps are dynamically rewritten while loaded to run on a given machine.
i wasn't razzing actually i was serious lol. i have seen that contiki OS too, pretty interesting. i wonder if i could get it running in an NES emu.
if a real OS like that is put onto an NES, what would be cool to do with it is create a circuit that could convert a PC's serial port output into something the NES can read, like fake a series of gamepad button pressing and then have the OS convert that to a data stream.
you could use that for all kinds of stuff. network tunneling could even be pulled off so you can get your NES onto the internet... very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very slowly.
DAVlifer
June 7th, 2008, 02:23 PM
I have seen CP/M cards for apple on ebay, some software too. There was a CP/M card for the TI-99/4a expansion box. One was made by Morning Star and the other by Corcomp or Myarc.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.