Hello,
here is a little patch to add support for vga= when using -kernel.
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) {
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to