Commit Graph

13 Commits

Author SHA1 Message Date
Alan Cox
1c675a3bc3 The new binutils has correctly redefined MAXPAGESIZE on amd64 as 0x200000
instead of 0x100000.  As a side effect, an amd64 kernel now loads at
physical address 0x200000 instead of 0x100000.  This is probably for the
best because it avoids the use of a 2MB page mapping for the first 1MB of
the kernel that also spans the fixed MTRRs.  However, getmemsize() still
thinks that the kernel loads at 0x100000, and so the physical memory between
0x100000 and 0x200000 is lost.  Fix this problem by replacing the hard-wired
constant in getmemsize() by a symbol "kernphys" that is defined by the
linker script.

In collaboration with:	kib
2011-03-28 06:35:17 +00:00
Dimitry Andric
8ba66bb849 Sync sys/conf/ldscript.amd64 with the upstream version, preserving
FreeBSD-specific customizations (in particular, the addition of
_start_ctors and _stop_ctors).
2010-11-04 20:22:44 +00:00
Dimitry Andric
714d4612df Binutils commit 0c845abb5a0083c6deebc75975608237015badba increased
ELF_MAXPAGESIZE for amd64 from 0x00100000 to 0x00200000.  This caused
the kernel to be incorrectly linked, using the existing linker script,
resulting in a virtual address of 0xffffffff80000000 for the LOAD
program header.

The boot loader will load such a kernel at a real address of 0x00000000,
which either causes protection faults in btx, crashes the machine, or
(in case of a VMware guest) even makes it power down. :)

Fix this by partially synchronizing the amd64 linker script with
binutils own updated version, in particular replacing a hardcoded
value of 0x00100000 by CONSTANT(MAXPAGESIZE).
2010-11-04 18:57:51 +00:00
Dimitry Andric
491fb27448 Use new output format 'elf64-x86-64-freebsd' instead of 'elf64-x86-64',
and similarly 'elf64-sparc-freebsd' instead of 'elf64-sparc'.
2010-11-01 20:20:31 +00:00
Tim J. Robbins
907cb02fe9 Provide the _start_ctors and _stop_ctors symbols. As on i386, the addresses
of these are the start and end of the .ctors section.
2004-05-29 01:09:00 +00:00
Peter Wemm
b05deb9bc1 Sync up with the files in the hammer branch in the p4 tree to get basic
AMD64 support.  There is still more to add.
2003-05-01 02:59:24 +00:00
Poul-Henning Kamp
3fc473df24 Add two symbols start_ctors and stop_ctors to allow us to find the
.ctors section so we can call the constructors.
2003-01-06 07:37:15 +00:00
David E. O'Brien
616d2d5d48 Use the new freebsd output format from Binutils 2.13.1. 2002-10-11 19:38:04 +00:00
Peter Wemm
d7ffc0023d Remove hard coded magic load address. Now to change the load address,
we just have to change the pmap.h constants and ld will automatically
adapt based on the "kernbase" symbol.
2001-09-18 01:12:43 +00:00
Peter Wemm
d0e12656b8 Add $FreeBSD$
Make the alpha linker script more like the i386 version - delete the
/usr/local and egcs directories
2000-01-11 15:35:16 +00:00
Peter Wemm
5004cc2ecf Remove a rather bogus search path reference.. 1999-06-03 22:07:41 +00:00
David Greenman
8681b974c1 Increased kernel virtual address space to 1GB. NOTE: You MUST have fixed
bootblocks in order to boot the kernel after this! Also note that this
change breaks BSDI BSD/OS compatibility.
Also increased default NKPT to 17 so that FreeBSD can boot on machines
with >=2GB of RAM. Booting on machines with exactly 4GB requires other
patches, not included.
1999-03-11 18:28:46 +00:00
Peter Wemm
6b7a14ce57 Make the ELF kernel build produce a dynamic executable (!). This enables
the in-kernel linker to access the _DYNAMIC data for doing loadable elf
modules.  The alpha kernel is already done this way, I've borrowed some of
the hacks from there.

This is primarily aimed at the 3-stage boot process which is intended to
be able to do pre-loading of kernel modules.

Note that the entry point isn't 0xf0100000 any more, it'll be a little
further on - but this value is stored in the headers.  I don't think this
will be a problem, but I'm sure somebody will tell me if it is. :-)

I'm not sure if btxboot is going to like this, it doesn't do proper ELF
header checking and assumes that there are exactly two program header
entries and that they are both PT_LOAD entries - a bad assumption.
1998-09-30 12:14:39 +00:00