CharlesGardiner-0848 avatar image
0 Votes"
CharlesGardiner-0848 asked CharlesGardiner-0848 answered

How to build a driver for a custom serial port in an FPGA connected to PCIe

What is Microsoft's recommended way to develop a custom driver for a 16550 compatible UART in an FPGA connected to the PCIe bus?

The device is 100% compatible to 16550 and has been verified on Linux and with Passmark BurnIn Test so it seems most appropriate to just use the serial.sys that comes with windows 10 anyway. The device does support both MSI and legacy INT but legacy is of course the default.

However, I have not yet managed to build this in a KMDF VisualStudio project. The build complains about not finding a *.sys file which is correct since I don't build one. I really just want to run inf2cat on the inf file and build and (EV) sign the package.

I have done this for another project before EV-signing was a requirement by just doing everything manually i.e. running inf2cat from a script and signing the output

EV-signing is the next part of the problem. Even if I can get through a VisualStudio build sequence somehow, makecab expects an inf, sys and pdb, doesn't it? So how can this be solved?

The main reason I would like to do this through a VisualStudio project is so that I can give my customer a project that he just loads and runs.

I'm surprised I couldn't find any solution on the web, there must be hundreds of similar FPGAs out there or is everybody running on Linux?

Thanks in advance for any advice

The first part of my inf file looks like this, which worked fine when I do everything by hand and with non-EV signing.

signature="$Windows NT$"

DefaultDestDir = 11;

; Drivers
%Author%=Author, NT$ARCH$

%SRL_DeviceDesc% = ComPort, "PCI\VEN_xxxx&DEV_a901&SUBSYS_a901xxxx"

. . . . . . . . .

; Service installation
; Port Driver (function driver for this device)
AddService = Serial, 0x00000002, Serial_Service_Inst, Serial_EventLog_Inst
AddService = Serenum,,Serenum_Service_Inst

. . . . . . . . .
DisplayName = %Serial.SVCDESC%
StartType = 1 ; SERVICE_SYSTEM_START (this driver may do detection)
ServiceBinary = %12%\serial.sys
LoadOrderGroup = Extended base

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

CharlesGardiner-0848 avatar image
0 Votes"
CharlesGardiner-0848 answered

To partially answer my own question, I've just taken a long shot and tried to create a cab for uploading to the HW partner center dashboard for EV signing....

It seems it is possible to create a cab file containing just the *.inf file. The partner center web tool has just returned the inf and signed cab file. I must now set up a machine a see whether this actually works (i.e. whether the driver loads on the FPGA device) .....

Still, I would be interested in hearing what is the recommended/preferred approach from Microsoft's point of view.

  • Can you / should you set this up in a VisualStudio project or just run inf2cat from a script? If so how should the build be configured to not expect a *.sys file?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.