--- qemu-0.9.1/hw/pc.c.kernel-option-vga 2008-01-06 20:38:42.000000000 +0100 +++ qemu-0.9.1/hw/pc.c 2008-02-27 11:50:21.000000000 +0100 @@ -493,6 +493,7 @@ uint8_t header[1024]; uint8_t *real_addr, *prot_addr, *cmdline_addr, *initrd_addr; FILE *f, *fi; + char *vmode; /* Align to 16 bytes as a paranoia measure */ cmdline_size = (strlen(kernel_cmdline)+16) & ~15; @@ -561,6 +562,26 @@ stw_p(header+0x22, cmdline_addr-real_addr); } + + /* 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_p(header+0x1fa, video_mode); + } + /* loader type */ /* High nybble = B reserved for Qemu; low nybble is revision number. If this code is substantially changed, you may want to consider