Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!rex!ukma!seismo!dimacs.rutgers.edu!aramis.rutgers.edu!remus.rutgers.edu!romulus.rutgers.edu!jjoshua From: jjoshua@romulus.rutgers.edu (J. Joshua) Newsgroups: comp.sys.mac.programmer Subject: Re: INIT/cdev communication question Message-ID: Date: 27 Mar 91 05:13:28 GMT References: <91083.154101CXT105@psuvm.psu.edu> <1991Mar26.185524.2932@eng.umd.edu> Organization: Brumfuss U. Lines: 31 To: russotto@eng.umd.edu In article <91083.154101CXT105@psuvm.psu.edu> CXT105@psuvm.psu.edu (Christopher Tate) writes: >Is there anything wrong with this scheme: > >My INIT opens up a resource of a custom type and ID (chosen to minimize >possible conflicts) which contains the data which needs to be shared by >the INIT and the cdev. Since the INIT file is first in the resource >search chain, the INIT will always open the resource out of its own >file. This is howw I do it... Put an 8 byte 'signature' in your init just before an area to store some values to be placed by the CDEV. When you load your init during boot time, make a note of the memory location of where is loaded - it doesn't get moved (of course detach the init resource). Store this location in a resource (make sure that the init and the cdev are in the same file so they sharee the same resource fork). When the cdev is called it can open the resource and get the address stored there. It can then check an offset of the address to find the init's signature. If this is found, you know where you can store stuff that you want the init to find. JOn. -- ________ | | This Messsage A Service By: | | Closed Captioned Jon Joshua | | For the Hearing Impaired jjoshua@remus.rutgers.edu `----. .-' |/ #include