[comp.sys.amiga.programmer] Help with CoolCapture routine.

lkoop@pnet01.cts.com (Lamonte Koop) (03/09/91)

     I am attempting to write a small routine to add a non-autoconfig memory
board to my system at boot-time through a CoolCapture routine. [So the
configuration does not need to be done in the startup-sequence every
time...it's for an accelerator's memory board].  I have a partially working
routine going, save for one problem...I cannot get the routine to properly
name the memory node.  Here's the routine:

CoolRoutine:
        movem.l  d0-d7/a0-a6,-(sp)
        move.l   AbsExecBase,a6
       
        move.l   #$1fffff,d0         ;size of memory to be added (2-megs)
        move.l   #$5,d1              ;attribuites
        move.l   #1,d2               ;priority
        move.l   #$2000000           ;Starting address
        lea.l    MemName,a1          ;Name of the block
        jsr      _LVOAddMemList(a6)  ;Add the list node
  
        movem.l (sp)+,d0-d7/a0-a6
        rts

MemName:  dc.b  'Whatever',0

Now, the routine (and an associated ColdCapture routine) are preserved on teh
system stack.  This includes the MemName entry. It looks like this:
 
Routine start

ColdCapture routine
CoolCapture routine
[Here's where the MemName entry is]

Routine end.

The whole area between the "Routine start" and "Routine End" is on the system
stack.  Unfortunately, although this DOES add the memory apon reboot (allowing
many system structures into the 32-bit RAM), it does not show the node name
(I get garbage).  I need the name in there as another program looks for it.
Any ideas on how to do this properly?  BTW: This is for a CSA Mega Midget 030
board and it's DRAM and SRAM.  If anyone can help out, or has done this
before, please let me know.  Email or posting here is fine.  Thanks in
advance.


                             LaMonte Koop
 Internet: lkoop@pnet01.cts.com         ARPA: crash!pnet01!lkoop@nosc.mil
           UUCP: {hplabs!hp-sdd ucsd nosc}!crash!pnet01!lkoop
 "It's a dog-eat-dog world...and I'm wearing Milk Bone underwear"--Norm

mcr@Sandelman.OCUnix.On.Ca (Michael Richardson) (03/11/91)

In article <7891@crash.cts.com> lkoop@pnet01.cts.com (Lamonte Koop) writes:
>Now, the routine (and an associated ColdCapture routine) are preserved on teh
>system stack.  This includes the MemName entry. It looks like this:
> 
>Routine start
>
>ColdCapture routine
>CoolCapture routine
>[Here's where the MemName entry is]
>
>Routine end.
>
>The whole area between the "Routine start" and "Routine End" is on the system
>stack.  Unfortunately, although this DOES add the memory apon reboot
 
  Really. On the system stack? Doesn't that get reset at some point?
Does the system really run a single thread (plus jmp's through A5/A4
to return according to Markus Wandel's 1.2 listing) all the way
through CoolCapture? 
  I would suspect that you have been lucky and only had the MemName
portion trashed.


-- 
   :!mcr!:            |  The postmaster never | - Pay attention only
   Michael Richardson |    resolves twice.    | to _MY_ opinions. -  
 HOME: mcr@sandelman.ocunix.on.ca +   Small Ottawa nodes contact me
 Bell: (613) 237-5629             +    about joining ocunix.on.ca!