Steward
分享是一種喜悅、更是一種幸福
驅動程式 - Windows Driver Model (WDM) - 使用範例 - C/C++ (DDK) - 開發環境
參考資訊:
https://github.com/steward-fu/wadk
https://github.com/Kron4ek/Wine-Builds/releases/tag/8.21
https://github.com/steward-fu/website/releases/download/wdm
司徒目前使用Debian做為開發測試環境,Compiler使用clang,Linker則是使用lld-link,測試的作業系統目前使用Windows XP,模擬器使用QEMU(qemu-system-i386),QEMU有支援Snapshot功能,因此只要做好Snapshot的環境,就可以相當方便測試WDM驅動程式
安裝clang、lld-link、wine、box86
$ sudo apt-get install \
gcc-arm* \
clang \
llvm \
lld \
wine \
wine32-tools \
wine-development \
libwine \
fonts-wine -y
$ cd
$ git clone https://github.com/ptitSeb/box86
$ mkdir box86/build
$ cd box86/build
$ cmake ..
$ make
$ sudo make install
P.S. 如果是在ARM64上面編譯,使用cmake .. -DRPI4ARM64=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
使用司徒預先做好的Windows XP、Wine環境
$ cd
$ wget https://github.com/steward-fu/website/releases/download/wdm/winxp.gz
$ wget https://github.com/steward-fu/website/releases/download/wdm/winxp.qcow2
$ wget https://github.com/steward-fu/website/releases/download/wdm/myqemu
$ wget https://github.com/steward-fu/website/releases/download/wdm/wine_env.tar.gz
$ wget https://github.com/Kron4ek/Wine-Builds/releases/download/8.21/wine-8.21-x86.tar.xz
$ wget https://github.com/Kron4ek/Wine-Builds/releases/download/8.21/wine-8.21-amd64.tar.xz
$ tar xvf wine-8.21-x86.tar.xz
$ tar xvf wine-8.21-amd64.tar.xz
$ mv wine-8.21-x86 ~/Wine86
$ mv wine-8.21-amd64 ~/Wine64
$ sudo mkdir /opt/qemu
$ sudo mv winxp.qcow2 winxp.gz /opt/qemu
$ sudo mv myqemu /usr/local/bin
$ sudo chmod a+x /usr/local/bin/myqemu
$ sudo vim /usr/local/bin/myx86
#!/bin/bash
WINEPREFIX=~/.wine_x86 box86 ~/Wine86/bin/wine "$@"
$ sudo chmod a+x /usr/local/bin/myx86
$ tar xvf wine_env.tar.gz
$ myx86 --version
wine-8.21
準備需要的編譯環境
$ cd $ git clone https://github.com/steward-fu/wadk $ sudo mv wadk /opt
假如在Windows WSL環境測試,記得設定wslconfig
C:/> vim ~/.wslconfig
[wsl2]
guiApplications=true
nestedVirtualization=true