Hello

I want to develop a serial port driver that is able to pass over all
data to a specific IP address. My questions are:

1. How to add a virtual COM ports to the Device Manager so that they
are available as normal physical ports?
2. Which technology/API to use to access IP (Winsock probably not
possible) layer from kernel mode? Are there any examples in the DDK/
Internet?
3. What is a good starting point for writing a serial port driver for
Win32 (XP)? I know the example from DDK, but it looks rather too
complex to be a simple driver.

Thanks in advance
dominolog

Re: WinXP serial port driver - Serial to IP communication by Don

Don
Wed Jul 30 07:54:17 CDT 2008

Comments inline:
"dominolog" <dominiktomczak@gmail.com> wrote in message
news:748afa1c-7aeb-4a02-bf3b-3a6654d605c3@59g2000hsb.googlegroups.com...
> Hello
>
> I want to develop a serial port driver that is able to pass over all
> data to a specific IP address. My questions are:
>
> 1. How to add a virtual COM ports to the Device Manager so that they
> are available as normal physical ports?

You can create the ports dynamically in your driver, look at the Toaster bus
sample.

> 2. Which technology/API to use to access IP (Winsock probably not
> possible) layer from kernel mode? Are there any examples in the DDK/
> Internet?

Since you are talking XP you need to use TDI.

> 3. What is a good starting point for writing a serial port driver for
> Win32 (XP)? I know the example from DDK, but it looks rather too
> complex to be a simple driver.

What you are proposing is not a simple driver. The sample in the DDK/WDK is
the actual serial port driver for the system. You are going to need to
reproduce all the calls into the driver.



--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply




Re: WinXP serial port driver - Serial to IP communication by dominolog

dominolog
Wed Jul 30 09:43:53 CDT 2008

On 30 Lip, 14:54, "Don Burn" <b...@stopspam.windrvr.com> wrote:
> Comments inline:"dominolog" <dominiktomc...@gmail.com> wrote in message
>
> news:748afa1c-7aeb-4a02-bf3b-3a6654d605c3@59g2000hsb.googlegroups.com...
>
> > Hello
>
> > I want to develop a serial port driver that is able to pass over all
> > data to a specific IP address. My questions are:
>
> > 1. How to add a virtual COM ports to the Device Manager so that they
> > are available as normal physical ports?
>
> You can create the ports dynamically in your driver, look at the Toaster =
bus
> sample.
>
> > 2. Which technology/API to use to access IP (Winsock probably not
> > possible) layer from kernel mode? Are there any examples in the DDK/
> > Internet?
>
> Since you are talking XP you need to use TDI.
>
> > 3. What is a good starting point for writing a serial port driver for
> > Win32 (XP)? I know the example from DDK, but it looks rather too
> > complex to be a simple driver.
>
> What you are proposing is not a simple driver. =A0The sample in the DDK/W=
DK is
> the actual serial port driver for the system. =A0You are going to need to
> reproduce all the calls into the driver.
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website:http://www.windrvr.com
> Blog:http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply

Hello
What do you mean by "reproduce all the calls into the driver"? Do you
mean handling all the ioctls calls?

Also, can you provide me with a good starting point for TDI start?

Thanks

Re: WinXP serial port driver - Serial to IP communication by dominolog

dominolog
Wed Jul 30 09:47:09 CDT 2008

On 30 Lip, 14:54, "Don Burn" <b...@stopspam.windrvr.com> wrote:
> Comments inline:"dominolog" <dominiktomc...@gmail.com> wrote in message
>
> news:748afa1c-7aeb-4a02-bf3b-3a6654d605c3@59g2000hsb.googlegroups.com...
>
> > Hello
>
> > I want to develop a serial port driver that is able to pass over all
> > data to a specific IP address. My questions are:
>
> > 1. How to add a virtual COM ports to the Device Manager so that they
> > are available as normal physical ports?
>
> You can create the ports dynamically in your driver, look at the Toaster =
bus
> sample.
>
> > 2. Which technology/API to use to access IP (Winsock probably not
> > possible) layer from kernel mode? Are there any examples in the DDK/
> > Internet?
>
> Since you are talking XP you need to use TDI.
>
> > 3. What is a good starting point for writing a serial port driver for
> > Win32 (XP)? I know the example from DDK, but it looks rather too
> > complex to be a simple driver.
>
> What you are proposing is not a simple driver. =A0The sample in the DDK/W=
DK is
> the actual serial port driver for the system. =A0You are going to need to
> reproduce all the calls into the driver.
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website:http://www.windrvr.com
> Blog:http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply

