From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 4C1AC9414D6 for ; Wed, 24 Jan 2024 15:31:18 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=GBDdwLURYOa6RC+CnULRsFfVGuPVIfu11QpP/+H5ZvM=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1706110277; v=1; b=eJxLuQA88hmFqDGkg+askf9AnQ9XsK/mnmalDtqGc+Kg6qg48zuRVI78nHYAq2tVjU6Yp/YP tKLa9AYaN7q5u4xjUSbgW0IVnCFbdRH9NUMzl4289hvUi04Ei1sLjAvIeGdw3DVdnkiCVvBZkc/ NuPJUk63zo+UjTwnk86vllz4= X-Received: by 127.0.0.2 with SMTP id QyfSYY7687511xlaPd0z6Q5z; Wed, 24 Jan 2024 07:31:17 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.25554.1706110276436032591 for ; Wed, 24 Jan 2024 07:31:16 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-662-C5S8g3iePk-_bXQjj_a4Vw-1; Wed, 24 Jan 2024 10:31:14 -0500 X-MC-Unique: C5S8g3iePk-_bXQjj_a4Vw-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8B79E84AC67; Wed, 24 Jan 2024 15:31:13 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.193.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 586ABC2E1E6; Wed, 24 Jan 2024 15:31:13 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 338BB180038B; Wed, 24 Jan 2024 16:31:07 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Jiewen Yao , Gerd Hoffmann , Erdem Aktas , Ard Biesheuvel , Laszlo Ersek , Michael Roth , Min Xu , Tom Lendacky , Oliver Steffen Subject: [edk2-devel] [PATCH 1/1] OvmfPkg/ResetVector: send post codes to qemu debug console Date: Wed, 24 Jan 2024 16:31:07 +0100 Message-ID: <20240124153107.2112760-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,kraxel@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: KbvViSws3BMr00ShADzvYQ9Vx7686176AA= Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=eJxLuQA8; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Neat when doing ResetVector coding. Signed-off-by: Gerd Hoffmann --- OvmfPkg/ResetVector/DebugCon.asm | 43 +++++++++++++++++++++++++++ OvmfPkg/ResetVector/ResetVector.nasmb | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 OvmfPkg/ResetVector/DebugCon.asm diff --git a/OvmfPkg/ResetVector/DebugCon.asm b/OvmfPkg/ResetVector/DebugCon.asm new file mode 100644 index 000000000000..9c57d1a52c75 --- /dev/null +++ b/OvmfPkg/ResetVector/DebugCon.asm @@ -0,0 +1,43 @@ +;------------------------------------------------------------------------------ +; @file +; qemu debug console support macros (based on serial port macros) +; +; Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
+; SPDX-License-Identifier: BSD-2-Clause-Patent +; +;------------------------------------------------------------------------------ + +%macro outToDebugPort 1 + mov dx, 0x402 + mov al, %1 + out dx, al +%endmacro + +%macro debugShowCharacter 1 + outToDebugPort %1 +%endmacro + +%macro debugShowHexDigit 1 + %if (%1 < 0xa) + debugShowCharacter BYTE ('0' + (%1)) + %else + debugShowCharacter BYTE ('a' + ((%1) - 0xa)) + %endif +%endmacro + +%macro debugNewline 0 + debugShowCharacter `\r` + debugShowCharacter `\n` +%endmacro + +%macro debugShowPostCode 1 + debugShowHexDigit (((%1) >> 4) & 0xf) + debugShowHexDigit ((%1) & 0xf) + debugNewline +%endmacro + +BITS 16 + +%macro debugInitialize 0 + ; not required +%endmacro diff --git a/OvmfPkg/ResetVector/ResetVector.nasmb b/OvmfPkg/ResetVector/ResetVector.nasmb index 5832aaa8abf7..f1655ddfcde3 100644 --- a/OvmfPkg/ResetVector/ResetVector.nasmb +++ b/OvmfPkg/ResetVector/ResetVector.nasmb @@ -41,7 +41,7 @@ %elifdef DEBUG_SERIAL %include "SerialDebug.asm" %else - %include "DebugDisabled.asm" + %include "DebugCon.asm" %endif %include "Ia32/SearchForBfvBase.asm" -- 2.43.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114312): https://edk2.groups.io/g/devel/message/114312 Mute This Topic: https://groups.io/mt/103933942/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-