CP/M clone for OSI CIII - need help

Post Reply
retroconnector
Posts: 2
Joined: Mon Oct 29, 2018 2:36 pm

CP/M clone for OSI CIII - need help

Post by retroconnector »

I've been transcribing the source code for a CP/M clone for 6502, specifically written on an Ohio Scientific Challenger-3 system. The source and background can be found at archive.org: https://archive.org/details/OUPMA6502OperatingSystem

My efforts have been, so far, focused on cleaning up the OCR from the scans and publishing the results to github here:
https://github.com/option8/OUP-M

I'd like to get some help in a couple of areas.

1 - finish cleaning up the source, fixing OCR mistakes and any typos I have introduced myself.

2 - somehow transferring and compiling the resulting source code on either an actual or emulated OSI C3.


Volunteers and/or encouragement are greatly appreciated!
Klyball
Posts: 230
Joined: Tue Dec 09, 2014 12:53 am

Re: CP/M clone for OSI CIII - need help

Post by Klyball »

I spent a bit of time cleaning these up , I got it working , some wha,t but my eyes are going buggy checking the docs and debugging, who knows if this even fully worked to begin with. I have attached a complete package , if someone else wants to take a crack at it..
Attachments
OUP_M.zip
(1.13 MiB) Downloaded 627 times
Replica 600 Rev D:8K,CEGMON
Replica 610 Rev B: 24k,MPI B-51 with Custom Data separator D-13
510 on the bench/replica 582 backplane/replica 470a /replica 555/original 570B/2 x Shugart 851
Ongoing : 630 ,620 ,510,542c,custom 590,SA1200,592,594,596,598
Klyball
Posts: 230
Joined: Tue Dec 09, 2014 12:53 am

Re: CP/M clone for OSI CIII - need help

Post by Klyball »

The only problem that causes the os to pretty much not operate is a index hole problem.
it is finding the index hole early on writing tracks and when trying to load a file from tracks
I don't have my c3 set up to try on the real thing so I don't know if it is a emulator bug or software , can some one try it on a c3 if you have one setup.
things that work from os :
-booting
-dir
thing that don't
-loading file (index hole error)
-save (index hole error)

by loading utility lod file and running from 0200
- 1 COPY ALL TRACKS (fail hangs)
-2 COPY OPTION TRACKS (reads track fails on write- partial write then index hole error)
-3 INI TRACK (works)
-4 READ OPTION TRACK (works)
-5 WRITE OPTION TRACK (fails partial write then index hole error)
Replica 600 Rev D:8K,CEGMON
Replica 610 Rev B: 24k,MPI B-51 with Custom Data separator D-13
510 on the bench/replica 582 backplane/replica 470a /replica 555/original 570B/2 x Shugart 851
Ongoing : 630 ,620 ,510,542c,custom 590,SA1200,592,594,596,598
Mark
Posts: 292
Joined: Tue Sep 16, 2008 6:04 am
Location: Madison, WI
Contact:

Re: CP/M clone for OSI CIII - need help

Post by Mark »

Hey, does this look interesting?
H/D/M?D
O.U.6502 CP/M VERSION
DIR ERA TYPE SAVE REN B:
A>DIR

A:
DSKUTY COM 013
A>
Amazing work!

There are a couple of issues with WinOSI V1.5 that prevented boot, but the current version (1.6 +) is better.

One issue was in the emulated disk controller. The disk ACIA IRQ active bit was not "set" unless interrupts were enabled. Just after loading the boot track, writes are made to the disk controller ACIA in order to determine system clock rates (I assume). The lack of IRQ bit caused the code to run off the end of an index table. I did not know the ACIA set this bit even when IRQs were not enabled, but that is what the CP/M code relied on. It has been corrected.

The other issue is more of a configuration thing. The CP/M OS requires RAM at $D000 to $EFFF. This was not set in the default C3 configuration, but it can be added as extension RAM. This uncovered the 2nd issue. There is a bug in the RAM configuration U/I tab that failed to correctly save extension RAM values. Once again this was corrected in WinOSI 1.6.

I have resolved most of the todo list items in WinOSI, and have been working diligently to release it soon -- like in the next week or two.

Amazing work getting the CP/M clone working!

-Mark
nama
Posts: 357
Joined: Wed Mar 30, 2011 9:44 am
Location: New Zealand
Contact:

Re: CP/M clone for OSI CIII - need help

Post by nama »

