网上的 [Windows.内核研究光盘]Windows.Academic.Program.by.zEalXP.iso 貌似是<<Windows 内核原理与实现>>的配套光盘.
虚拟机直接装的WinServer2003SP1
\WindowsResearchKernel-WRK\WRK-v1.2 拷贝到WinServer2003虚拟机
写了2个批处理来编译WRK
rem @file bld-wrk-entry.cmd
set path=C:\WRK-v1-2\tools\x86;%path%
path
call bld-wrk-process.cmd
pauserem @file bld-wrk-process.cmd
cd C:\WRK-v1-2\base\ntos\
nmake -nologo x86=运行 bld-wrk-entry.cmd, 提示缺少 "MSVCP71.dll"
在虚拟机目录 \WRK-v1-2\查找 *.dll,
WinServer2003编译出来的内核是X86的, 看到 \WRK-v1-2\tools\x86\ 下有cl.exe和一堆dll.
在开发机找一个靠谱点的MSVCP71.dll, 放在 \WRK-v1-2\tools\x86\
我在 开发机的 C:\Windows\System32 找到一个MSVCP71.dll
重新运行 bld-wrk-entry.cmd, 编译通过.
在wrk目录里查找wrkx86.exe
环境变量 SystemRoot=C:\WINDOWS
将wrkx86.exe 拷贝到 c:\windows\system32\ 中
在 C:\WINDOWS\repair\setup.log 中查找hal.dll
找到
\WINDOWS\system32\hal.dll = "halaacpi.dll","2a7f6"
在Wrk目录中查找hal*.dll
将 C:\WRK-v1-2\WS03SP1HALS\x86\halmacpi\halmacpi.dll 拷贝到 c:\windows\system32中
编辑c:\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="Windows Server 2003, Standard" /noexecute=optout /fastdetect
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="wrk" /kernel=wrkx86.exe hal=halmacpi.dll
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="wrk debug" /kernel=wrkx86.exe hal=halmacpi.dll /debug /debugport=com1 /baudrate=115200
停止虚拟机.
开发机上的WinDbg远程调试配置:
D:\WinDDK\7600.16385.1\Debuggers\windbg.exe -b -k com:pipe,port=\\.\pipe\com_1,resets=0删除虚拟打印机, 因为她占用COM1
增加虚拟串口 COM1
启动虚拟机, 选择启动项 "wrk debug", 随后启动WinDbg远程调试, 连接虚拟机 com_1.
WinDbg连上虚拟机了.
在WinDbg中查看虚拟机OS信息, 可以看到连接的是WRK1.2编译出的内核.
kd> version
Windows Server 2003 Kernel Version 3800 (Service Pack 1) MP (1 procs) Free x86 compatible
Built by: 3800.WRKP1.2(daveprobert)
Machine Name:
Kernel base = 0x80800000 PsLoadedModuleList = 0x808a0398
System Uptime: not available
Remote KD: KdSrv:Server=@{<Local>},Trans=@{COM:Port=\\.\pipe\com_1,Baud=19200,Pipe,Timeout=4000}
Microsoft (R) Windows Debugger Version 6.12.0002.633 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.
跑的有点慢, 好像WinDbg在下载东西. 流量不大.
也许是在下载符号, 大概1~3分钟的样子, 进到了Windows桌面.
环境搭完了, 停住WinDbg, 看看模块的加载
kd> lm
start end module name
7c930000 7ca00000 ntdll (pdb symbols) d:\windbgsyssymbolswin7x86\ntdll.pdb\DCE823FCF71A4BF5AA489994520EA18F2\ntdll.pdb
80800000 80a42000 nt (export symbols) wrkx86.exe
80a42000 80a6e000 hal (pdb symbols) d:\windbgsyssymbolswin7x86\halmacpi.pdb\3FC80D1EB1B8427FB9E1ABA54E14CA411\halmacpi.pdb
看到我们替换的2个模块 wrkx86.exe 和 halmacpi 都已经加载.
956




被折叠的 条评论
为什么被折叠?



