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

Re: AUX memory question



(rubywand, I suggest putting this excellent memory map into the FAQ)

David Empson wrote:
> > Why did they bother with write only access to this ram?
> 
> The major benefit is that it allows code in ROM to remain available for
> use while copying data into the language card.  For example, the
> standard memory move routine provided by the monitor can be used to copy
> data from main memory (or ROM) into the language card area.
> 
> One example of this is late versions of DOS 3.3, which were able to save
> disk space on the system master by not including a copy of the monitor
> firmware in the FPBASIC and INTBASIC files (saving 8 sectors per file).
> The LOADER.OBJ0 program reads whichever file is appropriate into the
> language card at $D000-$F7FF (using the write-only mode), then copies
> the monitor firmware from the ROM to the language card ($F800-$FFFF).
> This means that you end up with the "native" monitor firmware for the
> machine.
> 
> By comparison, earlier versions of DOS 3.3 included a copy of the
> "autostart" (Apple ][+) monitor ROM in FPBASIC and INTBASIC.  If you run
> this version on an Apple //e, then you lose several //e-specific
> features if you switch to Integer BASIC.  The 80-column firmware has a
> workaround for this: if it detects the "wrong" monitor in the language
> card, it copies the monitor firmware from the ROM.

Wow!  This architecture has more hacks in it than any I have ever seen! 
It is amazing that most of the Apple II software from the late 70's
still works on an Apple II[e|c|gs].

> 
> > > [Disconnecting /RAM]
> >
> > I never thought about being "polite".  In my normal usage of an Apple
> > II, I reboot it quite often.  Rebooting (or doing -prodos) reinitializes
> > /RAM.  I can add code to re-attach and reformat /RAM, but I will now
> > have to make sure that I don't trash important memory areas that ProDOS
> > would like me to preserve.  I'll try to find that technote.
> 
> The only memory areas you need to protect are auxiliary memory zero page
> ($0080-$00FF) and auxiliary memory $0200-$03FF.
> 
> Reattaching /RAM is basically the reverse process for removing it.  The
> only extra step is to issue a FORMAT call to its device driver (which
> requires a few steps to get the memory into the right state).  This will
> create a fresh directory on /RAM (unlike formatting other volumes).
> 
> If you don't have all the details, I should be able to E-Mail you a copy
> of the relevant technotes.

I have details on how to detach, re-attach and reformat /RAM from a book
about ProDOS by Gary Little (got on Ebay).  I don't remember the exact
title, but it is an excellent book.

> > If I am free to use the RAM in the language card, then I assume that
> > ProDOS 'lives' in the upper 16K (or 12K?) of the AUX memory proper,
> > accessed via the ALTZP switch?
> 
> Apart from the /RAM driver code, ProDOS lives entirely in main memory:
> $BF00-$BFFF is the global page (entry points, data structures, hook
> routines, etc.), and the kernel is in $D000-$FFFF (main memory language
> card).  There is also the quit code (program selector) in the second
> language card bank ($D100-$D3FF).

> I'm not sure what you mean about "the upper 16K of AUX memory proper".
> That is the auxiliary language card area, which I was telling you how to
> use in my previous message in this thread.

I guess I meant what you refered to as the "main memory language card".

> Have you seen a complete diagram of the 128K IIe memory map?  It
> certainly helps when trying to understand all this.  Here is a rough
> version (not to scale vertically).

I have never seen a full memory map of this detail.  It seems that a
128K IIe has far more than just 128K of addressable bytes.  I knew about
the expansion ROM switching, but I never understood the full
capabilities of the language card.  I thought it simply allowed you to
swap the 12K main ROM for 12K of ram.  Into this ram one would load
INTBASIC or ProDOS (I've always used Applesoft from ROM).

> 
>          MAIN RAM         AUX RAM            I/O             ROM

[lots of stuff deleted]

This is the part that always confused me.  I'm going to tape a print out
of this to my wall near my computer so I can refer to it all the time. 
I wonder who will take it down first, my wife or my cats...

> CFFF  ______  ______   ______  ______  |_____________| |_____________|
> D000 |      ||      | |      ||      |                 |             |
>      | Main || Main | |  Aux ||  Aux |                 |             |
>      |      ||      | |      ||      |                 |             |
>      |  LC  ||  LC  | |  LC  ||  LC  |                 |             |
>      |      ||      | |      ||      |                 |             |
>      | bank || bank | | bank || bank |                 |             |
>      |   1  ||   2  | |   1  ||   2  |                 |  Applesoft  |
>      |______||______| |______||______|                 |             |
> E000 |              | |              |                 |    BASIC    |
>      |              | |              |                 |             |
>      |              | |              |                 |     ROM     |
>      |              | |              |                 |             |
>      |              | |              |                 |             |
>      |     Main     | |      Aux     |                 |             |
>      |              | |              |                 |             |
>      |   Language   | |   Language   |                 |             |
>      |              | |              |                 |             |
>      |     Card     | |     Card     |                 |             |
>      |              | |              |                 |             |
>      |              | |              |                 |.............|
> F800 |              | |              |                 |   Monitor   |
>      |              | |              |                 |             |
>      |              | |              |                 |     ROM     |
> FFFF |______________| |______________|                 |_____________|
> 
> (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?  My current code will not relay on
having more than 128K of ram, but it would be neat to know.  My IIe
emulator card for my Mac LC-II insists on creating a 256K /RAM7, so I
assume that it follows the same spec.  Actually, I'll post a different
thread to ask about accessing memory beyond 128K from an IIe and IIgs
(in 8 bit mode).


-- 
dennis@usb.com                           Universal Savings Bank.

The three most dangerous things are a programmer with a soldering
iron, a manager who codes, and a user who gets ideas.