From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from server202.webhostingpad.com (server202mail.webhostingpad.com [50.31.162.9]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EA7DF82005 for ; Tue, 14 Feb 2017 16:00:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cmlab.biz; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe :List-Post:List-Owner:List-Archive; bh=uh/xhFQ1KyNp9QELjmVFhcwkmNUHo73BaBBC5x73ow4=; b=KsJ83qFLY1qbESSljvRhorRHLc IGReJ1rmM7IjrBzH+EDVRsgWA/JbNmFvKhZAAG8jrc2652+VRrUHN/62dIPqAaL0iO5P1I5BG86Qh aJySYv+z8Ey06W4YuqREHjwO/T5vnheRlVFEw9eQoZi3xlo/EwOi9OJJRSBQIlBDmMV4=; Received: from [71.216.152.198] (port=43164 helo=[192.168.50.197]) by server202.webhostingpad.com with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.87) (envelope-from ) id 1cdn11-000ebF-0v for edk2-devel@lists.01.org; Tue, 14 Feb 2017 18:00:11 -0600 To: edk2-devel@lists.01.org References: <485eda84-7d3c-cbcf-6dbe-bc302aa8e3c0@redhat.com> <09003614-2953-3c06-2b7d-b0fdb81fd581@cmlab.biz> <8d78b23b-8b0a-399f-0f9f-014099ed545b@cmlab.biz> From: "David A. Van Arnem" Message-ID: <2e03bfce-ef30-44cb-4da8-b90d23c6ec1b@cmlab.biz> Date: Tue, 14 Feb 2017 17:00:10 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server202.webhostingpad.com X-AntiAbuse: Original Domain - lists.01.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - cmlab.biz X-Get-Message-Sender-Via: server202.webhostingpad.com: authenticated_id: dvanarnem@cmlab.biz X-Authenticated-Sender: server202.webhostingpad.com: dvanarnem@cmlab.biz X-Source: X-Source-Args: X-Source-Dir: X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: =?UTF-8?B?UmU6IERFQlVHKCkgbWFjcm9zIGluIERYRSBkcml2ZXI6IGNhbuKAmXQgbWFrZSBpdCB3b3JrIGluIFFFTVU=?= X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 00:00:12 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/14/2017 04:46 PM, Nikolay Bodunov wrote: > Hi >=20 > I red this topic before asking the question in the maillist. Unfortunat= ely, > it's not for DXE phase. > I even tried to use it and recieved expected compiler error: >=20 > error 1001: Module type [PEIM] is not supported by library instance > [/home/nick/src/edk2/MdePkg/Library/UefiDebugLibConOut/ > UefiDebugLibConOut.inf] > consumed by [/home/nick/src/edk2/MdeModulePkg/Bus/Pci/ > SdMmcPciHcPei/SdMmcPciHcPei.inf] Hi, MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf lists DXE_DRIVER in its [Defines] section under LIBRARY_CLASS, so it is compatible with DXE_DRIVER module types (I have used it this way). However, if I'm reading your output correctly, you are trying to build a PEI module which is why you are getting the error. PEI is outside of my knowledge. Regards, David >=20 > Nikolay >=20 > 2017-02-15 2:14 GMT+03:00 David A. Van Arnem : >=20 >> >> >> On 02/14/2017 03:36 PM, Nikolay Bodunov wrote: >>> Hi >>> >>> I wrote "As a base". It's not my current code. >>> I called "DEBUG() directly, without any conditions. Of course, code o= n >>> given link won't call DEBUG() if no errors happen. >>> I understand that UEFI Appliction should work fine with usual print >>> functions, but now I want to know how to print debug message in DXE >> phase - >>> at any way. >> >> Ah, well I just dealt with this last week :-) >> >> My solution was to link DebugLib to >> MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf in the .dsc >> file (in addition to setting the PCD values like you already did). I >> imagine this will also work with OVMF, but I'm not sure because I >> haven't used it extensively. There were some other solutions >> recommended, the thread is here: >> >> https://lists.01.org/pipermail/edk2-devel/2017-February/007191.html >> >> Regards, >> David >> >>> >>> Nikolay. >>> >>> 2017-02-15 1:17 GMT+03:00 David A. Van Arnem : >>> >>>> Hi, >>>> >>>> From a quick look at your code, I'm not sure you want to make a >>>> DXE_DRIVER. The code looks more like a UEFI_APPLICATION. >>>> CrScreenshotDxe.c should normally manage a device, for UEFI_DRIVERS = it >>>> will implement the Driver Binding Protocol functions Supported(), >>>> Start(), and Stop(). >>>> >>>> Likely, the reason you aren't seeing any DEBUG() messages is because= >>>> your functions aren't being called. >>>> >>>> Regards, >>>> David >>>> >>>> On 02/14/2017 03:06 PM, Nikolay Bodunov wrote: >>>>> Thank you for the suggestions. >>>>> >>>>> I tried to use them: >>>>> >>>>>> (1) Please always terminate the debug message with a newline ("\n"= ) >>>>> Done. No changes. Of course, I usually do it, but in that case all = I >>>> needed >>>>> was to have any string on output. Sorry for bad programming style. >>>>> >>>>>> (2) Please use DEBUG_ERROR as the symbolic constant for the error = mask >>>>> Done. I think you meant in DEBUG() macros. No changes. Question abo= ut >>>>> style, too. >>>>> >>>>>> (3) DEBUG output from OVMF is by default not written to the serial= >> port >>>>> and >>>>>> add -D DEBUG_ON_SERIAL_PORT >>>>> Done. Recompiled OVMF with that option. I have now file "debug.log"= >> 74415 >>>>> bytes size that contains everything, include EFI Shell output, but >> except >>>>> my debug messages >>>>> >>>>> BTW, QEMU option "-debugcon file:debug.log -global >>>>> isa-debugcon.iobase=3D0x402", recommended in OVMF README, did nothi= ng - >>>>> "debug.log was empty. >>>>> >>>>> Based on results, I suppose that the problem is not on OVMF side. >>>>> Hope you propose something else to try. Maybe I got something in a >> wrong >>>>> way. >>>>> >>>>> Nikolay >>>>> >>>>> 2017-02-14 21:28 GMT+03:00 Kinney, Michael D < >> michael.d.kinney@intel.com >>>>> : >>>>> >>>>>> If you prefer debug messages on a serial port, you can >>>>>> add -D DEBUG_ON_SERIAL_PORT >>>>>> >>>>>> Mike >>>>>> >>>>>>> -----Original Message----- >>>>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Beha= lf >> Of >>>>>> Laszlo Ersek >>>>>>> Sent: Tuesday, February 14, 2017 10:17 AM >>>>>>> To: Nikolay Bodunov ; >>>> edk2-devel@ml01.01.org >>>>>>> Subject: Re: [edk2] DEBUG() macros in DXE driver: can=E2=80=99t m= ake it work >> in >>>>>> QEMU >>>>>>> >>>>>>> Hi Nikolay, >>>>>>> >>>>>>> On 02/14/17 18:55, Nikolay Bodunov wrote: >>>>>>>> Hello >>>>>>>> >>>>>>>> >>>>>>>> I compiled DXE Driver, in DEBUG_GCC49 mode, but I can=E2=80=99t = print any >>>> debug >>>>>>>> message. >>>>>>>> DEBUG((-1, =E2=80=9CPrint test=E2=80=9D)) does nothing. Exactl= y as >>>>>>>> DebugPrint(EFI_D_ERROR, =E2=80=9CPrint Test); >>>>>>> >>>>>>> (1) Please always terminate the debug message with a newline ("\n= ") >>>> once >>>>>>> you are done with it. (It's okay to format a single message with >>>> several >>>>>>> DEBUG calls of course, and terminate only the last DEBUG with a >>>> newline.) >>>>>>> >>>>>>> (2) Please use DEBUG_ERROR as the symbolic constant for the error= >> mask. >>>>>>> >>>>>>>> >>>>>>>> However, I see =E2=80=9CPrint Test=E2=80=9D string in my *.efi b= inary. >>>>>>>> I use QEMU + OMVF (OVMF was also recompliled in DEBUG_GCC49 mode= , to >>>> be >>>>>>>> sure). Serial port output is redirected to a file: >>>>>>>> qemu-system-x86_64 -L . --bios /=E2=80=A6/FV/OVMF.fd -hda hdd.im= g -serial >>>>>>>> file:./serial_file >>>>>>> >>>>>>> (3) DEBUG output from OVMF is by default not written to the seria= l >>>> port, >>>>>>> it is written to the QEMU debug port. Please consult OvmfPkg/READ= ME >> for >>>>>>> specifics, namely under "Capturing OVMF debug messages on qemu". >>>>>>> >>>>>>> Hope this helps, >>>>>>> Laszlo >>>>>>> >>>>>>>> >>>>>>>> All I see in output file is EFI shell output messages, include o= ne >>>>>> that my >>>>>>>> driver was succesfully loaded. But no messages from DEBUG(). >>>>>>>> >>>>>>>> >>>>>>>> My conditions: >>>>>>>> >>>>>>>> MODULE_TYPE =3D DXE_DRIVER >>>>>>>> >>>>>>>> >>>>>>>> Debug Print Library: >>>>>>>> >>>>>>>> DebugLib|MdePkg/Library/BaseDebugLibSerialPort/ >>>>>> BaseDebugLibSerialPort.inf >>>>>>>> >>>>>>>> (BaseDebugLibNull.inf is commented, of course) >>>>>>>> >>>>>>>> >>>>>>>> DebugPrintEnabled() returns TRUE >>>>>>>> >>>>>>>> >>>>>>>> I also tried to set some key options manually in MdeModulePkg.ds= c >>>>>>>> afterwards, but result didn=E2=80=99t change: >>>>>>>> >>>>>>>> >>>>>>>> [Components] >>>>>>>> >>>>>>>> >>>>>>>> MdeModulePkg/CrScreenshotDxe/CrScreenshotDxe.inf { >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> gEfiMdePkgTokenSpaceGuid.gEfiMdePkgTokenSpaceGuid. >>>>>> PcdDebugPrintErrorLevel|0x07 >>>>>>>> >>>>>>>> gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F >>>>>>>> >>>>>>>> gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000004= 2 >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> DebugLib|MdePkg/Library/BaseDebugLibSerialPort/ >>>>>> BaseDebugLibSerialPort.inf >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> GCC:*_*_*_CC_FLAGS =3D -UMDEPKG_NDEBUG >>>>>>>> >>>>>>>> } >>>>>>>> >>>>>>>> >>>>>>>> Code (I used it as a base): https://github.com/LongSoft/ >>>>>> CrScreenshotDxe >>>>>>>> >>>>>>>> Where I got wrong and what else could I try to make it work? >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> edk2-devel mailing list >>>>>>> edk2-devel@lists.01.org >>>>>>> https://lists.01.org/mailman/listinfo/edk2-devel >>>>>> >>>>> >>>>> >>>>> >>>> >>>> -- >>>> Regards, >>>> David Van Arnem >>>> Development Engineer IV >>>> Computer Measurement Laboratory, LLC >>>> >>>> >>> >>> >> >> -- >> Regards, >> David Van Arnem >> Development Engineer IV >> Computer Measurement Laboratory, LLC >> >> >=20 >=20 --=20 Regards, David Van Arnem Development Engineer IV Computer Measurement Laboratory, LLC