From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 9 19:03:56 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 E476516A52E for ; Mon, 9 Feb 2004 19:03:56 -0800 (PST) Received: from 263.sina.com (unknown [202.106.182.141]) by mx1.FreeBSD.org (Postfix) with SMTP id 0EB1443D1D for ; Mon, 9 Feb 2004 19:03:56 -0800 (PST) (envelope-from superhaar@263.sina.com) Received: (qmail 48415 invoked from network); 10 Feb 2004 02:08:22 -0000 Received: from unknown (HELO bsdbox) (219.153.12.79) by 202.106.182.141 with SMTP; 10 Feb 2004 02:08:22 -0000 Date: 10 Feb 2004 11:04:38 +0000 Message-Id: <87n07rp54p.fsf@263.sina.com> From: Hong MingJian To: freebsd-hackers@freebsd.org Subject: kernel load 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: Tue, 10 Feb 2004 03:03:57 -0000 Hi all, When reading locore.s, I have the following question. In the locore.s, there's a macro R defined as #define R(foo) ((foo)-KERNBASE) where KERNBASE equals to 0xC0000000. But in the sys/conf/ldscript.i386, it reads SECTIONS { . = kernbase + 0x00100000 + SIZEOF_HEADERS; ..... } The kernel is loaded at 0x00100000 by boot2 or loader with program header stripped. So, how the R macro can still work? I think it should be defined as `((foo)-KERNBASE-SIZEOF_HEADERS)' or the ldscript.i386 should be modified to . = kernbase + 0x00100000; I refers to the ld script for Linux i386 kernel(vmlinux.lds), it reads SECTIONS { . = 0xC0000000 + 0x100000; .......... } Thanks.