适用对象:东大计算机学院大四正在做操作系统课程设计的同学们 (其他同学请低空掠过)
操作系统课程设计 Kernel编译及WinDbg运行批处理文件,Help you work better!
在下载文件之前,请仔细阅读以下使用说明
用途:1.Kernel的编译命令行集成;2.WinDbg启动的命令行集成 (不用每次都敲这么多命令行啦~~)
在运行之前:1.请将虚拟机装好,端口配置OK;2.WinDbg装好;3.WRK源码部署完成
源代码:
![ContractedBlock.gif](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
::
Author:步碎酒散花醉
:: Time: 2010.9.1
:: Mail: Kingpro@live.cn
:: Website: http://kingpro.cnblogs.com
:: Copyright: Free Copy
:: 此批处理文件主要用于本次操作系统实验中宿主机的wrk编译及windbg启动
:: 由于这两项操作较为复杂 故做成批处理文件以供简单调用
:: 修改下面的基本参数 以适合您的环境
@echo off
:: 参数修改开始
:: WRK的根目录 根据实际目录修改
set wrk = D: \ ftp \ binary \ os \ wrk
:: 操作系统架构 根据你的系统的架构更改 [x86|amd64]
set arch = x86
:: 环境变量 一般不用修改
set path = %wrk% \ tools \ %arch% ; % path %
:: WinDebug的根目录 根据实际目录修改
set wdbg = C: \ WinDDK \ 7600.16385 . 1 \ Debuggers
:: WinDebug启动参数 一般不用修改
set windbgargs = -k com :pipe , port =\\.\ pipe \ debug , resets = 0 , reconnect
:: 系统环境参数 一般不用修改
set _NT_SYMBOL_PATH = %wrk% \ base \ ntos \ build \ exe ; %wrk% \ WS03SP1HALS \ x86 \ halacpim
:: 参数修改结束
color F1
echo Author: 步碎酒散花醉 ( kingpro@live . cn )
echo Free Copy \( ^^o^^ )/ 2010.9 . 1
echo -------------------------------------------------------------------------------
echo Base Parameters:
echo Source Code and Tools Path : %wrk%
echo System Architector: %arch%
echo WinDebug Path : %wdbg%
echo WinDebug Args: %windbgargs%
echo -------------------------------------------------------------------------------
echo If all the parameters above are correct
echo Press Y to continue
echo Else Press N to close and edit this bat file
:Check
set / p cho = [Y , N]
if %cho% equ N goto End
if %cho% equ n goto End
if %cho% equ Y goto Choices
if %cho% equ y goto Choices
echo Error Choice
goto Check
:Choices
echo -------------------------------------------------------------------------------
set / p cho = Build Kernel , Press B ; Run WinDbg , Press R ; Exit , Press E [B , R , E]?
if %cho% equ E goto End
if %cho% equ e goto End
if %cho% equ R goto WinDbg
if %cho% equ r goto WinDbg
if %cho% equ B goto BuildKernel
if %cho% equ b goto BuildKernel
echo Error Choice
goto Choices
:BuildKernel
cd %wrk% \ base \ ntos
echo Building Kernel ...
nmake -nologo %arch% =
echo Build Complete
goto Choices
:WinDbg
%wdbg% \ windbg . exe %windbgargs%
goto Choices
:End
:: Time: 2010.9.1
:: Mail: Kingpro@live.cn
:: Website: http://kingpro.cnblogs.com
:: Copyright: Free Copy
:: 此批处理文件主要用于本次操作系统实验中宿主机的wrk编译及windbg启动
:: 由于这两项操作较为复杂 故做成批处理文件以供简单调用
:: 修改下面的基本参数 以适合您的环境
@echo off
:: 参数修改开始
:: WRK的根目录 根据实际目录修改
set wrk = D: \ ftp \ binary \ os \ wrk
:: 操作系统架构 根据你的系统的架构更改 [x86|amd64]
set arch = x86
:: 环境变量 一般不用修改
set path = %wrk% \ tools \ %arch% ; % path %
:: WinDebug的根目录 根据实际目录修改
set wdbg = C: \ WinDDK \ 7600.16385 . 1 \ Debuggers
:: WinDebug启动参数 一般不用修改
set windbgargs = -k com :pipe , port =\\.\ pipe \ debug , resets = 0 , reconnect
:: 系统环境参数 一般不用修改
set _NT_SYMBOL_PATH = %wrk% \ base \ ntos \ build \ exe ; %wrk% \ WS03SP1HALS \ x86 \ halacpim
:: 参数修改结束
color F1
echo Author: 步碎酒散花醉 ( kingpro@live . cn )
echo Free Copy \( ^^o^^ )/ 2010.9 . 1
echo -------------------------------------------------------------------------------
echo Base Parameters:
echo Source Code and Tools Path : %wrk%
echo System Architector: %arch%
echo WinDebug Path : %wdbg%
echo WinDebug Args: %windbgargs%
echo -------------------------------------------------------------------------------
echo If all the parameters above are correct
echo Press Y to continue
echo Else Press N to close and edit this bat file
:Check
set / p cho = [Y , N]
if %cho% equ N goto End
if %cho% equ n goto End
if %cho% equ Y goto Choices
if %cho% equ y goto Choices
echo Error Choice
goto Check
:Choices
echo -------------------------------------------------------------------------------
set / p cho = Build Kernel , Press B ; Run WinDbg , Press R ; Exit , Press E [B , R , E]?
if %cho% equ E goto End
if %cho% equ e goto End
if %cho% equ R goto WinDbg
if %cho% equ r goto WinDbg
if %cho% equ B goto BuildKernel
if %cho% equ b goto BuildKernel
echo Error Choice
goto Choices
:BuildKernel
cd %wrk% \ base \ ntos
echo Building Kernel ...
nmake -nologo %arch% =
echo Build Complete
goto Choices
:WinDbg
%wdbg% \ windbg . exe %windbgargs%
goto Choices
:End
下载到批处理文件之后,右键编辑bat,修改前几行的变量设置,可能需要设置的变量有:
1.wrk 源码根目录
2.arch 系统架构,一般选择x86,除非你是AMD64位系统
3.wdbg WinDbg的安装目录
修改完成后保存。双击运行,有问题请自行尝试解决或者联系我。