diff options
author | ache <ache@FreeBSD.org> | 1998-09-29 04:09:39 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1998-09-29 04:09:39 +0000 |
commit | f4ce5ac9a2d3ed061cb15abbe575df94a173f692 (patch) | |
tree | 9a128da5edf01b4bf502abb4e7ef9cdf56977700 /sys | |
parent | 4f1d2ca2b5c34dd343d70f2df7319e0c88e8f22e (diff) | |
download | FreeBSD-src-f4ce5ac9a2d3ed061cb15abbe575df94a173f692.zip FreeBSD-src-f4ce5ac9a2d3ed061cb15abbe575df94a173f692.tar.gz |
workaround painful vm86_datacall requirement that segment+offset
must be withing the same PAGE frame
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/isa/vesa.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/i386/isa/vesa.c b/sys/i386/isa/vesa.c index fbd83a7..e03c714 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.2 1998/09/23 09:59:00 yokota Exp $ + * $Id: vesa.c,v 1.3 1998/09/25 11:55:46 yokota Exp $ */ #include "sc.h" @@ -327,10 +327,13 @@ vesa_translate_flags(u_int16_t vflags) static int vesa_bios_init(void) { - static u_char buf[512]; +#define VESA_INFO_SIZE 512 + static u_char buffer[VESA_INFO_SIZE * 2]; + static u_char *buf = buffer; struct vm86frame vmf; struct vesa_mode vmode; u_int32_t p; + u_short offset; int modes; int err; int i; @@ -343,10 +346,16 @@ vesa_bios_init(void) vesa_vmode[0].vi_mode = EOT; bzero(&vmf, sizeof(vmf)); /* paranoia */ - bzero(buf, sizeof(buf)); - bcopy("VBE2", buf, 4); /* try for VBE2 data */ + bzero(buffer, sizeof(buffer)); vmf.vmf_eax = 0x4f00; - err = vm86_datacall(0x10, &vmf, (char *)buf, sizeof(buf), + + /* workaround - see vm86.c:vm86_datacall */ + offset = (u_int)buf & PAGE_MASK; + if ((offset + VESA_INFO_SIZE) & PG_FRAME) + buf += PAGE_SIZE - offset; + + bcopy("VBE2", buf, 4); /* try for VBE2 data */ + err = vm86_datacall(0x10, &vmf, (char *)buf, VESA_INFO_SIZE, &vmf.vmf_es, &vmf.vmf_di); if ((err != 0) || (vmf.vmf_eax != 0x4f) || bcmp("VESA", buf, 4)) return 1; |