MMIO_Starting_Physical_Address and PCIe

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Octocontrabass
Member
Member
Posts: 5567
Joined: Mon Mar 25, 2013 7:01 pm

Re: MMIO_Starting_Physical_Address

Post by Octocontrabass »

Klakap wrote:As Occontrabass noted, you have to search RSDP in memory from 0xE0000 to 0xFFFFF as first. Only if you can not found RSDP in this memory, you can move to Bios EBDA area.
Aren't you supposed to search the EBDA first?
Klakap
Member
Member
Posts: 297
Joined: Sat Mar 10, 2018 10:16 am

Re: MMIO_Starting_Physical_Address

Post by Klakap »

Oh I am sorry, but from my tests on real computers is RSDP rather on BIOS ROM than EDBA.
Rukog
Member
Member
Posts: 51
Joined: Sun Aug 01, 2021 5:24 pm

Re: MMIO_Starting_Physical_Address

Post by Rukog »

The length of my XSDT.Entry is equal to 19 address of 64-bit and all are 32-bit lenght, weird considering I have 16 GB of RAM.
Image

The red rectangle is the first address of my XSDT.Entry

Is it the same for all of you ?
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: MMIO_Starting_Physical_Address

Post by nullplan »

Rukog wrote:The length of my XSDT.Entry is equal to 19 address of 64-bit and all are 32-bit lenght, weird considering I have 16 GB of RAM.
Not really. Read-only tables will be in ROM, which is typically in the low 4GB, and tables with changing/configuration-dependent content will be in some RAM area the firmware reserves to itself, which again is probably going to be in the low 4GB, if for no other reason then to be accessible to unpaged 32-bit mode, which is a possible configuration for the firmware.

Or put it another way: 4GB is really enough for all ACPI tables, isn't it? So why should any tables be beyond the 4GB line?

That said, never assume that the tables are in the low 4GB, even though they likely are. You never know when some firmware is going to decide to do something different, and the interface provides for large addresses.
Carpe diem!
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: MMIO_Starting_Physical_Address

Post by nexos »

Rukog wrote:The length of my XSDT.Entry is equal to 19 address of 64-bit and all are 32-bit lenght, weird considering I have 16 GB of RAM.
I remember Brendan said back a long while ago (before I had an account :) ) that x86 system's RSDT and XSDT were probably the same, as for compatibility with 32 bit OSes, it wouldn't make sense to have two copies of ACPI tables in ROM or memory.
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
Rukog
Member
Member
Posts: 51
Joined: Sun Aug 01, 2021 5:24 pm

Re: MMIO_Starting_Physical_Address

Post by Rukog »

Ive finally retrieve the MCFG table 8)

Image
Rukog
Member
Member
Posts: 51
Joined: Sun Aug 01, 2021 5:24 pm

Re: MMIO_Starting_Physical_Address

Post by Rukog »

Ive a doubt, ive dumped my
Memory Mapped Enhanced Configuration Space Base Address Allocation Structure
and I found that weird structure result
Untitled.jpg
The base address seems legit, but the group number is acting weird, the start and end bus seems OK tho.
Last edited by Rukog on Tue Aug 17, 2021 1:09 pm, edited 1 time in total.
Klakap
Member
Member
Posts: 297
Joined: Sat Mar 10, 2018 10:16 am

Re: MMIO_Starting_Physical_Address

Post by Klakap »

It seems that you have it. Try to search for some DeviceID and VendorID.
Octocontrabass
Member
Member
Posts: 5567
Joined: Mon Mar 25, 2013 7:01 pm

Re: MMIO_Starting_Physical_Address

Post by Octocontrabass »

Rukog wrote:the group number is acting weird
How so? It looks normal to me.
Rukog
Member
Member
Posts: 51
Joined: Sun Aug 01, 2021 5:24 pm

Re: MMIO_Starting_Physical_Address

Post by Rukog »

Klakap wrote:It seems that you have it. Try to search for some DeviceID and VendorID.
Ok so ive finally success to dump the base address and ive that result.

Image

There is no signature of PCI device (ive a GTX 1060), is that normal ?
Octocontrabass wrote:
Rukog wrote:the group number is acting weird
How so? It looks normal to me.
Ye I thought that when seeing all those zero bytes heh.
Octocontrabass
Member
Member
Posts: 5567
Joined: Mon Mar 25, 2013 7:01 pm

Re: MMIO_Starting_Physical_Address

Post by Octocontrabass »

Rukog wrote:There is no signature of PCI device (ive a GTX 1060), is that normal ?
According to the MCFG table, the memory-mapped extended configuration space covers 256 buses.

Each bus has 32 slots. Each slot has 8 functions. Each function has 4kiB of MMIO for the configuration space.

Since there are 8 functions per slot, each slot has 32kiB of MMIO. Since there are 32 slots per bus, each bus has 1MiB of MMIO.

So, it's probably in there, but there are 256 buses and 256MiB of MMIO. You'll have to enumerate the devices to find what you're looking for. (You don't have to check every single bus/slot/function, there are ways to enumerate PCI much more quickly than that.)
Post Reply