[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AUX memory question
Dennis Jenkins <dennis@usb.com> wrote:
> (rubywand, I suggest putting this excellent memory map into the FAQ)
Ditto. Ideally, it should be supplemented with more details on the
memory locations of each of the relevant soft switches.
> David Empson wrote:
> >
> > (If you have a RAMWorks or similar bank-switched card in the auxiliary
> > slot, then any 64K bank on the card can be switched into the auxiliary
> > memory space. "Normal" auxiliary memory, which contains the video
> > buffers, is bank 0 on the card.)
>
> How does one switch this memory?
I've never worked with one of these cards, but the principle is quite
simple: the card implements a write-only register at either $C071 or
$C073, into which you store the desired bank number.
ProDOS and the motherboard firmware have no built-in support for these
cards, so it is necessary to load a driver from disk (e.g. to create a
larger RAM disk). If you wanted to use the card for something other
than a RAM disk, it would be necessary to comply with some kind of
guidelines for allocation of banks within the card. I don't know if any
such guidelines exist.
The auxiliary slot cards have no ROM, hence no firmware. A RAM disk on
one of these cards cannot be used to boot the machine.
By comparison, standard slot RAM cards have firmware and appear to
ProDOS as a normal block device; you can boot from such a card.
Applications are supposed to use the SmartPort firmware interface to
access memory on the card, to allow for compatibility with various cards
that might implement the hardware interface differently.
Apple's own card uses a one byte memory window in the I/O space,
together with a three byte address register. The driver code writes the
address within the card's memory into the address register, then reads
or writes data one byte at a time using the data register. Each read or
write access automatically increments the address register.
> My IIe emulator card for my Mac LC-II insists on creating a 256K /RAM7, so I
> assume that it follows the same spec.
That will be a standard slot RAM card (an emulated one), not an
auxiliary slot card. I wouldn't expect the IIe card for the LC to
emulate the hardware interface, only the firmware interface.
> Actually, I'll post a different thread to ask about accessing memory beyond
> 128K from an IIe and IIgs (in 8 bit mode).
The IIgs is yet another kettle of fish. There is one fundamental rule:
if you use any memory outside of the ProDOS-8 area (main and auxiliary
memory, corresponding to banks 0 and 1 on the IIgs), you _must_ use IIgs
Memory Manager toolset to reserve the appropriate memory areas. (This
requires a little extra work to set it up correctly if you boot directly
into ProDOS-8.)
In general, you cannot assume that any particular memory range may be
available: the normal memory allocation technique is to ask for a block
of memory of a specified size at an unspecified location, lock it down
(so it won't move) then use pointers to access the content of the
memory. The memory block should be unlocked again if not in use for a
while, since this allows the system to move reserved memory around to
make space for a subsequent allocation.
No bank switching is required to access memory in the IIgs: you can set
up three-byte pointer variables on zero page, and use the 65816 indirect
long addressing modes to directly access the entire 16 MB address space.
The IIgs also emulates the memory map of the IIe, with bank switching as
described in my previous article, except that the $C100-$CFFF ROM space
works a little differently. It is also somewhat more complicated by the
presence of two pairs of banks which mirror the IIe memory layout (banks
0 and 1, and banks $E0 and $E1). The video buffers are actually in
banks $E0 and $E1, and hardware or software shadowing techniques are
used to mirror them into banks 0 and 1.