Skip site navigation (1)Skip section navigation (2)
Date:      10 Feb 2004 11:04:38 +0000
From:      Hong MingJian <superhaar@263.sina.com>
To:        freebsd-hackers@freebsd.org
Subject:   kernel load address
Message-ID:  <87n07rp54p.fsf@263.sina.com>

next in thread | raw e-mail | index | archive | help
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.



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