Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Get ECAM base address from KMDF

nor_naknor_nak Member Posts: 2
edited August 2023 in NTDEV

Hello,

Is there a way to get the ECAM base address to get information about the PCI configuration space?
OS is Windows 10, KMDF version is 1.19.
Initially, I used the fixed value (0xE0000000) identified from the device manager, but the value changed due to the CPU change.
Therefore, we would like to deal with this dynamically within the KMDF driver.

Thank you

Comments

  • Mark_RoddyMark_Roddy Member - All Emails Posts: 4,753

    Is there any way? Yes, of course, you just have to read the ACPI 'MCFG' table and off you go. But why would you need to do this? You can access extended configuration space for a device using the supported BUS_INTERFACE_STANDARD function mechanism or the IRP based IRP_MN_READ/WRITE_CONFIG mechanism. Note that the OS is likely to try to prevent you from using non-standard access methods on protected devices.

  • nor_naknor_nak Member Posts: 2

    @Mark_Roddy said:
    Is there any way? Yes, of course, you just have to read the ACPI 'MCFG' table and off you go. But why would you need to do this? You can access extended configuration space for a device using the supported BUS_INTERFACE_STANDARD function mechanism or the IRP based IRP_MN_READ/WRITE_CONFIG mechanism. Note that the OS is likely to try to prevent you from using non-standard access methods on protected devices.

    When doing CvP of a device, I was thinking of mapping and accessing control and status.
    I needed the ECAM address for mapping, but as you said you can do it with SetBusData/GetBusData.
    I was able to confirm that it works even in environments with different ECAM addresses!
    Thank you for your advice.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 13-17 May 2024 Live, Online
Developing Minifilters 1-5 Apr 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 20-24 May 2024 Live, Online