🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.mac
Article #6816

Re: Init Resources in another file...

#6816
From: marchesi
Date: Fri, 15 Aug 1986 15:12
45 lines
2395 bytes
In article <96900032@uiucuxc> dorner@uiucuxc.UUCP writes:
>
>I must have missed something--I, too, would really like to use this, but
>have never heard of it before.  Would one of you in the know please post
>the gory details on how to do this?
>
>Thanks,
>
>Steve Dorner
>dorner@uiucuxc.CSO.UIUC.EDU

Summary from Macintosh Tech Note #14: 'The INIT 31 Mechanism'

In the System files version >= 3.0 there is an INIT resource with ID 31
which during startup looks at all files in the System Folder for files of
type 'INIT'; when it finds one, it looks inside them for resources of type
'INIT' - if there are any, they are loaded and 'JSR'ed to before the file is
closed and the next one is looked for. INIT resources contain executable
code, beginning with the first byte of the resource; their 'locked' bit in
their resource attibutes should be set, and if the code should remain in
memory permanently, the INIT must call _DetachResource (and it should be
allocated on the system heap...) - also, if the 'permanent' space needed is
bigger than 1K, you should consider allocating it on the top of the memory,
subtracting the value you need from BufPtr ($10C) and moving your code above
this new BufPtr value. Warning: space allocated in this way cannot be moved,
enlarged or deallocated; since other INITs may use  this same technique, you
cannot rely on BufPtr always pointing to 'your' space; finally, the secondary
screen and sound buffers may not be used if this approach is taken.

(there is some additional info regarding boot-time driver number arbitration)

hope it helps

		ciao

		       Paolo

----------------------------------------------------------------------------
Paolo Petta

p-mail: DD Division
	CERN
	CH-1211 Geneva 23
	Switzerland
e-mail: ...{seismo,philabs,decvax,...}!mcvax!cernvax!marchesi
Technical Details
Message-ID: <364@cernvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!cernvax!marchesi
References: <4657@decwrl.DEC.COM> <96900032@uiucuxc>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!cernvax!marchesi
From: marchesi@cernvax.UUCP (marchesi)
Newsgroups: net.micro.mac
Subject: Re: Init Resources in another file...
Message-ID: <364@cernvax.UUCP>
Date: Fri, 15-Aug-86 11:12:26 EDT
Article-I.D.: cernvax.364
Posted: Fri Aug 15 11:12:26 1986
Date-Received: Sun, 17-Aug-86 06:15:16 EDT
References: <4657@decwrl.DEC.COM> <96900032@uiucuxc>
Reply-To: marchesi@cernvax.UUCP ()
Organization: CERN, Geneva/Switzerland
Lines: 46