janneyabc 发表于 2015-4-29 13:08:19

Windows Server 2008 R2 如何启动kernel dbg进行双机内核调试『续bcdedit 用法详解』

Bcdedit 用法详解
  昨天写了一篇文章< Windows Server 2008 R2 如何启动kernel dbg进行双机内核调试『配置详解』>其中提及到Bcdedit,但是并没有对其进行详细的解释,作为续篇,本文对其用法发进行讨论。
  Bcdedit用于对vista及其以后版本的windows进行启动配置,当然内核调试的启动也是基于这个工具的。好吧,言归正传,开始对配置进行讨论。
  首先如果想对启动项进行配置必须得先加入一个boot entry, adding Boot Entry 过程如下,
  
  我们可以选择从当前的启动项拷贝一份,然后做些必要的改动,具体命令如下:
  bcdedit /copy {current} /d "DebugEntry"
  
  执行成功会返回类似如下的输出:
  The entry was successfully copied to {49916baf-0e08-11db-9af4-000bdbd316a0}.
  
  当然你也可以选择自己从头开始新建一个Boot Entry,
  bcdedit /create /d "My Windows Server2008R2" /application osloader
  
  但是请记住:如果是自己手动创建的,系统是不会自动加入Boot Entry的,必须执行如下的命令将其加入Boot Entry,具体加入的位置可以选择,比如 /addlast
  bcdedit /displayorder {49916baf-0e08-11db-9af4-000bdbd316a0}/addlast
  
  如下是windbg里面对此问题的详细说明:
  When you use the /create option, the new boot loader entries are not added to the boot menu automatically. You must add the new boot entry to the boot menu by using the /displayorder option. You can place the boot loader entries in any order.
  
  加入Boot Entry之后就可以对其进行KD配置了,本文以串行口进行说明,
  
  首先设置调试方式为串行口:
  bcdedit /set {49916baf-0e08-11db-9af4-000bdbd316a0} debugtype serial
  设置串行口1为调试端口:
  bcdedit /set {49916baf-0e08-11db-9af4-000bdbd316a0} debugport 1
  设置波特率为:115200
  bcdedit /set {49916baf-0e08-11db-9af4-000bdbd316a0} baudrate 115200
  开启KD:
  bcdedit /debug {49916baf-0e08-11db-9af4-000bdbd316a0} on
  
  重启系统,并在调试机器上启KD,您应该可以顺利的链接到目标机器了。
  
  总结
  本文和上篇文章< Windows Server 2008 R2 如何启动kernel dbg进行双机内核调试『配置详解』 >完整的记录了如何启动双机内核调试,包括bcdedit命令,希望对大家有所帮助。
  
  
  
页: [1]
查看完整版本: Windows Server 2008 R2 如何启动kernel dbg进行双机内核调试『续bcdedit 用法详解』