45f8d9f9a8
Previously, ubldr would use the virtual addresses in the elf headers by masking off the high bits and assuming the result was a physical address where the kernel should be loaded. That would sometimes discard significant bits of the physical address, but the effects of that were undone by archsw copy code that would find a large block of memory and apply an offset to the source/dest copy addresses. The result was that things were loaded at a different physical address than requested by the higher code layers, but that worked because other adjustments were applied later (such as when jumping to the entry point). Very confusing, and somewhat fragile. Now the archsw copy routines are just simple copies, and instead archsw.arch_loadaddr is implemented to choose a load address. The new routine uses some of the code from the old offset-translation routine to find the largest block of ram, but it excludes ubldr itself from that range, and also excludes If ubldr splits the largest block of ram in two, the kernel is loaded into the bottom of whichever resulting block is larger. As part of eliminating ubldr itself from the ram ranges, export the heap start/end addresses in a pair of new global variables. This change means that the virtual addresses in the arm kernel elf headers now have no meaning at all, except for the entry point address. There is an implicit assumption that the entry point is in the first text page, and that the address in the the header can be turned into an offset by masking it with PAGE_MASK. In the future we can link all arm kernels at a virtual address of 0xC0000000 with no need to use any low-order part of the address to influence where in ram the kernel gets loaded. |
||
---|---|---|
.. | ||
bcache.c | ||
boot.c | ||
bootstrap.h | ||
commands.c | ||
console.c | ||
crc32.c | ||
crc32.h | ||
dev_net.c | ||
dev_net.h | ||
devopen.c | ||
disk.c | ||
disk.h | ||
gpt.c | ||
gpt.h | ||
help.common | ||
install.c | ||
interp_backslash.c | ||
interp_forth.c | ||
interp_parse.c | ||
interp.c | ||
isapnp.c | ||
isapnp.h | ||
load_elf32_obj.c | ||
load_elf32.c | ||
load_elf64_obj.c | ||
load_elf64.c | ||
load_elf_obj.c | ||
load_elf.c | ||
loader.8 | ||
ls.c | ||
Makefile.inc | ||
md.c | ||
merge_help.awk | ||
misc.c | ||
module.c | ||
newvers.sh | ||
panic.c | ||
part.c | ||
part.h | ||
pnp.c | ||
reloc_elf32.c | ||
reloc_elf64.c | ||
reloc_elf.c | ||
self_reloc.c | ||
ufsread.c | ||
util.c | ||
util.h | ||
zfsloader.8 |