Navigation Menu

Skip to content

Commit

Permalink
Merge Windows Driver Code (#817)
Browse files Browse the repository at this point in the history
This is the first of the Windows implementation code that will be merged. This is only the driver code.

Also note the updates to the appveyor configuration. It now builds, installs and queries the status of driver directly on the build machine. Then it builds an 'artifact' which is essentially the binaries packaged up.
  • Loading branch information
nibanks authored and jwhui committed Oct 25, 2016
1 parent b6adaaf commit f600840
Show file tree
Hide file tree
Showing 47 changed files with 13,041 additions and 228 deletions.
54 changes: 48 additions & 6 deletions .appveyor.yml
@@ -1,3 +1,31 @@
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#

version: 0.1.{build}
image: Visual Studio 2015
configuration:
Expand All @@ -7,13 +35,27 @@ platform:
- x64
- x86
clone_depth: 10
install:
- cmd: Bcdedit.exe -set TESTSIGNING ON
# Configure logging
- cmd: reg import .appveyor\ThreadEtw.reg
- ps: Restart-Computer -Force
- ps: Start-Sleep -s 10
build:
project: etc/visual-studio/openthread.sln
verbosity: minimal
after_build:
- ps: $env:Platform2 = $env:Platform
- ps: If ($env:Platform2 -eq "x86") { $env:Platform2 = "Win32" }
# Set up the release directories
- cmd: .appveyor\make_release.cmd
# Install driver (only runs on x64)
- cmd: .appveyor\install_driver.cmd
test_script:
- cmd: >-
set Platform2=%Platform%
if %Platform2%==x86 set Platform2=Win32
vstest.console /logger:Appveyor /inIsolation /platform:%Platform% build\bin\%Platform2%\%Configuration%\dll\UnitTests.dll
# Run the unit tests
- cmd: vstest.console /logger:Appveyor /inIsolation /platform:%Platform% build\bin\%Platform2%\%Configuration%\dll\UnitTests.dll
# Run the tests for the driver (only runs on x64)
- cmd: .appveyor\test_driver.cmd
artifacts:
- path: release
name: release
Binary file added .appveyor/ThreadEtw.reg
Binary file not shown.
43 changes: 43 additions & 0 deletions .appveyor/install_driver.cmd
@@ -0,0 +1,43 @@
REM
REM Copyright (c) 2016, The OpenThread Authors.
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM 1. Redistributions of source code must retain the above copyright
REM notice, this list of conditions and the following disclaimer.
REM 2. Redistributions in binary form must reproduce the above copyright
REM notice, this list of conditions and the following disclaimer in the
REM documentation and/or other materials provided with the distribution.
REM 3. Neither the name of the copyright holder nor the
REM names of its contributors may be used to endorse or promote products
REM derived from this software without specific prior written permission.
REM
REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
REM AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
REM ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
REM LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
REM CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
REM SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
REM INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
REM CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
REM ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
REM POSSIBILITY OF SUCH DAMAGE.
REM

IF NOT "%Platform%"=="x64" GOTO :EOF

pushd %APPVEYOR_BUILD_FOLDER%\build\bin\%Platform2%\%Configuration%\sys

REM Install the certifications to the cert stores
certutil -addstore root otLwf.cer
certutil -addstore TrustedPublisher otLwf.cer

cd otLwf

REM Install the NDSI LWF driver, otLwf.sys

netcfg.exe -v -l otlwf.inf -c s -i otLwf

popd
55 changes: 55 additions & 0 deletions .appveyor/make_release.cmd
@@ -0,0 +1,55 @@
REM
REM Copyright (c) 2016, The OpenThread Authors.
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM 1. Redistributions of source code must retain the above copyright
REM notice, this list of conditions and the following disclaimer.
REM 2. Redistributions in binary form must reproduce the above copyright
REM notice, this list of conditions and the following disclaimer in the
REM documentation and/or other materials provided with the distribution.
REM 3. Neither the name of the copyright holder nor the
REM names of its contributors may be used to endorse or promote products
REM derived from this software without specific prior written permission.
REM
REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
REM AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
REM ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
REM LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
REM CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
REM SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
REM INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
REM CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
REM ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
REM POSSIBILITY OF SUCH DAMAGE.
REM

pushd %APPVEYOR_BUILD_FOLDER%

REM Make the release directory
mkdir release
mkdir release\symbols
mkdir release\symbols\TraceFormat
mkdir release\logs

REM Copy the relavant binaries

copy build\bin\%Platform2%\%Configuration%\sys\otlwf\* release
copy build\bin\%Platform2%\%Configuration%\sys\otlwf.cer release
copy build\bin\%Platform2%\%Configuration%\sys\otlwf.pdb release\symbols
copy build\bin\%Platform2%\%Configuration%\dll\otApi.dll release
copy build\bin\%Platform2%\%Configuration%\dll\otApi.pdb release\symbols
copy build\bin\%Platform2%\%Configuration%\dll\otNodeApi.dll release
copy build\bin\%Platform2%\%Configuration%\dll\otNodeApi.pdb release\symbols
copy build\bin\%Platform2%\%Configuration%\exe\otCli.exe release
copy build\bin\%Platform2%\%Configuration%\exe\otCli.pdb release\symbols
copy build\bin\%Platform2%\%Configuration%\exe\otTestRunner.exe release
copy build\bin\%Platform2%\%Configuration%\exe\otTestRunner.pdb release\symbols

REM Generate the trace format files to decode the WPP logs

"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\x64\TracePdb.exe" -f release\symbols\*.pdb -p release\symbols\TraceFormat

popd
42 changes: 42 additions & 0 deletions .appveyor/test_driver.cmd
@@ -0,0 +1,42 @@
REM
REM Copyright (c) 2016, The OpenThread Authors.
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM 1. Redistributions of source code must retain the above copyright
REM notice, this list of conditions and the following disclaimer.
REM 2. Redistributions in binary form must reproduce the above copyright
REM notice, this list of conditions and the following disclaimer in the
REM documentation and/or other materials provided with the distribution.
REM 3. Neither the name of the copyright holder nor the
REM names of its contributors may be used to endorse or promote products
REM derived from this software without specific prior written permission.
REM
REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
REM AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
REM ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
REM LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
REM CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
REM SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
REM INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
REM CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
REM ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
REM POSSIBILITY OF SUCH DAMAGE.
REM

IF NOT "%Platform%"=="x64" GOTO :EOF

pushd %APPVEYOR_BUILD_FOLDER%\release

REM Query the driver state

sc query otlwf

REM Grab the logs

logman stop Thread -ets
copy %SystemRoot%\System32\LogFiles\WMI\Thread.* logs

popd
3 changes: 2 additions & 1 deletion .gitattributes
Expand Up @@ -41,4 +41,5 @@ Makefile eol=lf
*.vcxproj eol=crlf
*.vcxproj.filters eol=crlf
*.sln eol=crlf

*.rc text eol=crlf
*.inf text eol=crlf
1 change: 1 addition & 0 deletions Makefile.am
Expand Up @@ -54,6 +54,7 @@ EXTRA_DIST = \
.astyle/astyle-wrap.sh \
.default-version \
bootstrap \
etc \
README.md \
NOTICE \
CONTRIBUTING.md \
Expand Down
6 changes: 6 additions & 0 deletions etc/visual-studio/libopenthread.vcxproj.filters
Expand Up @@ -228,6 +228,9 @@
<ClCompile Include="..\..\src\core\thread\announce_begin_server.cpp">
<Filter>Source Files\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\crc16.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\core\openthreadcontext.h">
Expand Down Expand Up @@ -428,5 +431,8 @@
<ClInclude Include="..\..\src\core\meshcop\announce_begin_server.hpp">
<Filter>Header Files\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\crc16.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
</ItemGroup>
</Project>

0 comments on commit f600840

Please sign in to comment.