Skip to content

Building Driver

Herrick Spencer edited this page Mar 16, 2016 · 5 revisions

Building the driver in Visual Studio

  1. Install Visual Studio 2015
  2. Install Windows 10 WDK from https://msdn.microsoft.com/en-us/windows/hardware/hh852365.aspx
  3. Install Windows 10 SDK from https://dev.windows.com/en-US/downloads/windows-10-sdk
  4. Launch Visual Studio 2015 and open solution at graphics-driver-samples\render-only-sample\ros.sln
  5. Select Debug or Release
  6. Select X64, X32 or ARM targets
  7. Build solution

Building on the command line

The project can be built either in Visual Studio or on the command line. To build on the command line,

  1. Launch Developer Command Prompt for VS2015 from the Start Menu
  2. Change directories to the render-only-sample folder
  3. Invoke msbuild

To build all projects in the solution, run

msbuild ros.sln /p:Configuration=Debug /p:Platform=ARM

This will build the entire solution in the Debug|ARM configuration. To build a single project, pass the project name to the /t parameter. For example, to build only the roskmd project,

msbuild ros.sln /t:roskmd /p:Configuration=Debug /p:Platform=ARM

You can run the command from anywhere in the source tree as long as you pass the path of ros.sln to msbuild. If you were in the roskmd directory, you could run

msbuild ..\ros.sln /t:roskmd /p:Configuration=Debug /p:Platform=ARM

To do a clean, build the 'clean' target:

msbuild ros.sln /t:clean /p:Configuration=Debug /p:Platform=ARM

Updating the driver during development

After installing the driver following the instructions at Building Render Only Sample for Raspberry Pi 2, you will need to update roskmd.sys and rosumd.dll whenever you make a code change.

In Windbg, set up a kdfiles association for roskmd.sys:

.kdfiles -m \Systemroot\System32\drivers\roskmd.sys <local path to roskmd.sys>

For example,

.kdfiles -m \Systemroot\System32\drivers\roskmd.sys d:\workspace\graphics-driver-samples\render-only-sample\ARM\Debug\roskmd.sys

Whenever the system tries to load roskmd.sys, it will pull the file from your development machine.

rosumd.dll must be updated manually using sfpcopy. To update rosumd.dll, first copy rosumd.dll from your development machine to c:\data on your Pi using SMB, then SSH into your Pi and sfpcopy the new file over the old one:

cd \data
sfpcopy rosumd.dll c:\windows\system32\rosumd.dll

In summary, use the following procedure during development:

  1. Create a .kdfiles association for roskmd.sys when you initially install the driver. This association will persist for the lifetime of your windbg process.
  2. Make code changes and rebuild the driver
  3. Sfpcopy the new version of rosumd.dll
  4. Reboot