Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Aug 2010 20:21:52 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r212070 - head/sys/dev/fb
Message-ID:  <201008312021.o7VKLqq1040870@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Tue Aug 31 20:21:52 2010
New Revision: 212070
URL: http://svn.freebsd.org/changeset/base/212070

Log:
  Make sure the interrupt entry point is within the video ROM range.  We must
  not change interrupt vector if it is not pointing the ROM itself.  Actually,
  we just fail shadowing altogether if that is the case because the shadowed
  copy will be useless for sure and POST may not be relocatable or useful.
  While I'm here, fix a debugging message under bootverbose, really.  r211829
  fixed one case but broke another.  Mea Culpa.

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c	Tue Aug 31 19:59:18 2010	(r212069)
+++ head/sys/dev/fb/vesa.c	Tue Aug 31 20:21:52 2010	(r212070)
@@ -799,19 +799,25 @@ vesa_bios_init(void)
 	/*
 	 * Shadow video ROM.
 	 */
-	offs = BIOS_SADDRTOLADDR(vesa_bios_int10);
+	offs = vesa_bios_int10;
 	if (vesa_shadow_rom) {
 		vbios = x86bios_get_orm(vesa_bios_offs);
 		if (vbios != NULL) {
 			vesa_bios_size = vbios[2] * 512;
-			vesa_bios = x86bios_alloc(&vesa_bios_offs,
-			    vesa_bios_size, M_WAITOK);
-			memcpy(vesa_bios, vbios, vesa_bios_size);
-			offs = offs - VESA_BIOS_OFFSET + vesa_bios_offs;
-			offs = (X86BIOS_PHYSTOSEG(offs) << 16) +
-			    X86BIOS_PHYSTOOFF(offs);
-			x86bios_set_intr(0x10, offs);
-		} else
+			offs = BIOS_SADDRTOLADDR(vesa_bios_int10);
+			if (offs > vesa_bios_offs &&
+			    offs < vesa_bios_offs + vesa_bios_size) {
+				vesa_bios = x86bios_alloc(&vesa_bios_offs,
+				    vesa_bios_size, M_WAITOK);
+				memcpy(vesa_bios, vbios, vesa_bios_size);
+				offs = offs - VESA_BIOS_OFFSET + vesa_bios_offs;
+				offs = (X86BIOS_PHYSTOSEG(offs) << 16) +
+				    X86BIOS_PHYSTOOFF(offs);
+				x86bios_set_intr(0x10, offs);
+			} else
+				offs = vesa_bios_int10;
+		}
+		if (vesa_bios == NULL)
 			printf("VESA: failed to shadow video ROM\n");
 	}
 	if (bootverbose)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008312021.o7VKLqq1040870>