Article View: comp.sys.mac
Article #36832Re: Programming INITs
From: Edward C Horvath
Date: Mon, 23 Jan 1989 03:57
Date: Mon, 23 Jan 1989 03:57
22 lines
1392 bytes
1392 bytes
From article <7238@batcomputer.tn.cornell.edu>, by mha@batcomputer.tn.cornell.edu (Mark H. Anbinder): > ...How do you write > an INIT that hangs around in memory AFTER startup? You have two problems: how to get your code to hang around, and how to get it some cycles. The first problem has two answers: install the code as System heap reasources; at INIT time, LoadResource and DetachResource. Make sure you supply a sysx resource in your INIT file to let the INIT-31 process know how much to grow the System heap. The alternative, no longer recommended, is to decrease BufPtr by a suitable amount and install your code between the new and old values. You can get your code cycles by installing it as a VBL task (which only gets cycles, in effect, at interrupt time) or by SetTrapAddress on a commonly-used trap (like SystemTask). Don't tailPatch, i.e. do your thing, then call the original SystemTask by jmp'ing to it. Hope that helps, or at least points you in the right direction... =Ned Horvath=
Technical Details
Message-ID:
<2537@pegasus.ATT.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!rutgers!att!pegasus!echReferences:
<7238@batcomputer.tn.cornell.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!rutgers!att!pegasus!ech From: ech@pegasus.ATT.COM (Edward C Horvath) Newsgroups: comp.sys.mac Subject: Re: Programming INITs Message-ID: <2537@pegasus.ATT.COM> Date: 23 Jan 89 03:57:46 GMT References: <7238@batcomputer.tn.cornell.edu> Organization: AT&T ISL Middletown NJ USA Lines: 22