From owner-cvs-src@FreeBSD.ORG Thu Jun 3 18:25:00 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9FF6C16A4CE; Thu, 3 Jun 2004 18:25:00 -0700 (PDT) Received: from exchhz01.viatech.com.cn (ip-40-162-97-218.anlai.com [218.97.162.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A74043D45; Thu, 3 Jun 2004 18:24:56 -0700 (PDT) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (DAVIDWNT [10.4.1.99]) by exchhz01.viatech.com.cn with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id MB4CDG4D; Fri, 4 Jun 2004 09:24:52 +0800 Message-ID: <40BFCFFC.5040701@freebsd.org> Date: Fri, 04 Jun 2004 09:27:24 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nate Lawson References: <20040603160405.E45592@root.org> In-Reply-To: <20040603160405.E45592@root.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: Poul-Henning Kamp cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/i386/include/pc bios.h src/sys/i386/i386 bios.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2004 01:25:00 -0000 Nate Lawson wrote: > On Thu, 3 Jun 2004, Poul-Henning Kamp wrote: > >>phk 2004/06/03 15:36:24 PDT >> >> FreeBSD src repository >> >> Modified files: >> sys/i386/include/pc bios.h >> sys/i386/i386 bios.c >> Log: >> Add new bios_string() which will hunt for a string inside a given > > range > >> of the BIOS. This can be used for finding arbitrary magic in the > > BIOS > >> in order to recognize particular platforms. >> >> Revision Changes Path >> 1.66 +15 -0 src/sys/i386/i386/bios.c >> 1.15 +8 -0 src/sys/i386/include/pc/bios.h >> >>--- src/sys/i386/i386/bios.c:1.65 Sun May 30 10:57:42 2004 >>+++ src/sys/i386/i386/bios.c Thu Jun 3 15:36:24 2004 >>@@ -472,6 +472,21 @@ >> free(pte, M_TEMP); /* ... and free it */ >> } >> return (i); >>+} >>+ >>+const u_char * >>+bios_string(u_int from, u_int to, const u_char *string, int len) >>+{ >>+ const char *t, *te; >>+ >>+ if (len == 0) >>+ len = strlen(string); >>+ t = (const char *)(KERNBASE + from); >>+ te = (const char *)(KERNBASE + to); >>+ for (; t <= te; t++) >>+ if (!memcmp(string, t, len)) >>+ return (t); >>+ return (NULL); >> } > > > Many BIOS strings have alignment requirements. That might be useful to > add. Is all of BIOS mapped into kernel memory or should this operate on > physical addresses instead? > > -Nate > > First 4M bytes are mapped at KERNBASE, right ? I saw KERNLOAD is 4M bytes, and from page 1 to KERNLOAD are mapped read-only, zero page is mapped R/W, all in locore.s. David Xu