COM port detection

To be honest most of it is just out of interest and for future reference. As
you say it does not really matter but I would still like to know the basics
of how Windows device enumeration works in practice, having read so many
books and articles on the subject.

Regards FarmerJo

> Given that the BIOS contains user settings that enable/disable COM ports in

addition to specifying its I/O and interrupts, how does Windows read these
settings?

Do you have NT4 DDK and its SERIAL source? it used sophisticated probing I
think.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

> Assuming that we have an ACPI compliant Windows XP PC what is the

sequence
of events that result in serial.sys being loaded in terms of root
enumerators and PnP etc?

ACPI BIOS adds a node to ACPI table about the serial port

NTLDR fetches the ACPI table and throws it to some memory location later used
to build HKLM\HARDWARE

ACPI.SYS reads this registry ACPI table and interprets it, creating a PDO for
the serial port


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Hi,

Thanks thats the sort of thing I was looking for.

ACPI BIOS adds a node to ACPI table about the serial port

If the user has disabled a COM port in the BIOS presumably the the entry in
the ACPI table is not created?
Where does the ACPI table exist as created by the BIOS? I mean is it at some
fixed address link the BIOS data area (0x400) or somewhere else?

NTLDR fetches the ACPI table and throws it to some memory location later
used
to build HKLM\HARDWARE

What is it that creates HKLM\HARDWARE?

FramerJo

> If the user has disabled a COM port in the BIOS presumably the the entry in

the ACPI table is not created?

Correct.

Where does the ACPI table exist as created by the BIOS? I mean is it at some
fixed address link the BIOS data area (0x400) or somewhere else?

BIOS data area is obsoleted by ACPI table I think.

I think there is some int 15h to get the base address of ACPI table.

What is it that creates HKLM\HARDWARE?

HKLM\HARDWARE is created by the kernel from some in-memory structures created
by NTLDR and NTDETECT.COM


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

First, you need to find RSDP - this is the root of ACPI table.
The first 8 bytes of RSDP are a signature field which equals to "RSD PTR ".

After you found RSDP, you need to parse the tables and search for your
specific table in question.

On x86 systems, RSDP should be searched for in one of the two regions:

  • The first 1Kb of the Extended BIOS Data Area (EBDA), skip lowest 16 bytes
  • BIOS read-only memory space between 0xE0000 and 0xFFFFF

Check how Linux scans the ACPI tables - it’s a good reference.

Alexey

Maxim S. Shatskih wrote:

> If the user has disabled a COM port in the BIOS presumably the the entry in
> the ACPI table is not created?
>

Correct.

> Where does the ACPI table exist as created by the BIOS? I mean is it at some
> fixed address link the BIOS data area (0x400) or somewhere else?
>

BIOS data area is obsoleted by ACPI table I think.

I think there is some int 15h to get the base address of ACPI table.

> What is it that creates HKLM\HARDWARE?
>

HKLM\HARDWARE is created by the kernel from some in-memory structures created
by NTLDR and NTDETECT.COM