qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] pc: make vgabios exit port more useful


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 1/2] pc: make vgabios exit port more useful
Date: Fri, 12 Aug 2011 08:46:32 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

On 08/08/2011 02:31 PM, Anthony Liguori wrote:
We've always listened on port 501 for vgabios panic messages.  In the entire
time I've worked on QEMU, I've never actually seen a vgabios panic message :-)

If we change the semantics of this port a little bit, it makes it possible to
use it for more interesting use-cases.  I chose this approach instead of adding
a new I/O port because it avoids having a guest visible change.

This change allows single-byte access to port 501 and also uses the value
written to construct an exit code.

Signed-off-by: Anthony Liguori<address@hidden>

Applied.

Regards,

Anthony Liguori

---
  hw/pc.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 1c9d89a..4b07b35 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -549,8 +549,7 @@ static void bochs_bios_write(void *opaque, uint32_t addr, 
uint32_t val)
          /* LGPL'ed VGA BIOS messages */
      case 0x501:
      case 0x502:
-        fprintf(stderr, "VGA BIOS panic, line %d\n", val);
-        exit(1);
+        exit((val<<  1) | 1);
      case 0x500:
      case 0x503:
  #ifdef DEBUG_BIOS
@@ -591,6 +590,7 @@ static void *bochs_bios_init(void)
      register_ioport_write(0x403, 1, 1, bochs_bios_write, NULL);
      register_ioport_write(0x8900, 1, 1, bochs_bios_write, NULL);

+    register_ioport_write(0x501, 1, 1, bochs_bios_write, NULL);
      register_ioport_write(0x501, 1, 2, bochs_bios_write, NULL);
      register_ioport_write(0x502, 1, 2, bochs_bios_write, NULL);
      register_ioport_write(0x500, 1, 1, bochs_bios_write, NULL);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]