Is this something that would have potential to work on other systems beyond C3?

2P (1mhz 32k) - 502 + 8k + CEGMON + garbage collector fix BASIC, D&N MEM-CM9 + 24k, 540 (mono) [SOLD]
4PMF (2mhz 24k) - 505, 540, 527, D13 + 5.25" + Gotek
Superboard RevD - CEGMON + 610 board 24k + D13
Spares - 3 x 527, 1 x 505, Backplane
Mark
Posts: 292
Joined: Tue Sep 16, 2008 6:04 am
Location: Madison, WI
Contact:

Re: CP/M clone for OSI CIII - need help

Post by Mark »

I see I'm still catching up. WinOSI 1.5 did work well enough... and my IRQ flag was a syntax/compiler limitation in later code.

Anyhoo, I'm watching some of the disk I/O. CP/M is unique in the way it writes to the disk. It uses the disk erase control line to erase empty data on the track. That is something the emulator handles, but there is really no way to signal that in the OSI disk images. A zero in the disk image is not the same as no data (erased). It also uses timing delays to position read/write operations. Other OS do that too, but looping to wait to read data didn't need to change the index into the disk image data. Still working my through the code...

The CP/M code wont work on other machines as it is, but there is source....

-Mark
retroconnector
Posts: 2
Joined: Mon Oct 29, 2018 2:36 pm

Re: CP/M clone for OSI CIII - need help

Post by retroconnector »

This is great! I'm thoroughly impressed that you guys got it compiled and it actually boots.

Please submit your changes to the source and any other instructions or files to the github site (fork, pull request, etc), so other people can build on your work.
MK14HAK
Posts: 356
Joined: Wed Mar 16, 2011 1:49 am
Location: New Zealand

Re: CP/M clone for OSI CIII - need help

Post by MK14HAK »

I can appreciate the amount of time gone into this. Great work. Has a nice nostalgia element to it also with the connection to Ohio Uni and the C3. A fun thesis back in the day I imagine.
What's the plan from here as far as Utilities go. Are there more archive sources or sources from Commodore, DOS/65 available/usable ?
600RevB:16K,2MHz,64x32,470,CEGMON
SuperKit:502,540B,542B,CEGMON, 8" and 5" FDDs
Cards:PE IO,6522 D-A-D, AY3-8910,ProgramGraphics,Color,UK101
WIP:HexDOS,FDD Emulator
Mark
Posts: 292
Joined: Tue Sep 16, 2008 6:04 am
Location: Madison, WI
Contact:

Re: CP/M clone for OSI CIII - need help

Post by Mark »

So internally WinOSI has to simulate the passage of time for simulated hardware events. Reading data from the disk takes time, writing data needs several clock ticks before the transmit data empty register is set, and the ACIA is ready for the next byte, etc.

The problem with the CP/M code failing is that the WinOSI disk emulation is based on a 1MHz system clock. There is a fixed number of system clocks before the index hole on a floppy comes around again, ending a track. This works fine for OS65D and others, but the CP/M software isn't quite so efficient. It executes too many instructions between write events to the disk. While some software is ready to write the next byte as soon as the ACIA can handle it, the CP/M code misses by ~30% @1MHz. Real C3 systems generally run at 2Mhz so it probably wouldn't get noticed.

So in the end, the simulated index hole comes around before CP/M has written all its data which causes an error. And unfortunately, although you can speed up the CPU clock in WInOSI, it just changes the amount of time it waits around for real time to catch up. The simulated disk I/O is still based on the CPU clock ticks, not ticks per second.

But I will change that! (At least WinOSI should simulate a 2Mhz system clock if it isn't adjustable.)

I should have realized this earlier. I once had the same problem with a disk dump utility failing on one machine, working on another just because one was set to 1MHz. In the end I rewrote the code to make it work on either one.
The more you know...
Klyball
Posts: 230
Joined: Tue Dec 09, 2014 12:53 am

Re: CP/M clone for OSI CIII - need help

Post by Klyball »

Mark, that makes sense, that why it was writing about 60% of the track.
Replica 600 Rev D:8K,CEGMON
Replica 610 Rev B: 24k,MPI B-51 with Custom Data separator D-13
510 on the bench/replica 582 backplane/replica 470a /replica 555/original 570B/2 x Shugart 851
Ongoing : 630 ,620 ,510,542c,custom 590,SA1200,592,594,596,598
Post Reply