From owner-svn-src-all@FreeBSD.ORG Tue Aug 31 20:21:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA2D710656AB; Tue, 31 Aug 2010 20:21:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9AA38FC15; Tue, 31 Aug 2010 20:21:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7VKLq23040872; Tue, 31 Aug 2010 20:21:52 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7VKLqq1040870; Tue, 31 Aug 2010 20:21:52 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201008312021.o7VKLqq1040870@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 31 Aug 2010 20:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212070 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Aug 2010 20:21:53 -0000 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)