WinXP serial port driver - Serial to IP communication

Discussion in 'Windows Vista Drivers' started by dominolog, Jul 30, 2008.

  1. dominolog

    dominolog Guest

    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
     
    dominolog, Jul 30, 2008
    #1
    1. Advertisements

  2. dominolog

    Don Burn Guest

    Comments inline:
    You can create the ports dynamically in your driver, look at the Toaster bus
    sample.
    Since you are talking XP you need to use TDI.
    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
     
    Don Burn, Jul 30, 2008
    #2
    1. Advertisements

  3. dominolog

    dominolog Guest

    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
     
    dominolog, Jul 30, 2008
    #3
  4. dominolog

    dominolog Guest

    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
     
    dominolog, Jul 30, 2008
    #4
  5. dominolog

    Don Burn Guest

    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




    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
     
    Don Burn, Jul 30, 2008
    #5
  6. dominolog

    dominolog Guest

    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
     
    dominolog, Jul 30, 2008
    #6
  7. dominolog

    Don Burn Guest

    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




    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
     
    Don Burn, Jul 30, 2008
    #7
  8. dominolog

    dominolog Guest

    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
     
    dominolog, Jul 30, 2008
    #8
  9. driver. Thus I'll need a mechanism to communicate between user mode
    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.
    Yes.
     
    Maxim S. Shatskih, Jul 30, 2008
    #9
  10. dominolog

    Don Burn Guest

    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




    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
     
    Don Burn, Jul 30, 2008
    #10
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.