qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Pascal Terjan" <pterjan@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Support for vga= kernel option
Date: Thu, 11 Jan 2007 14:12:27 +0100	[thread overview]
Message-ID: <e8ca35370701110512u163b32bev18f8695d2a365e2c@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 74 bytes --]

Hello,
here is a little patch to add support for vga= when using -kernel.

[-- Attachment #2: qemu_pc_vga=.patch --]
[-- Type: text/x-patch, Size: 1409 bytes --]

Index: hw/pc.c
===================================================================
RCS file: /sources/qemu/qemu/hw/pc.c,v
retrieving revision 1.68
diff -u -r1.68 pc.c
--- hw/pc.c	10 Jan 2007 16:23:41 -0000	1.68
+++ hw/pc.c	11 Jan 2007 13:10:55 -0000
@@ -544,6 +544,7 @@
     if (linux_boot) {
         uint8_t bootsect[512];
         uint8_t old_bootsect[512];
+        char *vmode;
 
         if (bs_table[0] == NULL) {
             fprintf(stderr, "A disk image must be given for 'hda' when booting a Linux kernel\n");
@@ -595,6 +596,25 @@
                 KERNEL_CMDLINE_ADDR - KERNEL_PARAMS_ADDR);
         /* loader type */
         stw_raw(phys_ram_base + KERNEL_PARAMS_ADDR + 0x210, 0x01);
+
+        /* handle vga= parameter */
+        vmode = strstr(kernel_cmdline, "vga=");
+        if (vmode) {
+            char *space;
+            unsigned int video_mode;
+            /* skip "vga=" */
+            vmode += 4;
+            if (!strncmp(vmode, "normal", 6)) {
+                video_mode = 0xffff;
+            } else if (!strncmp(vmode, "ext", 3)) {
+                video_mode = 0xfffe;
+            } else if (!strncmp(vmode, "ask", 3)) {
+                video_mode = 0xfffd;
+            } else {
+                video_mode = strtol(vmode, NULL, 0);
+            }
+            stw_raw(phys_ram_base + KERNEL_PARAMS_ADDR + 0x1fa, video_mode);
+        }
     }
 
     if (pci_enabled) {

             reply	other threads:[~2007-01-11 13:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-11 13:12 Pascal Terjan [this message]
2007-02-05 22:40 ` [Qemu-devel] Re: Support for vga= kernel option Pascal Terjan
2007-02-06  0:24   ` Hetz Ben Hamo
2007-02-10 22:48   ` Thiemo Seufer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e8ca35370701110512u163b32bev18f8695d2a365e2c@mail.gmail.com \
    --to=pterjan@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).