Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 Don't rely on vga_post_call being called be...



details:   https://anonhg.NetBSD.org/src/rev/a87014a8dfd5
branches:  trunk
changeset: 761982:a87014a8dfd5
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Feb 12 19:13:30 2011 +0000

description:
Don't rely on vga_post_call being called before vga_post_set_vbe

diffstat:

 sys/arch/x86/x86/vga_post.c |  17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 22c06a9be6ef -r a87014a8dfd5 sys/arch/x86/x86/vga_post.c
--- a/sys/arch/x86/x86/vga_post.c       Sat Feb 12 19:07:35 2011 +0000
+++ b/sys/arch/x86/x86/vga_post.c       Sat Feb 12 19:13:30 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vga_post.c,v 1.17 2010/11/12 13:18:59 uebayasi Exp $ */
+/* $NetBSD: vga_post.c,v 1.18 2011/02/12 19:13:30 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vga_post.c,v 1.17 2010/11/12 13:18:59 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vga_post.c,v 1.18 2011/02/12 19:13:30 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -235,6 +235,19 @@
 void
 vga_post_set_vbe(struct vga_post *sc, uint16_t vbemode)
 {
+       sc->emu.x86.R_EAX = sc->initial_eax;
+       sc->emu.x86.R_EDX = 0x00000080;
+       sc->emu.x86.R_DS = 0x0040;
+       sc->emu.x86.register_flags = 0x3200;
+
+       memcpy((void *)sc->sys_image, sc->bios_data, PAGE_SIZE);
+
+       /* stack is at the end of the first 64KB */
+       sc->emu.x86.R_SS = 0;
+       sc->emu.x86.R_ESP = 0;
+
+       x86emu_i8254_init(&sc->i8254, nanotime);
+
        sc->emu.x86.R_EBX = vbemode | 0x4000;
        sc->emu.x86.R_EAX = 0x4f02;
        X86EMU_exec_intr(&sc->emu, 0x10);



Home | Main Index | Thread Index | Old Index