Code Monkey home page Code Monkey logo

windows7-drivers's Introduction

Windows 7 drivers

AppVeyor branch

Basic Windows 7 drivers.

These don't actually manage any hardware, they are just examples of code running in the kernel mode.

Development

Installation

To install a driver as a Windows service, you can use the sc utility. For example:

sc create simple type= kernel binPath= C:\workspace\personal\windows7-drivers\km\build\wdk7.1\bin\x64\release\simple.sys

You can then load/unload the driver by starting/stopping the corresponding service using the net utility.

net start simple
net stop simple

To uninstall a driver, delete the corresponding service using sc.

sc delete simple

Please note that 64-bit versions of Windows 7 (or later) disallow loading 32-bit drivers!

You may also need to explicitly enable self-signed drivers on 64-bit versions of Windows. Using the bcdedit utility, execute

bcdedit /set testsigning on

and restart your computer.

Debugging

A driver can be debugged using WinDbg. To enable kernel debugging, you can use the msconfig utility (navigate to "Boot" -> "Advanced options..." and check "Debug") or the bcdedit utility:

bcdedit /debug on
bcdedit /dbgsettings serial debugport:1 baudrate:115200

Then restart your computer for the new settings to take effect.

If a driver is loaded on a physical machine, you can connect to the COM port specified in kernel debugging settings (#1 by default) with an actual cable and enter the kernel debugging mode in WinDbg via "File" -> "Kernel Debug...". You might need to restart the debuggee machine a couple of times in order to enter the kernel debugging mode.

If a driver is loaded on a virtual machine, the conventional approach is to expose one of the guest OS's COM ports via a named pipe. You can then connect to the pipe from a WinDbg instance on the host OS (via "File" -> "Kernel Debug..."). Refer to your virtualization software's documentation for details.

Utilities

A couple of usages examples are included along with the drivers. For details, see Utilities.

License

Distributed under the MIT License. See LICENSE.txt for details.

windows7-drivers's People

Contributors

egor-tensin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.