freebsd-dev/sys/boot/common
John Baldwin 00f3efe1bd Add support for FreeBSD/i386 guests under bhyve.
- 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
2014-02-05 04:39:03 +00:00
..
bcache.c
boot.c zfs boot: try to set vfs.root.mountfrom from currdev as a fallback 2012-05-12 09:07:41 +00:00
bootstrap.h Fix the bug I introduced in r247045. 2013-02-25 01:50:04 +00:00
commands.c
console.c boot/console: handle consoles that fail to probe 2012-10-06 20:01:17 +00:00
crc32.c Remove second consts in r233288 in order to appease C++ compilers. 2012-03-26 18:22:04 +00:00
crc32.h - Split code shared by almost any boot loader into separate files and 2010-09-24 19:49:12 +00:00
dev_net.c
dev_net.h
devopen.c
disk.c When loader tries to open GPT partition, but partition table is not GPT, 2012-10-22 11:01:43 +00:00
disk.h Add the flags parameter to the disk_open() function and DISK_F_NOCACHE 2012-10-21 12:14:58 +00:00
gpt.c Read backup GPT header from the last LBA only when primary GPT header and 2012-04-12 12:37:53 +00:00
gpt.h - Split code shared by almost any boot loader into separate files and 2010-09-24 19:49:12 +00:00
help.common
interp_backslash.c
interp_forth.c Bring in some userboot changes from the bhyve branch to reduce diffs. 2013-01-08 03:27:37 +00:00
interp_parse.c Replace index() and rindex() calls with strchr() and strrchr(). 2012-01-03 18:51:58 +00:00
interp.c Remove new-line characters from the include() errors to make it consistent 2012-10-25 15:45:32 +00:00
isapnp.c
isapnp.h
load_elf32_obj.c Add support for FreeBSD/i386 guests under bhyve. 2014-02-05 04:39:03 +00:00
load_elf32.c Add support for FreeBSD/i386 guests under bhyve. 2014-02-05 04:39:03 +00:00
load_elf64_obj.c
load_elf64.c
load_elf_obj.c Don't return an error if a kld does not contain any modules (e.g. a 2012-06-20 21:06:51 +00:00
load_elf.c Attach the elf section headers to the loaded kernel as metadata, so 2013-03-10 00:43:01 +00:00
loader.8 Sweep man pages replacing ad -> ada. 2013-10-01 18:41:53 +00:00
ls.c
Makefile.inc Hook in new files menusets.4th and manual. 2012-11-07 02:14:03 +00:00
md.c
merge_help.awk
misc.c
module.c Since we didn't break the loop, we should set i to -1 to start from the 2013-04-21 09:10:35 +00:00
newvers.sh
panic.c
part.c Make the check for number of entries less strict. 2013-08-08 11:24:25 +00:00
part.h Create the interface to work with various partition tables from the 2012-08-05 11:29:44 +00:00
pnp.c
reloc_elf32.c
reloc_elf64.c
reloc_elf.c Implement elfN(reloc) for powerpc. With this change the kernel is now able to 2012-09-21 18:21:31 +00:00
ufsread.c Use 32-bit ufs_ino_t instead of ino_t to keep boot2 small and prevent 2012-05-25 09:36:39 +00:00
util.c strncmp for boot code: fix an off by one error 2013-04-05 09:14:30 +00:00
util.h Rename bcpy() macro to bcopy(). 2011-02-27 12:25:47 +00:00