DDK&WDM學習 – HelloDDK 手動編譯步驟以及相關設定

來源:互聯網
上載者:User

1, 安裝WDK,啟動編譯環境,Checked用於調試相當於VC中的Debug,Free用於發布和正式使用相當於VC中的Release。

 

注*配置命令列視窗的寬度 - 1,註冊表 “HKEY_CURRENT_USER/Console/ScreenBufferSize” 或者2,CMD視窗 “屬性->布局->螢幕緩衝區大小”

*查看環境變數 - 命令列輸入“SET”, 沒有參數 

 

2,  設定檔說明 makefile, Sources 和 dirs

makefile:

# makefile<br />#<br /># DO NOT EDIT THIS FILE!!! Edit ./sources. If you want to add a new source<br /># file to this component. This file merely indirects to the real make file<br /># that is shared by all the driver components of the Windows NT DDK<br />#<br />!INCLUDE $(NTMAKEENV)/makefile.def 

注 * NTMAKEENV 可以在環境變數中找到, eg: NTMAKEENV=C:/WinDDK/7600.16385.1/bin

 

Sources:

TARGETNAME=HelloDDK<br />TARGETTYPE=DRIVER<br />TARGETPATH=OBJ<br />INCLUDES=$(BASEDIR)/inc;/<br /> $(BASEDIR)/inc/ddk;/<br />SOURCES=Driver.cpp/ 

注 *TARGETTYPE=DRIVER 表示編譯驅動程式, TARGETTYPE=PROGRAM 表示編譯Win32程式

SOURCES 中只需要包含.c/.cpp檔案,不要包含標頭檔

 

dirs:

D:/WinDDK/7600.16385.1/src>type dirs<br />DIRS= /<br /> 1394 /<br /> audio /<br /> AVStream /<br /> biometrics /<br /> bth /<br /> filesys /<br /> general /<br /> hid /<br /> input /<br /> ir /<br /> mmedia /<br /> network /<br /> print /<br /> sd /<br /> SensorsAndLocation /<br /> serial /<br /> setup /<br /> sideshow /<br /> smartcrd /<br /> storage /<br /> swtuner /<br /> test /<br /> usb /<br /> video /<br /> videocap /<br /> wia /<br /> wmi /<br /> wpd 

注 *此檔案表示需要依次編譯的目錄

 

3, 使用 build.exe 編譯代碼

 

4, Virtual PC

Settings

COM1 - Named Pipe - //./pipe/com_1

 

Windows XP SP3, boot.ini

 

[boot loader]

timeout=30

default=multi(0)disk(0)rdisk(0)partition(1)/WINDOWS

[operating systems]

multi(0)disk(0)rdisk(0)partition(1)/WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect

multi(0)disk(0)rdisk(0)partition(1)/WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /debug /debugport=com1 /baudrate=115200

 

 

注 * 紅色字型表示的串口編號要一致

 

5, WinDBG

捷徑 - target

eg:C:/WinDDK/7600.16385.1/Debuggers/windbg.exe -y C:/localSymbols;srv*C:/localSymbols*http://msdl.microsoft.com/download/symbols -k com:pipe,port=//./pipe/com_1 -Q

 

注 * 藍色字型表示的具名管道名稱要一致

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.