davidgiven / cpmish

An open source sort-of CP/M 2.2 distribution.
http://cowlark.com/cpmish
Other
347 stars 37 forks source link

Other platforms, can we add? #13

Open Allisontheolder opened 4 years ago

Allisontheolder commented 4 years ago

Here in the USA the NC200 is a collector item as they are actually rare. Really looks slick.

PX-8s are more common as I have three. Kaypros tend to be more often the second version of the KII vs K2 and very often 4.84 flavor or enhanced with Advent turbo rom. The KII is have sorta boots the disk but the files are scrambled so its a Bios version thing. Real hardware z80 boxes include Z100 based Compupro with Z80 and their disk controller CCS Z80 with their disk controller Northstar horizon chassis Z80 with my disk controller 765 based.

Also monoboard SBCs: SB180 AmproLB+

Outlanders: DEC vt180 with CPm z80 card. Grant Searle Z80 with IDE (CF) also CP/M YAZC yet another Z280 computer.

Not much as stands that behaves well with the existing kit. piecemeal if the -compiler is sorted will. However the C versions of code may present disk space issues as they will be much larger.

Allisontheolder commented 4 years ago

For sims: MyZ80 read the docs if you want to replace the existing CP/M+ish, very good for testing utilities. MyHorizon David Dunfields, you get a pick of OS and aps in NSI files.

davidgiven commented 4 years ago

Yes, absolutely! I did the Kaypro II port using an emulator as an experiment to make sure it was portable and building for multiple platforms works (it does). Unfortunately it needs someone to actually do the work, and I have too much stuff to do as it is. (There don't appear to be many paying CP/M jobs.) If you have the hardware and you're interested...

BTW, re the PX-8: I have one, complete with printer, acoustic coupler and floppy drive (sadly broken). Alas, I don't think a port to the PX-8 will work given the weird hardware (three processors!) and the software in ROM. But it's still very cool. Here it is in action... https://www.youtube.com/watch?v=S3MARL-F8NI

Allisontheolder commented 4 years ago

On the kaypro there are at least for z80 flavors and they do differ. The II and 2s are literally differnt boards both z80. I have three of the four flavors, two stock. The third is a 4/84 with Advent turbo rom , personality board, a noname 1mb RAMdisk, and Handyman. A great machine but you only need up to the bios as replacing the bios (in rom with boot) breaks everything. Oddly the sources were made public but the site was one of the owner just went away and it expired. Fragments may exist. That kind of modding was common here.

PX-8 I have three very complete with multiple wedges nothing broken. There are three CPUs two however you don't mess with. the 6803 is for display and tape and has fixed rom, and the 7508 (cmos four bitter) is startup and battery monitor (internal mask rom) the bios is sufficiently complete you can hang any thing including IDE on the bus and there is space in the memory map for the driver. Generally they lack for two things larger storage (some cases any storage) and handy applications. Using the PF10 or 120kb ramdisk (or both) the latter is easy, just pipe it over the serial line. However space even with the PF10 is cramped. Its sufficiently developed by CP/M standards that breaking it and replacing is insane and unneeded as it does a good job of abstracting all of the hardware. That may be a bridge too far for some.

The easy shot is the AmproLB as the sources for everything they did exists since day one. As I put a fujitsu 45mb 3.5" on that and the bios driver for it was easily editied as the largest SCSI/SASI drive they worked it for was 20mb. Putting the Zr/Zsdos was harder as no TOD clock so it has a interrupt it counts or just skip datestamping.

Since most of the code cannot be or was not intended to be hosted on a z80 system and ZR/ZSdos is on most of mine it may be a request only.

MiguelVis commented 4 years ago

What about the superb Amstrad PCW?

davidgiven commented 4 years ago

It'd work fine on the PCW --- it has the same banking and MMU model as the NC200, so you could reuse the same supervisor architecture, and maybe even a lot of the code. The biggest change would be the TTY, as the PCW has a bitmapped display, so you'd need a font, text rendering code, etc. Luckily the base PCW had (AFAICT) 256kB RAM, because it needs 24kB of video RAM somewhere. Bear in mind that cpmish is only 2.2 and the PCW's native CP/M Plus is 3. (I went with 2.2 for simplicity.)

It just needs someone to do it...

Allisontheolder commented 4 years ago

The easy way is replace only the CCP and BDOS modules and use the existent bios with deblocking patched in. Patching CP/M style systems is a matter of intercepting the calls to BIOS jump table and vectoring them to unused space and adding the needed steps.

bastetfurry commented 4 years ago

There are so many different systems. The Commodore 128 should be pretty common, our retro user meetup, the Dienstagstreff, as like 20 of them. You got the good old ZX Spectrum, even if CP/M from tape is no fun. Then there is the RC2014 as a new method of executing "CP/M", even from CF-Card.

It would be helpful if we could get a tutorial/starting point for creating new platforms, i would love to add the C128 to the supported platforms, but would need some form of starting help. :)

davidgiven commented 4 years ago

Yes, there's not a lot of documentation. One day (in my copious spare time) I'll write up a So You Want To Port CP/M document.

Right now the simplest BIOS is the Kaypro II one, so you could just copy that. Of course, it's mostly simple because all the work's done in the ROM... https://github.com/davidgiven/cpmish/tree/master/arch/kayproii

Allisontheolder commented 4 years ago

There is a lot, if you willing to use the existing docs. Andy Johnson-Laird book is a must and the standard CP/M docs are applicable.

The version that David (ZSdos) is using installs in the general way as CP/MV2. That being any Z80 platform with block oriented storage (any form) is doable and the real work is the BIOS as its machine specific and getting it on media for the first time.

In fact you can just overlay the CCP and BDOS with ZCPR and BDOS as the bios is compatable save for any of the date and time functions (user build option).

