From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MQNk2-0001kP-G1 for qemu-devel@nongnu.org; Mon, 13 Jul 2009 11:46:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MQNjx-0001hX-Hu for qemu-devel@nongnu.org; Mon, 13 Jul 2009 11:46:58 -0400 Received: from [199.232.76.173] (port=49427 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQNjx-0001hG-B0 for qemu-devel@nongnu.org; Mon, 13 Jul 2009 11:46:53 -0400 Received: from mail-ew0-f207.google.com ([209.85.219.207]:37079) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MQNjw-000495-UC for qemu-devel@nongnu.org; Mon, 13 Jul 2009 11:46:53 -0400 Received: by ewy3 with SMTP id 3so2286434ewy.34 for ; Mon, 13 Jul 2009 08:46:51 -0700 (PDT) From: Pascal Terjan Content-Type: text/plain Date: Mon, 13 Jul 2009 17:46:42 +0200 Message-Id: <1247500002.28895.4.camel@plop> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] Handle vga= in -append List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 --- hw/pc.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index c134506..9050934 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,25 @@ 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) { + 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 -- 1.6.3.3