meranda@iguana.cis.ohio-state.edu (deron meranda) (03/08/91)
I would like some technical clarification about the ROMTAG method of initializing libraries that I can't seem to find in the RKM's. The example library code given in the RKM as well as the source for other libraries I have seen use a simple ROMTAG to iniitialize the library. Normally, the "executable" file starts out like: SECTION Library,CODE moveq #-1,d0 rts RomTag: dc.w $4afc ... 1) Does OpenLibrary cheat and expect to find a romtag structure at the beginning of the "executable" file, or does it perform an actual romtag scan, like when exec is starting up. (This lazy method is hinted at in RKM Includes+Autodocs, p.A-28, in the function exec/InitResident). If a "real" romtag scan is indeed performed, what part of memory is scanned ? (i.e. only the loaded seglist, only the first segment in the seglist, etc.) Is it then conceivable to put this romtag data in a preinitialized C variable, instead of at the beginning of some assembly startup? Also, for curiosity, if a library "executable" has multiple romtags (with different names), will they ALL be initialized (in order of their priority fields)? 2) In addition, are the newly loaded library's romtag(s) added to the exec resident list? If so, AND they have the RTF_COLDSTART flag set, then this library may be able to survive a reboot, right? However, what if the library is expunged and nothing else tramples on that memory before a reboot occurs. In this case, could the library "come back" after the reboot, even though it was expunged? 3) When the initialization code for the romtag is called after the library is loaded, what are the current register assignments? From the example, it is clear that A6 contains the ExecBase and A0 contains the seglist for the loaded code. Are there any other useful register assignments, and is A0 a BPTR? Thanks for any insight or clarification :) Deron E. Meranda ( meranda@cis.ohio-state.edu )