[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Genie & Lamp Feb97 5/20
Hello News!
>>>>>>>>>> CSplit: Version 2.2 >>>>>>>>>>
>>>>>>>>>> CSplit: Begin part 5/20 >>>>>>>>>>
cases. Depending on the device driver(s) in question, this might work.
\
Here's
the problem tho: The MLI sets up a command block (device driver
parameter \
list)
prior to calling the device driver. One of those parameters in the
command block is UNIT NUMBER (found at $43) which is in the format:
%DSSS0000, \
where D
is the drive number minus one, and SSS is the slot number. OK? Keep
this \
in
mind. Next, let's take a look at the hardware side. Most external
\
cards can
be plugged into any slot and work. The easiest way to communicate with
a \
card
is to read/write at the slot hardware _base_ address, using the
X-Register \
to
specify the actual slot offset. For example, the assembly language \
instruction
LDA $C080,X where X=$10 would access slot 1. If X=$20, then the access
\
would
be to slot 2, etc. So, the people who write device drivers, only need a
\
base
address ($C080) and where their card is at (loaded in the X-Reg). Now,
\
let's
put the two together.
1. The device driver needs the X-Register to be set to the slot
number. 2. The MLI issues the slot number as part of the Unit Number.
Hmmm...If you were a device driver, where would you get that slot \
number??? :)
And everythings fine until.... someone _swaps_ the entries in the P8
device driver table and _doesn't_ tell P8 about it :(
Say you have a 3.5 drive on slot 5, and a SCSI card in slot 7, and you
\
swap the
device drivers. =Potentially= you have the 3.5 driver accessing the
SCSI \
card,
and the SCSI driver accessing the 3.5 drive. +NOT+ what you want!!!
AND- I don't even want to think about what would happen if the two
swapped entries refered to different devices, i.e. a serial device and a
block device. \
Yikes!
So, I can be wrong on this, because not all device drivers are written
the \
same
way. Maybe it'll work for you, but I wanted to at least inform you that
the results may prove disasterous. Also, since I'm jumping in here,
maybe I \
drew
the wrong conclusion about where this discussion was going to go, and in
\
that
case Sorry!
BTW, I'm currently writing a P8 device driver to control an IDE HD with
\
multiple
partitions, which the user may map into unused P8 slots. (like the \
RamFAST).
The basic theory is to fill the unused P8 device driver vectors with my
\
device
driver entry point and then translate the different Unit Numbers passed
by \
the
MLI into the correct partition, there by creating virtual drives. If \
someone
tried to swap the entries, nothing would happen because the entries are
the same-- it's the Unit Number that makes the difference.
So, basicly, hot swapping the device driver entries is a BAD idea, in
my opinion, of course :)
-Sully
(All miss-spellings are my own :)
(R.SULLIVAN8, CAT9, TOP23, MSG:7/M645;1)
>>>>> Hans:
"""""
Sully knows exactly what I was hacking to do, and makes great points.
Don't worry though, I wasn't going to let you walk into the quicksand,
at least \
not
without adequate warning and protection. <g>
Currently, what cards are in slots 5 and 7, respectively, and how many
\
devices
are attached to each card? If slot 5 is the built-in diskport, how many
\
drives
are attached?
Will the program from which you want to access the 'swapped' slot device
\
address
files on it from BASIC with BASIC.SYSTEM commands (e.g. LOAD X, S5,D1),
or \
will
it address it from machine code?
BTW, before you even attempt to swap the $C7 0D for the $C5 4E with a
few \
POKES,
_everything_ needs to be backed up. Plus, unless Sully bales me out with
the answers, I need to re-read Gary Little's explanation about the whole
mapping procedure, as another location (Sully's $BF32,X) may also need
to be \
massaged.
Of course, if you're a curious sort, and a bit impulsive, and if you've
_got everything backed up_, and your estate planning is in order, you
can go \
ahead
with the POKES anyway, and let us know what happens. <g>
Hugh...
(H.HOOD, CAT9, TOP23, MSG:8/M645;1)
>>>>> Hans, Hugh,
"""""
I whipped up a short program that will correctly handle the slot 5/slot
7 \
swap
problem. This program applies a patch to P8 that will intercept calls
to \
slot
5/7, fix the Unit Number, then passes (redirects) control to the
opposite \
slot.
When the program is launched, it will relocate itself between the BI and
the buffers, so it is protected from other programs. The patch must be
applied \
each
time Prodos is launched, but never twice in the same session. I'm \
emailing you
guys a copy of both the program and the Merlin source. I used GSHK
with BinaryII, hope that isn't a problem.
-Sully
(R.SULLIVAN8, CAT9, TOP23, MSG:9/M645;1)
<<<<< Hugh and Sully,
"""""
Actually, that's exactly what I want to streamline -- the HD backup
process. Here's what I've got:
The machine is a Laser 128EX with an expansion box, so I've got two \
available
expansion slots -- slot 5 and slot 7. Each slot is controlled by a
hardware switch. If I switch slot 5 "on", I can only access 128K of
ram, and since \
I use
AppleWorks a lot, slot 5 remains dedicated to ram. If I switch slot 7
\
"on", I
lose access to any 3.5" drive connected to the external drive port (a 5
1/4" drive simply responds to s6,d2, but a 3.5" drive is addressed as
s7,d1 -- \
same
port). So the problem is that I have three "devices" (1 MB of ram, HD,
\
and 3.5"
drive) competing for two resources, but I only ever need any two of them
\
at the
same time.
In normal use, I have 1 MB of extended ram tying up slot 5 and an Apple
\
High-
Speed SCSI card in slot 7. For the occasions when I need to transfer a
\
file to
(or from) a 3.5" drive, I simply set up a ramdisk, temporarily move the
\
file (or
disk) to the ramdrive, flip the switch, and reboot. Although this is
fine \
>>>>>>>>>> CSplit: End part 5/20 crc: e1c9 >>>>>>>>>>
* 2qwk! 2.03 * The first full-featured QWK reader for the Apple.