류짱:Beyond MySelf

Windows Server 2008 디버거 설정 방법 본문

Microsoft/Windows Platform

Windows Server 2008 디버거 설정 방법

リュちゃん 2010. 7. 6. 20:05

 Windows Server 2008 에서 로컬 커널 디버깅을 시도 하면 아래와 같은 오류 메시지와 함께 디버깅 프로그램이 실행 되지 않습니다.

 

 

Windows server 2008에서 로컬 커널 디버깅은 기본적으로 Disable 되어있습니다. 그렇기 때문에 아래와 같이 bcdedit 을 이용해서 booting configuration을 변경 하여야 합니다.

명령 프롬프트를 관리자 권한으로 실행 후 아래의 명령어로  현 상태의 booting configuration을 복사 후 생성 합니다.


bcdedit /copy {current} /d "Windows Server 2008 Debug Mode"

명령어를 입력 후 생성 된 새로운 ID를 이용해  debug 옵션을 on 합니다.

bcdedit /debug {new id} on


 

 

 

위 성공 메시지 확인 후 bcdedit 명령어를 입력 한 후 debug 옵션이 on 으로 변경 된 것을 확인 할 수 있습니다.

 

bcdedit의 명령어 사용법

bcdedit /copy {current} /d "Instrumented build"
 * Creates a new copy of the current boot entry that will be modified below.
 * This command will return a new id that you will use in the commands below.
bcdedit /set {new id} kernel ntkrnlmx.exe
 * This is optional and needs to be set only if you want to run a different kernel for debugging(instrumentation, etc.).
bcdedit /displayorder {new id} {current}
 * This is optional. It sets the new entry to be first in the boot list.
 * If you want to leave the original entry as the first in the list, don't use this command.
bcdedit /default {new id}
 * This is optional. It sets the new entry to be the default selection in the boot list.
bcdedit /bootdebug {new id} ON
 * Set up boot debugging for the new id. This should be set.
bcdedit /debug {new id} ON
 * Set up normal kernel debugging. This should be set.
bcdedit /dbgsettings SERIAL DEBUGPORT:1 BAUDRATE:115200
* Modify this if needed for the debugging type you are using.

추가 명령어 사용법은 명령 프롬프트에서 bcdedit /? 입력 후 확인 하시기 바랍니다^^


설정 완료 후 시스템을 재 시작 후 아래와 같이 Windows Server 2008 Debug Mode를 선택 한 후 부팅을 합니다.


 
Debug Mode로 부팅 후 관리자 권한으로 Windows debugging tool을 실행 합니다.


WinDbg가 실행 되면 아래와 같이 !vm 명령어를 이용해서 커널 리소를 확인 할 수 있습니다.

감사합니다.^^