Path: utzoo!attcan!uunet!portal!cup.portal.com!ts From: ts@cup.portal.com (Tim W Smith) Newsgroups: comp.sys.mac.programmer Subject: Re: Disk spunup/not mounting ? Message-ID: <22450@cup.portal.com> Date: 23 Sep 89 07:39:51 GMT References: <4879@shlump.nac.dec.com> Organization: The Portal System (TM) Lines: 50 By the time the Mac gets around to running your INIT, it is too late. The sequence at boot time is somethine like this ( for the exact sequence, check the tech notes ): 1. For each SCSI disk, load the driver for that disk 2. Mount the disk that the System file is on 3. Run INITs 4. Most disk drivers loaded in step 1 have set the dNeedTime bit. When they get called because of this, they post disk insertion events so that the Finder will mount their volumes Since your disk has not yet been spun up by step 1, it's driver is not loaded. When you reboot, it has been spun up, so it then works. This does not explain your report of it working sometimes the first time. Is it possible that it was already spun up from a previous use? Anyway, you will need to change your INIT to load the driver from the disk after it spins up. The information you need is in IM IV. This is what you have to do: 1. Read block 0 of the disk. This contains the Driver Descriptor Map. This will tell you where the driver is on the disk. 2. Allocate a non-relocatable block in the system heap big enough to hold the driver. 3. Read the driver from the disk into this block. 4. Read block 1 from the disk into another non-relocatable block in the system heap. 5. Put the address of this block in A0, and put the SCSI id of the driver in D5. 6. JSR to the start of the driver. It will install itself and return to you. You may want to change your INIT to check first to see if the driver has already been installed, just for safety. Do this by looking at the entry in the unit table for your SCSI disk and seeing if it is non-zero. SCSI device N is supposed to use entry 32+N. Tim Smith