So any Z80 with more than 20K of ram origined at 0000h (or mapable from a monitor) is a candidate. I sould strongly suggest mroe than 32K of ram as many of the common aps (multiplan, larger basics, DBASE, compilers) would like 40K or more.

So that opens a lot of machines as possible. The distioction of any version is BIOS as the core is largely invariant save for user customization and relocation for the available ram..

One last hopefully helpful item is that CP/M (all flavors) does not require a boot track. several of my machines I burned the package into a 2764 and at power up copy that eproms content to high (as relocated) memory and its off and running. Running from rom is not directly supported as there embedded data areas.

That technique makes it easier for dumb at power up machines like the Northstar horizon (S100 without a monitor program) as a that assumes a NS* formatted floppy as its a hard sector controller and only boots a compatible image file.

Easy low pain machine to put it on was CCS s100, Reason is the Boot rom carries the read routines ready to use and the CPU board carries a very good monitor. That combined with existing IO routines reduces the BIOS to a lot of small details, disk write and deblocking. Deblocksing is the most troublesome as its made more mysterious by sometimes obscure code with macros. The fundamental issue is CP/M (all flavors) uses logical 128 byte logical sectors and most media use 128/256/512/1024 byte sector (most typical is 512 for larger floppy, IDE, CF, SD) sizes so every sector on media may be one or many more logical sectors to CP/M-Zrdos.

Any machine that allows access to IO, mass storage and ram without a current OS booted will be easiest. That usually implies some amount of rom with a simple monitor.

Allisontheolder commented 4 years ago

CPUville is worth study as he has a fair outline of the tasks. Bios being the biggie and the skeleton (that is there for anyone to make their custom BIOS) and the MDS-II is useless unless you have an intel development system (as its written for that) but show a typical simple (minimal) bios. I even put one out into the then usenet domain as a raw formatted version. I could dig that out again, (its 8080 code but readable). In the end its about the BIOS.

Allisontheolder commented 4 years ago

In the end there are a few common systems and that is likely geographic thing. MY collection of CP/M based systems has more than 25 flavors and I can say none are identical at the bios and FDC/DISK level. Many will have similarities however if only differences like what serial device or FDC used and addresses of devices. I think it represents whats likely or common in the North East USA (New England Region).

An example of something I've never seen is MSX, I'm looking now for 40++ years. A C128 is common here and there were CP/M releases for it but you had to have one or the other disk for compatibility (1542 comes to mind).

alvaro64 commented 1 year ago

davidgiven, Allisontheolder, you have done a great job documenting CP/M

I have the possibility to buy an Amstrad PCW (hesitating about it). Allisontheolder , davidgiven , do you think it is possible to run an open source CP/M on it?

Alison wrote that we can replace the CCP and BDOS. I understand it would be loaded from floppy disk. Right? Also , I suppose floppy disk drive is compatible with PC style floppy (don't really know, it is only a hope)

Alison wrote "and use the existent bios with deblocking patched in". How can this be done? Is it possible to download the bios, and afterwards patch it , burn a rom chip, and physically switch the rom chip on the board? Would it be the way to go? I understand that possibly it would imply disassembling to rom code. Why deblocking is not already implemented on the Amstrad bios?

davidgiven commented 1 year ago

Doing a PCW port should be relatively straightforward, depending on how complex you want to make it --- the PCW has a banking system so you could put most of the BIOS code in a different address space to maximise user TPA. The NC200 port does this. But be aware the cpmish is based on CP/M 2.2, while the PCW's native CP/M is 3.0. 3.0 supports native memory banking, allowing a more complex (and faster) BDOS and more TPA, plus a few more system calls. Chances are that any complex PCW code won't run on cpmish because it's expecting 3.0 features.

Re deblocking: another 3.0 feature is that deblocking is now done in the BDOS, rather than requiring the BIOS to do it. This makes the BIOS interface a bit different. I think it would honestly be easier to reimplement the BIOS. The PCW boot ROM is tiny and contains just enough functionality to load and run one sector from disk, and that sector has to load the rest. That means the BIOS is on disk --- none of it is in the ROM.

alvaro64 commented 1 year ago

Thanks! I understand that blocking or deblocking refers to transformation of a CP/M logical 128 byte logical sectors from what the media uses for a sector: 128/256/512/1024 bytes (most typical is 512 for floppy, IDE) Right? Or is that a misunderstanding from my side? My level of expertise, as of today, is somewhere between low and medium, however I am considering to go in the adventure of trying to put an open source CP/M on this Amstrad PCW By the way, do you know if the floppy disc drive of the Amstrad PCW is a standard PC floppy drive?

davidgiven commented 1 year ago

Re deblocking: yes, that's correct. The CP/M alteration manual here talks about it but it doesn't do a very good job. http://www.gaby.de/cpm/manuals/archive/cpm22htm/ch6.htm#Section_6.12

Re disk formats: sort of. The on-disk format is standard PC. However, only a few PCW models use normal 3.5" disk drives (IIRC only the 9256). The others use 3" drives with incompatible disks. You can wire these up to a normal FDC but it's work. Finding the disks is also increasingly difficult (and expensive). Which model are you looking at?

alvaro64 commented 1 year ago

Thank you for your time! No particular model, although my questions have aroused because I have seen announced an Amstrad PCW 9512 and wanted to consider if it is possible to install an open source CP/M on it. In general, what I am looking for, is to take a computer (probably a computer kit) and installing there some variant of CP/M, with thw source code. If it needs so, to customize the bios for it. And in the process , to learn things. There are several homebrew designs. For example. there are some Z80 boards around the homebrew RC2014 bus. Also there is Don Stewart's "CPU Ville" Z80 SBC board. Another design is Z80 Retro