Skip to contentSkip to conversation

Support for vga= kernel option

Qemu-devel Pascal Terjan 3 participants 4 messages Jan 11, 2007 – Feb 10, 2007

lore
Share & tools
lore
#0 lore raw

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

pc.c +20 -0
diff -u -r1.68 pc.c
@@ -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) {
#1 lore raw

2007/1/11, Pascal Terjan <[email protected]>:

Quoted 3 lines

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

Anything against this patch ?

#2 lore raw

I suggest either re-posting the patch or sending it to the committers (Fabrice or others).

Many developers are at #qemu in irc (freenode)

Thanks,
Hetz

Quoted 13 lines · Pascal Terjan

2007/1/11, Pascal Terjan <[email protected]>:

Quoted 3 lines

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

Anything against this patch ?

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Signature · 3 lines
Skepticism is the lazy person's default position.
Visit my blog (hebrew) for things that (sometimes) matter:
http://wp.dad-answers.com