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.
This commit is contained in:
Kazutaka YOKOTA 1999-03-31 15:27:00 +00:00
parent 3ee9bf69aa
commit fd99a054d9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=45196

View File

@ -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");