|
Hello,
the answer to your question depends entirely on your protected mode
environment.
The document "Standard BIOS 32-bit Service Directory Proposal, Revision
0.4"
(which could be got from phoenix web site) defines this environment in very
clear
manner. Probably, there's no good of the BIOS32 Service Directory and
any of
services it points to, if you mean to use these under control of any PM OS
(and
virtually any PM OS has its own PCI subsystem).
At a level of an OS, you probably need some locking mechanism to perform
PCI
conf. accesses (imagine, the task switch has occured at the moment when
your task
(i.e. any code running in context of your task -- PCI BIOS code, for
example) has
written to the CONFIG_ADDRESS register (assuming that the mech. #1 is
in use)
but not yet has used the CONFIG_DATA. After your task has been switched
from,
someone else could destroy the value in CONFIG_ADDRESS).
What about accessing device configuration under Windows (from a device
driver),
see for details articles Q140730 and Q253232 and also functions
HalGetBusData*
and HalSetBusData*.
Also note that PCI bus numbers are dynamic in Windows and can change at
any
moment. Usually, you do not need to scan PCI bus nor do any PCI access to
locate
your device. With enough priviledges, you can obtain this information from
the
HKLM\System\CurrentControlSet\Enum and the
HKLM\System\CurrentControlSet\Services branches in the
registry. The
former lists devices in a system, the latter defines correspondence between
devices
and their drivers. You can set a notification for specific keys or analyze
the
stream of incoming messages (see WM_DEVICECHANGE message) in order
to determine that the location of your device has changed (the bus number
is
changed).
I hope the above answers your questions.
Regards,
Alexander Bezrukov.
|