[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can anyone help me with Apple CP/M



Paul Schlyter wrote:

> >>> And also, does anyone know if I can use my beautiful UniDisk 3.5"
> >>> drive with Microsoft style CP/M ?
> >>
> >> It's definitely possible, but will require that you dig a lot "under
> >> the hood" yourself, and acquaint yourself with how the SoftCard
> >> BIOS works (both the Z80 and the 6502 parts).  And if course you
> >> must also know how to access your UniDisk 3.5" from 6502 assembly
> >> language.  Good luck!  (no, I can't help you since I don't know
> >> how the UniDisk 3.5" works)
> >
> > Ok, The 6502 accessing of the UniDisk I can handle, but I'd assumed that
> > this would all be done in Z80 mode. Doesn't the softcard just pull the
> > 6502 into halt
> 
> Almost: the 6502 is allowed to refresh itself evey microsecond.  This
> is necessary: since the 6502 is a dynamic processor, putting it to
> halt for more than about 50 microseconds will make it "forget" the
> contents of all it's CPU registers.  This is done by letting the Z80
> run at 4 MHz for half a microsecond, then halting the Z80 for the
> other half of the microsecond - then the 6502 refreshes itself by
> doing a dummy memory fetch; the data fetched is not used but discarded.
> 
> > and allow the Z80 to control the system?
> 
> Yes, however the Z80 can at any time stop itself and give control
> back to the 6502.  And it does at all disk accesses for instance.
> This is because the code for the lowest-level disk access to the
> Apple drives (the RWTS in DOS 3.3 -- there are equivalents in all
> other OS'es for the Apple II) are very sensitive to timing/etc,
> and instead of rewriting it all in Z80 code, it's simpler to just
> modify the 6502 code which already is there and well tested.
> 
> 
> > Or does any access to C000-CFFF have to be done in 6502 mode.
> 
> Nope!  Keyboard reads, serial port I/O, etc are all done in
> Z80 mode in the SoftCard.  However the range $C000-$CFFF are
> mapped to 0E000h-0EFFFh as seen from the Z80.

Thanks a lot for the info!
 
> If you really want to pursue this, I might be able to dig up some
> old disassemblies I might still have, which might give you the
> needed information faster than if you'd dig it up all by yourself.

If you could do this, it'd be fantastic...
 
> And, yes, you have another problem: you say you know how to handle
> the Unidisk from 6502 assembly.  How much code is needed for this?
> A few tens of bytes?  Then you might be able to squeeze it in
> somewhere in $0300-$03FF = 0F300h-0F3FFh -- just watch out so you
> don't overwrite stuff that's already there!  Or is it hundreds of
> bytes, or even a few kilobytes large?  Then you must find space
> elsewhere, e.g. by somehow moving down CP/M a KByte or so.

Hmm, well, not that much code actually, since the smartport firmware
takes
care of most of the details. It's a nice clean logical block design,
using
512 byte blocks, and the code is very simple to write if you have the
smartport
firmware and unidisk references.
 
> Or do you want to throw out all support of standard Apple disks and
> replace it with support for only the Unidisk.  Then you have 2 KBYtes
> available free at $0800-$0FFF = 0F800h-0FFFFh, but instead you ahve
> another problem: you must, somehow, create a Softcard CP/M boot diski
> for the Unidisk, and that requires familiarity with the Softcard CP/M
> boot process.

Well, I don't think removing the 5.25" drivers is a very clean option,
since they work
pretty well. Since I'm planning this for the IIe/IIc rather than the
II+, I'd only
really need about a dozen or so bytes Just enough to hit the ramrd
switch and turn off 80store
and the whole unidisk driver can then run in auxiliary memory.
 
How much detail does the softcard documentation go into on the boot
process? I've been reading
up on the CP/M BIOS layer in the manuals, and it doesn't seem to be a
huge job to rewrite
the whole BIOS, seeing as the Apple II hardware is so well documented.
It's really only
the disk routines and console driver after all (although serial port
drivers would be a hassle). It struck me this week that combined with
some of the //e's nicer peripherals
(3.5" disks, SCSI, Ram cards) that the right BIOS could lead to one of
the slickest CP/M
systems around. Imagine multiple CP/M partitions on a SCSI disk with a
RamWorks style card
being used to provide a disk cache :)

But, I'm getting ahead of myself again. Any information you can provide
on the internals
of the softcard CP/M would be fantastic, if you don't mind taking the
time to dig them up.

Thanks,

Matt

PS - I believe there where some 60k CP/M systems for the Apple II as
well. Does this apply
to the PCPI Applicard, or some variant of the softcard ?