aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@gmail.com>2009-07-13 17:46:42 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-07-16 17:28:50 -0500
commitbf4e5d92979c5f7b0b5e5d0a261954aa87f02ac1 (patch)
treef313ed6864a05817efc031c02ff20bfb46729ada
parent07323531c196223293bf266bd4d3811bd24c6e34 (diff)
Handle vga= in -append
Here is a patch I had sent twice to the list 2 years ago. Hopefuly this time someone will be interested It adds support for passing vga mode to linux kernel through vga= option in -append Signed-off-by: Pascal Terjan <pterjan@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--hw/pc.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/hw/pc.c b/hw/pc.c
index de23fa7f6e..b47c95d72a 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -825,6 +825,7 @@ static void load_linux(void *fw_cfg,
uint8_t header[8192];
target_phys_addr_t real_addr, prot_addr, cmdline_addr, initrd_addr = 0;
FILE *f, *fi;
+ char *vmode;
/* Align to 16 bytes as a paranoia measure */
cmdline_size = (strlen(kernel_cmdline)+16) & ~15;
@@ -900,6 +901,24 @@ static void load_linux(void *fw_cfg,
stw_p(header+0x22, cmdline_addr-real_addr);
}
+ /* handle vga= parameter */
+ vmode = strstr(kernel_cmdline, "vga=");
+ if (vmode) {
+ 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