Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: externsion!



At 21:14 +0800 31/5/01, Rachappa Kolar wrote:
1. Before validate hardware is called by port scanner will the drivercode be
loaded (in RAM) ? if yes is it through the system extension file in extension
folder which is made run by startup code after system initialisation ?

Ans:

I'll assume your writing a PCI device driver. The process is similar, if if little more complex, for other types of devices.

OT includes a component called the "PCI port scanner". At startup the PCI port scanner walks the Name Registry looking for all PCI network cards. For each card, the scanner attempts to load a ROM-based driver. ROM-based drivers are rarely present for network cards, so the PCI port scanner then calls the Driver Loader Library (described in "Designing PCI Cards and Drivers for Power Macintosh Computers") to find the list of appropriate disk-based drivers. The Driver Loader Library searches a number of places for the disk-based driver, but the most important place is the Extensions folder (looking for files of type 'ndrv'). Once DLL has found the list of candidate drivers, the PCI port scanner loaders each driver (starting with the most appropriate) and calls its "ValidateHardware" entry point. This entry point can return one of three different results.

o kENOENTErr -- Implies that the driver doesn't recognise this hardware.

o kOTNoError -- Implies that the driver did recognise this hardware and is the right driver for the port. The PCI port scanner will unload the driver code. OT will reload driver code when the port is actually opened by a network protocol.

o kOTPCINoErrorStayLoaded -- Same as the above except that the PCI port scanner will not unload the driver code.

2. What an extencion file for the driver do ? Does it load the driver?

Ans:

The extension file (ie the file of type 'ndrv', which stands for "native driver" btw) contains the actual driver code. This file is entirely self contained. It includes information that allows OT to match your driver against the PCI hardware, and the actual code to control the hardware. For a typical PCI Ethernet card this code is automatically loaded and unloaded by OT when the port is opened and closed. You don't have to manually load or unload the code.

3. What does DlpiProbe( ) do & Where can I get detailed function about this
and all Dlpi functions and Enetlib function likeAllocateMemory()
,OpenInterrupt( ) is there any help for appleEnetSDK .

I don't know the AppleEnet framework so I'll defer to those that do.

S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.