From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-in4.apple.com (mail-out4.apple.com [17.151.62.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 51BD282119 for ; Wed, 8 Feb 2017 16:43:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1486601012; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-reply-to:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=TJUJNHqSl3QS1mZEEYqFo8i3RzO+1VoNkDjuMoLNDwE=; b=kDtTNStu8qlR4AahaL0i7qp6430GdB4cOcH39k07/rTLnjmsjNm3KyODqY0NLlDg ol02lhkAcAtgVX6AEZOAJzevlhC0b10Y5VRi/ESRakTyoB/V8TMU2K1exUsMrRXm mPVd/MegFaPFOIV7MgNLbc1Up8/JYvVOvO802sbp0hszrAm10diPzlVyeKHkrBji qhO2CVhSE4xo7J/BIKW4O0GlsDFflGk8kb3iT8WlZaczXd4LbCWA0Xp6ZAutEJbX 6nZ4TkDI9qb0fx4xZjcMei3qJ0uhtP9vD6l8EhHll29xEYlqST0kSwomo7iZALUE bfb76dPoaEO+hRxo0ZbLXg==; Received: from relay6.apple.com (relay6.apple.com [17.128.113.90]) by mail-in4.apple.com (Apple Secure Mail Relay) with SMTP id FA.1E.10104.33BBB985; Wed, 8 Feb 2017 16:43:32 -0800 (PST) X-AuditID: 11973e12-ad23a9a000002778-35-589bbb332a6a Received: from nwk-mmpp-sz11.apple.com (nwk-mmpp-sz11.apple.com [17.128.115.155]) by relay6.apple.com (Apple SCV relay) with SMTP id 90.77.00867.33BBB985; Wed, 8 Feb 2017 16:43:31 -0800 (PST) MIME-version: 1.0 Received: from [17.114.152.165] (unknown [17.114.152.165]) by nwk-mmpp-sz11.apple.com (Oracle Communications Messaging Server 8.0.1.2.0 64bit (built Dec 14 2016)) with ESMTPSA id <0OL300A9Y0OJNLB0@nwk-mmpp-sz11.apple.com>; Wed, 08 Feb 2017 16:43:31 -0800 (PST) Sender: afish@apple.com From: Andrew Fish Message-id: Date: Wed, 08 Feb 2017 16:43:31 -0800 In-reply-to: <4a3de604-5e60-7ed2-e520-29ab6b551c33@cmlab.biz> Cc: "edk2-devel@ml01.01.org" To: "David A. Van Arnem" References: <4a3de604-5e60-7ed2-e520-29ab6b551c33@cmlab.biz> X-Mailer: Apple Mail (2.3226) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrALMWRmVeSWpSXmKPExsUi2FAYpWuye3aEwYfFTBaL1khZrNvzjd2B yePE1wCPSRceMwcwRXHZpKTmZJalFunbJXBlHD+6gqmgzabi9MP5jA2MLcZdjJwcEgImEi+f T2fpYuTiEBLYyyhxdPcidpjEoUu7mCEShxglpmzeDZbgFRCU+DH5HguIzSwQJtHffo0RoqiH SWJd0y9GkISwgLjEuzObmEFsNgFliRXzP0A120i0fd/MDlGjKbH2wF0mEJtFQFXi0ssPQPUc HJwCthIvt/hAzDeVOP15D9hIEQE9iSVL3oKNFAIaM/XyITaQcgkBWYnZv7xATpAQOMEmceDN fpYJjEKzkJw6C8mpELaWxPdHrUBxDiBbXuLgeVmIsKbEs3uf2CFsbYkn7y6wLmBkW8UolJuY maObmWeil1hQkJOql5yfu4kRFAXT7YR2MJ5aZXWIUYCDUYmHt8JydoQQa2JZcWXuIUZpDhYl cV4hk5kRQgLpiSWp2ampBalF8UWlOanFhxiZODilGhit1+ZmCPGk3K7amr3gxadptw4GTFgq /Wbtpd7Oeo3GAxXXVm50VYz6+budY4k1W/erlx+uTFd+lxTEMmvxpo4ML718+T3RFV6yjKfC uG+EMF0MYAjSn7F35+OHAVbH5I9bVz8MeLDi8Tz/T5XBjaJey/+ciOD08/39suo4m6yD7Xuf 5et/W01XYinOSDTUYi4qTgQA5Z0L6mMCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGIsWRmVeSWpSXmKPExsUi2FA8W9d49+wIg2unLSwWrZGyWLfnG7sD k8eJrwEeky48Zg5giuKySUnNySxLLdK3S+DKOH50BVNBm03F6YfzGRsYW4y7GDk5JARMJA5d 2sUMYYtJXLi3nq2LkYtDSOAQo8SUzbvZQRK8AoISPybfYwGxmQXCJPrbrzFCFPUwSaxr+sUI khAWEJd4d2YT2CQ2AWWJFfM/QDXbSLR938wOUaMpsfbAXSYQm0VAVeLSyw9A9RwcnAK2Ei+3 +EDMN5U4/XkP2EgRAT2JJUvego0UAhoz9fIhNpByCQFZidm/vCYwCsxCct0sJNdB2FoS3x+1 AsU5gGx5iYPnZSHCmhLP7n1ih7C1JZ68u8C6gJFtFaNAUWpOYqWZXmJBQU6qXnJ+7iZGcDAX Ru1gbFhudYhRgINRiYf3gvXsCCHWxLLiylxgEHEwK4nwlm4CCvGmJFZWpRblxxeV5qQWH2Kc yAj04kRmKdHkfGCs5ZXEG5qYGJgYG5sZG5ubmNNSWEmc13P/jAghgfTEktTs1NSC1CKYo5g4 OKUaGCu0WI5K1KxJb3Lcsswq4Bz7RUfBw5fXhz58WjNhaduuQv4zfoGJPTpFG5eqP/hbv75Y an6w2Ln+2IXBrxMPRPkHl29s8ym+IzF9p3HIG4kP//siEmR5dyytt/lca61a5t09uyu+880P j0wpYTYuz+5lZw5b/tR3t8yc3Kv55ezKIGuZ48tmK7EUZyQaajEXFScCAN+539rZAgAA X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: Print from DXE_DRIVER 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: Thu, 09 Feb 2017 00:43:32 -0000 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT > On Feb 8, 2017, at 2:10 PM, David A. Van Arnem wrote: > > Hello, > > I am working on a DXE_DRIVER for a custom device. I like to use Print() > statements to trace code execution during development. Prints are not allowed in drivers as they are likely to break the UI. > Thus I have put > a print statement in each of my Supported(), Don't do that Supported gets called a lot. Well it is OK if you conditionally print. > Start(), and Stop() > functions for the driver binding protocol. Currently I am building the > driver as part of the UefiCpuPkg, with no changes to the current > UefiCpuPkg.dsc except for adding my driver under [Components]. I have > also added the PrintLib and UefiLib to the [LibraryClasses] section in > my driver's INF file, and included the necessary headers. > > When I load the driver from the shell (load .efi), I get a > message indicating it loaded successfully, but no output from the > Print() messages. You should be able to use shell commands to see if you driver is connected. > The documentation for the shell says load should test > both the Supported() and Start() functions, so I would expect to see the > output, but I am not sure I am using the correct library instances to > accomplish this. Is it possible to use Print() from a DXE_DRIVER, and > which library instance should I use in the UefiCpuPkg.dsc file? Print() is part of the UefiLib. The PrintLib vends sprintf kinds of things. > If not, > would changing it to a UEFI_DRIVER help? Any other recommendations? > If you are publishing driver binding protocol you should be UEFI_DRIVER, if possible. > If there is an example in edk2 that does this that you could point me > to, that would be sufficient as well. Thanks! > If you want to write directly to the UEFI Console you can try this. Place it in the entry point of your driver in case you have some bug that is preventing your from registering the Driver Binding Protocol. gST->ConOut->OutputString (gST->ConOut, L"Hello World\n\r"); Make sure you use L"" vs "" as Print takes a CHAR16 and %s also default to CHAR16 (not ASCII) Thanks, Andrew Fish > -- > Regards, > David Van Arnem > Development Engineer IV > Computer Measurement Laboratory, LLC > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel