Wednesday, April 9, 2014

68k project: step 6 - lets' start thinking about CP/M

First, some news of the project: The updated scheme HERE . Generally nothing new, only MAX232A is drawn
Here is the picture of my board taken 20140325.
First, I have some minor (but nice!) changes in my firmware. First is
GOaddressmonitor command , which goes to the specified address.
And the second... (have I ever told you I'm genius? REALLY? Oh, sorry) - I catch the BREAK from a serial line and inititate CPU Reset! (actually, even MCU reset).
So, in C-Kermit> (if you use C-Kermit as do I) 's terminal mode, I can press [CTRL]+[\] [B] , and get a reset!
More, I own an HP 9000 A500 server and it has as "Service Processor". And I'd like to have a full Service Processor console in future like the one on that server. Saying, it can turn on and off ATX power (if I have a spare pin and free memory on Atmega8)....
Sometimes in future
So, let's talk about CP/M iteself
This is my first attempt to port CP/M to any computer by the method explained in, our case, "System Guide". The prerequestings are:
  • I should have System Guide (I do)
  • I should have CP/M 68 in S-records (I do from : I use this)
  • The system must accept S-Records (my does)
  • I must have an assembler which generates S-Records (I use A68k from TI 68K calculator project:
    68000 Assembler - version 2.71.F3s (Sep 21, 2004)
    Copyright 1985 by Brian R. Anderson
    AmigaDOS conversion copyright 1991 by Charlie Gibbs.
    Adapted for use with Fargo by David Ellsworth.
    Bugfixes and additions by Julien Muchembled, Paul Froissart and Kevin Kofler
    Warning: do not use asm68k
    asmx multi-assembler version 2.0b5
    Copyright 1998-2007 Bruce Tomlin
    buggy as shit. May be vasm is good - but I'm not ready to write linker scripts just to get SRecord from the source with static lables and given ORG)
So, on the CP/M distribution there is a file CPM15000.SR - that's an CP/M in S-Records (which is loaded from address $15000).
On the first disk of distribution set there is a very useful README.TXT which says that to create a BIOS I should figure out _init (== ORG of BIOS == $1B000) and _ccp ($150BC) symbols in CPM15000.MAP (and that differs from what is written in "System Guide"; there said you should patch Srecords file [for 1.0 and 1.1 CP/M 68k vers.]).
So lets go to "System Guide" directly to the Appendix B on page 59 and start type "Sample Bios" into text editor.
As you can see, BIOS install TRAP #3 and CP/M works with BIOS via this TRAP. I've tried to start with
  • constat
  • conin
  • conout
, but it was not enough; setexc also a must for CP/M to show you it's A:>. The first thing it does, it installs an TRAP handlers for almost all the TRAPS! I will not retype it here, that will be attached later, when it will be at least read/write sectors. To start CP/M first load CP/M itself, then BIOS, then type go15000
After I wrote basic sector read/write access I was able to say DIR,TYPE and even REN. But could not run any program, that's because I've forgot getseg call at all. And then I was able to run DDT68000, but during read it compained "Cannot write sector" (and it was not writing sector at all!)
That was because I forgot flush call.
Funny - this code contains *No* CP/M specific code yet, and is just update of firmware ;-) Code for ChVI

No comments:

Post a Comment