From de1479db500a6af0ced6ef72c3698ae0b8c63450 Mon Sep 17 00:00:00 2001 From: yokota Date: Wed, 31 Mar 1999 15:27:00 +0000 Subject: [PATCH] Follow up to the recent vm86 change in rev. 1.19. - Make a copy of the information block returned in the vm86 space by the VESA BIOS init function. Otherwise it will be overwritten by subsequent BIOS calls in the same vm86 context. --- sys/i386/isa/vesa.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/i386/isa/vesa.c b/sys/i386/isa/vesa.c index 5f303ed96cb..11434a57a8e 100644 --- a/sys/i386/isa/vesa.c +++ b/sys/i386/isa/vesa.c @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: vesa.c,v 1.20 1999/03/18 20:13:20 jlemon Exp $ + * $Id: vesa.c,v 1.21 1999/03/29 15:10:56 yokota Exp $ */ #include "vga.h" @@ -432,9 +432,10 @@ static void static int vesa_bios_init(void) { + static u_char buf[512]; struct vm86frame vmf; struct vesa_mode vmode; - u_char *buf; + u_char *vmbuf; int modes; int err; int i; @@ -446,15 +447,16 @@ vesa_bios_init(void) vesa_adp_info = NULL; vesa_vmode[0].vi_mode = EOT; - buf = (u_char *)vm86_addpage(&vesa_vmcontext, 1, 0); + vmbuf = (u_char *)vm86_addpage(&vesa_vmcontext, 1, 0); bzero(&vmf, sizeof(vmf)); /* paranoia */ - bcopy("VBE2", buf, 4); /* try for VBE2 data */ + bcopy("VBE2", vmbuf, 4); /* try for VBE2 data */ vmf.vmf_eax = 0x4f00; - vm86_getptr(&vesa_vmcontext, (vm_offset_t)buf, &vmf.vmf_es, &vmf.vmf_di); + vm86_getptr(&vesa_vmcontext, (vm_offset_t)vmbuf, &vmf.vmf_es, &vmf.vmf_di); err = vm86_datacall(0x10, &vmf, &vesa_vmcontext); - if ((err != 0) || (vmf.vmf_eax != 0x4f) || bcmp("VESA", buf, 4)) + if ((err != 0) || (vmf.vmf_eax != 0x4f) || bcmp("VESA", vmbuf, 4)) return 1; + bcopy(vmbuf, buf, sizeof(buf)); vesa_adp_info = (struct vesa_info *)buf; if (bootverbose) { printf("VESA: information block\n"); -- 2.45.2