#freeze
#contents
*はじめに [#kc7ae411]
いきなりですが、デバイスドライバを作ってみましょう~
と言っても、表題の通り、ここでは開発ツールのインストールと、サンプルプログラムのコンパイル方法のみ紹介します。~
~
今後、USBゲストツールを(できれば^^;)紹介していきたいと思っているので、その下準備です。
*DDKのダウンロード [#l4330ba7]
こちらのサイトからダウンロードします。~
''Windows Server 2003 SP1 DDK''~
http://www.microsoft.com/japan/whdc/DevTools/ddk/default.mspx
~
~
*インストール [#s5c5d386]
ISOイメージなので、仮想CDドライブソフトを用いて、マウントします。~
ここでは詳細は割愛します。~
~
参考
-http://www.atmarkit.co.jp/fwin2k/win2ktips/536vcdrom/vcdrom.html
-http://msdn.microsoft.com/subscriptions/faq/
~
~
~
今回は、'''D:\usr\WinDDK\''' にインストールしたものとします。
*試しに一つコンパイルを [#jbfe93bc]
**まずは環境変数の設定 [#v7802c39]
コマンドプロンプトを開いて、以下のディレクトリに移動します。
D:\usr\WinDDK\3790.1830\bin\x86\
コマンドラインから、以下のコマンドを実行します。
> setenv.bat D:\usr\WinDDK\3790.1830\
これで環境変数の設定は完了です。
**サンプルのコンパイル [#w6aca86b]
以下のディレクトリに移動
D:\usr\WinDDK\3790.1830\src\wdm\usb\usbview
~
コンパイル
> D:\usr\WinDDK\3790.1830\bin\x86\nmake.exe makefile
~
コンパイル済みファイルは、以下のフォルダに作成されます。
D:\usr\WinDDK\3790.1830\src\wdm\usb\usbview_\objfre_wnet_x86\i386\
~
''usbview''の実行
> cd D:\usr\WinDDK\3790.1830\src\wdm\usb\usbview_\objfre_wnet_x86\i386\
> usbview.exe
現在接続されているUSB機器の一覧が表示されます。
*Appendix [#nbffaf28]
-nmakeコマンドのヘルプを表示
D:\usr\WinDDK\3790.1830\src>D:\usr\WinDDK\3790.1830\bin\x86\nmake.exe /?
Microsoft (R) Program Maintenance Utility Version 7.00.8882
Copyright (C) Microsoft Corp 1988-2000. All rights reserved.
Usage: NMAKE @commandfile
NMAKE [options] [/f makefile] [/x stderrfile] [macrodefs] [targets]
Options:
/A Build all evaluated targets
/B Build if time stamps are equal
/C Suppress output messages
/D Display build information
/E Override env-var macros
/HELP Display brief usage message
/I Ignore exit codes from commands
/K Build unrelated targets on error
/N Display commands but do not execute
/NOLOGO Suppress copyright message
/P Display NMAKE information
/Q Check time stamps but do not build
/R Ignore predefined rules/macros
/S Suppress executed-commands display
/T Change time stamps but do not build
/U Dump inline files
/Y Disable batch-mode
/? Display brief usage message
-"setenv.bat"のオプション
D:\usr\WinDDK\3790.1830\bin>setenv
Usage: "setenv <directory> [fre|chk] [64|AMD64] [hal] [WXP|WNET|W2K] [no_prefast] [bscmake]"
By default, setenv.bat will set the environment variable NO_BROWSER_FILE.
Using the "bscmake" option will cause setenv.bat to not define this variable.
Example: setenv d:\ddk chk set checked environment
Example: setenv d:\ddk set free environment for Windows Server 2003 (default)
Example: setenv d:\ddk fre WNET Same
Example: setenv d:\ddk fre 64 sets IA64 bit free environment
Example: setenv d:\ddk fre AMD64 sets AMD64 bit free environment
Example: setenv d:\ddk fre WXP sets free build environment for Windows XP
Example: setenv d:\ddk hal sets free hal environment
Example: setenv d:\ddk fre hal Same
**参考 [#hd368954]
http://www.neko.ne.jp/~freewing/software/usb_ddk/
RIGHT:2006-10-08 (日) 01:35:07
----
[[Prog]]