geekhack

geekhack Projects => Making Stuff Together! => DIY Discussions ARCHIVE => Topic started by: sethstorm on Wed, 09 December 2009, 08:51:57

Title: The Windows DDK, Keyboard driver build instructions.
Post by: sethstorm on Wed, 09 December 2009, 08:51:57
Based on discussions in Kishy's Terminal Keyboard conversion (http://geekhack.org/showwiki.php?title=Island:7306) article, here are some instructions on dealing with the DDK (should you wish to modify and build your own i8042prt driver.)


Patches and Drivers:

Files (32-bit, x86):
x86 i8042prt.sys and diffs (http://geekhack.org/attachment.php?attachmentid=11287&d=1276934243)

Files (64bit, x64/AMD64):
x64 i8042prt.sys (http://geekhack.org/attachment.php?attachmentid=13117&d=1287805020)

x64 diffs (http://geekhack.org/attachment.php?attachmentid=13118&d=1287807440)


DDK Files:

Direct link(no login):
http://download.microsoft.com/download/9/0/f/90f019ac-8243-48d3-91cf-81fc4093ecfd/1830_usa_ddk.iso (http://download.microsoft.com/download/9/0/f/90f019ac-8243-48d3-91cf-81fc4093ecfd/1830_usa_ddk.iso)

Indirect link:
You may need to do is have a Windows Live ID(no charge) and be willing to add the Microsoft Connect service(no charge) to it.  Once you have that, you should be able to grab the SDK you need, which is named "1830_usa_ddk.iso".  

https://connect.microsoft.com/site148/Downloads/DownloadDetails.aspx?DownloadID=21028 (https://connect.microsoft.com/site148/Downloads/DownloadDetails.aspx?DownloadID=21028)



Should you wish to build your own:

While I have to say that this is at your own risk, it isn't too hard if you are careful in your work.

First of all: backup your i8042prt.sys in C:\windows\system32\drivers.  

Second of all, have a USB keyboard handy should things go wrong.

Notes for x64 users:

Additional patches are available.  Sleep/Wake keyboard button support has been removed so that it can build.  It is not necessary for 32-bit only users.  





Install/Build/Result:
Following the download, mount the iso image.  Further instructions on doing so are out of the scope of this document.



Install:
Select Custom install, go to samples -> input -> items relating to 8042 input sample and add those.  If you want to add the USB one, go right ahead - but the relevant sample is the 8042 one.
Install to the default directory it gives you: (e.g. C:\WINDDK\3790.1830)


Modification:
The files you need will be here if you installed with the default path.
Code: [Select]
C:\WINDDK\3790.1830\src\input\pnpi8042

Build:
Open a command prompt, go to C:\WINDDK\3790.1830\bin\

Use Build x86 for 32-bit.
Use Build AMD64/x64 for 64-bit.



Build x86:
Code: [Select]
setenv.bat C:\WINDDK\3790.1830 fre hal


Build AMD64/x64:
Code: [Select]
setenv.bat C:\WINDDK\3790.1830 fre AMD64

From there, change directory to ..\src\input\pnpi8042
run build.exe with no options (or if you wish, add options)



Result:
If build went through w/o error, it will be at:
Code: [Select]
C:\WINDDK\3790.1830\src\input\pnpi8042\daytona\objfre_wnet_x86\i8042prt.sys
(ignore any spaces inserted, that's the forum software)



Some helpful hints:
Should you be working from .diff's, this may be helpful.  This is not a complete guide to the format of the file, but it is enough to get the reader going.

Patching
I recommend hand-patching the files based on the diffs.  Here's a quick way to determine how to do this if you wish to go this route.  

If you're uncomfortable with that, a proper patching tool should not be hard to find.



At the start of a new source code file.  (For the purpose of my patches, these are separated out into individual files)
Code: [Select]
--- pnpi8042.orig/kbddep.c 2005-03-24 14:24:00.000000000 -0500
+++ pnpi8042.dev/kbddep.c 2009-12-08 11:25:52.000000000 -0500



Lines that state where to begin editing in a specific source code file.  The relevant number is the start number.  In this example, it would be 427
Code: [Select]
@@ -427,6 +427,7 @@


Lines that start with minus are lines to delete, followed by lines that start with + which are lines to add.  Replace the items to delete with the items to add at the line where the deleted code started.  
Code: [Select]

-    }
+    // [JCE] Resetting a terminal keyboard makes it send two ID bytes



Lines that only require adding code at the specified line in the source code.
Code: [Select]

+    // [JCE] Set all keys to give make/break codes. It seems that on a terminal
Title: The Windows DDK, Keyboard driver build instructions.
Post by: kishy on Sat, 19 December 2009, 12:34:48
I consistently get this: "The content that you requested cannot be found or you do not have permission to view it.

If you believe you have reached this page in error, click the Help link at the top of the page to report the issue and include this ID in your e-mail: dcf1379c-c4ca-431a-982e-0be8e6568097 "

I have a Live account and am registered with Connect, so perhaps it is restricted by your location?
Title: The Windows DDK, Keyboard driver build instructions.
Post by: keyb_gr on Sun, 20 December 2009, 12:12:07
FWIW, after signing up for a Live account and then Connect, I was able to obtain the DDK a few weeks ago.
Title: The Windows DDK, Keyboard driver build instructions.
Post by: kishy on Sun, 20 December 2009, 15:28:01
Quote from: keyb_gr;143930
FWIW, after signing up for a Live account and then Connect, I was able to obtain the DDK a few weeks ago.

I'll make another account from scratch and do it all over. Maybe there were issues relating to how I used my pre-existing Live account, who knows.

And this time I'll enter more convincing fake info during registration.

Edit: alright, got it to go. Note I had to work my way through the site to get to it. The URL provided in the article is correct but even when registered properly and logged in, it does not work...you need to get to that page from within the Connect site (apparently they check referrers).
Title: Attaching some diff's
Post by: sethstorm on Sat, 19 June 2010, 02:58:06
Some diffs for the Windows 2003 DDK.Attachment here (http://geekhack.org/attachment.php?attachmentid=11287&stc=1&d=1276934241).
Title: The Windows DDK, Keyboard driver build instructions.
Post by: Soarer on Sat, 14 August 2010, 08:38:51
Found a direct no hassle download from M$ themselves... :)

http://download.microsoft.com/.../1830_usa_ddk.iso (http://download.microsoft.com/download/9/0/f/90f019ac-8243-48d3-91cf-81fc4093ecfd/1830_usa_ddk.iso)
Title: x64 Diffs
Post by: sethstorm on Fri, 22 October 2010, 23:22:17
Thanks go to acfrazier for being able to test a working x64 setup.  The wiki item has been changed to reflect the new x64 related changes.

Notes:
Use this patch set after the others.
No need to use if x86(32-bit).  

Changes:
Removes the Sleep/Wake keyboard "system buttons" from the keyboard driver.  Should not affect non-keyboard input.
Title: The Windows DDK, Keyboard driver build instructions.
Post by: super-6-1 on Sat, 03 March 2012, 12:38:41
anyone have the x64 sys file? i really need it for my comp... it use to work and now its not valid