00f3efe1bd
- Similar to the hack for bootinfo32.c in userboot, define _MACHINE_ELF_WANT_32BIT in the load_elf32 file handlers in userboot. This allows userboot to load 32-bit kernels and modules. - Copy the SMAP generation code out of bootinfo64.c and into its own file so it can be shared with bootinfo32.c to pass an SMAP to the i386 kernel. - Use uint32_t instead of u_long when aligning module metadata in bootinfo32.c in userboot, as otherwise the metadata used 64-bit alignment which corrupted the layout. - Populate the basemem and extmem members of the bootinfo struct passed to 32-bit kernels. - Fix the 32-bit stack in userboot to start at the top of the stack instead of the bottom so that there is room to grow before the kernel switches to its own stack. - Push a fake return address onto the 32-bit stack in addition to the arguments normally passed to exec() in the loader. This return address is needed to convince recover_bootinfo() in the 32-bit locore code that it is being invoked from a "new" boot block. - Add a routine to libvmmapi to setup a 32-bit flat mode register state including a GDT and TSS that is able to start the i386 kernel and update bhyveload to use it when booting an i386 kernel. - Use the guest register state to determine the CPU's current instruction mode (32-bit vs 64-bit) and paging mode (flat, 32-bit, PAE, or long mode) in the instruction emulation code. Update the gla2gpa() routine used when fetching instructions to handle flat mode, 32-bit paging, and PAE paging in addition to long mode paging. Don't look for a REX prefix when the CPU is in 32-bit mode, and use the detected mode to enable the existing 32-bit mode code when decoding the mod r/m byte. Reviewed by: grehan, neel MFC after: 1 month |
||
---|---|---|
.. | ||
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 | ||
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 | ||
ufsread.c | ||
util.c | ||
util.h |