Also, can You advice whether do I really need a driver? I want to
emulate serial COM ports and capture all the data that is sent to it
via (WriteFile/ReadFile) into the IP packets to some destination
endpoint.

Thanks

Re: WinXP serial port driver - Serial to IP communication by Don

Don
Wed Jul 30 09:51:26 CDT 2008

Yes all the IOCTL's and read/write etc. For TDI seriously consider the
samples (they cost) from http://www.pcausa.com/. If nothing else, join that
egroup many of the TDI pro's hang out there.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply




"dominolog" <dominiktomczak@gmail.com> wrote in message
news:2edc875e-b83a-4747-af45-4c226a3d48d3@e39g2000hsf.googlegroups.com...
On 30 Lip, 14:54, "Don Burn" <b...@stopspam.windrvr.com> wrote:
> Comments inline:"dominolog" <dominiktomc...@gmail.com> wrote in message
>
> news:748afa1c-7aeb-4a02-bf3b-3a6654d605c3@59g2000hsb.googlegroups.com...
>
> > Hello
>
> > I want to develop a serial port driver that is able to pass over all
> > data to a specific IP address. My questions are:
>
> > 1. How to add a virtual COM ports to the Device Manager so that they
> > are available as normal physical ports?
>
> You can create the ports dynamically in your driver, look at the Toaster
> bus
> sample.
>
> > 2. Which technology/API to use to access IP (Winsock probably not
> > possible) layer from kernel mode? Are there any examples in the DDK/
> > Internet?
>
> Since you are talking XP you need to use TDI.
>
> > 3. What is a good starting point for writing a serial port driver for
> > Win32 (XP)? I know the example from DDK, but it looks rather too
> > complex to be a simple driver.
>
> What you are proposing is not a simple driver. The sample in the DDK/WDK
> is
> the actual serial port driver for the system. You are going to need to
> reproduce all the calls into the driver.
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website:http://www.windrvr.com
> Blog:http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply

Hello
What do you mean by "reproduce all the calls into the driver"? Do you
mean handling all the ioctls calls?

Also, can you provide me with a good starting point for TDI start?

Thanks



Re: WinXP serial port driver - Serial to IP communication by dominolog

dominolog
Wed Jul 30 10:07:18 CDT 2008

On 30 Lip, 16:51, "Don Burn" <b...@stopspam.windrvr.com> wrote:
> Yes all the IOCTL's and read/write etc. =A0For TDI seriously consider the
> samples (they cost) fromhttp://www.pcausa.com/. =A0If nothing else, join =
that
> egroup many of the TDI pro's hang out there.
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website:http://www.windrvr.com
> Blog:http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
> "dominolog" <dominiktomc...@gmail.com> wrote in message
>
> news:2edc875e-b83a-4747-af45-4c226a3d48d3@e39g2000hsf.googlegroups.com...
> On 30 Lip, 14:54, "Don Burn" <b...@stopspam.windrvr.com> wrote:
>
>
>
> > Comments inline:"dominolog" <dominiktomc...@gmail.com> wrote in message
>
> >news:748afa1c-7aeb-4a02-bf3b-3a6654d605c3@59g2000hsb.googlegroups.com...
>
> > > Hello
>
> > > I want to develop a serial port driver that is able to pass over all
> > > data to a specific IP address. My questions are:
>
> > > 1. How to add a virtual COM ports to the Device Manager so that they
> > > are available as normal physical ports?
>
> > You can create the ports dynamically in your driver, look at the Toaste=
r
> > bus
> > sample.
>
> > > 2. Which technology/API to use to access IP (Winsock probably not
> > > possible) layer from kernel mode? Are there any examples in the DDK/
> > > Internet?
>
> > Since you are talking XP you need to use TDI.
>
> > > 3. What is a good starting point for writing a serial port driver for
> > > Win32 (XP)? I know the example from DDK, but it looks rather too
> > > complex to be a simple driver.
>
> > What you are proposing is not a simple driver. The sample in the DDK/WD=
K
> > is
> > the actual serial port driver for the system. You are going to need to
> > reproduce all the calls into the driver.
>
> > --
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > Website:http://www.windrvr.com
> > Blog:http://msmvps.com/blogs/WinDrvr
> > Remove StopSpam to reply
>
> Hello
> What do you mean by "reproduce all the calls into the driver"? Do you
> mean handling all the ioctls calls?
>
> Also, can you provide me with a good starting point for TDI start?
>
> Thanks

