qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Handle vga= in -append (second try)
@ 2007-02-16 18:50 Pascal Terjan
  0 siblings, 0 replies; only message in thread
From: Pascal Terjan @ 2007-02-16 18:50 UTC (permalink / raw)
  To: qemu-devel

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

Hello,
vga= is a special parameter that needs to be handled by bootloader so
that the kernel can get it before parsing its command line.
The small attached patch add support for it.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: qemu-pc_append_vga.patch --]
[-- Type: text/x-patch; name="qemu-pc_append_vga.patch", Size: 1408 bytes --]

Index: hw/pc.c
===================================================================
RCS file: /sources/qemu/qemu/hw/pc.c,v
retrieving revision 1.70
diff -u -r1.70 pc.c
--- hw/pc.c	8 Feb 2007 23:09:59 -0000	1.70
+++ hw/pc.c	16 Feb 2007 18:45:10 -0000
@@ -567,6 +567,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");
@@ -618,6 +619,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) {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-16 18:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-16 18:50 [Qemu-devel] [PATCH] Handle vga= in -append (second try) Pascal Terjan

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).