samalone@athena.mit.edu (Stuart A. Malone) (04/01/88)
I'm trying to write an INIT that makes the Mac eject the disk in the least recently used drive when it needs an offline volume. I know how to patch into the Sony driver, so I can record when each drive was last used, but how do I patch the file manager to call my clever routine when it needs an offline volume? I'm sure that somewhere there is a file manager routine that says "make sure this volume is online", but it doesn't seem to correspond to any of the documented traps. (I just pray that the calls to the routine aren't in ROM, or I'm sunk...) --Stuart A. Malone
ephraim@think.COM (ephraim vishniac) (04/02/88)
samalone@athena.mit.edu (Stuart A. Malone) writes: >I'm trying to write an INIT that makes the Mac eject the disk in the least >recently used drive when it needs an offline volume. I know how to patch into >the Sony driver, so I can record when each drive was last used, but how do I >patch the file manager to call my clever routine when it needs an offline >volume? I'm sure that somewhere there is a file manager routine that says >"make sure this volume is online", but it doesn't seem to correspond to any of >the documented traps. (I just pray that the calls to the routine aren't in >ROM, or I'm sunk...) Check your list of low-memory (spelled *unsupported*) globals for one called something like dskSwitchHook or words to that effect. (Sorry, I haven't got the list handy.) It's the address of the routine which throws up the disk-swap dialog. Unfortunately, it's completely undocumented and unsupported. I doped out most of it while working on a removable-media drive. It didn't do what I needed, which was to gain periodic control during the dialog, so I dumped my notes on the subject. Come to think of it, I'm not sure if it received control before or after the disk ejection was done. It's possible that it's not called until a drive has been freed up, and it just waits around for a disk to be inserted. Bring on MacNosy... Ephraim Vishniac ephraim@think.com Thinking Machines Corporation / 245 First Street / Cambridge, MA 02142-1214 On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?"