After considering what You wrote I think I would rather try to move
most of the needed code into the user space. This means I'll write a
Serial Driver that simply implements all IOCTLs and forward them to a
user space Win32 service application that handles sockets connection
for forwarding data to remote IP endpoints. Thus I would potentially
reduce the complexity and possible errors of the kernel mode serial
driver. Thus I'll need a mechanism to communicate between user mode
and kernel mode - can You recommend me sth?

Do You consider this as a good approach?

Thanks

Re: WinXP serial port driver - Serial to IP communication by Don

Don
Wed Jul 30 10:23:21 CDT 2008

Yes, this is a doable approach. If you check the web there are multiple
drivers people sell that are serial ports that provide an API to user space
for emulation/connection.

--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply




"dominolog" <dominiktomczak@gmail.com> wrote in message
news:54a5e753-7df9-4e51-96a7-d8e5abe12e35@x41g2000hsb.googlegroups.com...
On 30 Lip, 16:51, "Don Burn" <b...@stopspam.windrvr.com> wrote:
> Yes all the IOCTL's and read/write etc. For TDI seriously consider the
> samples (they cost) fromhttp://www.pcausa.com/. If nothing else, join that
> egroup many of the TDI pro's hang out there.
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website:http://www.windrvr.com
> Blog:http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
> "dominolog" <dominiktomc...@gmail.com> wrote in message
>
> news:2edc875e-b83a-4747-af45-4c226a3d48d3@e39g2000hsf.googlegroups.com...
> On 30 Lip, 14:54, "Don Burn" <b...@stopspam.windrvr.com> wrote:
>
>
>
> > Comments inline:"dominolog" <dominiktomc...@gmail.com> wrote in message
>
> >news:748afa1c-7aeb-4a02-bf3b-3a6654d605c3@59g2000hsb.googlegroups.com...
>
> > > Hello
>
> > > I want to develop a serial port driver that is able to pass over all
> > > data to a specific IP address. My questions are:
>
> > > 1. How to add a virtual COM ports to the Device Manager so that they
> > > are available as normal physical ports?
>
> > You can create the ports dynamically in your driver, look at the Toaster
> > bus
> > sample.
>
> > > 2. Which technology/API to use to access IP (Winsock probably not
> > > possible) layer from kernel mode? Are there any examples in the DDK/
> > > Internet?
>
> > Since you are talking XP you need to use TDI.
>
> > > 3. What is a good starting point for writing a serial port driver for
> > > Win32 (XP)? I know the example from DDK, but it looks rather too
> > > complex to be a simple driver.
>
> > What you are proposing is not a simple driver. The sample in the DDK/WDK
> > is
> > the actual serial port driver for the system. You are going to need to
> > reproduce all the calls into the driver.
>
> > --
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > Website:http://www.windrvr.com
> > Blog:http://msmvps.com/blogs/WinDrvr
> > Remove StopSpam to reply
>
> Hello
> What do you mean by "reproduce all the calls into the driver"? Do you
> mean handling all the ioctls calls?
>
> Also, can you provide me with a good starting point for TDI start?
>
> Thanks

After considering what You wrote I think I would rather try to move
most of the needed code into the user space. This means I'll write a
Serial Driver that simply implements all IOCTLs and forward them to a
user space Win32 service application that handles sockets connection
for forwarding data to remote IP endpoints. Thus I would potentially
reduce the complexity and possible errors of the kernel mode serial
driver. Thus I'll need a mechanism to communicate between user mode
and kernel mode - can You recommend me sth?

Do You consider this as a good approach?

Thanks



Re: WinXP serial port driver - Serial to IP communication by dominolog

dominolog
Wed Jul 30 10:32:30 CDT 2008

