🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #12832

Re: ExecBase

#12832
From: Eddy Carroll
Date: Wed, 24 May 1989 00:47
47 lines
2047 bytes
In article <31472@sri-unix.SRI.COM>, thomas@cbmvax.UUCP (Dave Thomas QA)
writes:
> In article <10702@cit-vax.Caltech.Edu> bdiscoe@tybalt.caltech.edu.UUCP
> (Ben W. Discoe) writes:
>> 
>>    I'm trying to find Execbase.  I seem to remember reading somewhere that 
>> it's always at 0000004 in memory, but it doesn't seem to be there, and
>> I can't find my reference any more.  Could anyone tell me where it is or
>> how to find it?
> 
> The pointer to ExecBase is in address 4. In other words:
>    struct ExecBase *ExecBase = (struct ExecBase *) 4;
>  

Shouldn't this be:

	#include <exec/execbase.h>
	struct ExecBase *SysBase;
	   ...
	main()
	{
	       ...
	    SysBase = *(struct ExecBase **) 4;
	       ...
	}

i.e. set SysBase to the contents of the location which contains the
pointer to ExecBase?

Also, the initialisation has to be done at run time rather than compile
time (after all, ExecBase could move around depending on the memory
installed etc), so the expression given above can't be used as an initialiser
expression for the declaration of SysBase.

All of which is pretty academic anyway, since Lattice initialises SysBase
for you, and I'm sure Aztec does too. So all you need to say is:

extern struct ExecBase *SysBase;

anywhere, and it will be automatically setup for use.

Eddy (who will probably find a large number of other people have also replied
      to this, but what the heck :-)
--
Eddy Carroll               ----* Genuine MUD Wizard  | "You haven't lived until
INTER: ecarroll@cs.tcd.ie                            |  until you've died in
 UUCP: {..uunet}!mcvax!ukc!cs.tcd.ie!csvax1!ecarroll |  MUD!" - Richard Bartle
Technical Details
Message-ID: <45382@csvax1.cs.tcd.ie>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!ukc!tcdcs!csvax1!ecarroll
References: <31472@sri-unix.SRI.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!ukc!tcdcs!csvax1!ecarroll
From: ecarroll@csvax1.cs.tcd.ie (Eddy Carroll)
Newsgroups: comp.sys.amiga.tech
Subject: Re: ExecBase
Message-ID: <45382@csvax1.cs.tcd.ie>
Date: 24 May 89 00:47:56 GMT
References: <31472@sri-unix.SRI.COM>
Organization: Computer Science Department, Trinity College Dublin
Lines: 47