From f0e19d90c0fc3bf47cab297e03cd0fc782076767 Mon Sep 17 00:00:00 2001 From: ru Date: Sun, 29 Oct 2006 14:50:58 +0000 Subject: 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) --- sys/boot/common/load_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/boot/common/load_elf.c') diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c index cd983a9..be8f881 100644 --- a/sys/boot/common/load_elf.c +++ b/sys/boot/common/load_elf.c @@ -263,7 +263,7 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off) #if __ELF_WORD_SIZE == 64 off = - (off & 0xffffffffff000000ull);/* x86_64 relocates after locore */ #else - off = - (off & 0xff000000u); /* i386 relocates after locore */ + off = - (off & 0xc0000000u); /* i386 relocates after locore */ #endif #else off = 0; /* other archs use direct mapped kernels */ -- cgit v1.1