On 30 Lip, 17:23, "Don Burn" <b...@stopspam.windrvr.com> wrote:
> Yes, this is a doable approach. =A0If you check the web there are multipl=
e
> drivers people sell that are serial ports that provide an API to user spa=
ce
> for emulation/connection.
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website:http://www.windrvr.com
> Blog:http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
> "dominolog" <dominiktomc...@gmail.com> wrote in message
>
> news:54a5e753-7df9-4e51-96a7-d8e5abe12e35@x41g2000hsb.googlegroups.com...
> On 30 Lip, 16:51, "Don Burn" <b...@stopspam.windrvr.com> wrote:
>
>
>
> > Yes all the IOCTL's and read/write etc. For TDI seriously consider the
> > samples (they cost) fromhttp://www.pcausa.com/. If nothing else, join t=
hat
> > egroup many of the TDI pro's hang out there.
>
> > --
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > Website:http://www.windrvr.com
> > Blog:http://msmvps.com/blogs/WinDrvr
> > Remove StopSpam to reply
>
> > "dominolog" <dominiktomc...@gmail.com> wrote in message
>
> >news:2edc875e-b83a-4747-af45-4c226a3d48d3@e39g2000hsf.googlegroups.com..=
.
> > On 30 Lip, 14:54, "Don Burn" <b...@stopspam.windrvr.com> wrote:
>
> > > Comments inline:"dominolog" <dominiktomc...@gmail.com> wrote in messa=
ge
>
> > >news:748afa1c-7aeb-4a02-bf3b-3a6654d605c3@59g2000hsb.googlegroups.com.=
..
>
> > > > Hello
>
> > > > I want to develop a serial port driver that is able to pass over al=
l
> > > > data to a specific IP address. My questions are:
>
> > > > 1. How to add a virtual COM ports to the Device Manager so that the=
y
> > > > are available as normal physical ports?
>
> > > You can create the ports dynamically in your driver, look at the Toas=
ter
> > > bus
> > > sample.
>
> > > > 2. Which technology/API to use to access IP (Winsock probably not
> > > > possible) layer from kernel mode? Are there any examples in the DDK=
/
> > > > Internet?
>
> > > Since you are talking XP you need to use TDI.
>
> > > > 3. What is a good starting point for writing a serial port driver f=
or
> > > > Win32 (XP)? I know the example from DDK, but it looks rather too
> > > > complex to be a simple driver.
>
> > > What you are proposing is not a simple driver. The sample in the DDK/=
WDK
> > > is
> > > the actual serial port driver for the system. You are going to need t=
o
> > > reproduce all the calls into the driver.
>
> > > --
> > > Don Burn (MVP, Windows DDK)
> > > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > > Website:http://www.windrvr.com
> > > Blog:http://msmvps.com/blogs/WinDrvr
> > > Remove StopSpam to reply
>
> > Hello
> > What do you mean by "reproduce all the calls into the driver"? Do you
> > mean handling all the ioctls calls?
>
> > Also, can you provide me with a good starting point for TDI start?
>
> > Thanks
>
> After considering what You wrote I think I would rather try to move
> most of the needed code into the user space. This means I'll write a
> Serial Driver that simply implements all IOCTLs and forward them to a
> user space Win32 service application that handles sockets connection
> for forwarding data to remote IP endpoints. Thus I would potentially
> reduce the complexity and possible errors of the kernel mode serial
> driver. Thus I'll need a mechanism to communicate between user mode
> and kernel mode - can You recommend me sth?
>
> Do You consider this as a good approach?
>
> Thanks

Thanks.

Can U simply point to some API functions? Or what duo you mean by
"there are multiple
drivers people sell that are serial ports that provide an API to user
space
for emulation/connection. "

Thanks

Re: WinXP serial port driver - Serial to IP communication by Maxim

Maxim
Wed Jul 30 10:39:22 CDT 2008

>driver. Thus I'll need a mechanism to communicate between user mode
>and kernel mode - can You recommend me sth?

The usual inverted calls - the user mode calls DeviceIoControl, and the request
is pended in the driver till it will be filled with data and completed.

>Do You consider this as a good approach?

Yes.

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


Re: WinXP serial port driver - Serial to IP communication by Don

Don
Wed Jul 30 10:43:25 CDT 2008

There are companies that will sell you the emulation driver, depending on
your needs this could be a good approach.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply



"dominolog" <dominiktomczak@gmail.com> wrote in message
news:2f6eeca5-da64-4a6b-92fc-09406ee2c9b2@d45g2000hsc.googlegroups.com...

Can U simply point to some API functions? Or what duo you mean by
"there are multiple
drivers people sell that are serial ports that provide an API to user
space
for emulation/connection. "

Thanks