Re: [edk2] Qestion about how to debug OVMF with UDT on QEMU

2017-08-09 Thread wang xiaofeng
HI Michael,
   I have tried your suggestion. ttermpro.exe shows connection refused in my 
Win7 after command "start "Monitor" /B %TERA_TERM_PATH% localhost:20717 /nossh"
  the tool also cannot work lonely.
   Any other software or configuration should I apply?
  Thanks!








At 2017-08-10 03:37:01, "Laszlo Ersek"  wrote:
>On 08/09/17 20:21, Kinney, Michael D wrote:
>> Laszlo,
>> 
>> I works really well for me using QEMU on Windows.
>> 
>> * Build OVMF setting -D SOURCE_DEBUG_ENABLE and -D DEBUG_ON_SERIAL_PORT.
>> 
>> * Configure The UDK Debugger SoftDebugger.ini file to use TCP port 20716
>> 
>>   [Debug Port]
>>   Channel = TCP
>>   Server = localhost
>>   Port = 20716
>> 
>> * Configure QEMU so the monitor and serial port 
>>   are redirected to a tcp ports 20717 and 20716.
>> 
>>   -monitor tcp:localhost:20717,server
>>   -serial  tcp:localhost:20716,server
>> 
>> I use a batch file to launch the UDK debugger and
>> and terminal emulators immediately before running
>> QEMU because the tcp server in QEMU will
>> timeout of a connect does not happen quickly.
>> 
>>   start "Monitor" /B "c:\Program Files (x86)\teraterm\ttermpro.exe" 
>> localhost:20717 /nossh
>>   start "Debugger" /B "C:\Program Files (x86)\Intel\Intel(R) UEFI 
>> Development Kit Debugger Tool\eXdi.exe" /LaunchWinDbg
>>   start "Console" /B "c:\Program Files (x86)\teraterm\ttermpro.exe" 
>> localhost:20715 /nossh
>> 
>>   start "QEMU" /B "%QEMU_PATH%\qemu-system-i386w.exe" ^
>>   -machine q35,smm=on,accel=tcg -cpu Nehalem ^
>>   -global ICH9-LPC.disable_s3=1 ^
>>   -drive 
>> if=pflash,format=raw,unit=0,file=%EDKII_BUILD_OUTPUT%\FV\OVMF_CODE.fd,readonly=on
>>  ^
>>   -drive 
>> if=pflash,format=raw,unit=1,file=%EDKII_BUILD_OUTPUT%\FV\OVMF_VARS.fd ^
>>   -monitor tcp:localhost:20717,server ^
>>   -serial  tcp:localhost:20716,server
>> 
>> Since the serial connections are redirected to tcp ports
>> on the localhost, this actually provide an excellent
>> UDK Debugger experience.
>
>Thanks for the writeup. :) Maybe we should put this in the wiki
>(although I'm completely aware of how I would react if this was
>suggested to me in response to an email of mine :) )
>
>And, perhaps I should give this another try sometime :)
>
>Thank you!
>Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Qestion about how to debug OVMF with UDT on QEMU

2017-08-09 Thread Laszlo Ersek
On 08/09/17 20:21, Kinney, Michael D wrote:
> Laszlo,
> 
> I works really well for me using QEMU on Windows.
> 
> * Build OVMF setting -D SOURCE_DEBUG_ENABLE and -D DEBUG_ON_SERIAL_PORT.
> 
> * Configure The UDK Debugger SoftDebugger.ini file to use TCP port 20716
> 
>   [Debug Port]
>   Channel = TCP
>   Server = localhost
>   Port = 20716
> 
> * Configure QEMU so the monitor and serial port 
>   are redirected to a tcp ports 20717 and 20716.
> 
>   -monitor tcp:localhost:20717,server
>   -serial  tcp:localhost:20716,server
> 
> I use a batch file to launch the UDK debugger and
> and terminal emulators immediately before running
> QEMU because the tcp server in QEMU will
> timeout of a connect does not happen quickly.
> 
>   start "Monitor" /B "c:\Program Files (x86)\teraterm\ttermpro.exe" 
> localhost:20717 /nossh
>   start "Debugger" /B "C:\Program Files (x86)\Intel\Intel(R) UEFI Development 
> Kit Debugger Tool\eXdi.exe" /LaunchWinDbg
>   start "Console" /B "c:\Program Files (x86)\teraterm\ttermpro.exe" 
> localhost:20715 /nossh
> 
>   start "QEMU" /B "%QEMU_PATH%\qemu-system-i386w.exe" ^
>   -machine q35,smm=on,accel=tcg -cpu Nehalem ^
>   -global ICH9-LPC.disable_s3=1 ^
>   -drive 
> if=pflash,format=raw,unit=0,file=%EDKII_BUILD_OUTPUT%\FV\OVMF_CODE.fd,readonly=on
>  ^
>   -drive 
> if=pflash,format=raw,unit=1,file=%EDKII_BUILD_OUTPUT%\FV\OVMF_VARS.fd ^
>   -monitor tcp:localhost:20717,server ^
>   -serial  tcp:localhost:20716,server
> 
> Since the serial connections are redirected to tcp ports
> on the localhost, this actually provide an excellent
> UDK Debugger experience.

Thanks for the writeup. :) Maybe we should put this in the wiki
(although I'm completely aware of how I would react if this was
suggested to me in response to an email of mine :) )

And, perhaps I should give this another try sometime :)

Thank you!
Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Qestion about how to debug OVMF with UDT on QEMU

