summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/vesa.c
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>1999-03-31 15:27:00 +0000
committeryokota <yokota@FreeBSD.org>1999-03-31 15:27:00 +0000
commitde1479db500a6af0ced6ef72c3698ae0b8c63450 (patch)
tree2914bc572ad3410db2cb35fa6d9559a996422495 /sys/i386/isa/vesa.c
parent356cb7fdd8b8de4e4e0b6a3ae56331cd82bb8027 (diff)
downloadFreeBSD-src-de1479db500a6af0ced6ef72c3698ae0b8c63450.zip
FreeBSD-src-de1479db500a6af0ced6ef72c3698ae0b8c63450.tar.gz
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.
Diffstat (limited to 'sys/i386/isa/vesa.c')
-rw-r--r--sys/i386/isa/vesa.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/i386/isa/vesa.c b/sys/i386/isa/vesa.c
index 5f303ed..11434a5 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");
OpenPOWER on IntegriCloud