[comp.sys.amiga] Amiga Exception Vectors

aiajms@castle.ed.ac.uk (-=Andy=-) (03/13/90)

I am currently designing a mini operating system round the 68000 here at
Uni. I thought I might have a look at the Amiga Exception vectors and
found to my suprise that the system stack pointer seemed to be directed
to location 0, ie on top of itself. The PC pointed to an area of memory
in my fast ram which seemed fair enough but several of the other vectors
seemed to be pointing to the area between the Amiga ROM and the top of
the 68000 memory map, which according to the fabby (ahem) Amiga Manual
does not exist! It does however mention that the exception table has
some sort of overlay and I notice from the Gary chip that it has some
sort of Overlay input, presumably for some weird sort of decoding.

I am not really a hardware person, and I am a bit more than confused. It
just seems rather odd to have the SSP at location 0000 unless perhaps
the stack actually exists in this weird piece of memory between ROM and 
the top of memory which is in turn overlayed on another piece of
memory!!!

Anyone help me out???
Thanks


-=Andy=-

===========================================================================
Name  : Andy Mcsherry
Degree: Computer Science & Artificial Intelligence		   //
Univ  : University Of Edinburgh, Scotland.		       \\ //
Mail  : aiajms%uk.ac.ed.castle@nsfnet-relay			\X/
Motd  : Don't be STingy, buy a decent computer         -->     AMIGA 
==========================================================================

ckp@grebyn.com (Checkpoint Technologies) (03/14/90)

In article <2780@castle.ed.ac.uk> aiajms@castle.ed.ac.uk (-=Andy=-) writes:
>
>I am currently designing a mini operating system round the 68000 here at
>Uni. I thought I might have a look at the Amiga Exception vectors and
>found to my suprise that the system stack pointer seemed to be directed
>to location 0, ie on top of itself. The PC pointed to an area of memory
>in my fast ram which seemed fair enough but several of the other vectors
>seemed to be pointing to the area between the Amiga ROM and the top of
>the 68000 memory map, which according to the fabby (ahem) Amiga Manual
>does not exist! It does however mention that the exception table has
>some sort of overlay and I notice from the Gary chip that it has some
>sort of Overlay input, presumably for some weird sort of decoding.

	The memory map of the Amiga looks different between normal
runtime and just after a reset.  That "overlay" signal you see tells the
Gary chip to place the ROM beginning at address 0, which is the reset
condition.  After powerup, the ROM startup routines negate the 'overlay'
signal, ROM moves to
$FC0000, and chip RAM appears at 0.  So therefore, when you peek
location 0 (Reset SSP) and 4 (Reset PC), what you see is not really used
at reset time.  To see the real SSP and PC, you should peek the first
two long words in ROM.

darrenr@munnari.oz.au (Darren James REED) (03/14/90)

 
   Yes, you are right, there are a couple of overlay vectors that are provided by one of the chips, be it gary, agnus or whatever.  However it is only present (I assume) when those chips receive a RESET signal so at all other times, the first 8 bytes are then RAM.
   To check them out, the only possible way I know would be to (perhaps) use the following code:

   move.l  #Chk_Reset,$64.s  (trap intercept vector 0)
   trap    #0
   ....
Chk_Reset:
   reset              put external chips in RESET state
   move.w  #$2700,SR
   move.l  $0,a0      a0=reset address
   move.l  $4,a1      a1=stack pointer
   rte

   It is likely that the above routine will do nasty things to the amiga and may guru it.   As long as the other chips are in the reset state long enough for the above instructions to execute, it should work.
   It is a rather dirty way of doing it but given the nature of the 680x0 series, the only way.

Darren.