It is generally hard to debug across x86 processor mode transitions, and to 
debug 16-bit real mode code with modern tools. There are a few places in the 
x86 that still require 16-bit real mode for handoffs (like the reset vector) so 
you tend to hit this issue more in debugging firmware.

Thanks,

Andrew Fish


> On Aug 3, 2017, at 8:41 PM, wang xiaofeng <[email protected]> wrote:
> 
> Hi  Andrew,
>     THe problem is solved, after the SEC code switch to protected mode, gdb 
> can work well now
> 
> 
> 
> 
> 
> 
> At 2017-08-04 11:26:16, "wang xiaofeng" <[email protected]> wrote:
> HI Andrew,
>      How can I adjust the debugger to correct mode? Or I have to enable the 
> debug after swtich to protected mode?
> 
> 
> 
> 
> 
> 
> At 2017-08-04 10:57:16, "Andrew Fish" <[email protected] 
> <mailto:[email protected]>> wrote:
> >The reset vector is 16-bit real mode, so you have the debugger in the wrong 
> >mode. The code should transition to 32 bit protected early in the flow.
> >
> >Sent from my iPhone
> >
> >> On Aug 3, 2017, at 7:47 PM, wang xiaofeng <[email protected] 
> >> <mailto:[email protected]>> wrote:
> >> 
> >> Hello,
> >>       I am tring to add my own SEC code base on OVMF and run on QEMU. 
> >> Since the code cannot run I need to step to step trace the assembly code .
> >>      The hang point is very early before I can use either UDK or debug 
> >> serial output. I tried to use gdb to connect to QEMU.I start gdb in 
> >> another terminal, and issue the following commands:
> >>  (gdb) set architecture i386:x86-64:intel
> >>  (gdb) target remote localhost:1234
> >>   It really stops at the bios first instruction at 0XFFFFFFF0. But gdb 
> >> shows eip= 0xFFF0 and CS=0xF000(why it not be 0xfff0). After I trigger the 
> >> command "display /i $pc"
> >>   It shows the assembly code in 0xFFF0 instead of    0XFFFFFFF0, so the 
> >> information is incorrect.
> >>   Anyone knows how to corrently debug the SEC code ? Other debug tool is 
> >> also ok.
> >>   Thanks in advance!
> >> 
> >> 
> >> 
> >> _______________________________________________
> >> edk2-devel mailing list
> >> [email protected] <mailto:[email protected]>
> >> https://lists.01.org/mailman/listinfo/edk2-devel
> >_______________________________________________
> >edk2-devel mailing list
> >[email protected] <mailto:[email protected]>
> >https://lists.01.org/mailman/listinfo/edk2-devel
> 
> 
>  
> 
> 
> 【网易自营|30天无忧退货】不到同款1折价!Tory Burch制造商美式休闲人字拖限时仅29.9元>> 
> <http://you.163.com/item/detail?id=1185012&from=web_gg_mail_jiaobiao_9>    

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to