2017-08-09 Thread Kinney, Michael D
Laszlo,

I works really well for me using QEMU on Windows.

* Build OVMF setting -D SOURCE_DEBUG_ENABLE and -D DEBUG_ON_SERIAL_PORT.

* Configure The UDK Debugger SoftDebugger.ini file to use TCP port 20716

  [Debug Port]
  Channel = TCP
  Server = localhost
  Port = 20716

* Configure QEMU so the monitor and serial port 
  are redirected to a tcp ports 20717 and 20716.

  -monitor tcp:localhost:20717,server
  -serial  tcp:localhost:20716,server

I use a batch file to launch the UDK debugger and
and terminal emulators immediately before running
QEMU because the tcp server in QEMU will
timeout of a connect does not happen quickly.

  start "Monitor" /B "c:\Program Files (x86)\teraterm\ttermpro.exe" 
localhost:20717 /nossh
  start "Debugger" /B "C:\Program Files (x86)\Intel\Intel(R) UEFI Development 
Kit Debugger Tool\eXdi.exe" /LaunchWinDbg
  start "Console" /B "c:\Program Files (x86)\teraterm\ttermpro.exe" 
localhost:20715 /nossh

  start "QEMU" /B "%QEMU_PATH%\qemu-system-i386w.exe" ^
  -machine q35,smm=on,accel=tcg -cpu Nehalem ^
  -global ICH9-LPC.disable_s3=1 ^
  -drive 
if=pflash,format=raw,unit=0,file=%EDKII_BUILD_OUTPUT%\FV\OVMF_CODE.fd,readonly=on
 ^
  -drive if=pflash,format=raw,unit=1,file=%EDKII_BUILD_OUTPUT%\FV\OVMF_VARS.fd ^
  -monitor tcp:localhost:20717,server ^
  -serial  tcp:localhost:20716,server

Since the serial connections are redirected to tcp ports
on the localhost, this actually provide an excellent
UDK Debugger experience.

Best regards,

Mike

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Wednesday, August 9, 2017 4:03 AM
> To: wang xiaofeng ; Kinney, Michael D
> 
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Qestion about how to debug OVMF with UDT on
> QEMU
> 
> On 08/09/17 09:34, wang xiaofeng wrote:
> > Hello All,
> >I try to debug OVMF with UDT on QEMU in windows.
> >I build OVMF on windows 7 with VS2013 . And also runs it in
> QEMUWin32.
> >I add   DEFINE SOURCE_DEBUG_ENABLE = TRUE in ovmf.dsc
> and build a new bios. From makefile it seems this feature is
> enabled  for OVMF SecMain
> >
> >
> >
> $(BIN_DIR)\SourceLevelDebugPkg\Library\PeCoffExtraActionLibDebug
> \PeCoffExtraActionLibDebug\OUTPUT\PeCoffExtraActionLib.lib \
> >
> $(BIN_DIR)\SourceLevelDebugPkg\Library\DebugAgent\SecPeiDebugAge
> ntLib\OUTPUT\SecPeiDebugAgentLib.lib \
> >
> >
> > But how can I link it to the local Windows UDT(which I
> have tested works for  real hardware bios by serail port )?
> > Another question is why OVMF fdf don;t include
> DebugAgentPei.inf?
> > Or I have to enable at least 1 or 2 VM for this task?
> > Thanks in advance!
> 
> In the past I've tried to set up the UDK debugger between two
> virtual
> machines, using a UNIX domain socket to connect their serial
> ports. It
> didn't work, the debugger protocol kept falling apart. I
> suspected that
> the emulated serial ports didn't follow the timings of physical
> serial
> ports closely enough.
> 
> So, I never use SOURCE_DEBUG_ENABLE, but I think others on the
> list may
> have gotten it to work? Mike perhaps?
> 
> Thanks
> Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Qestion about how to debug OVMF with UDT on QEMU

2017-08-09 Thread Laszlo Ersek
On 08/09/17 09:34, wang xiaofeng wrote:
> Hello All,
>I try to debug OVMF with UDT on QEMU in windows.
>I build OVMF on windows 7 with VS2013 . And also runs it in QEMUWin32.
>I add   DEFINE SOURCE_DEBUG_ENABLE = TRUE in ovmf.dsc and build a new 
> bios. From makefile it seems this feature is enabled  for OVMF SecMain
> 
> 
> 
> $(BIN_DIR)\SourceLevelDebugPkg\Library\PeCoffExtraActionLibDebug\PeCoffExtraActionLibDebug\OUTPUT\PeCoffExtraActionLib.lib
>  \
> 
> $(BIN_DIR)\SourceLevelDebugPkg\Library\DebugAgent\SecPeiDebugAgentLib\OUTPUT\SecPeiDebugAgentLib.lib
>  \
> 
> 
> But how can I link it to the local Windows UDT(which I have tested works 
> for  real hardware bios by serail port )?
> Another question is why OVMF fdf don;t include DebugAgentPei.inf?
> Or I have to enable at least 1 or 2 VM for this task?
> Thanks in advance!

In the past I've tried to set up the UDK debugger between two virtual
machines, using a UNIX domain socket to connect their serial ports. It
didn't work, the debugger protocol kept falling apart. I suspected that
the emulated serial ports didn't follow the timings of physical serial
ports closely enough.

So, I never use SOURCE_DEBUG_ENABLE, but I think others on the list may
have gotten it to work? Mike perhaps?

Thanks
Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel