Serial Port Initialization

I have a few questions regarding the setting up and initialization of the serial port device in windows.
Who is responsible for allocating and assigning resources to an integrated serial port? Does the BIOS do
that and then tell the OS what to use, or does the serial port chipset (UART i think it is) participate
in PnP arbitration to determine what resources to use. In either case what does the windows serial port
driver do to initalize the serial port.
I am trying to track down an issue with a machine and seem to be unable to determine why the DTR line
is activated at boot and kept active, yet deactivated when CreateFile(COMx) is called, and as soon as
the handle is closed, its active again…

Thanks for any input
asa

The BIOS/ACPI will report the device and its preferred i/o resource
list. The serial port driver itself will just use the resources
assigned to it. Depending on the boot loader and flags in the OS entry
(/fastdetect or /noserialmice), the boot loader will try to detect a
mouse attached to the port. DTR is used during this detection process,
read
http://blogs.msdn.com/doronh/archive/2006/11/13/what-is-the-serial-enume
ration-protocol.aspx for more details (I link to the spec for the
protocol as well).

On CreateFile, the driver will power on the port (it is powered off
until it is in use), this may raise DTR .

Anyways, the entire source for serial.sys is in the WDK
(src\kernel\serial). You can see for yourself what it does

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Asa Yeamans
Sent: Wednesday, January 31, 2007 9:53 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Serial Port Initialization

I have a few questions regarding the setting up and initialization of
the serial port device in windows.
Who is responsible for allocating and assigning resources to an
integrated serial port? Does the BIOS do
that and then tell the OS what to use, or does the serial port chipset
(UART i think it is) participate
in PnP arbitration to determine what resources to use. In either case
what does the windows serial port
driver do to initalize the serial port.
I am trying to track down an issue with a machine and seem to be unable
to determine why the DTR line
is activated at boot and kept active, yet deactivated when
CreateFile(COMx) is called, and as soon as
the handle is closed, its active again…

Thanks for any input
asa


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

>Who is responsible for allocating and assigning resources to an integrated

serial port?

As for all onboard devices - ACPI.

Does the BIOS do
that and then tell the OS what to use, or does the serial port chipset

BIOS provides an ACPI table for the OS, which has an entry about the serial
port. The OS then uses bytecode methods in this table to query the resource
requirements of the port and to assign resources.

Serial port driver does not participate in it, it is being told the already
assigned resources.

determine why the DTR line
is activated at boot and kept active, yet deactivated when CreateFile(COMx) is
called, and as soon as
the handle is closed, its active again…

Look at SERIAL DDK sample.


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