public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Andrew Fish <afish@apple.com>
To: wang xiaofeng <winggundum82@163.com>
Cc: edk2-devel@lists.01.org
Subject: Re: Issue of step by step debugging of OVMF SEC code in QEMU
Date: Thu, 03 Aug 2017 21:35:07 -0700	[thread overview]
Message-ID: <91BAE400-08F7-4C4E-9164-1D2FC5C813CB@apple.com> (raw)
In-Reply-To: <63e494d7.42fb.15dab550a17.Coremail.winggundum82@163.com>

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 <winggundum82@163.com> 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" <winggundum82@163.com> 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" <afish@apple.com <mailto:afish@apple.com>> 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 <winggundum82@163.com <mailto:winggundum82@163.com>> 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
> >> edk2-devel@lists.01.org <mailto:edk2-devel@lists.01.org>
> >> https://lists.01.org/mailman/listinfo/edk2-devel
> >_______________________________________________
> >edk2-devel mailing list
> >edk2-devel@lists.01.org <mailto:edk2-devel@lists.01.org>
> >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>    



  reply	other threads:[~2017-08-04  4:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03 23:11 [PATCH v3 0/1] Use BusMasterCommonBuffer to map FW_CFG_DMA_ACCESS Brijesh Singh
2017-08-03 23:11 ` [PATCH v3 1/1] OvmfPkg/QemuFwCfgLib: " Brijesh Singh
2017-08-04  2:47   ` Issue of step by step debugging of OVMF SEC code in QEMU wang xiaofeng
     [not found]     ` <14E6BF08-E850-4DBD-BA6E-EE1ED90B97AA@apple.com>
2017-08-04  3:26       ` wang xiaofeng
2017-08-04  3:41         ` wang xiaofeng
2017-08-04  4:35           ` Andrew Fish [this message]
2017-08-05  1:32   ` [PATCH v3 1/1] OvmfPkg/QemuFwCfgLib: Use BusMasterCommonBuffer to map FW_CFG_DMA_ACCESS Laszlo Ersek
2017-08-04 23:07 ` [PATCH v3 0/1] " Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91BAE400-08F7-4C4E-9164-1D2FC5C813CB@apple.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox