diff options
author | ru <ru@FreeBSD.org> | 2006-10-29 14:50:58 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2006-10-29 14:50:58 +0000 |
commit | f0e19d90c0fc3bf47cab297e03cd0fc782076767 (patch) | |
tree | 8b907f11b53d6e4725c11716fdf425629834fc0a /sys/boot/i386/gptboot/gptboot.c | |
parent | 248a5cec67d92bfe2d6ecfe22e5e82d80fbbbdc6 (diff) | |
download | FreeBSD-src-f0e19d90c0fc3bf47cab297e03cd0fc782076767.zip FreeBSD-src-f0e19d90c0fc3bf47cab297e03cd0fc782076767.tar.gz |
Because the BTX mini-kernel now uses flat memory mode and clients
are no longer limited to a virtual address space of 16 megabytes,
only mask high two bits of a virtual address. This allows to load
larger kernels (up to 1 gigabyte). Not masking addresses at all
was a bad idea on machines with less than >3G of memory -- kernels
are linked at 0xc0xxxxxx, and that would attempt to load a kernel
at above 3G. By masking only two highest bits we stay within the
safe limits while still allowing to boot larger kernels.
(This is a safer reimplmentation of sys/boot/i386/boot2/boot.2.c
rev. 1.71.)
Prodded by: jhb
Tested by: nyan (pc98)
Diffstat (limited to 'sys/boot/i386/gptboot/gptboot.c')
-rw-r--r-- | sys/boot/i386/gptboot/gptboot.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/boot/i386/gptboot/gptboot.c b/sys/boot/i386/gptboot/gptboot.c index df3fe81..b07c9ed 100644 --- a/sys/boot/i386/gptboot/gptboot.c +++ b/sys/boot/i386/gptboot/gptboot.c @@ -334,7 +334,7 @@ load(void) return; } if (fmt == 0) { - addr = hdr.ex.a_entry & 0xffffff; + addr = hdr.ex.a_entry & 0x3fffffff; p = PTOV(addr); fs_off = PAGE_SIZE; if (xfsread(ino, p, hdr.ex.a_text)) @@ -368,7 +368,7 @@ load(void) j++; } for (i = 0; i < 2; i++) { - p = PTOV(ep[i].p_paddr & 0xffffff); + p = PTOV(ep[i].p_paddr & 0x3fffffff); fs_off = ep[i].p_offset; if (xfsread(ino, p, ep[i].p_filesz)) return; @@ -389,7 +389,7 @@ load(void) p += es[i].sh_size; } } - addr = hdr.eh.e_entry & 0xffffff; + addr = hdr.eh.e_entry & 0x3fffffff; } bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); |