<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Mon, 17 Oct 1988 07:08:51 GMT
From   : pyramid!athertn!paul@lll-lcc.llnl.gov (Paul Sander)
Subject: CP/M+ BIOS

In an earlier posting, I mention a problem I am having accessing
the disk directly through the BIOS provided with my CP/M Card [TM]
installed in my old Apple II Plus.  I have not had complete success
after calling SELDISK, SETTRACK, SETSECTOR, SETDMA, SETGNK, and
finally READ via the BIOS.

In Message-ID <11670001@hpsmtc1.HP.COM> galew@hpsmtc1.HP.COM 
(Gale Wolfenbarger) writes:
>Boy have you ever stepped into a can of worms!

Well, I don't know.  It seems manageable to the well-informed.

>                                                I'm not sure if
>I can help you or not but I'll try.  I did the last 3 or 4
>releases of the als BIOS for the CPM Card but that was about 3
>years ago and things are pretty fuzzy about it now.

I'm pleased to make your acquaintence.  I'm sure that anything you 
say will be very helpful.

>                                                     First if
>you have the version of the als CPM that works with ProDos you
>are in.  With it you can make calls to ProDos and ask it to
>read files for you.  As I recall there is a utility in ProDos
>to convert DOS to ProDos files.
> [Stuff deleted mentioning details about this conversion method]

My CP/M Plus revision level for the CP/M Card [TM] is 3.01C2, about
3+1/2 years old.  It came with some Prodos utilities, but I don't
have Prodos.

>If you don't have the ProDos version, all is still not lost as
>there are two other entry points that I added to read and write
>single bytes to and from Apple memory.  So if you made a RWTS
>call to read the sector from the apple diskette, you can get
>the information from apple memory a byte at a time.

The good folks at ALS sent me a copy of Mark Howard's application
note describing the APRD and APWRT calls.  The problem with this
method is that I have no documentation describing the Z-80/6502
interface, or any protocol for invoking RWTS (or anything else)
under the 6502.

>Finally, it is possible to make BIOS calls through BDOS by
>using function 50.  (I think that is the right number).  This
>function was designed for this purpose.  It will return to you
>a pointer to your data in CPM memory where you can get to it.
>It does all the bank switching and copying for you.

It looks like this is what I need.  Unfortunately, its calling
sequence looks like one of the best kept secrets in the industry.
Every document I've seen that mentions it simply states that DEreg
passes a "BIOS PB [parameter block?] address" and that Areg 
returns with the "BIOS return."  Nowhere have I seen the field
offsets, sizes, and purposes of this BIOS PB thing; I am also
curious about how the SELDISK BIOS call return value is passed
back, as it's normally an address returned in HLreg.  The BDOS
function number for the direct BIOS calls is indeed 32H (or 50 in
decimal).

>                                                     Remember
>though, interleave between CPM, DOS, and ProDos are all
>different.  (It's enough to make you scream!.)

I've calculated the interleave translation, and I can even
calculate it at runtime by reading track $11 (assuming the VTOC
and directory are allocated the same way stock DOS 3.3 allocates
them, probably a bad assumption but it works for me).

As I mentioned in my previous posting, I have been able to coax the
BIOS to read DOS sectors into shared memory, but this involved
disassembling parts of the BIOS, and kludging in my own routines
which switch banks and call the BIOS.  The problems I've run into
are that so far I've only been able to copy sectors into/out of
shared memory, the subroutine I hooked into in the BIOS kept
moving as newer BIOS revisions came out (not a flame, just an
observation of a standard side-effect of software development), and
the discovery that SID is loaded into the top of memory (into shared
memory).

The ideal solution to my problem, I believe, would be an implementation
using the BDOS call we discussed.  A second solution would be to find
out where the BDOS keeps its transfer buffer in shared memory, and use
my hack to switch banks and call the BIOS myself.

I would appreciate any help that Gale (or anyone else knowledgeable
about this BDOS call) could give me.


Many thanks in advance,

Paul Sander                             | Do YOU get nervous when a
paul@athertn.Atherton.com               | sys{op,adm,prg,engr} says
{decwrl,sun,hplabs!hpda}!athertn!paul   | "oops..." ?
-- 

Paul Sander                             | Do YOU get nervous when a
paul@athertn.Atherton.com               | sys{op,adm,prg,engr} says
{decwrl,sun,hplabs!hpda}!athertn!paul   | "oops..." ?

<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>