qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] pc: make vgabios exit port more useful
@ 2011-08-08 19:31 Anthony Liguori
  2011-08-08 19:31 ` [Qemu-devel] [PATCH 2/2] [FYI] coverage test for Linux installs Anthony Liguori
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Anthony Liguori @ 2011-08-08 19:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Lucas Meneghel Rodrigues, Anthony Liguori, Avi Kivity

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 <aliguori@us.ibm.com>
---
 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);
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-08-24 13:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-08 19:31 [Qemu-devel] [PATCH 1/2] pc: make vgabios exit port more useful Anthony Liguori
2011-08-08 19:31 ` [Qemu-devel] [PATCH 2/2] [FYI] coverage test for Linux installs Anthony Liguori
2011-08-08 19:35   ` Anthony Liguori
2011-08-23 15:50   ` Ryan Harper
2011-08-12 13:46 ` [Qemu-devel] [PATCH 1/2] pc: make vgabios exit port more useful Anthony Liguori
2011-08-24  9:47 ` Avi Kivity
2011-08-24 12:38   ` Anthony Liguori
2011-08-24 12:55     ` Avi Kivity
2011-08-24 13:02       ` Anthony Liguori
2011-08-24 13:06         ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).