From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 15 18:45:15 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C50B716A4CE for ; Wed, 15 Dec 2004 18:45:15 +0000 (GMT) Received: from mgw-x2.nokia.com (mgw-x2.nokia.com [131.228.20.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC70943D64 for ; Wed, 15 Dec 2004 18:45:14 +0000 (GMT) (envelope-from Vijay.Singh@nokia.com) Received: from esdks003.ntc.nokia.com (esdks003.ntc.nokia.com [172.21.138.158])iBFIjCr07170 for ; Wed, 15 Dec 2004 20:45:13 +0200 (EET) X-Scanned: Wed, 15 Dec 2004 20:45:06 +0200 Nokia Message Protector V1.3.31 2004060815 - RELEASE Received: (from root@localhost) by esdks003.ntc.nokia.com (8.12.9/8.12.9) id iBFIj61Y018125 for ; Wed, 15 Dec 2004 20:45:06 +0200 Received: from mgw-int2.ntc.nokia.com (172.21.143.97) by esdks003.ntc.nokia.com 00T45ZYk; Wed, 15 Dec 2004 20:44:10 EET Received: from daebh002.NOE.Nokia.com (daebh002.americas.nokia.com [10.241.35.122])iBFIi9319063 for ; Wed, 15 Dec 2004 20:44:09 +0200 (EET) Received: from mvebe001.NOE.Nokia.com ([172.18.140.37]) by daebh002.NOE.Nokia.com with Microsoft SMTPSVC(5.0.2195.6881); Wed, 15 Dec 2004 12:43:47 -0600 X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Wed, 15 Dec 2004 10:43:45 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: loading kernel at any physical address Thread-Index: AcTi1gFqVh94gpcaQtGzgwxEfIBhnQ== From: To: X-OriginalArrivalTime: 15 Dec 2004 18:43:47.0938 (UTC) FILETIME=[034B9420:01C4E2D6] Subject: loading kernel at any physical address X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2004 18:45:15 -0000 Hello all, for a project I am trying to figure out how to boot a FreeBSD = kernel loaded at any physical address. Right now the locore.s magic = works because the load addres (KERNLOAD) and (KERNBASE) are set such = that #define R(foo) ((foo)-KERNBASE) macro is able to get the addresses before paging is enabled. If the loadaddress information is not embedded in defines, then is the = following solution expected to work: .globl _loadaddress /* should be at 16M aligned ??? */ .set _loadaddress,KERNBASE and then: NON_GPROF_ENTRY(btext) nop /* nops for 8 byte alignment */ nop nop call 0f 0: mov 4(%ebp), %eax add $-8, %eax /* This is actual physical load = addr */ add $-0x100000, %eax subl %eax, _loadaddress /* new kernbase w.r.t load addr = */ /* instead of standard 1MB reloc = */ and then=20 #define R(foo) ((foo)- _loadaddress) One issue might be loadaddress over 16M, but for this problem we can = assume that the processor has been in protected mode, so it has access = to that space. Any input on this is highly appreciated. br vijay