ADC Home > Reference Library > Technical Q&As > Legacy Documents > Hardware & Drivers >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

GetDriverDiskFragment and 'ndrv' Drivers


Q: I have been successfully using RenameDriver() in my 'INIT' using the PCI Power Macintosh DDK, Version B4. However, when I load my driver from an 'INIT' file type using GetDriverDiskFragment() and InstallDriverFromFragment(), the only property added or updated in the device tree is the driver-ref property. GetDriverDiskFragment() and InstallDriverFrom Fragment() could be changed to add the same properties that the 'ndrv' adds. Why aren't the same properties added when I use GetDriverDiskFragment() and InstallDriverFrom Fragment() as the 'ndrv'?

In my other 'INIT', I used DetachResource() for handles. If I use the combination of GetDriverMemoryFragment() and InstallDriverFromFragment(), do I need to use a routine call to disassociate the first Ptr argument in GetDriverMemoryFragment() from the 'INIT', and if so, what routine should I call?

A: Although GetDriverDiskFragment was created for family experts, use this call for 'ndrv' drivers, if you want to. GetDriverDiskFragment does not put the same properties in the device tree as 'ndrv' drivers do, because it was not designed to be used with 'ndrv' drivers. After you have your properties in the NameRegistry by using GetDriverDiskFragment, you can add additional ones. See Designing PCI Cards & Drivers for Power Macintosh Computers, in the chapter on NameRegistry, for more information.

When you make a call to GetDriverMemoryFragment in your INIT, and you have a pointer that you created in your code, you are responsible for disposing of that pointer, just like any other pointer you create. To free up the storage you created, make a call to DisposePtr.

[Jul 15 1995]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.