History log of /freebsd-11-stable/stand/i386/boot2/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
360838 09-May-2020 dim

MFC r358643:

Link stand/i386 components using a linker script

LLD 10.0.0 changed the behavior of the -Ttext option, so that using
-Ttext=0x0 now causes linking of the loaders to fail with:

ld: error: output file too large: 18446744073707016908 bytes

I reported this in https://bugs.llvm.org/show_bug.cgi?id=44715, and
initially reverted the upstream change in r357259 to work around it.

However, after some discussion with Fangrui Song in the upstream ticket,
I think we can classify this as an unfortunate interaction between using
-Ttext=0 in combination with --no-rosegment. (We added the latter
in r332090, because btxld does not correctly handle input with more
than 2 PT_LOAD segments.)

Fangrui suggested to use a linker script instead, and Warner was already
attempting this in r305353, but had to revert it due to "crypto-using
boot problems" (not sure what those were :).

This review updates the stand/i386/boot.ldscript to handle more
sections, inserts some symbols like _edata and such that we use in
libsa, and also discards any .interp section.

It uses ORG which is defined on the linker command line using
--defsym ORG=value to set the start of all the sections.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D23952

360660 05-May-2020 dim

MFC r355940:

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo". That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libunwind
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm-project
/freebsd-11-stable/contrib/llvm-project/clang
/freebsd-11-stable/contrib/llvm-project/compiler-rt
/freebsd-11-stable/contrib/llvm-project/libcxx
/freebsd-11-stable/contrib/llvm-project/libcxx/include/__errc
/freebsd-11-stable/contrib/llvm-project/libcxx/include/errno.h
/freebsd-11-stable/contrib/llvm-project/libunwind
/freebsd-11-stable/contrib/llvm-project/lld
/freebsd-11-stable/contrib/llvm-project/lldb
/freebsd-11-stable/contrib/llvm-project/llvm
/freebsd-11-stable/contrib/llvm-project/openmp
/freebsd-11-stable/contrib/openmp
/freebsd-11-stable/gnu/usr.bin/cc/include/Makefile
/freebsd-11-stable/lib/clang/clang.build.mk
/freebsd-11-stable/lib/clang/clang.pre.mk
/freebsd-11-stable/lib/clang/libclang/Makefile
/freebsd-11-stable/lib/clang/liblldb/Makefile
/freebsd-11-stable/lib/clang/libllvm/Makefile
/freebsd-11-stable/lib/clang/libllvmminimal/Makefile
/freebsd-11-stable/lib/clang/lldb.pre.mk
/freebsd-11-stable/lib/clang/llvm.build.mk
/freebsd-11-stable/lib/clang/llvm.pre.mk
/freebsd-11-stable/lib/libblocksruntime/Makefile
/freebsd-11-stable/lib/libc++/Makefile
/freebsd-11-stable/lib/libc++experimental/Makefile
/freebsd-11-stable/lib/libc/arm/aeabi/Makefile.inc
/freebsd-11-stable/lib/libclang_rt/Makefile.inc
/freebsd-11-stable/lib/libcompiler_rt/Makefile.inc
/freebsd-11-stable/lib/libexecinfo/Makefile
/freebsd-11-stable/lib/libgcc_eh/Makefile.inc
/freebsd-11-stable/lib/libomp/Makefile
/freebsd-11-stable/share/doc/llvm/Makefile
/freebsd-11-stable/share/doc/llvm/clang/Makefile
/freebsd-11-stable/share/mk/bsd.clang-analyze.mk
Makefile
/freebsd-11-stable/stand/libsa/Makefile
/freebsd-11-stable/usr.bin/clang/bugpoint/Makefile
/freebsd-11-stable/usr.bin/clang/clang-format/Makefile
/freebsd-11-stable/usr.bin/clang/clang-tblgen/Makefile
/freebsd-11-stable/usr.bin/clang/clang/Makefile
/freebsd-11-stable/usr.bin/clang/llc/Makefile
/freebsd-11-stable/usr.bin/clang/lld/Makefile
/freebsd-11-stable/usr.bin/clang/lldb-tblgen/Makefile
/freebsd-11-stable/usr.bin/clang/lldb/Makefile
/freebsd-11-stable/usr.bin/clang/lli/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-ar/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-as/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-bcanalyzer/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-cov/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-cxxdump/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-cxxfilt/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-diff/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-dis/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-dwarfdump/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-extract/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-link/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-lto/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-lto2/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-mc/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-mca/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-modextract/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-nm/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-objcopy/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-objdump/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-pdbutil/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-profdata/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-rtdyld/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-symbolizer/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-tblgen/Makefile
/freebsd-11-stable/usr.bin/clang/llvm-xray/Makefile
/freebsd-11-stable/usr.bin/clang/opt/Makefile
351515 26-Aug-2019 kevans

MFC r351119, r351135-r351136, r351412: stand xtoolchain-llvm90 fixes

r351119:
stand: push LIBC_SRC up into defs.mk

Other parts of stand/ that don't use libsa will need to grab bits from libc
shortly. Push LIBC_SRC up to defs.mk in advance of this so that they can use
it, and rename it to LIBCSRC to match the convention of the rest of the *SRC
variables in this file.

r351135:
stand: boot2: fix build with xtoolchain-llvm90

ufsread.c grows a dependency on __ashldi3 with llvm90. Grab ashldi3.c out of
compiler-rt rather than trying to link against libsa (for now).
-Wno-missing-prototypes is necessary to compile ashldi3.c standalone.

r351136:
stand: gptboot: fix build with xtoolchain-llvm90

ufsread.c grows a dependency on __ashldi3 with llvm90. For gptboot, just
start pulling in ashldi3.c ashrdi3.c lshrdi3.c into libsa for all archs as
the number of archs requiring one or more of them keeps growing. qdivrem.c
and quad.h can be trivially kicked out of libsa if we start pulling these
from compiler-rt as qdivrem was only used to implement umoddi3, divdi3,
moddi3 (also in qdivrem.c).

r351412:
stand: boot2: fix amd64-xtoolchain-gcc build

-Wno-missing-declarations is the GCC equivalent of
-Wno-missing-prototypes... this was overlooked in r351135.

344399 21-Feb-2019 kevans

MFC GELI Loader Improvements: r336252, r336254, r336256, r336354,
r336532-r336534, r336537, r336626, r337326, r337349, r341071, r341160,
r341420, r341473, r341651, r342793

Note that this MFC contains some seemingly unrelated zfsloader bits -- this
was needed in order to pull in some later fixes for GELI hand-off w/ ZFS
bits included.

r336252:
Extend loader(8) geli support to all architectures and all disk-like devices.

This moves the bulk of the geli support from lib386/biosdisk.c into a new
geli/gelidev.c which implements a devsw-type device whose dv_strategy()
function handles geli decryption. Support for all arches comes from moving
the taste-and-attach code to the devopen() function in libsa.

After opening any DEVT_DISK device, devopen() calls the new function
geli_probe_and_attach(), which will "attach" the geli code to the open_file
struct by creating a geli_devdesc instance to replace the disk_devdesc
instance in the open_file. That routes all IO for the device through the
geli code.

A new public geli_add_key() function is added, to allow arch/vendor-specific
code to add keys obtained from custom hardware or other sources.

With these changes, geli support will be compiled into all variations of
loader(8) on all arches because the default is WITH_LOADER_GELI.

r336254:
Use if rather than case for a simple boolean. gcc thinks blks is
undefined sometimes with the case, but enc is always 0 or 1, so
and if / else is better anyway.

r336256:
Fix glitched indentation (and rewrap as needed due to deeper indent).
No functional changes.

r336354:
zfsboot: fix build with WITHOUT_LOADER_GELI

r336532:
Collapse zfsloader functionality back down into loader.

We no longer really need a separate zfsloader. It was useful when we
were first supporting ZFS and had limited ability to properly boot off
of ZFS without the special boot loader. Now that the boot loader has
matured, go the way loader.efi pioneered and just build one
binary. Change the name of the loader to load in the secondary boot
blocks to be just /boot/loader. Provide a symbolic link from zfsloader
to loader so people who have not upgraded their boot blocks are not
affected. This has the happy benefit of making coexistence easier as
well (fewer binaries in the matrix).

r336533:
Eliminate zfsloader man page.

Remove all cross references to zfsloader.8 and /boot/zfsloader.
Move ZFS specific info into loader.8.

r336534:
NM and OBJCOPY are already defined for all builds. There's no need to
conditionally define them here.

r336537:
Mention zfsloader being folded into loader in UPDATING.

r336626:
Older zfs boot blocks don't support symlinks. install the link to
zfsloader as a hard link. While newer ones do, the whole point of the
link was to transition to the new world order smoothly. A hard link is
less flexible, but it works and will result in fewer bumps. Adjust
UPDATING entry to match.

r337326:
loader: biosdisk.c has leftover geli header.

A small cleanup, remove unneeded #include.

r337349:
zfsboot: Fix startup crash

On a FreeNAS mini XL, with geli encrypted drives the loader crashed in
geli_read().

When we iterate over the list of disks and allocate the zfsdsk structures we
don’t zero out the gdev pointer. In one case that resulted in geli_read()
(called on the bogus pointer) dividing by zero.

Use calloc() to ensure the zfsdsk structure is always zeroed, so the pointer is
initialised to NULL. As a side benefit it gets rid of one #ifdef
LOADER_GELI_SUPPORT.

r341071:
Restore the ability to override the disk unit/partition at the boot: prompt
in gptboot.

When arch-independent geli support was added, a new static 'gdsk' struct
was added, but there was still a static 'dsk' struct, and when you typed
in an alternate disk/partition, the string was parsed into that struct,
which was then never used for anything. Now the string gets parsed into
gdsk.dsk, the struct that's actually used.

r341160:
Add comments describing the bootargs handoff between loader(8) and gptboot
or zfsboot, when loader(8) is the BTX loader. No functional changes.

r341420:
Eliminate duplicated code and struct member definitions in the handoff
of args data between gptboot/zfsboot and loader(8).

Despite what seems like a lot of changes here, there are no actual
changes in behavior, or in the data layout in the structures involved.
This is just eliminating identical code pasted into multiple locations.

In detail, the changes are...

- Move struct zfs_boot_args definition from libsa/zfs/libzfs.h to
i386/common/bootargs.h because it is specific to x86 booting and the
handoff between zfsboot and loader, and has no relation to the zfs
library code in general.

- The geli_boot_args and zfs_boot_args structs both contain an identical
set of member variables containing geli information. Extract this out
to a new geli_boot_data struct, and embed it in the arg-passing structs.

- Provide new routines geli_import_boot_data() and geli_export_boot_data()
that can be shared between gptboot, zfsboot, and loader instead of
pasting identical code into several different .c files.

- Remove some checks for a NULL pointer that can never be true because the
pointer being tested was set using pointer math (kargs + 1) and that can
never result in NULL in this code.

r341473:
Fix args cross-threading between gptboot(8) and loader(8) with zfs support.

When loader(8) is built with zfs support enabled, it assumes that any extarg
data present is a zfs_boot_args struct, but if the first-stage loader was
gptboot(8) the extarg data is actually a geli_boot_args struct. Luckily,
zfsboot(8) and gptzfsboot(8) have always passed KARGS_FLAGS_ZFS along with
KARGS_FLAGS_EXTARG, so we can use KARGS_FLAGS_ZFS to decide whether the
extarg data is a zfs_boot_args struct.

To avoid similar problems in the future, gptboot(8) now passes a new
KARGS_FLAGS_GELI to indicate that extarg data is geli_boot_args. In
loader(8), if the neither KARGS_FLAGS_ZFS nor KARGS_FLAGS_GELI is set but
extarg data is present (which will be the case for gptboot compiled before
this change), we now check for the known size of the geli_boot_args struct
passed by the older versions of gptboot as a way of confirming what type of
extarg data is present.

In a semi-related tidying up, since loader's main() has already decided
what type of extarg data is present and set the global 'zargs' var
accordingly, don't repeat the check in extract_currdev, just check whether
zargs is NULL or not.

r341651:
Don't reference zfs-specific variables if LOADER_ZFS_SUPPORT is undefined
because the variables will be undefined too.

r342793:
MK_ZFS -> {MK_ZFS|MK_LOADER_ZFS}, this is so we can diable userland / kernel
ZFS but keep the boot-loaders when using ZoL port.

Relnotes: yes (GELI support extended)
Relnotes: yes (zfsloader has been collapsed into loader and may be
removed after boot blocks have been updated)


/freebsd-11-stable/.gitattributes
/freebsd-11-stable/UPDATING
/freebsd-11-stable/share/mk/src.opts.mk
/freebsd-11-stable/stand/common/devopen.c
/freebsd-11-stable/stand/common/metadata.c
/freebsd-11-stable/stand/common/paths.h
/freebsd-11-stable/stand/defs.mk
/freebsd-11-stable/stand/efi/boot1/Makefile
/freebsd-11-stable/stand/efi/libefi/Makefile
/freebsd-11-stable/stand/efi/loader/Makefile
/freebsd-11-stable/stand/efi/loader/bootinfo.c
/freebsd-11-stable/stand/i386/Makefile
Makefile
/freebsd-11-stable/stand/i386/common/bootargs.h
/freebsd-11-stable/stand/i386/gptboot/Makefile
/freebsd-11-stable/stand/i386/gptboot/gptboot.c
/freebsd-11-stable/stand/i386/gptzfsboot/Makefile
/freebsd-11-stable/stand/i386/gptzfsboot/gptzfsboot.8
/freebsd-11-stable/stand/i386/isoboot/Makefile
/freebsd-11-stable/stand/i386/libi386/Makefile
/freebsd-11-stable/stand/i386/libi386/biosdisk.c
/freebsd-11-stable/stand/i386/libi386/bootinfo32.c
/freebsd-11-stable/stand/i386/libi386/bootinfo64.c
/freebsd-11-stable/stand/i386/loader/Makefile
/freebsd-11-stable/stand/i386/loader/main.c
/freebsd-11-stable/stand/i386/zfsboot/Makefile
/freebsd-11-stable/stand/i386/zfsboot/zfsboot.8
/freebsd-11-stable/stand/i386/zfsboot/zfsboot.c
/freebsd-11-stable/stand/i386/zfsloader/Makefile
/freebsd-11-stable/stand/libsa/Makefile
/freebsd-11-stable/stand/libsa/geli/Makefile.inc
/freebsd-11-stable/stand/libsa/geli/geli_metadata.c
/freebsd-11-stable/stand/libsa/geli/geliboot.c
/freebsd-11-stable/stand/libsa/geli/geliboot.h
/freebsd-11-stable/stand/libsa/geli/geliboot_crypto.c
/freebsd-11-stable/stand/libsa/geli/geliboot_internal.h
/freebsd-11-stable/stand/libsa/geli/gelidev.c
/freebsd-11-stable/stand/libsa/zfs/libzfs.h
/freebsd-11-stable/stand/loader.mk
/freebsd-11-stable/stand/lua/core.lua.8
/freebsd-11-stable/stand/man/Makefile
/freebsd-11-stable/stand/man/loader.8
/freebsd-11-stable/stand/man/zfsloader.8
/freebsd-11-stable/stand/sparc64/Makefile
/freebsd-11-stable/stand/sparc64/loader/Makefile
/freebsd-11-stable/stand/sparc64/zfsloader/Makefile
/freebsd-11-stable/stand/userboot/userboot/Makefile
/freebsd-11-stable/stand/userboot/userboot/bootinfo32.c
/freebsd-11-stable/tools/build/options/WITHOUT_LOADER_ZFS
/freebsd-11-stable/tools/build/options/WITHOUT_ZFS
332130 06-Apr-2018 kevans

MFC r329726, r329737, r329740

r329726:
Honor settings for including / excluding cd9660, ufs, ext2fs and msdos.

The Makefile gives the impression that ext2fs and msdos were excluded
(they weren't) and that you could exclude cd9660 and ufs support (you
couldn't). Allow those to be excluded.

We need to look, in the future, at trimming the number of supported
filesystems, and this will make that easier.

r329737:
Purely whitespace changes bringing this file closer to style(9).

Curiously, changing whitespace seems to cause the md5 of the .o files to differ
these days hence the following testing strategy:

Tested by: objdump -d | md5 (both in-tree clang and lang/gcc6)

r329740:
Further style(9) changes.

Tested by: objdump -d | md5 (both in-tree clang and lang/gcc6)

329175 12-Feb-2018 kevans

MFC Loader Fixes 2017q4p7: r324844,r326089,r326926,r326440,r326484,r326494,
r326588,r326708,r326784,r326914,r327390,r328446,r326090,r326143,r326144,
r326182,r326384,r326421,r326440,r326441,r326442,r326443,r326444,r326445,
r326446,r326447,r326448,r326484,r326485,r326486,r326487,r326488,r326490,
r326491,r326492,r326493,r326494,r326495,r326504,r326507,r326509,r326584,
r326585,r326586,r326587,r326588,r326589,r326590,r326591,r326592,r326593,
r326594,r326600,r326616,r326671,r326707,r326708,r326709,r326710,r326711,
r326712,r326714,r326720,r326768,r326772,r326784,r326792,r326812,r326854,
r326855,r326856,r326858,r326886,r326887,r326914,r326926,r326927,r326960,
r326961,r326962,r326963,r327351,r327453,r327390,r327523,r327524,r326489,
r327880,r328437,r328438,r328439,r328441,r328446,r328448,r328449,r328612,
r328613,r328615

While here, undo our libfdt hack of not including <stdlib.h> if we're
compiling _STANDALONE.

r324844: When building standalone, don't define errno. Let the definition from
stand.h override. This is similar to what we do in the kernel.

r326089: loader.efi: efipart does not recognize partitionless disks

r326090: net_parse_rootpath() has no parameters

r326143: Fix theoretical integer overflow issues. If the product here is

r326144: Mark the func pointer as __dead2. It looks up loader_main, which

r326182: Modify all FreeBSD bootloaders on PowerPC AIM (Book-S) systems

r326384: Use const pointers to avoid casting away constness.

r326421: loader.efi: efipart should exclude iPXE stub block protocol

r326440: Remove stale dependency on ufsread.c

r326441: Minor flags cleanup

r326442: Cleanup CFALGS usage here

r326443: We don't need both _STAND and _STANDALONE, use the latter.

r326444: Move geli to common DO32 stuff

r326445: Fix random() and srandom() prototypes to match the standard.

r326446: Undefine _STANDALONE since this is test code.

r326447: Tweaks to the beri boot loader so that it builds w/o warnings.

r326448: Fix all warnings related to geli and ZFS support on x86.

r326484: Const poison the propname.

r326485: Delcare md_load in libofw.h. Make all prototypes match for ofw

r326486: Include machine/md_var to pick up __syncicache prototype.

r326487: Cast mdp (a vm_offset_t) to void * to match prototype.

r326488: e_entry can be smaller than a pointer. Cast it to an intptr_t

r326490: Declare our strange brand of main().

r326491: Disconnet ps3 from the build. There's too many warnings to fix.

r326492: Cast void * pointer to char * so the arg matches the %s format.

r326493: Provide a md_load64 prototype.

r326494: Mark two things as unused (since they are only sometimes used)

r326495: Now it's safe to bump WARNS to 1.

r326504: Switch to proper MK_LOADER_GELI tests.

r326507: increase maximum size of zfsboot

r326509: loader.efi: add note about iPXE into the efipart.c

r326584: When building standalone, include stand.h rather than the kernel

r326585: Include ficl.h before anything else

r326586: No need to include the userland md5.h, the kernel one is just fine.

r326587: Use the kernel relative paths, rather than the userland relative
paths

r326588: Need to include skein in the include path

r326589: Make sure we include the right path for skein.h

r326590: Prefer stdint.h to inttypes.h

r326591: This isn't NetBSD specific code. Include these for any kernel /

r326592: Don't inherit CFLAGS. This a specialized test program.

r326593: Stop building with the standard system headers.

r326594: Now that we offer a semi-sane standards-ish set of #include files,
stop hacking includes with sed.

r326600: Since this is contrib code, create an upstreamable version of my

r326616: dhcp_try_rfc1048() is not used any more

r326671: Avoid setting -Wno-tentative-definition-incomplete-type with gcc.

r326707: Add partial support signal.h functioanlity. Pull in
machine/signal.h

r326708: Remove _KERNEL hack now that errno.h does the right thing when
built standalone.

r326709: Provide implementations for iscntrl, ispunct and isgraph.

r326710: Put the files we're copying over into a few variables and clean
hings up.

r326711: Const poison a couple of interfaces.

r326712: Create interp class.

r326714: boot1.c needs EFI_ZFS_BOOT too, so add it globally.

r326720: This path belongs in ficl/Makefile, not the common defines for
users

r326768: Fix a comment to be more accurate

r326772: Fix regression with lua import

r326784: Revert part of 362772. It was causing problems for includes

r326792: Attempt to unbreak buildworld

r326812: Revert r326792, r326784, r326772, r326712

r326854: libefi: make efichar.h more usable in stand code

r326855: Cargo cut a fix for the regressions r326585 caused.

r326856: Fix comments after bump in size.

r326858: Revert r326855: Cargo cut a fix for the regressions r326585 caused.

r326886: Panic in sbrk if setheap hasn't been called yet. This is preferable
o a mysterious crash

r326887: Remove the 'mini libstand in libstand' that util.[ch] provided.

r326914: Move loader-only defines to loader.mk from defs.mk

r326926: Move loader help file definitions to being 100% inside of
loader.mk.

r326927: libficl is only ever used in a loader (never a boot) program. Move
it.

r326960: Simplify things a little. The RETURN macro isn't required.

r326961: Interact is always called with NULL. Simplify code a little

r326962: Hoist btx include stuff to i386/Makefile.inc

r326963: No need to use relative paths like this here.

r327351: Fix ubldr. uboot/lib uses defines for the loader.

r327453: Add a validbcd() routine that uses the bcd2bin_data[] array

r327390: Garbage-collect loader.ps3. It is currently disconnected from the
build and kboot replaces.

r327523: Don't clobber system LDFLAGS for beri boot loaders.

r327524: Use 'extern uint8_t' instead of 'extern void' for external symbols.

r326489: Allow this file to be used in libsa without warning...

r327880: Move getsecs() prototype to stand.h from net.h so it can be used

r328437: Split panic routine

r328438: Implement abort() as a call to panic.

r328439: Provide abs form stdlib.h.

r328441: abort() should be marked __dead2 since it won't return.

r328446: Now that exit is __dead2, we need to tag ub_exit() as __dead2.

r328448: Make exit() never return until host_exit can be written.

r328449: Tag unreachable places as such. I left the while (1); in place

r328612: Move strtold wrapper from strtol.c to its own strtold.c.

r328613: Kill copies of strtol and strtoul.

r328615: Update stand.h for changes for strto*l

PR: 223969


/freebsd-11-stable/contrib/compiler-rt/lib/builtins/int_lib.h
/freebsd-11-stable/lib/libc/stdlib/Makefile.inc
/freebsd-11-stable/lib/libc/stdlib/strtol.c
/freebsd-11-stable/lib/libc/stdlib/strtold.c
/freebsd-11-stable/stand/Makefile.amd64
/freebsd-11-stable/stand/Makefile.i386
/freebsd-11-stable/stand/Makefile.inc
/freebsd-11-stable/stand/arm/uboot/Makefile
/freebsd-11-stable/stand/common/bootstrap.h
/freebsd-11-stable/stand/common/dev_net.c
/freebsd-11-stable/stand/common/interp.c
/freebsd-11-stable/stand/common/interp_backslash.c
/freebsd-11-stable/stand/common/interp_forth.c
/freebsd-11-stable/stand/common/interp_parse.c
/freebsd-11-stable/stand/common/load_elf.c
/freebsd-11-stable/stand/common/load_elf_obj.c
/freebsd-11-stable/stand/common/reloc_elf.c
/freebsd-11-stable/stand/defs.mk
/freebsd-11-stable/stand/efi/boot1/Makefile
/freebsd-11-stable/stand/efi/boot1/boot1.c
/freebsd-11-stable/stand/efi/include/efichar.h
/freebsd-11-stable/stand/efi/libefi/Makefile
/freebsd-11-stable/stand/efi/libefi/efichar.c
/freebsd-11-stable/stand/efi/libefi/efipart.c
/freebsd-11-stable/stand/efi/loader/Makefile
/freebsd-11-stable/stand/efi/loader/main.c
/freebsd-11-stable/stand/ficl.mk
/freebsd-11-stable/stand/ficl/Makefile
/freebsd-11-stable/stand/ficl/float.c
/freebsd-11-stable/stand/geli/Makefile
/freebsd-11-stable/stand/geli/geliboot.c
/freebsd-11-stable/stand/geli/geliboot_internal.h
/freebsd-11-stable/stand/i386/Makefile.inc
Makefile
/freebsd-11-stable/stand/i386/common/cons.c
/freebsd-11-stable/stand/i386/common/drv.c
/freebsd-11-stable/stand/i386/gptboot/Makefile
/freebsd-11-stable/stand/i386/gptboot/gptboot.c
/freebsd-11-stable/stand/i386/gptboot/gptldr.S
/freebsd-11-stable/stand/i386/gptzfsboot/Makefile
/freebsd-11-stable/stand/i386/libfirewire/Makefile
/freebsd-11-stable/stand/i386/libi386/Makefile
/freebsd-11-stable/stand/i386/libi386/biosdisk.c
/freebsd-11-stable/stand/i386/libi386/multiboot.c
/freebsd-11-stable/stand/i386/loader/Makefile
/freebsd-11-stable/stand/i386/loader/main.c
/freebsd-11-stable/stand/i386/zfsboot/Makefile
/freebsd-11-stable/stand/i386/zfsboot/zfsboot.c
/freebsd-11-stable/stand/libsa/Makefile
/freebsd-11-stable/stand/libsa/abort.c
/freebsd-11-stable/stand/libsa/bootp.c
/freebsd-11-stable/stand/libsa/bootp.h
/freebsd-11-stable/stand/libsa/cd9660.c
/freebsd-11-stable/stand/libsa/gpt.c
/freebsd-11-stable/stand/libsa/net.h
/freebsd-11-stable/stand/libsa/panic.c
/freebsd-11-stable/stand/libsa/sbrk.c
/freebsd-11-stable/stand/libsa/stand.h
/freebsd-11-stable/stand/libsa/strtol.c
/freebsd-11-stable/stand/libsa/strtoul.c
/freebsd-11-stable/stand/libsa/util.c
/freebsd-11-stable/stand/libsa/util.h
/freebsd-11-stable/stand/libsa/xlocale_private.h
/freebsd-11-stable/stand/loader.mk
/freebsd-11-stable/stand/mips/beri/boot2/Makefile
/freebsd-11-stable/stand/mips/beri/boot2/boot2.c
/freebsd-11-stable/stand/mips/beri/common/altera_jtag_uart.c
/freebsd-11-stable/stand/mips/beri/common/cfi.c
/freebsd-11-stable/stand/mips/beri/common/sdcard.c
/freebsd-11-stable/stand/mips/beri/loader/Makefile
/freebsd-11-stable/stand/mips/beri/loader/devicename.c
/freebsd-11-stable/stand/mips/beri/loader/exec.c
/freebsd-11-stable/stand/mips/beri/loader/loader.h
/freebsd-11-stable/stand/mips/beri/loader/main.c
/freebsd-11-stable/stand/mips/uboot/Makefile
/freebsd-11-stable/stand/mips/uboot/conf.c
/freebsd-11-stable/stand/ofw/common/main.c
/freebsd-11-stable/stand/ofw/libofw/elf_freebsd.c
/freebsd-11-stable/stand/ofw/libofw/libofw.h
/freebsd-11-stable/stand/ofw/libofw/openfirm.c
/freebsd-11-stable/stand/ofw/libofw/openfirm.h
/freebsd-11-stable/stand/ofw/libofw/ppc64_elf_freebsd.c
/freebsd-11-stable/stand/powerpc/Makefile
/freebsd-11-stable/stand/powerpc/boot1.chrp/Makefile
/freebsd-11-stable/stand/powerpc/boot1.chrp/boot1.c
/freebsd-11-stable/stand/powerpc/kboot/Makefile
/freebsd-11-stable/stand/powerpc/kboot/host_syscall.h
/freebsd-11-stable/stand/powerpc/kboot/hostdisk.c
/freebsd-11-stable/stand/powerpc/kboot/kbootfdt.c
/freebsd-11-stable/stand/powerpc/kboot/main.c
/freebsd-11-stable/stand/powerpc/kboot/ppc64_elf_freebsd.c
/freebsd-11-stable/stand/powerpc/ofw/Makefile
/freebsd-11-stable/stand/powerpc/ofw/start.c
/freebsd-11-stable/stand/powerpc/ps3
/freebsd-11-stable/stand/powerpc/uboot/Makefile
/freebsd-11-stable/stand/sparc64/boot1/Makefile
/freebsd-11-stable/stand/sparc64/loader/Makefile
/freebsd-11-stable/stand/sparc64/loader/main.c
/freebsd-11-stable/stand/sparc64/loader/metadata.c
/freebsd-11-stable/stand/uboot/common/main.c
/freebsd-11-stable/stand/uboot/lib/glue.c
/freebsd-11-stable/stand/uboot/lib/glue.h
/freebsd-11-stable/stand/userboot/test/Makefile
/freebsd-11-stable/stand/userboot/test/test.c
/freebsd-11-stable/stand/userboot/userboot/Makefile
/freebsd-11-stable/stand/userboot/userboot/main.c
/freebsd-11-stable/stand/zfs/zfsimpl.c
/freebsd-11-stable/sys/cddl/boot/zfs/zfssubr.c
/freebsd-11-stable/sys/contrib/libfdt/libfdt_env.h
/freebsd-11-stable/sys/geom/eli/g_eli_hmac.c
/freebsd-11-stable/sys/geom/eli/pkcs5v2.c
/freebsd-11-stable/sys/opencrypto/xform_userland.h
/freebsd-11-stable/sys/sys/errno.h
/freebsd-11-stable/sys/sys/libkern.h
/freebsd-11-stable/sys/sys/syslimits.h
329145 12-Feb-2018 kevans

MFC r325834,r325997,326502: Move sys/boot to stand/

This is effectively a direct commit to stable/11, due to differences between
stable/11 and head. Changes to DTS in sys/boot/fdt/dts were often
accompanied by kernel changes. Many of these were also risc-v updates that
likely had many more dependencies to MFC.

Because of this, sys/boot/fdt/dts remains as-is while everything else in
sys/boot relocates to stand/.

r325834: Move sys/boot to stand. Fix all references to new location

r325997: Remove empty directories.

r326502: Document the sys/boot -> stand move in hier.7 and the top-level README.


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/Makefile.inc1
/freebsd-11-stable/README
/freebsd-11-stable/lib/libefivar/Makefile
/freebsd-11-stable/release/powerpc/generate-hfs.sh
/freebsd-11-stable/release/tools/vmimage.subr
/freebsd-11-stable/share/examples/bootforth/README
/freebsd-11-stable/share/examples/etc/make.conf
/freebsd-11-stable/share/man/man5/make.conf.5
/freebsd-11-stable/share/man/man7/hier.7
/freebsd-11-stable/share/man/man8/diskless.8
/freebsd-11-stable/stand
/freebsd-11-stable/stand/Makefile
/freebsd-11-stable/stand/Makefile.amd64
/freebsd-11-stable/stand/Makefile.arm
/freebsd-11-stable/stand/Makefile.arm64
/freebsd-11-stable/stand/Makefile.i386
/freebsd-11-stable/stand/Makefile.inc
/freebsd-11-stable/stand/Makefile.mips
/freebsd-11-stable/stand/Makefile.pc98
/freebsd-11-stable/stand/Makefile.powerpc
/freebsd-11-stable/stand/Makefile.sparc64
/freebsd-11-stable/stand/arm
/freebsd-11-stable/stand/arm64
/freebsd-11-stable/stand/common
/freebsd-11-stable/stand/defs.mk
/freebsd-11-stable/stand/efi
/freebsd-11-stable/stand/fdt
/freebsd-11-stable/stand/fdt.mk
/freebsd-11-stable/stand/fdt/Makefile
/freebsd-11-stable/stand/fdt/Makefile.depend
/freebsd-11-stable/stand/fdt/fdt_loader_cmd.c
/freebsd-11-stable/stand/fdt/fdt_platform.h
/freebsd-11-stable/stand/fdt/help.fdt
/freebsd-11-stable/stand/ficl
/freebsd-11-stable/stand/ficl.mk
/freebsd-11-stable/stand/ficl32
/freebsd-11-stable/stand/forth
/freebsd-11-stable/stand/forth/pnp.4th
/freebsd-11-stable/stand/forth/support.4th
/freebsd-11-stable/stand/geli
/freebsd-11-stable/stand/i386
/freebsd-11-stable/stand/i386/Makefile.inc
/freebsd-11-stable/stand/kshim
/freebsd-11-stable/stand/libsa
/freebsd-11-stable/stand/libsa32
/freebsd-11-stable/stand/loader.mk
/freebsd-11-stable/stand/man
/freebsd-11-stable/stand/mips
/freebsd-11-stable/stand/ofw
/freebsd-11-stable/stand/pc98
/freebsd-11-stable/stand/pc98/Makefile.inc
/freebsd-11-stable/stand/powerpc
/freebsd-11-stable/stand/sparc64
/freebsd-11-stable/stand/uboot
/freebsd-11-stable/stand/uboot.mk
/freebsd-11-stable/stand/usb
/freebsd-11-stable/stand/userboot
/freebsd-11-stable/stand/userboot/ficl
/freebsd-11-stable/stand/userboot/libstand
/freebsd-11-stable/stand/userboot/zfs
/freebsd-11-stable/stand/zfs
/freebsd-11-stable/stand/zfs32
/freebsd-11-stable/sys/Makefile
/freebsd-11-stable/sys/boot/Makefile
/freebsd-11-stable/sys/boot/Makefile.amd64
/freebsd-11-stable/sys/boot/Makefile.arm
/freebsd-11-stable/sys/boot/Makefile.arm64
/freebsd-11-stable/sys/boot/Makefile.i386
/freebsd-11-stable/sys/boot/Makefile.inc
/freebsd-11-stable/sys/boot/Makefile.mips
/freebsd-11-stable/sys/boot/Makefile.pc98
/freebsd-11-stable/sys/boot/Makefile.powerpc
/freebsd-11-stable/sys/boot/Makefile.sparc64
/freebsd-11-stable/sys/boot/arm
/freebsd-11-stable/sys/boot/arm64
/freebsd-11-stable/sys/boot/common
/freebsd-11-stable/sys/boot/defs.mk
/freebsd-11-stable/sys/boot/efi
/freebsd-11-stable/sys/boot/fdt.mk
/freebsd-11-stable/sys/boot/fdt/Makefile
/freebsd-11-stable/sys/boot/fdt/Makefile.depend
/freebsd-11-stable/sys/boot/fdt/fdt_loader_cmd.c
/freebsd-11-stable/sys/boot/fdt/fdt_platform.h
/freebsd-11-stable/sys/boot/fdt/help.fdt
/freebsd-11-stable/sys/boot/ficl
/freebsd-11-stable/sys/boot/ficl.mk
/freebsd-11-stable/sys/boot/ficl32
/freebsd-11-stable/sys/boot/forth
/freebsd-11-stable/sys/boot/geli
/freebsd-11-stable/sys/boot/i386
/freebsd-11-stable/sys/boot/kshim
/freebsd-11-stable/sys/boot/libsa
/freebsd-11-stable/sys/boot/libsa32
/freebsd-11-stable/sys/boot/loader.mk
/freebsd-11-stable/sys/boot/man
/freebsd-11-stable/sys/boot/mips
/freebsd-11-stable/sys/boot/ofw
/freebsd-11-stable/sys/boot/pc98
/freebsd-11-stable/sys/boot/powerpc
/freebsd-11-stable/sys/boot/sparc64
/freebsd-11-stable/sys/boot/uboot
/freebsd-11-stable/sys/boot/uboot.mk
/freebsd-11-stable/sys/boot/usb
/freebsd-11-stable/sys/boot/userboot
/freebsd-11-stable/sys/boot/zfs
/freebsd-11-stable/sys/boot/zfs32
/freebsd-11-stable/sys/contrib/dev/acpica/acpica_prep.sh
/freebsd-11-stable/tools/boot/universe.sh
/freebsd-11-stable/tools/tools/bootparttest/Makefile
/freebsd-11-stable/tools/tools/zfsboottest/Makefile
/freebsd-11-stable/usr.sbin/bhyveload/Makefile
329140 11-Feb-2018 kevans

MFC Loader Fixes 2017q4p6: r324649,r324650,r324651,r324652,r324653,r324654,
r324700,r324702,r324709,r324717,r324719,r324841,r324842,r324843,r324845,
r324850,r324876,r324877,r324878,r324879,r324880,r324881,r324883,r324980,
r324981,r324982,r324995,r325014,r325093,r325094,r325114,r325170,r325171,
r325172,r325173,r325174,r325175,r325176,r325248,r325286,r325310,r325332,
r325338,r325339,r325376,r325377,r325379,r325380,r325382,r325478,r325479,
r325480,r325482,r325483,r325484,r325485,r325556,r325641,r325681,r325685,
r325686,r325687,r325688,r325689,r325690,r325691,r325692,r325693,r325694,
r325743,r325744,r325748,r325775,r325779,r325780

r324649: Move common/Makefile.inc to sys/boot/loader.mk.

r324650: tweak style

r324651: create defs.mk for common definitions

r324652: Move all the ficl common code into ficl.mk

r324653: LOADER_foo_SUPPORTED

r324654: Explicitly inlcude SYSDIR in the include path

r324700: loader: initialize dv_cleanup in md.c to eliminate clang warning

r324702: We need to include disk.o in libuboot.a when we're building with
support for disk access.

r324709: Revert "Unify boot1 with loader" change r324646

r324717: libsa/ip.c: misplaced comment, ip_v is half char, not ip_p

r324719: libsa/ip: stop read loop on bad fragments

r324841: Use BOOTDIR more consistently in defs.mk rather than repeat
sys/boot.

r324842: Introduce BOOTOBJ: The top level object directory for the boot tree

r324843: Stopgap fix to the mistmatch between LOADER_GELI_SUPPORT and
LOADER_NO_GELI_SUPPORT.

r324845: Use BOOTOBJ and BOOTDIR to find geli includes and libraries.

r324850: Define LIBSA32 to LIBSA on i386 to fix build.

r324876: Move fdt and uboot defines into common uboot.mk.

r324877: End source directories with SRC rather than a hodgepodge of names

r324878: Make at91 boot loader compile again.

r324879: Prefer SRCTOP paths for bits we're grabbing from libc.

r324880: Use BOOTSRC here.

r324881: Use SYSDIR instead of ${.CURDIR}/../..<etc>/sys.

r324883: Use preferred defined paths, rather than relative paths in fdt.

r324980: Use BOOTDIR consistently.

r324981: Move BINDIR definition to defs.mk, and override where it isn't
/boot

r324982: Remove sys/boot/arm/at91 and ixp425

r324995: loader.efi: Make framebuffer commands available for arm64

r325014: Add a 'place holder' arm struct efi_fb until a real one comes

r325093: Define new EFI variables

r325094: Cleanup non-arch Makefiles

r325114: Use defs.mk defins in most MD code

r325170: Use defs.mk values for userboot

r325171: Use defs.mk name and prefer bsd.init.mk

r325172: Remove the -nostdlib stuff I added. Instead, fix LDFLAGS to be
honored correctly with the new Makefile.inc include order.

r325173: We don't need to build a special ficl for userboot.

r325174: Minor cleanup

r325175: For amd64, compile both zfs and zfs32 libraries.

r325176: Actually add zfs32/Makefile

r325248: loader ptblread() is broken with >512B sectors

r325286: efipart_strategy is using wrong offset with >512B sectors

r325310: zfs.c:vdev_read() needs to be careful about large sectors

r325332: loader: re-enable gzip support for x86

r325338: loader: fix BOOTSRC -> BOOTOBJ in a library path

r325339: This used to have bzip2 support too.

r325376: WIP: centralize machine links

r325377: mostly libsa

r325379: Revert "mostly libsa"

r325380: Revert "WIP: centralize machine links"

r325382: Cleanup stray libstand names to be libsa names.

r325478: Powerpc is a 32-bit boot loader.

r325479: Define LIBFICL32 to be libficl.a on i386 and libficl32.a on amd64.

r325480: Use DO32 for all the places that we need to flag we're building a
32-bit version of a library.

r325482: Move machine and other link creation to defs.mk

r325483: MACHINE can never be powerpc64, so cleanup code that thinks it can.

r325484: Prefer bsd.init.mk to src.opts.mk

r325485: Centralize all 32-bit builds on 64-bit platform stuff.

r325556: loader: set options before including bsd.init.mk

r325641: loader.efi: efi_devpath_is_prefix should return bool

r325681: boot1: avoid using NULL device path

r325685: libsa32 isn't needed for i386. It's already a 32-bit platform.

r325686: Simplify this if to a direct assignment.

r325687: Remove all the empty help files from the powerpc build.

r325688: FDT support doesn't make sense for ps3, remove it.

r325689: Remove LOADER_FDT_SUPPORT as a Makefile variable.

r325690: Remove LOADER_ZFS_SUPPORT as a Makefile variable

r325691: Remove useless PNP define here.

r325692: Replace LOADER_FIREWIRE_SUPPORT variable

r325693: Move LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI

r325694: Install the 4th files in sys/boot/forth instead of each loader

r325743: Make sure the proper loader.rc gets installed.

r325744: boot1: also check for NULL device

r325748: Use proper include file.

r325775: Add loader.conf to the list of files that are MD.

r325779: Add /boot/dts to the list of default modules.

r325780: Don't add /boot/dt*s* but /boot/dt*b*. Stupid think-o.


/freebsd-11-stable/UPDATING
/freebsd-11-stable/share/mk/src.opts.mk
/freebsd-11-stable/sys/arm/include/metadata.h
/freebsd-11-stable/sys/arm64/include/metadata.h
/freebsd-11-stable/sys/boot/Makefile
/freebsd-11-stable/sys/boot/Makefile.amd64
/freebsd-11-stable/sys/boot/Makefile.arm
/freebsd-11-stable/sys/boot/Makefile.arm64
/freebsd-11-stable/sys/boot/Makefile.i386
/freebsd-11-stable/sys/boot/Makefile.inc
/freebsd-11-stable/sys/boot/Makefile.powerpc
/freebsd-11-stable/sys/boot/Makefile.sparc64
/freebsd-11-stable/sys/boot/arm/at91/Makefile
/freebsd-11-stable/sys/boot/arm/at91/Makefile.inc
/freebsd-11-stable/sys/boot/arm/at91/boot0/Makefile
/freebsd-11-stable/sys/boot/arm/at91/boot0/README
/freebsd-11-stable/sys/boot/arm/at91/boot0/linker.cfg
/freebsd-11-stable/sys/boot/arm/at91/boot0/main.c
/freebsd-11-stable/sys/boot/arm/at91/boot0iic/Makefile
/freebsd-11-stable/sys/boot/arm/at91/boot0iic/main.c
/freebsd-11-stable/sys/boot/arm/at91/boot0spi/Makefile
/freebsd-11-stable/sys/boot/arm/at91/boot0spi/main.c
/freebsd-11-stable/sys/boot/arm/at91/boot2/Makefile
/freebsd-11-stable/sys/boot/arm/at91/boot2/board.h
/freebsd-11-stable/sys/boot/arm/at91/boot2/boot2.c
/freebsd-11-stable/sys/boot/arm/at91/boot2/bwct_board.c
/freebsd-11-stable/sys/boot/arm/at91/boot2/centipad_board.c
/freebsd-11-stable/sys/boot/arm/at91/boot2/kb920x_board.c
/freebsd-11-stable/sys/boot/arm/at91/bootiic/Makefile
/freebsd-11-stable/sys/boot/arm/at91/bootiic/README
/freebsd-11-stable/sys/boot/arm/at91/bootiic/env_vars.c
/freebsd-11-stable/sys/boot/arm/at91/bootiic/env_vars.h
/freebsd-11-stable/sys/boot/arm/at91/bootiic/loader_prompt.c
/freebsd-11-stable/sys/boot/arm/at91/bootiic/loader_prompt.h
/freebsd-11-stable/sys/boot/arm/at91/bootiic/main.c
/freebsd-11-stable/sys/boot/arm/at91/bootspi/Makefile
/freebsd-11-stable/sys/boot/arm/at91/bootspi/README
/freebsd-11-stable/sys/boot/arm/at91/bootspi/ee.c
/freebsd-11-stable/sys/boot/arm/at91/bootspi/ee.h
/freebsd-11-stable/sys/boot/arm/at91/bootspi/env_vars.c
/freebsd-11-stable/sys/boot/arm/at91/bootspi/env_vars.h
/freebsd-11-stable/sys/boot/arm/at91/bootspi/loader_prompt.c
/freebsd-11-stable/sys/boot/arm/at91/bootspi/loader_prompt.h
/freebsd-11-stable/sys/boot/arm/at91/bootspi/main.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/Makefile
/freebsd-11-stable/sys/boot/arm/at91/libat91/arm_init.S
/freebsd-11-stable/sys/boot/arm/at91/libat91/at91rm9200.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/delay.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/eeprom.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/emac.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/emac.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/emac_init.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/getc.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/lib.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/lib_AT91RM9200.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/mci_device.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/memcmp.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/memcpy.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/memset.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/p_string.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/printf.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/putchar.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/reset.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/sd-card.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/sd-card.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/spi_flash.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/spi_flash.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/strcmp.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/strcpy.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/strcvt.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/strlen.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/tag_list.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/tag_list.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/xmodem.c
/freebsd-11-stable/sys/boot/arm/at91/linker.cfg
/freebsd-11-stable/sys/boot/arm/ixp425/Makefile.inc
/freebsd-11-stable/sys/boot/arm/ixp425/boot2/Makefile
/freebsd-11-stable/sys/boot/arm/ixp425/boot2/arm_init.S
/freebsd-11-stable/sys/boot/arm/ixp425/boot2/boot2.c
/freebsd-11-stable/sys/boot/arm/ixp425/boot2/cf_ata.h
/freebsd-11-stable/sys/boot/arm/ixp425/boot2/ixp425_board.c
/freebsd-11-stable/sys/boot/arm/ixp425/boot2/lib.h
/freebsd-11-stable/sys/boot/arm/loader
/freebsd-11-stable/sys/boot/arm/loader/loader.conf
/freebsd-11-stable/sys/boot/arm/uboot/Makefile
/freebsd-11-stable/sys/boot/arm/uboot/loader.conf
/freebsd-11-stable/sys/boot/common/Makefile.inc
/freebsd-11-stable/sys/boot/common/disk.c
/freebsd-11-stable/sys/boot/common/md.c
/freebsd-11-stable/sys/boot/defs.mk
/freebsd-11-stable/sys/boot/efi/Makefile
/freebsd-11-stable/sys/boot/efi/Makefile.inc
/freebsd-11-stable/sys/boot/efi/boot1/Makefile
/freebsd-11-stable/sys/boot/efi/boot1/boot1.c
/freebsd-11-stable/sys/boot/efi/boot1/boot_module.h
/freebsd-11-stable/sys/boot/efi/boot1/ufs_module.c
/freebsd-11-stable/sys/boot/efi/boot1/zfs_module.c
/freebsd-11-stable/sys/boot/efi/fdt/Makefile
/freebsd-11-stable/sys/boot/efi/include/efilib.h
/freebsd-11-stable/sys/boot/efi/libefi/Makefile
/freebsd-11-stable/sys/boot/efi/libefi/devpath.c
/freebsd-11-stable/sys/boot/efi/libefi/efi_main.c
/freebsd-11-stable/sys/boot/efi/libefi/efipart.c
/freebsd-11-stable/sys/boot/efi/loader/Makefile
/freebsd-11-stable/sys/boot/efi/loader/arch/amd64/Makefile.inc
/freebsd-11-stable/sys/boot/efi/loader/arch/amd64/framebuffer.c
/freebsd-11-stable/sys/boot/efi/loader/arch/amd64/framebuffer.h
/freebsd-11-stable/sys/boot/efi/loader/arch/arm/Makefile.inc
/freebsd-11-stable/sys/boot/efi/loader/arch/arm64/Makefile.inc
/freebsd-11-stable/sys/boot/efi/loader/arch/i386/Makefile.inc
/freebsd-11-stable/sys/boot/efi/loader/bootinfo.c
/freebsd-11-stable/sys/boot/efi/loader/efi_main.c
/freebsd-11-stable/sys/boot/efi/loader/framebuffer.c
/freebsd-11-stable/sys/boot/efi/loader/framebuffer.h
/freebsd-11-stable/sys/boot/fdt.mk
/freebsd-11-stable/sys/boot/fdt/Makefile
/freebsd-11-stable/sys/boot/ficl.mk
/freebsd-11-stable/sys/boot/ficl/Makefile
/freebsd-11-stable/sys/boot/ficl32/Makefile
/freebsd-11-stable/sys/boot/forth/Makefile
/freebsd-11-stable/sys/boot/forth/Makefile.inc
/freebsd-11-stable/sys/boot/forth/loader.conf
/freebsd-11-stable/sys/boot/geli/Makefile
/freebsd-11-stable/sys/boot/i386/Makefile
/freebsd-11-stable/sys/boot/i386/Makefile.inc
/freebsd-11-stable/sys/boot/i386/boot0/Makefile
/freebsd-11-stable/sys/boot/i386/boot2/Makefile
/freebsd-11-stable/sys/boot/i386/btx/btx/Makefile
/freebsd-11-stable/sys/boot/i386/btx/btxldr/Makefile
/freebsd-11-stable/sys/boot/i386/btx/lib/Makefile
/freebsd-11-stable/sys/boot/i386/cdboot/Makefile
/freebsd-11-stable/sys/boot/i386/gptboot/Makefile
/freebsd-11-stable/sys/boot/i386/gptzfsboot/Makefile
/freebsd-11-stable/sys/boot/i386/kgzldr/Makefile
/freebsd-11-stable/sys/boot/i386/libfirewire/Makefile
/freebsd-11-stable/sys/boot/i386/libi386/Makefile
/freebsd-11-stable/sys/boot/i386/loader/Makefile
/freebsd-11-stable/sys/boot/i386/mbr/Makefile
/freebsd-11-stable/sys/boot/i386/pmbr/Makefile
/freebsd-11-stable/sys/boot/i386/pxeldr/Makefile
/freebsd-11-stable/sys/boot/i386/zfsboot/Makefile
/freebsd-11-stable/sys/boot/i386/zfsloader/Makefile
/freebsd-11-stable/sys/boot/libsa/Makefile
/freebsd-11-stable/sys/boot/libsa/ip.c
/freebsd-11-stable/sys/boot/libsa32/Makefile
/freebsd-11-stable/sys/boot/loader.mk
/freebsd-11-stable/sys/boot/man/Makefile
/freebsd-11-stable/sys/boot/mips/beri/Makefile.inc
/freebsd-11-stable/sys/boot/mips/beri/boot2/Makefile
/freebsd-11-stable/sys/boot/mips/beri/loader/Makefile
/freebsd-11-stable/sys/boot/mips/uboot/Makefile
/freebsd-11-stable/sys/boot/ofw/Makefile.inc
/freebsd-11-stable/sys/boot/ofw/libofw/Makefile
/freebsd-11-stable/sys/boot/powerpc/Makefile
/freebsd-11-stable/sys/boot/powerpc/Makefile.inc
/freebsd-11-stable/sys/boot/powerpc/boot1.chrp/Makefile
/freebsd-11-stable/sys/boot/powerpc/kboot/Makefile
/freebsd-11-stable/sys/boot/powerpc/kboot/help.kboot
/freebsd-11-stable/sys/boot/powerpc/ofw/Makefile
/freebsd-11-stable/sys/boot/powerpc/ofw/help.ofw
/freebsd-11-stable/sys/boot/powerpc/ps3/Makefile
/freebsd-11-stable/sys/boot/powerpc/ps3/help.ps3
/freebsd-11-stable/sys/boot/powerpc/uboot/Makefile
/freebsd-11-stable/sys/boot/powerpc/uboot/help.uboot
/freebsd-11-stable/sys/boot/sparc64/Makefile
/freebsd-11-stable/sys/boot/sparc64/Makefile.inc
/freebsd-11-stable/sys/boot/sparc64/boot1/Makefile
/freebsd-11-stable/sys/boot/sparc64/loader/Makefile
/freebsd-11-stable/sys/boot/sparc64/zfsloader/Makefile
/freebsd-11-stable/sys/boot/uboot.mk
/freebsd-11-stable/sys/boot/uboot/Makefile
/freebsd-11-stable/sys/boot/uboot/Makefile.inc
/freebsd-11-stable/sys/boot/uboot/common/Makefile.inc
/freebsd-11-stable/sys/boot/uboot/fdt/Makefile
/freebsd-11-stable/sys/boot/uboot/lib/Makefile
/freebsd-11-stable/sys/boot/userboot/Makefile
/freebsd-11-stable/sys/boot/userboot/ficl/Makefile
/freebsd-11-stable/sys/boot/userboot/ficl/Makefile.depend
/freebsd-11-stable/sys/boot/userboot/test/Makefile
/freebsd-11-stable/sys/boot/userboot/test/test.c
/freebsd-11-stable/sys/boot/userboot/userboot/Makefile
/freebsd-11-stable/sys/boot/userboot/zfs/Makefile
/freebsd-11-stable/sys/boot/userboot/zfs/Makefile.depend
/freebsd-11-stable/sys/boot/zfs/Makefile
/freebsd-11-stable/sys/boot/zfs/zfs.c
/freebsd-11-stable/sys/boot/zfs32
/freebsd-11-stable/sys/boot/zfs32/Makefile
/freebsd-11-stable/tools/boot/universe.sh
/freebsd-11-stable/tools/build/options/WITHOUT_LOADER_GEIL
/freebsd-11-stable/tools/build/options/WITH_LOADER_FIREWIRE
329099 10-Feb-2018 kevans

MFC Loader Fixes 2017q1: r311458,r312237,r312314,r312374,r312947,r313042,
r313047,r313166,r313328,r313332,r313333,r313337,r313348,r313349,r313389,
r313442,r313451,r313575,r313645,r313710,r314114,r314213,r314275,r314945,
r314948,r315008,r315408,r315427,r315645,r315646,r315648,r315653,r315850,
r316064,r316078,r316079,r316100,r316104,r316111,r316112,r316171,r316279,
r316280,r316287,r316311,r316343,r316424,r316436

r311458: Use compiler driver to link BERI boot loaders

r312237: loader.efi: find_currdev() can leak memory

r312314: loader: move device path definitions to include/efidevp.h

r312374: loader: efi devpath api usage should be more aware of NULL pointers

r312947: Remove "-Xassembler -G0" from CFLAGS.

r313042: loader.efi environment related cleanups

r313047: loader: disk/part api needs to use uint64_t offsets

r313166: loader: libefi/env.c warnings in arm build

r313328: loader: Implement disk_ioctl() to support DIOCGSECTORSIZE and
DIOCGMEDIASIZE.

r313332: loader: bcache read ahead block count should take account the large
sectors

r313333: loader: Replace EFI part devices.

r313337: loader: 313329 missed ZFS guard in loader/main.c

r313348: loader: biosdisk fix for 2+TB disks

r313349: loader: disk io should not use alloca()

r313389: efipart is also using the '%S' printf format, add -Wno-format for
it.

r313442: loader: possible NULL pointer dereference in efipart.c

r313451: loader: possible NULL pointer dereference in bcache.c

r313575: makefs: make the buffer functions look exactly like the kernel ones

r313645: loader: implement MEDIA_FILEPATH_DP support in efipart

r313710: loader: cstyle fixes and DIOCGMEDIASIZE should use uint64_t

r314114: Use LDFLAGS with CC instead of _LDFLAGS.

r314213: Remove control+r handling from geliboot's pwgets()

r314275: Remove unused macro from common/drv.c.

r314945: Some style(9) fixes. No functional changes.

r314948: Try to extract the RFC1048 data from PXE.

r315008: r314948 seems to be missing a variable or two that will break

r315408: loader: remove open_disk cache

r315427: loader: biosdisk should report IO error from INT13

r315645: loader: disk_cleanup was left in userboot_disk.c

r315646: loader: pxe.h constants have wrong values

r315648: libstand: verify value provided by nfs.read_size

r315653: loader: verify the value from dhcp.interface-mtu and use snprintf
o set mtu

r315850: The original author abused Nd (one-line description, used by
makewhatis)

r316064: Fix build with path names with 'align' or 'nop' in them.

r316078: gpt*boot: Save a bit more memory when LOADER_NO_GELI_SUPPORT is
specified

r316079: Simply retire the sedification of the boot2.s file.

r316100: Remove -fno-guess-branch-probability and -fno-unit-at-a-time.

r316104: Use `NO_WCAST_ALIGN` instead of spelling it out as -Wno-cast-align
in CFLAGS

r316111: loader: move bios getsecs into time.c

r316112: loader: ls command should display file types properly

r316171: xfsread inlined uses more space, so remove the inline tag.

r316279: loader: efipart should check disk size from partition table

r316280: loader: simplify efi_zfs_probe and avoid double probing for zfs.

r316287: Remove OLD_NFSV2 from loader and libstand

r316311: Add explicit_bzero() to libstand, and switch GELIBoot to using it

r316343: Implement boot-time encryption key passing (keybuf)

r316424: Fix sparc64 build broken by r316343 and r316076

r316436: Restore EFI boot environment functionality broken in r313333

PR: 216940 217298 217935


/freebsd-11-stable/lib/libstand/Makefile
/freebsd-11-stable/lib/libstand/bootp.c
/freebsd-11-stable/lib/libstand/bootp.h
/freebsd-11-stable/lib/libstand/nfs.c
/freebsd-11-stable/lib/libstand/nfsv2.h
/freebsd-11-stable/lib/libstand/stand.h
/freebsd-11-stable/sys/boot/common/bcache.c
/freebsd-11-stable/sys/boot/common/bootstrap.h
/freebsd-11-stable/sys/boot/common/dev_net.c
/freebsd-11-stable/sys/boot/common/disk.c
/freebsd-11-stable/sys/boot/common/disk.h
/freebsd-11-stable/sys/boot/common/ls.c
/freebsd-11-stable/sys/boot/common/part.c
/freebsd-11-stable/sys/boot/common/part.h
/freebsd-11-stable/sys/boot/efi/include/efidevp.h
/freebsd-11-stable/sys/boot/efi/include/efilib.h
/freebsd-11-stable/sys/boot/efi/libefi/Makefile
/freebsd-11-stable/sys/boot/efi/libefi/devpath.c
/freebsd-11-stable/sys/boot/efi/libefi/efinet.c
/freebsd-11-stable/sys/boot/efi/libefi/efipart.c
/freebsd-11-stable/sys/boot/efi/libefi/env.c
/freebsd-11-stable/sys/boot/efi/libefi/wchar.c
/freebsd-11-stable/sys/boot/efi/loader/conf.c
/freebsd-11-stable/sys/boot/efi/loader/devicename.c
/freebsd-11-stable/sys/boot/efi/loader/main.c
/freebsd-11-stable/sys/boot/forth/beastie.4th.8
/freebsd-11-stable/sys/boot/forth/loader.4th
/freebsd-11-stable/sys/boot/geli/Makefile
/freebsd-11-stable/sys/boot/geli/geliboot.c
/freebsd-11-stable/sys/boot/geli/geliboot.h
/freebsd-11-stable/sys/boot/geli/geliboot_crypto.c
/freebsd-11-stable/sys/boot/geli/geliboot_internal.h
/freebsd-11-stable/sys/boot/geli/pwgets.c
/freebsd-11-stable/sys/boot/i386/boot2/Makefile
/freebsd-11-stable/sys/boot/i386/boot2/boot2.c
/freebsd-11-stable/sys/boot/i386/btx/lib/btxv86.h
/freebsd-11-stable/sys/boot/i386/common/bootargs.h
/freebsd-11-stable/sys/boot/i386/common/drv.c
/freebsd-11-stable/sys/boot/i386/gptboot/Makefile
/freebsd-11-stable/sys/boot/i386/gptboot/gptboot.c
/freebsd-11-stable/sys/boot/i386/gptzfsboot/Makefile
/freebsd-11-stable/sys/boot/i386/libi386/bioscd.c
/freebsd-11-stable/sys/boot/i386/libi386/biosdisk.c
/freebsd-11-stable/sys/boot/i386/libi386/bootinfo32.c
/freebsd-11-stable/sys/boot/i386/libi386/bootinfo64.c
/freebsd-11-stable/sys/boot/i386/libi386/pxe.c
/freebsd-11-stable/sys/boot/i386/libi386/pxe.h
/freebsd-11-stable/sys/boot/i386/libi386/time.c
/freebsd-11-stable/sys/boot/i386/loader/Makefile
/freebsd-11-stable/sys/boot/i386/loader/main.c
/freebsd-11-stable/sys/boot/i386/zfsboot/zfsboot.c
/freebsd-11-stable/sys/boot/mips/beri/boot2/Makefile
/freebsd-11-stable/sys/boot/mips/beri/common/common.ldscript
/freebsd-11-stable/sys/boot/mips/beri/loader/beri_disk_cfi.c
/freebsd-11-stable/sys/boot/mips/beri/loader/beri_disk_sdcard.c
/freebsd-11-stable/sys/boot/mips/beri/loader/loader.ldscript
/freebsd-11-stable/sys/boot/sparc64/loader/Makefile
/freebsd-11-stable/sys/boot/uboot/lib/disk.c
/freebsd-11-stable/sys/boot/usb/storage/umass_loader.c
/freebsd-11-stable/sys/boot/userboot/userboot/userboot_disk.c
/freebsd-11-stable/sys/boot/zfs/libzfs.h
/freebsd-11-stable/sys/boot/zfs/zfs.c
/freebsd-11-stable/sys/crypto/intake.h
/freebsd-11-stable/sys/geom/eli/g_eli.c
/freebsd-11-stable/sys/geom/eli/g_eli.h
/freebsd-11-stable/sys/opencrypto/crypto.c
/freebsd-11-stable/sys/sys/linker.h
/freebsd-11-stable/usr.sbin/makefs/ffs.c
/freebsd-11-stable/usr.sbin/makefs/ffs/buf.c
/freebsd-11-stable/usr.sbin/makefs/ffs/buf.h
/freebsd-11-stable/usr.sbin/makefs/ffs/ffs_alloc.c
/freebsd-11-stable/usr.sbin/makefs/ffs/ffs_balloc.c
329010 08-Feb-2018 kevans

MFC r303555,r303556,r303936,r303962,r304317,r304532,r305026,r305107,r305132,
r305178,r305353,r305814,r306159,r306380,r306504: Loader fixes, 2016q3

r303555: bcache should support reads shorter than sector size

r303556: Improve boot loader quote parsing

r303936: Add kernel environment variables under smbios.system

r303962: Add the missing space between .asciz directive and opening quote
for some lines with #ifdef BTXLDR_VERBOSE/#endif

r304317: boot1.efi Free() should check for NULL to provide consistent
behavior

r304532: Replace sprintf -> snprintf for command_errbuf provisioned from
dynamic content.

r305026: Emulate efi_cons_poll when WaitForKey is not available

r305107: Create a hook 'post-initialize' for people that want to define
something to read in .conf files after all other .conf files for the purpose
of overriding.

r305132: Remove accidentally committed stray comment.

r305178: bd_int13probe() should check extended info if sector info is bad

r305353: Don't use -N to set the OMAGIC with data and text writeable and
data not page aligned.

r305814: ufsread: Do not cast struct direct from void *

r306159: Consistently declare getsecs(void) with proper return type and void
when no arguments are present.

r306380: loader command interpreter should reset command_errmsg

r306504: Fix a cluster of bugs in list EFI environment variables

PR: 204602, 211958, 211958
Relnotes: yes ("Improve boot loader quote parsing")


/freebsd-11-stable/sys/boot/common/bcache.c
/freebsd-11-stable/sys/boot/common/boot.c
/freebsd-11-stable/sys/boot/common/bootstrap.h
/freebsd-11-stable/sys/boot/common/commands.c
/freebsd-11-stable/sys/boot/common/interp.c
/freebsd-11-stable/sys/boot/common/interp_forth.c
/freebsd-11-stable/sys/boot/common/interp_parse.c
/freebsd-11-stable/sys/boot/common/ls.c
/freebsd-11-stable/sys/boot/common/module.c
/freebsd-11-stable/sys/boot/common/ufsread.c
/freebsd-11-stable/sys/boot/efi/boot1/boot1.c
/freebsd-11-stable/sys/boot/efi/libefi/efi_console.c
/freebsd-11-stable/sys/boot/efi/libefi/time.c
/freebsd-11-stable/sys/boot/efi/libefi/time_event.c
/freebsd-11-stable/sys/boot/efi/loader/arch/amd64/framebuffer.c
/freebsd-11-stable/sys/boot/efi/loader/main.c
/freebsd-11-stable/sys/boot/fdt/fdt_loader_cmd.c
/freebsd-11-stable/sys/boot/forth/loader.4th
/freebsd-11-stable/sys/boot/i386/Makefile.inc
/freebsd-11-stable/sys/boot/i386/boot.ldscript
/freebsd-11-stable/sys/boot/i386/boot0/Makefile
/freebsd-11-stable/sys/boot/i386/boot2/Makefile
/freebsd-11-stable/sys/boot/i386/btx/btx/Makefile
/freebsd-11-stable/sys/boot/i386/btx/btxldr/Makefile
/freebsd-11-stable/sys/boot/i386/btx/btxldr/btxldr.S
/freebsd-11-stable/sys/boot/i386/cdboot/Makefile
/freebsd-11-stable/sys/boot/i386/gptboot/Makefile
/freebsd-11-stable/sys/boot/i386/gptzfsboot/Makefile
/freebsd-11-stable/sys/boot/i386/libi386/biosdisk.c
/freebsd-11-stable/sys/boot/i386/libi386/pxe.c
/freebsd-11-stable/sys/boot/i386/libi386/smbios.c
/freebsd-11-stable/sys/boot/i386/mbr/Makefile
/freebsd-11-stable/sys/boot/i386/pmbr/Makefile
/freebsd-11-stable/sys/boot/i386/pxeldr/Makefile
/freebsd-11-stable/sys/boot/i386/zfsboot/Makefile
/freebsd-11-stable/sys/boot/ofw/libofw/ofw_time.c
/freebsd-11-stable/sys/boot/pc98/Makefile.inc
/freebsd-11-stable/sys/boot/pc98/boot0/Makefile
/freebsd-11-stable/sys/boot/pc98/boot2/Makefile
/freebsd-11-stable/sys/boot/pc98/btx/btx/Makefile
/freebsd-11-stable/sys/boot/pc98/btx/btxldr/Makefile
/freebsd-11-stable/sys/boot/pc98/cdboot/Makefile
/freebsd-11-stable/sys/boot/powerpc/kboot/main.c
/freebsd-11-stable/sys/boot/powerpc/ps3/main.c
/freebsd-11-stable/sys/boot/uboot/lib/time.c
328866 05-Feb-2018 kevans

MFC r304321,304753,304754,306751,316077,316110:
SHA512, skein, large block support for loader zfs

MFC r304321: Add SHA512, skein, large blocks support for loader zfs.
MFC r304753: loader: zio_checksum_verify() must test spa for NULL pointer
MFC r304754: r304321 broken bhyve zvol VM bhyveload hang 100% WCPU
MFC r306751: Disable loop unrolling in skein for sys/boot
MFC r316077: Unbreak compilation with gcc 4.2.1
MFC r316110: Use `-Wno-missing-declarations` with CWARNFLAGS for skein.c

323256 07-Sep-2017 rlibby

MFC r322329:

i386/boot2: -fno-asynchronous-unwind-tables for gcc

319024 28-May-2017 ngie

MFC r309412,r316109,r316132:

r309412 (by imp):

dd is currently a bootstrap tool. It really doesn't have any business
being a bootstrap tool. However, for reproducible build output,
FreeBSD added dd status=none because it was otherwise difficult to
suppress the status information, but retain any errors that might
happen. There's no real reason that dd has to be a build tool, other
than we use status=none unconditional. Remove dd from a bootstrap tool
entirely by only using status=none when available. This may also help
efforts to build the system on non-FreeBSD hosts as well.

r316109:

Don't hardcode input files for stage 1/2 bootloaders; use .ALLSRC instead

This is a better pattern to follow when creating the bootloaders and doing
the relevant space checks to make sure that the sizes aren't exceeded (and
thus, copy-pasting is a bit less error prone).

r316132:

Parameterize out 7680 (15 * 512) as BOOT2SIZE, similar to sys/boot/i386/zfsboot/...

This is being done to make it easier to change in the future--this action might be
needed sooner rather than later because of gcc 6.3.0 bailing, stating that there
is negative free space left (deficit) in the boot2 bootloader.

302408 08-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
297283 26-Mar-2016 bdrewery

Implement (ACFLAGS|CFLAGS|CXXFLAGS).SRC globally.

Sponsored by: EMC / Isilon Storage Division


295757 18-Feb-2016 emaste

Remove dd xfer stats emitted during buildworld

They result in gratuitous differences when comparing build log output.


294925 27-Jan-2016 imp

Fix mistake when transitioning to the new defines with ZFS loader. I
hate adding yet another define, but it is the lessor of the evil
choices available. Kill another evil by removing PATH_BOOT3 and
replacing it with PATH_LOADER or PATH_LOADER_ZFS as appropriate.

PR: 206659


294766 26-Jan-2016 imp

RBX_ defines are in rbx.h, move it there.

Differential Revision: https://reviews.freebsd.org/D5038


294765 26-Jan-2016 imp

Move all the separate copies of the same strings into paths.h. There's
nothing machine specific about these.

Differential Revision: https://reviews.freebsd.org/D5038


291563 01-Dec-2015 bdrewery

META MODE: Update dependencies with 'the-lot' and add missing directories.

This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so. A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR. These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package. The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by: EMC / Isilon Storage Division


291320 25-Nov-2015 bdrewery

META MODE: Don't create .meta files when symlinking sources into the obj directory.

Tracking these leads to situations where meta mode will consider the
file to be out of date if /bin/sh or /bin/ln are newer than the source
file. There's no reason for meta mode to do this as make is already
handling the rebuild dependency fine.

Sponsored by: EMC / Isilon Storage Division


288228 25-Sep-2015 bdrewery

META_MODE: Remove DEP_MACHINE from Makefile.depend files.

This has not been needed since r246865 in projects/bmake.

Sponsored by: EMC / Isilon Storage Division


288226 25-Sep-2015 bdrewery

META_MODE: Remove DEP_RELDIR from Makefile.depend files.

This has not been needed since r284171 in projects/bmake.

Sponsored by: EMC / Isilon Storage Division


284878 26-Jun-2015 delphij

Reduce warnings:

- Add prototype for boot2 main()
- Don't make assignment within if statement, split it into two.

No functional or binary change -- verified with sha256(1).

MFC after: 2 weeks


284345 13-Jun-2015 sjg

Add META_MODE support.

Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision: D2796
Reviewed by: brooks imp


280980 02-Apr-2015 dim

Ensure the cross assembler, linker and objcopy are used for the build32
stage, just like for the regular world stage.

Reviewed by: rodrigc, imp, bapt, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D2187


279598 04-Mar-2015 dim

When compiling boot2 with gcc on i386 and pc98, only use the custom flag
-mno-align-long-strings when compiling with base gcc. This is checked
by comparing the version number against 4.2.1, which is not exactly
right, but good enough. (There is no other way to check whether we are
using the non-standard gcc in base, as far as I know.)

Reported by: rodrigc
MFC after: 3 days


276479 31-Dec-2014 dim

Upgrade our copy of clang, llvm and lldb to 3.5.0 release.

Please note that this version now requires C++11 support to build; see
UPDATING for more information.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.5.0/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.5.0/tools/clang/docs/ReleaseNotes.html>

Thanks to Ed Maste, Roman Divacky, Andrew Turner, Justin Hibbits and
Antoine Brodin for their invaluable help with this import.

Approved by: portmgr (antoine)
MFC after: 1 month


275305 30-Nov-2014 rdivacky

Unbreak the code for non-digits below '0' by casting the expression
to unsigned int.

Pointed out by: bde


275237 29-Nov-2014 rdivacky

Shrink boot2 a bit more by factoring out common pattern
of printf();return(-1);

This shrinks it by 8bytes using clang35 and by 12bytes using clang34.


275191 27-Nov-2014 rdivacky

Revert part of r275059. Comparing unsigned 8 bit value
against -'0' is always false so the conditional block is
optimized away.


275062 25-Nov-2014 rdivacky

Fix style(9).

Suggested by: jkim


275061 25-Nov-2014 rdivacky

Fix style(9).

Suggested by: jkim


275059 25-Nov-2014 rdivacky

Shrink boot2 by a couple more bytes.

Reviewed by: jhb
Tested by: me, dim


272249 28-Sep-2014 nyan

Remove extra '\'.


270168 19-Aug-2014 bdrewery

Revert r267233 for now. PIE support needs to be reworked.

1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other
build-only utility libraries.
2. Another 40% is fixed by generating _pic.a variants of various libraries.
3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR)
where it never would work anyhow, such as csu or loader. This suggests
there may be better ways of adding support to the tree. Many of these
cases can be fixed such that -fPIE will work but there is really no
reason to have it in those cases.
4. Some of the uses are working around hacks done to some Makefiles that are
really building libraries but have been using bsd.prog.mk because the code
is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have
been needed.

We likely do want to enable PIE by default (opt-out) for non-tree consumers
(such as ports). For in-tree though we probably want to only enable PIE
(opt-in) for common attack targets such as remote service daemons and setuid
utilities. This is also a great performance compromise since ASLR is expected
to reduce performance. As such it does not make sense to enable it in all
utilities such as ls(1) that have little benefit to having it enabled.

Reported by: kib


268475 10-Jul-2014 imp

Make SERIAL support optional again. Enable it for i386 because a huge
percentage of machines has a 16550. Disable it for pc98 since only a
tiny fraction of them have one. These changes save 293 bytes when
building with clang, but preserves the ability to build with serial if
you really want. We now have 92 bytes free (412 with the in-tree gcc).


267233 08-Jun-2014 bdrewery

In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.

This is currently an opt-in build flag. Once ASLR support is ready and stable
it should changed to opt-out and be enabled by default along with ASLR.

Each application Makefile uses opt-out to ensure that ASLR will be enabled by
default in new directories when the system is compiled with PIE/ASLR. [2]

Mark known build failures as NO_PIE for now.

The only known runtime failure was rtld.

[1] http://www.bsdcan.org/2014/schedule/events/452.en.html
Submitted by: Shawn Webb <lattera@gmail.com>
Discussed between: des@ and Shawn Webb [2]


265400 05-May-2014 imp

Introduce CWARNFLAGS.${COMPILER_TYPE} and use that to simplify the
thicket of .if ${COMPILER_TYPE} == "clang" that controls
warnings. Also, use CFLAGS.clang in a couple places in preference to
having a similar construct that's related to the CWARNFLAGS changes.


260334 05-Jan-2014 dim

Split the last gcc-specific flags off into CFLAGS.gcc. This also
removes the need to use -Qunused-arguments for clang throughout the
tree.

MFC after: 3 days


260095 30-Dec-2013 dim

For sys/boot/i386 and sys/boot/pc98, separate flags to be passed
directly to the linker (LD_FLAGS) from flags passed indirectly, via the
compiler driver (LDFLAGS).

This is because several Makefiles under sys/boot/i386 and sys/boot/pc98
use ${LD} directly to link, and the normal LDFLAGS value should not be
used in these cases.

MFC after: 3 days


259913 26-Dec-2013 dim

For libstand and sys/boot, split off gcc-only flags into CFLAGS.gcc.

MFC after: 3 days
X-MFC-With: r259730


242804 08-Nov-2012 dim

Shrink boot2 by 8 bytes, by eliminating some unneeded instructions in
sio.S. This is not particularly needed for head right now, but it is
intended to merge to stable/9, to fix boot2 build with clang there.

Reviewed by: avg
MFC after: 3 days


241301 06-Oct-2012 avg

add detection of serial console presence to btx and boot2-like blocks

Note that this commit slightly increases size of boot blocks.

Reviewed by: jhb
Tested by: Olivier Cochard-Labbe <olivier@cochard.me>
MFC after: 26 days


236405 01-Jun-2012 jhb

Remove unnecessary initializations. The BSS of boot2 is in fact
zero'd when boot2 begins execution by the _start() routine in btxcsu.S.

MFC after: 1 week


235988 25-May-2012 gleb

Use 32-bit ufs_ino_t instead of ino_t to keep boot2 small and prevent
unnecessary 64-bit math on 32-bit machines.

Sponsored by: Google Summer of Code 2011


232754 09-Mar-2012 jkim

Make boot2 build with Clang again.

Submitted by: dim (bsd.sys.mk)
Reviewed by: dim, jhb


232623 06-Mar-2012 jhb

Add a note to clarify why we create a relocated copy of boot1 in lower
memory.


232570 05-Mar-2012 jhb

Fix boot2 to handle boot config files that only contain a custom path to
a loader or kernel. Specifically, kname cannot be pointed at cmd[] since
it's value is change to be an empty string after the initial call to
parse, and cmd[]'s value can be changed (thus losing a prior setting for
kname) due to user input at the boot prompt. While here, ensure that that
initial boot config file text is nul-terminated, that ops is initialized
to zero, and that kname is always initialized to a valid string.

Tested by: Domagoj Smolcic rank1seeker of gmail
MFC after: 1 week


232263 28-Feb-2012 dim

Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to
get rid of testing explicitly for clang (using ${CC:T:Mclang}) in
individual Makefiles.

Instead, use the following extra macros, for use with clang:
- NO_WERROR.clang (disables -Werror)
- NO_WCAST_ALIGN.clang (disables -Wcast-align)
- NO_WFORMAT.clang (disables -Wformat and friends)
- CLANG_NO_IAS (disables integrated assembler)
- CLANG_OPT_SMALL (adds flags for extra small size optimizations)

As a side effect, this enables setting CC/CXX/CPP in src.conf instead of
make.conf! For clang, use the following:

CC=clang
CXX=clang++
CPP=clang-cpp

MFC after: 2 weeks


226746 25-Oct-2011 jhb

Consolidate duplicate definitions of V86_CY() and V86_ZR() which check for
the carry and zero flags being set, respectively, in <btxv86.h> and use
them throughout the x86 boot code.


226506 18-Oct-2011 des

Look for /boot/config in addition to /boot.config, with the former taking
precedence over the latter if it exists.

MFC after: 3 weeks


224131 17-Jul-2011 dim

When building some of the boot loaders with clang, and DEBUG_FLAGS or
CFLAGS having '-g' in it, clang outputs several assembly directives that
are too new for our version of binutils.

Therefore, assemble the resulting .s files with clang instead. A more
general solution can be implemented when a GNU as-compatible driver for
clang's integrated assembler appears.

Reported by: dougb


221506 05-May-2011 dim

Fine-tune llvm optimization for sys/boot/i386/boot2, which shaves off
some more bytes from the final boot2 image.

Submitted by: rdivacky


221348 02-May-2011 dim

Clang r130700 can now compile sys/boot/i386/boot2 with room to spare.


221177 28-Apr-2011 jhb

Due to space constraints, the UFS boot2 and boot1 use an evil hack where
boot2 calls back into boot1 to perform disk reads. The ZFS MBR boot blocks
do not have the same space constraints, so remove this hack for ZFS.
While here, remove commented out code to support C/H/S addressing from
zfsldr. The ZFS and GPT bootstraps always just use EDD LBA addressing.

MFC after: 2 weeks


220392 06-Apr-2011 rdivacky

Move getc() body before xgetc() so gcc does not emit a warning about function
having no body.

Approved by: jhb


220389 06-Apr-2011 rdivacky

Mark getc() as inline, this has no effect on gcc but helps clang.

Approved by: jhb


220337 04-Apr-2011 rdivacky

Build boot2 with -mregparm=3, ie. pass upto 3 arguments via registers.
This modifies CFLAGS and tweaks sio.S to use the new calling convention.
The sio_init() and sio_putc() prototypes are modified so that other
users of this code know the correct calling convention.

This makes the code smaller when compiled with clang.

Reviewed by: jhb
Tested by: me and Freddie Cash <fjwcash gmail com>


219452 10-Mar-2011 rdivacky

Some more shrinking.

o bunch of variables are turned into uint8_t

o initial setting of namep[] in lookup() is removed
as it's only overwritten a few lines down

o kname is explicitly initialized in main() as BSS
in boot2 is not zeroed

o the setting and reading of "fmt" in load() is removed

o buf in printf() is made static to save space

Reviewed by: jhb
Tested by: me and Fabian Keil <freebsd-listen fabiankeil de>


219186 02-Mar-2011 rdivacky

This patch shrinks boot2 a little.

o It switches kname to be just a pointer instead of an array
thus avoiding a couple of memcpy()s.

o It changes ioctl to unsigned from uint8_t.

o It changes the second keyhit limit to 3 seconds from 5
so that constant propagation can take place.

o It changes the ticks overflow computation as suggested by bde@.

o It removes bi_basemem/bi_extmem/bi_memsizes_valid setting from
bootinfo as it is unused.

Reviewed by: jhb


218926 21-Feb-2011 dim

In sys/boot/i386/boot2/boot2.c, change the type of the 'opts' variable
from uint16_t back to uint32_t. The actual option bitmasks (RB_* and
RBX_*) assume at least a 32 bit variable.

Submitted by: rdivacky


218745 16-Feb-2011 imp

Remove reading of symbols from a.out loaded files. Since we are tight
on space for clang and a.out support is only needed for /boot/loader,
they are excess bytes that serve no useful purpose other than to
support really old kernels (FreeBSD < 3.2 or so). Prefer clang
support over support for these old kernels and remove this code. We
gain about 100 bytes of space this way.

Reviewed by: rdivacky@


218713 15-Feb-2011 dim

Apply a few small optimizations to boot2's code, to make it shrink a
little further. This gets us further on the way to be able to build it
successfully with clang. Using in-tree gcc, this shrinks boot2.bin with
60 bytes, the in-tree clang shaves off 72 bytes, and ToT clang 84 bytes.

Submitted by: rdivacky
Reviewed by: imp


217028 05-Jan-2011 dim

Remove superfluous -mno-(mmx|3dnow|sse|sse2|sse3) flags in Makefiles
under sys/boot/{i386,pc98}, since these are already added via
sys/boot/{i386,pc98}/Makefile.inc.

Submitted by: arundel


215285 14-Nov-2010 brucec

Fix the jump location.


215284 14-Nov-2010 brucec

When rebooting the machine jump to 0xf000:fff0 instead of 0xffff:0x0.
This is the same change that was made in rev 1.33 of boot/i386/btx/btx/btx.S

PR: i386/91871
Submitted by: Bjorn Konig <bkoenig at cs.tu-berlin.de>
MFC after: 1 week


214210 22-Oct-2010 rdivacky

Avoid using memcpy() for copying 32bit chunks. This shrinks
the resulting code a little.

Approved by: rpaulo (mentor)
Reviewed by: jhb


212979 21-Sep-2010 dim

When building world with clang, for gnu/lib/libobjc, sys/boot/i386/boot2
and sys/boot/pc98/boot2, do not simply assign 'gcc' to CC, since compile
flags are sometimes passed via this variable, for example during the
build32 stage on amd64. This caused the 32-bit libobjc build on amd64
to fail.

Instead, only replace the first instance of clang (if any, including
optional path) with gcc, and leave the arguments alone.

Approved-by: rpaulo (mentor)


212060 31-Aug-2010 dim

Use a more robust way to substitute gcc for clang, when compiling
gnu/lib/libobjc and sys/boot/i386/boot2, so it also works when using
absolute paths and/or options, as in CC="/absolute/path/clang -foo".

Approved by: rpaulo (mentor)


211677 23-Aug-2010 imp

MF tbemd: Minor tweaks, prefer MACHINE_CPUARCH generally to MACHINE_ARCH


211571 21-Aug-2010 rpaulo

Make sure the boot2 stage is compiled with gcc, as clang has no
problems compiling it, but it just gets too big at the moment, even
with -Os. This is not applicable to gptboot, though.

Submitted by: Dimitry Andric <dimitry at andric.com>


205662 26-Mar-2010 delphij

Our boot loader is capable of booting both i386 and amd64 kernels so
call it "x86" instead of "i386".

Suggested by: jhb in response to Alexander Best's loader proposal
MFC after: 1 month


189500 07-Mar-2009 marcel

Revert the part of change 107879 that employs the unused bytes after
the disklabel in the 2nd sector for boot code. Even with both UFS1
and UFS2 supported, there's enough bytes left that we don't have to
nibble from the disklabel.
Thus, the entire 2nd sector is now reserved for the disklabel, which
makes the bootcode compatible again with disklabels that have more
than 8 partitions -- such as those created and supported by gpart.

i386: 135 bytes available
amd64: 151 bytes available

Ok'd by: jhb


181436 08-Aug-2008 jhb

- Initialize the vm86 structure to a known-good state. Specifically, always
set the %eflags used during a BIOS call via BTX to 0x202. Previously
the flags field was uninitialized garbage, and thus it was "random" if
interrupts were enabled or not during BIOS calls.
- Use constants from <machine/psl.h> for fields in %eflags.

MFC after: 3 days


180145 01-Jul-2008 nyan

Fix off-by-one error.

MFC after: 1 week


176644 28-Feb-2008 jhb

Rev 1.72 fixed a bug where if /boot.config changed the console its contents
weren't displayed on the new console. However, the config string has been
altered as part of being parsed so we only display the first option. Fix
this by saving a copy of /boot.config before parsing it and displaying the
saved copy after parsing.

MFC after: 1 week
PR: i386/103972
Submitted by: Alexandre Belloni alexandre.belloni of netasq.com


173040 26-Oct-2007 jhb

Use the smaller cgbase() macro in ufsread.c if UFS_SMALL_CGBASE is
defined. This lets each boot program choose which version of cgbase() it
wants to use rather than forcing ufsread.c to have that knowledge.

MFC after: 1 week
Discussed with: imp


172921 24-Oct-2007 jhb

Slightly cleanup the 'bootdev' concept on x86 by changing the various
macros to treat the 'slice' field as a real part of the bootdev instead
of as hack that spans two other fields (adaptor (sic) and controller)
that are not used in any modern FreeBSD boot code.

MFC after: 1 week


169732 19-May-2007 kan

Tweak inlining parameters a little. Add warning to tell us if function
we declared as inline can not be inlined.


163914 02-Nov-2006 ru

Revert the last change. Masking only 2 MSBs of the virtual address
to get the physical address doesn't work for all values of KVA_PAGES,
while masking 8 MSBs works for all values of KVA_PAGES that are
multiple of 4 for non-PAE and 8 for PAE. (This leaves us limited
with 12MB for non-PAE kernels and 14MB for PAE kernels.)

To get things right, we'd need to subtract the KERNBASE from the
virtual address (but KERNBASE is not easy to figure out from here),
or have physical addresses set properly in the ELF headers.

Discussed with: jhb


163765 29-Oct-2006 ru

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)


163707 26-Oct-2006 ru

Restore support for -c and -d that were treacherously murdered in
rev. 1.58. (This only costs us four bytes.)

Prodded by: bde
MFC after: 3 days


163706 26-Oct-2006 ru

Back out rev. 1.71 as it breaks directly loading (i386) kernels.

OK'ed by: jhb
PR: i386/96430, i386/104709
MFC after: 3 days


157667 11-Apr-2006 jhb

Minor whitespace tweak.


151999 03-Nov-2005 ru

Consistently use OPT_* macros to test/set boot options.


151382 16-Oct-2005 sobomax

Re-implement rev.1.76 with respect to the code size.


151381 16-Oct-2005 sobomax

Backout previous commit - for some reason it overflows space constrains on
amd64. Better version will follow.


151367 16-Oct-2005 sobomax

Add new option `q', which makes second stage loader quiet unless autoboot
is disabled or fails.

MFC after: 1 week


150464 22-Sep-2005 ru

- RBX_MASK wasn't updated when RB_PAUSE was changed from 0x40000
to 0x100000 in rev. 1.67.

- NOPT wasn't updated (decremented) in previous revision.


149212 18-Aug-2005 iedowse

Add the ability to specify the boot2 serial console speed in
/boot.config or on the "boot:" prompt line via a "-S<speed>" flag,
e.g. "-h -S19200". This adds about 50 bytes to the size of boot2
and required a few other small changes to limit the size impact.
This changes only affects boot2; there are further loader changes
to follow.


148767 06-Aug-2005 ssouhlal

The kernel is usually at /boot/kernel/kernel nowadays.

PR: i386/81756
Submitted by: trasz <trasz@buziaczek.pl>


148046 15-Jul-2005 ache

Add -mno-sse3 for prescott/nocona


146696 27-May-2005 jhb

Print out the commands from /boot.config after parsing them so that they
output is sent to the correct console(s).

PR: kern/66425
Submitted by: Gavin Atkinson gavin at ury dot york dot ac dot uk
MFC after: 1 week


143661 15-Mar-2005 obrien

Ensure GCC does not use FP registers in integer code.
I think all we really need is -fno-sse2.
I really don't like cluttering up the compiler invocation,
but this bigger hammer will fix reported problems for now.


135410 18-Sep-2004 jhb

A long, long time ago in a CVS branch far away (specifically, HEAD prior
to 4.0 and RELENG_3), the BTX mini-kernel used paging rather than flat
mode and clients were limited to a virtual address space of 16 megabytes.
Because of this limitation, boot2 silently masked all physical addresses
in any binaries it loaded so that they were always loaded into the first
16 Meg. Since BTX no longer has this limitation (and hasn't for a long
time), remove the masking from boot2. This allows boot2 to load kernels
larger than about 12 to 14 meg (12 for non-PAE, 14 for PAE).

Submitted by: Sergey Lyubka devnull at uptsoft dot com
MFC after: 1 month


134430 28-Aug-2004 yar

Try packet mode of INT13 on a hard disk first if not prohibited by
the flag, fall back to the old INT13/AH=02 function if that fails.
This way of operation is less likely to fail with modern BIOSes and
large disks of strange geometries.

PR: i386/70241
Submitted by: Valentin Nechayev <netch <@> netch.kiev.ua> (inital version)
Discussed with: jhb (by Valentin Nechayev)
Tested on: bochs (with EDD turned on or off by patching the BIOS), PCs


134382 27-Aug-2004 yar

B1FLAGS -> BOOT_BOOT1_FLAGS, which is consistent with
naming of other boot-related make vars.


133154 05-Aug-2004 kan

Move boot2 BSS zeroing into btx startup code out of boot1. boot1 does not
have clear idea on boot2 BSS size and leaves portion of it not zeroed out.
btxcsu.s is in much better position for this job.

Obtained from: DragonflyBSD (with minor adjustments)


132870 30-Jul-2004 kan

Compile boot2 with -fno-unit-at-a-time. GCCs aggressive optimization
breaks boot in spectacular ways otherwise.


132864 30-Jul-2004 kan

Clean up local memcpy implementation to take void * parameters.


132764 28-Jul-2004 kan

Define our own memcpy here instead of relying on GCC to provide one.


129993 02-Jun-2004 phk

Some embedded platforms have no keyboard controller. Give up waiting
for it to react after a timeout.


129240 14-May-2004 ru

Back out last revision that unnecessarily changed valid assembler
line comments and damaged the CVS history.

Prompted by: bde, jhb


128716 28-Apr-2004 ru

After talking to Bruce Evans and reading more standards specs,
switch to using C99-style comments everywhere in preprocessed
assembler. The reason is that lines starting with the regexp
'^[[:space:]]#' are treated as preprocessing directives, and
while it seems to work now with GCC, it's not necessarily has
to work. Use C99 comments `//' for the trailing comments to
save whitespace.


128707 28-Apr-2004 ru

- Use C (and CPP) style comments for assembler-with-cpp sources,
for lines that start with a comment.
- Preserve as(1) style comments for the rest.


126891 12-Mar-2004 trhodes

These are changes to allow to use the Intel C/C++ compiler (lang/icc)
to build the kernel. It doesn't affect the operation if gcc.

Most of the changes are just adding __INTEL_COMPILER to #ifdef's, as
icc v8 may define __GNUC__ some parts may look strange but are
necessary.

Additional changes:
- in_cksum.[ch]:
* use a generic C version instead of the assembly version in the !gcc
case (ASM code breaks with the optimizations icc does)
-> no bad checksums with an icc compiled kernel
Help from: andre, grehan, das
Stolen from: alpha version via ppc version
The entire checksum code should IMHO be replaced with the DragonFly
version (because it isn't guaranteed future revisions of gcc will
include similar optimizations) as in:
---snip---
Revision Changes Path
1.12 +1 -0 src/sys/conf/files.i386
1.4 +142 -558 src/sys/i386/i386/in_cksum.c
1.5 +33 -69 src/sys/i386/include/in_cksum.h
1.5 +2 -0 src/sys/netinet/igmp.c
1.6 +0 -1 src/sys/netinet/in.h
1.6 +2 -0 src/sys/netinet/ip_icmp.c

1.4 +3 -4 src/contrib/ipfilter/ip_compat.h
1.3 +1 -2 src/sbin/natd/icmp.c
1.4 +0 -1 src/sbin/natd/natd.c
1.48 +1 -0 src/sys/conf/files
1.2 +0 -1 src/sys/conf/files.amd64
1.13 +0 -1 src/sys/conf/files.i386
1.5 +0 -1 src/sys/conf/files.pc98
1.7 +1 -1 src/sys/contrib/ipfilter/netinet/fil.c
1.10 +2 -3 src/sys/contrib/ipfilter/netinet/ip_compat.h
1.10 +1 -1 src/sys/contrib/ipfilter/netinet/ip_fil.c
1.7 +1 -1 src/sys/dev/netif/txp/if_txp.c
1.7 +1 -1 src/sys/net/ip_mroute/ip_mroute.c
1.7 +1 -2 src/sys/net/ipfw/ip_fw2.c
1.6 +1 -2 src/sys/netinet/igmp.c
1.4 +158 -116 src/sys/netinet/in_cksum.c
1.6 +1 -1 src/sys/netinet/ip_gre.c
1.7 +1 -2 src/sys/netinet/ip_icmp.c
1.10 +1 -1 src/sys/netinet/ip_input.c
1.10 +1 -2 src/sys/netinet/ip_output.c
1.13 +1 -2 src/sys/netinet/tcp_input.c
1.9 +1 -2 src/sys/netinet/tcp_output.c
1.10 +1 -1 src/sys/netinet/tcp_subr.c
1.10 +1 -1 src/sys/netinet/tcp_syncache.c
1.9 +1 -2 src/sys/netinet/udp_usrreq.c

1.5 +1 -2 src/sys/netinet6/ipsec.c
1.5 +1 -2 src/sys/netproto/ipsec/ipsec.c
1.5 +1 -1 src/sys/netproto/ipsec/ipsec_input.c
1.4 +1 -2 src/sys/netproto/ipsec/ipsec_output.c

and finally remove
sys/i386/i386 in_cksum.c
sys/i386/include in_cksum.h
---snip---
- endian.h:
* DTRT in C++ mode
- quad.h:
* we don't use gcc v1 anymore, remove support for it
Suggested by: bde (long ago)
- assym.h:
* avoid zero-length arrays (remove dependency on a gcc specific
feature)
This change changes the contents of the object file, but as it's
only used to generate some values for a header, and the generator
knows how to handle this, there's no impact in the gcc case.
Explained by: bde
Submitted by: Marius Strobl <marius@alchemy.franken.de>
- aicasm.c:
* minor change to teach it about the way icc spells "-nostdinc"
Not approved by: gibbs (no reply to my mail)
- bump __FreeBSD_version (lang/icc needs to know about the changes)

Incarnations of this patch survive gcc compiles since a loooong time,
I use it on my desktop. An icc compiled kernel works since Nov. 2003
(exceptions: snd_* if used as modules), it survives a build of the
entire ports collection with icc.

Parts of this commit contains suggestions or submissions from
Marius Strobl <marius@alchemy.franken.de>.

Reviewed by: -arch
Submitted by: netchild


125932 17-Feb-2004 ru

Re-add sio.S, and properly deal with assembler files.

Repocopied by: joe


125901 16-Feb-2004 obrien

Fix the AMD64 build: this file shouldn't exist.


125621 09-Feb-2004 ru

- Factor out -nostdlib to an upper level Makefile.inc.

- Now that bsd.prog.mk deals with programs linked with -nostdlib
better, and has a notion of an "internal" program, use PROG
where possible. This has a good impact on the contents of
.depend files and causes programs to be linked with cc(1).

XXX: boot2 couldn't be converted as it's actually two programs.

Tested on: i386, amd64


125581 07-Feb-2004 ru

Argh, unbreak "make depend" for AMD64.

Reported by: kris


125566 07-Feb-2004 ru

- Removed -elf which is not a valid gcc(1) option anymore.
- Removed -ffreestanding; it's enforced by ../Makefile.inc.


125564 07-Feb-2004 ru

Generate .depend file.


125556 07-Feb-2004 ru

Untangle building of AMD64 boot code.

Tested on: amd64 (sledge)


125537 06-Feb-2004 ru

First round of cleanups to sys/boot/ makefiles:

- do not use PROG for what's not a real C program,
- use sys.mk transformation rules where possible,
- only create the "machine" symlink on AMD64,
- removed MAINTAINER lines in individual makefiles,
- added the LIBSTAND defitinion to <bsd.libnames.mk>,
- somewhat better contents in .depend files.

Tested on: i386, amd64
Prodded by: bde


125517 06-Feb-2004 ru

Inherit BINDIR from a parent Makefile.inc.


122749 15-Nov-2003 bde

Changed the RB_PAUSE flag from 0x40000 to 0x100000 and marked the old
value as reserved for internal use in boot blocks, because RB_PAUSE
broke binary compatibility by usurping the RB_DUAL flag. Probably no
one except me has boot blocks for which this matters, since most boot
blocks based on biosboot including pc98's boot2 can't boot elf kernels,
and /boot/loader doesn't properly pass flags set by the previous stage.

reboot.h:
Also mark the historical RB_PROBEKBD flag (0x80000) as reserved for
internal use in boot blocks.

boot2.c:
Added comments to inhibit usurping of other flags.

Approved by: guido, imp
MFC after: 1 week


122463 11-Nov-2003 bde

Include <sys/reboot.h> the definition of RB_BOOTINFO. The previous
commit broke the world because it depended on namespace pollution that
was only in my version of <machine/bootinfo.h>. The include was removed
in rev.1.63 after the last reference to it went away in rev.1.61.


122433 10-Nov-2003 bde

Fixed loss of setting of the RB_BOOTINFO flag in rev.1.43. Fixed wrong
comment about this flag in rev.1.61. It is not historical like the
comment said; it is the flag that says that most of what is laboriously
put in the bootinfo struct is actually there. Newer kernels were
bootable by even the broken boot2 without losing anything except the
symbol table, but older kernels need at least the memory sizes.

Restoring the "|" with RB_BOOTINFO that was lost in rev.1.43 costs 5
bytes. The fix can be done in only 4 bytes by fixing some code that
was removed in rev.1.61 (put RB_BOOTINFO back in in the initial value
of "opts" and fix RBX_MASK to not clobber it.)


119482 25-Aug-2003 obrien

Use __FBSDID().
Also some minor copyright style cleanups.


119253 22-Aug-2003 imp

Many newer CF do not handle having the entire track read from them at
boot time. Instead, read it a sector at a time. While this sounds
like a significant slowdown, I've not been able to measure any
signficant difference.

Submitted by: luigi
Reviewed by: jhb, sam (both a while ago)
MFC After: 3 days


116864 26-Jun-2003 peter

Build on amd64. Yes, I know this isn't particularly nice.


113083 04-Apr-2003 phk

Libdisk does not need to include <sys/diskslice.h> any more.

Move the remaining bits of <sys/diskslice.h> to <i386/include/bootinfo.h>

Move i386/pc98 specific bits from <sys/reboot.h> to
<i386/include/bootinfo.h> as well.

Adjust includes in sys/boot accordingly.


111490 25-Feb-2003 ru

Fixed CLEANFILES.

Submitted by: cron


109886 26-Jan-2003 phk

Build a file "boot" which consists of boot1 and boot2 concatenated.

There is little if any reason to treat the two components separately
and it will simplify disklabel(8) and libdisk if we didn't.


109235 14-Jan-2003 imp

Save 4 more bytes by not initializing opts to 0. This moves it from
the data section to the bss section givig us initialization for free.

Noticed by: bde


109197 13-Jan-2003 imp

Fix interactive booting:
o Revision 1.38 introduced the -n flag. It conflicted with the
RB_BOOTINFO flag, so was in effect always on. Change the -n flag to
be bit 0x1c instead of 0x1f. This also had the consequence that a mal-formed
/boot.config would render the system unbootable because the user was
unable to enter anything at all on the command line.
o Remove the initialization of opt to be RB_BOOTINFO since we filter that bit
out and do not otherwise use it.

Reviewed by: jhb
MFC after: 3 days


108149 21-Dec-2002 obrien

-mno-align-long-strings can make things smaller, so lets use it in hopes
that it does here.


108119 20-Dec-2002 imp

Put back the casts to unsigned. While no strictly necessary for its
current uses, the name strcmp has strong connotations that shouldn't
lightly be discarded. This doesn't cost us anything.

Submitted by: bde


108016 18-Dec-2002 imp

I didn't intend to delete this rm from the Makefile. It snuck in at
the last second before the commit.

# likely we can remove this hack now that gcc generates better aligned code
# in the align to word case.

Noticed by: bde


108005 17-Dec-2002 imp

Reduce diffs with Peter's expanded diffs:
1) Put back the keyboard printing printf, at the cost of 58 bytes.
2) Minor tweak to getstr at no apparent cost.


108000 17-Dec-2002 imp

Make both UFS1 and UFS2 fit on the same boot blocks. These are a
subset of Peter's patchs that are believed to be safe.

Makefile tweaks:
o -fomit-frame-pointer
o Change default to building both UFS1 and UFS2 bootblocks.

Lots of boot2 tweaks:
o lookup is only ever called with kname, so use it directly.
o inline memsize
o getstr are only ever called with cmd, so hardware that.
o tweaks to the parsing code to test after the conversion rather than
before since we tested after anyways.
o eliminate support for %x in printf.
o eliminate a few bytes in printfs.
o Tweak the boot banner.
o eliminate support for wd and " " devices (I might add wd back to
keep bde happy).
o eliminate support for a few arguments.

This takes us from -162 bytes free to 67 bytes free.

I've tested this only on a few systems, so be careful when updating to
this change.

Submitted by: peter, imp, ian


107889 15-Dec-2002 obrien

Remove unneeded casts. Add others to make WARNS=5 happy.


107879 14-Dec-2002 phk

Employ the unused bytes after the disklabel in the second sector. This makes
it possible to make UFS1_ONLY and UFS2_ONLY versions which fit inside the
traditional 16 sectors.

Remove assorted now unneeded hackery.

UFS1_AND_UFS2 still needs another 150 bytes to work, and that is probably
not within our reach, ever.


107878 14-Dec-2002 phk

Remove unnecessary call to fsread().


107875 14-Dec-2002 phk

Always use the smaller GCC builtin memcpy


107874 14-Dec-2002 phk

Remove unused variable.


107869 14-Dec-2002 phk

Don't fill in the table with the BIOS idea about disk-geometry, we don't
use it. This saves a surprising number of bytes.


104683 08-Oct-2002 jhb

Revert MEM_USR back to 0xa000 for BTX clients. Instead, adjust boot2
to run at 0xc000 by changing its virtual start address from 0x1000 to
0x2000.

Tested by: phk


104680 08-Oct-2002 phk

Now that ufsread.c doesn't do 64bit divide remainder operations,
don't bother with libkern.

Sponsored by: DARPA & NAI Labs.


104679 08-Oct-2002 phk

Save a couple of bytes by not returning ints nobody care about.

Sponsored by: DARPA & NAI labs


104673 08-Oct-2002 green

Reinstate rev 1.36 with an important line that got missed. Note this
also improves the "random undocumented offsets into various memory
spaces" a little bit.


104671 08-Oct-2002 phk

Remove unused TYPE_WD and TYPE_WFD.


104670 08-Oct-2002 phk

Correctly calculate dmadat: We need to take the address of _end, it's
contents is irrelevant and likely to be zero;

This doesn't change the resultant value, but it does save a couple of bytes
because &_end is constant.


104668 08-Oct-2002 phk

Unbreak boot2 by backing out rev 1.36 to Makefile, which does not
work as advertised:

bang# pwd
/bang/src/sys/boot/i386/boot2
bang# make clean >& /dev/null
bang# cvs -q update -r 1.35 Makefile >& /dev/null
bang# make >& /dev/null
bang# cat /usr/obj/`pwd`/boot2.h
#define XREADORG 0x725
bang# cvs -q update -r 1.36 Makefile > & /dev/null
bang# make clean > & /dev/null
bang# make > & /dev/null
bang# cat /usr/obj/`pwd`/boot2.h
#define XREADORG 0x25
bang#


104666 08-Oct-2002 phk

Save four bytes by shortening a string two chars.

Sponsored by: DARPA & NAI Labs.


104636 07-Oct-2002 green

Correct a bug in adding 0x700 to a number.


104635 07-Oct-2002 phk

Conditionalize the number of sectors loaded by boot1.s on UFS1/UFS12.

Conditionalize the "XX bytes left" checks reference on UFS1/UFS12.

Conditionally build the necessary 64bit math for boot2 if UFS12.

Sponsored by: DARPA & NAI Labs.


104632 07-Oct-2002 phk

Change the comment character from # to // in boot1.s and run
it through CPP so we can conditionalized things.

Sponsored by: DARPA & NAI Labs


104620 07-Oct-2002 phk

Correctly compensate for both offset and unoffset on-disk BSD disklabels.

Sponsored by: DARPA & NAI Labs.


104618 07-Oct-2002 phk

Move MEM_USR a page upwards to make space for larger UFS1 boot2.

Load 4 sectors more than we used to. This is harmless overhead for
the UFS1_ONLY case, but sufficient for boot2(UFS1+2).

Sponsored by: DARPA & NAI Labs


104612 07-Oct-2002 phk

Move the definition of UFS1_ONLY into the Makefiles where it belongs.

Sponsored by: DARPA & NAI Labs.


104315 01-Oct-2002 iwasaki

Don't call INT 12H anymore in boot program.
Many recent machine have a broken INT 12H (Get base memory size)
implementation and boot program stops if INT 12H is called.

This commit should solve the problem at very first step of FreeBSD
installation occurred on newer some machines.

Reviewed by: bde, jhb
MFC after: 1 week


104272 01-Oct-2002 phk

Split MBR and PC98 on-disk sliceformats out from disklabel.h, step 1:

Peter had repocopied sys/disklabel.h to sys/diskpc98.h and sys/diskmbr.h.

These two new copies are still intact copies of disklabel.h and
therefore protected by #ifndef _SYS_DISKLABEL_H_ so #including them
in programs which already include <sys.disklabel.h> is currently a
no-op.

This commit adds a number of such #includes.

Once I have verified that I have fixed all the places which need fixing,
I will commit the updated versions of the three #include files.

Sponsored by: DARPA & NAI Labs.


102807 01-Sep-2002 kan

Restore Rev. 1.40 (remove "Keyboard yes/no" printf).
GCC 3.2 overflows boot2 by 12 bytes, this patch brings it back
within the boundaries, with 12 bytes available for future bloat.

Approved by: obrien


100872 29-Jul-2002 ru

Drop support for COPY, -c has been the default mode of install(1)
for a long time now.

Approved by: bde


98556 21-Jun-2002 phk

Revert the part of Kirks UFS2 commit which added divdi3.c and moddi3.c
to libi386, this issue was resolved already in a cleaner way.


98542 21-Jun-2002 mckusick

This commit adds basic support for the UFS2 filesystem. The UFS2
filesystem expands the inode to 256 bytes to make space for 64-bit
block pointers. It also adds a file-creation time field, an ability
to use jumbo blocks per inode to allow extent like pointer density,
and space for extended attributes (up to twice the filesystem block
size worth of attributes, e.g., on a 16K filesystem, there is space
for 32K of attributes). UFS2 fully supports and runs existing UFS1
filesystems. New filesystems built using newfs can be built in either
UFS1 or UFS2 format using the -O option. In this commit UFS1 is
the default format, so if you want to build UFS2 format filesystems,
you must specify -O 2. This default will be changed to UFS2 when
UFS2 proves itself to be stable. In this commit the boot code for
reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c)
as there is insufficient space in the boot block. Once the size of the
boot block is increased, this code can be defined.

Things to note: the definition of SBSIZE has changed to SBLOCKSIZE.
The header file <ufs/ufs/dinode.h> must be included before
<ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and
ufs_lbn_t.

Still TODO:
Verify that the first level bootstraps work for all the architectures.
Convert the utility ffsinfo to understand UFS2 and test growfs.
Add support for the extended attribute storage. Update soft updates
to ensure integrity of extended attribute storage. Switch the
current extended attribute interfaces to use the extended attribute
storage. Add the extent like functionality (framework is there,
but is currently never used).

Sponsored by: DARPA & NAI Labs.
Reviewed by: Poul-Henning Kamp <phk@freebsd.org>


97867 05-Jun-2002 phk

Add explicit dependency on ufsread.c


97860 05-Jun-2002 phk

Preparation for UFS2 commit:

Factor the ufs reading code out of the i386/boot2 loader so it can
be reused by for instance sparc64.

Sponsored by: DARPA and NAI Labs.


96533 13-May-2002 ru

Align CLEANFILES with revision 1.25 changes.


96460 12-May-2002 bde

Saved 176 bytes by compiling with -fno-guess-branch-probability. The
default of -fguess-branch-probablility causes time optimizations (?)
like rewriting `if (foo) x++;' as
`if (!foo) goto forth; back: ; ...; forth: x++; goto back;". This is
pessimizes space especially well on i386's because one short branch
gets converted to 2 long ones.

Removed -fno-align-foo since it is implied by -Os. Previous commit
messages seem to have overstated the new alignment bugs in gcc. The
only case that affects boot2 is that -fno-align-functions (or
equivalently -falign-functions=1) actually gives -falign-functions=2.
This is caused by FUNCTION_BOUNDARY being 2 (bytes) instead of 1.
The default case where the optimization level is 1 and no alignment
options are given is more broken. All alignments are minimal, modulo
the bug in FUNCTION_BOUNDARY. This is caused by toplev.c setting
defaults too early.

Some hacks in previous commits ar not needed now, but may as well be
kept until gcc is fixed. The previous on in the Makefile saved 96
bytes of text due to the wrong FUNCTION_BOUNDARY and 32 bytes of data
due to unrelated bloat in the alignment of large objects. There aren't
even any options to control alignment of data.


96426 11-May-2002 peter

Save about 60 bytes by #define memcpy __builtin_memcpy and removing
the function we provided. Restore the Keyboard: yes/no printf for the
probe diagnostics. We end up with 40 bytes free.


96424 11-May-2002 peter

Use a crowbar and duct-tape to make boot2 fit again. This gets it down
to 4 bytes free. I removed a printf (the Keyboard yes/no) since it is of
marginal value and sed'ed the generated asm output to remove the unwanted
aligns. There's probably a better way to gain a few extra bytes than
losing the printf. Shortening strings is probably a better option but this
should get us over the hurdle.


96327 10-May-2002 jhb

- Axe -mpreferred-stack-boundary=2 as -Os turns this on by default.
- Axe -fdata-sections as turning it on or off makes no difference. If
it did make a difference it would serve to bloat boot2 even further with
extra padding.
- Axe -fforce-addr. This gets us 32 bytes so we are down to only being
64-bytes over.

We still can't compile this with gcc 3.1. The problem seems to be that
the -fno-align-foo options don't actually work. Comparing the new and
old output it turns out that gcc is 4-byte padding all the functions and
labels and what not despite the passed in arguments thus adding the
unfortunate bloat to boot2.


96306 10-May-2002 obrien

-ffreestanding is the word for /sys.


94411 11-Apr-2002 pb

Code cleanup, no functional change.
Patch adapted from PR.

PR: i386/36015
Submitted by: thomas@cuivre.fr.eu.org
MFC after: 1 week


93044 23-Mar-2002 pb

Add option -n to i386 boot2 to disallow boot interruption by keypress.

PR: i386/36016
Submitted by: Thomas Quinot <thomas@cuivre.fr.eu.org>
Reviewed by: rnordier
MFC after: 1 week


92225 13-Mar-2002 ru

Implement -m and -p loader(8) "boot" command options in boot2.
(This is more useful for 4.x where boot blocks can still load
kernels, modulo the PR kern/17422.)


89481 17-Jan-2002 iedowse

Oops, the previous revision (1.35) broke booting from floppies
because the buffers we use could end up spanning a 64k boundary.
Unfortunately it causes too much bloat (228 -> 72 bytes free) to
just reinstate the old malloc() function.

Instead, define a structure that contains all 4 buffers which must
not cross 64k boundaries. We allocate a 64k-aligned instance in
main() using the magic that was in the old boot2 malloc() function.
This brings the free space down to 168 bytes, but that is still
better than it was before revision 1.35 (136 bytes).

Reported by: Mike Brancato <funnyguy@digitalsmackdown.net>
Pointy-hat to: iedowse


89368 14-Jan-2002 iedowse

Make the i386 boot2 fully blocksize-agnostic, as has already been
done with boot1 on the alpha. We use 4k buffers regardless of the
actual filesystem block size.

Remove the simple malloc() implementation, as it is no longer used.


89154 09-Jan-2002 iedowse

Increase BSIZEMAX from 8k to 16k, so that we can reliably boot from
filesystems with 16k blocks.


85805 01-Nov-2001 peter

Fix the ILLEGAL fdisk table that is there for supporting "dangerously
dedicated" mode. This was specifying that there are 256 (illegal!)
heads on the disk. If bioses store that in a byte, and it gets truncated
to 0, then that almost certainly causes the infamous divide-by-zero
nightmare.

This is also most likely the reason why the Thinkpad T20/A20 series
were locking up when FreeBSD was installed. This is also the most likely
reason why a boot1 being present causes an IA64 box to lock up at boot.
(removing the "part4" stuff from boot1.s fixes the IA64 boxes and would
most likely have fixed the T20/A20 and some TP600E series thinkpads)


85374 23-Oct-2001 jlemon

Allow the RBX_DUAL flag to appear in bootinfo.


80751 31-Jul-2001 jhb

Add in a hack to support IBM "El Torito" CD-ROM booting BIOS's which expect
the first sector of the emulated floppy to contain a valid MS-DOS BPB that
it can modify. Since boot1 is the first sector of boot.flp, this resulted
in the BIOS overwriting part of boot1: specifically the function used to
read in sectors from the disk.

Submitted by: Mark Peek <mark@whistle.com>
Submitted by: Doug Ambrisko <ambrisko@ambrisko.com>
PR: i386/26382
Obtained from: NetBSD, OpenBSD (the example BPB)
MFC after: 1 month


80084 21-Jul-2001 rnordier

Unset MAINTAINER.


76224 02-May-2001 obrien

* include/elf.h has been repo copied to include/elf-hints.h, and it no
longer includes machine/elf.h.
* consumers of elf.h now use the minimalist elf header possible.

This change is motivated by Binutils 2.11.0 and too much clashing over
our base elf headers and the Binutils elf headers.


66555 02-Oct-2000 rnordier

Set MAINTAINER.


62665 06-Jul-2000 jhb

- Inline all the functions that are only called once. This results in a
savings of 68 bytes in boot2.
- Also add a comment warning that you can't remove the empty exit()
function.


62660 06-Jul-2000 jhb

Doh. The disklabel is not 0x200 bytes of zeros, but it is 0x200 bytes long.


62658 06-Jul-2000 jhb

Clarify the comments in here a bit. The first sector of boot2 is not just
zeros, it is actually the disklabel itself. boot2.ldr is simply a
placeholder in the boot2 binary.


62138 26-Jun-2000 jhb

Add in support for EDD to support large disks via LBA. This uses a
method similar to that of the loader to avoid potentially breaking older
drives in that we only use EDD if the desired cylinder is > 1023.


61836 19-Jun-2000 jhb

Comment this bad boy. Hopefully the next person that comes along won't
have to spend a few hours reading the code to figure all this out.


61627 13-Jun-2000 ru

Treat \t and \n inside /boot.config as whitespaces.

PR: 19215


60821 23-May-2000 jhb

Clean up all of the 16-bit assembly code in the x86 bootstrap to work
with the new binutils. Now that we have a decent assembler, all the old
m4 macros are no longer needed. Instead, straight assembly can be used
since as(1) now understands 16-bit addressing, branches, etc. Also,
several bugs have been fixed in as(1), allowing boot0.s to be further
cleaned up.


59150 11-Apr-2000 jhb

Add a missing dependency: boot2 depends on the BTX kernel.


57090 09-Feb-2000 ru

Support the new ata(4) syntax, while providing backward compatibility for wd(4).

Reviewed by: jkh, msmith, sos
Approved by: jkh


53174 15-Nov-1999 obrien

Add -fdata-sections, which is a new GCC 2.95 optimization. Remove
-fschedule-insns as it wasn't such a big win with 2.95 after all.

Add the *BIG* win "-mpreferred-stack-boundary=2" optimiztion submitted by
Dima. GCC 2.95 ensures the stack frame is always properly [opitimally]
aligned by surrounding every function call by code simular to
"addl $-12, %esp" / "addl $12, %esp". Here we need the reduction in space,
with speed not an issue.


53159 14-Nov-1999 obrien

Return this file to its pre-spammed version. Thanks to some new compiler
optimizations, we can go from 3 bytes free with the spammed version, to
279 bytes free with the full version.


53135 14-Nov-1999 obrien

Enter complier upgrade mode again. We need to cut 169 bytes from this:
Remove some printf() calls, reduce size of buffers, and abbreviate
some strings.

Hopefully the boot people will fix this spamage after the cut over to
Gcc 2.95.2 as the system compiler.


53134 13-Nov-1999 obrien

Turn on the -fforce-addr and -fschedule-insns optimizations. Adding
either one gives us an additional 32 bytes of additional space available
when using EGCS 1.1.2. With GCC 2.95.2 -fforce-addr gives us 12 more bytes,
and adding -fschedule-insns gives us an additional 4 bytes.


50477 28-Aug-1999 peter

$Id$ -> $FreeBSD$


48919 20-Jul-1999 rnordier

Reintroduce LBA (cyl > 1023) support in the bootblocks, enabled by
means of a build option.


48034 19-Jun-1999 rnordier

Fix use of e_phoff in place of e_phnum.


45335 05-Apr-1999 rnordier

Fix damage introduced in previous commit.


45334 05-Apr-1999 rnordier

Optimize better for space.
Thanks to: jdp


45309 04-Apr-1999 obrien

Remove the string ">>> FreeBSD/i386 BOOT". I need to reduce the size of
boot2 by 16 bytes. I expect this to be temperary until the boot2 authors
can do the proper fix.


45175 31-Mar-1999 joerg

Make <DEL> an alternative rubout character for command input; many
serial terminals use this as their default rubout key.


43374 29-Jan-1999 rnordier

Check size of partition before using it.


43113 24-Jan-1999 msmith

Fill in the bi_bios_dev field in the bootinfo struct; the loader doesn't
guess this value well in anything other than the simplest of situations.


42638 13-Jan-1999 rnordier

In the event of a disk error, boot2 is expecting an error
code to be returned: give it one


42519 11-Jan-1999 rnordier

Drop boot.help support.


42480 10-Jan-1999 rnordier

Use etc/make.conf settings for serial port and speed.

Submitted by: rvb
Reviewed by: bde


42478 10-Jan-1999 peter

Damn, I thought I had committed this already, but it seems not.

Move the relocated boot1 and arg transfer space from 0x600/0x800 to
0x700/0x900. In theory this should make no difference, apart from the fact
that Buslogic controllers happen to use a few bytes at 0x600 for some sort
of scratch space for it's int 0x13 hook (!!!), causing the machine to crash
badly when the boot2 code makes it's callbacks into boot1 for disk IO.

Submitted by: Robert Nordier <rnordier@freebsd.org>


41085 11-Nov-1998 rnordier

Revise error messages.


41013 08-Nov-1998 rnordier

Prevent boot.config being parsed more than once.


41010 08-Nov-1998 rnordier

Drop the familiar 'text=xxxx data=xxxx bss=xxxx ...' display while
loading. This eliminates noise when loading boot/loader; and when
loading a kernel, they generally flash by too fast to be
intelligible anyway.


41008 08-Nov-1998 rnordier

boot1: Eliminate EDD detection and optional use of disk packet
interface. Do some general consistency fixes and space optimizations.
Use of some freed-up space to defend against possible BIOS misfeatures.

boot2: Revise disk read interface to provide for boot1 changes. Free
up space for this.


40940 05-Nov-1998 rnordier

Make use of BIOS int 0x13 extensions configurable, and disabled
by default.


40675 27-Oct-1998 rnordier

Avoid interruptions while talking to keyboard controller.


40674 27-Oct-1998 rnordier

biosboot compatibility fix: change behavior of backspace in getstr().
Noticed by: abial

Optimize away a few bytes to make space for the above.


40541 20-Oct-1998 rnordier

Make serial port, data format, and bps configurable.


40477 17-Oct-1998 rnordier

Fix some glitches in the input routine:
Don't display a \b if not acting on it.
Don't process binary zero chars (which result from pressing function
keys, etc. on the PC).


40476 17-Oct-1998 rnordier

Having probed the keyboard, turn off the -P flag.


40474 17-Oct-1998 rnordier

Treat all options as toggles (ie. -c -c is the same no -c). Since
the boot.config settings are persistent, this seems to provide a
useful override capability, and should break only on broken
boot.config's.

Output a cosmetic newline if booting with no input.


40472 17-Oct-1998 rnordier

biosboot compatibility fix:
If we have a boot.config command, display it.


40471 17-Oct-1998 rnordier

biosboot compatibility fix:
Read boot.help before parsing boot.config. We were parsing
boot.config first, which could result in boot.help being read
from a different location (or not found), which would probably
just cause surprise, without being useful.


40416 15-Oct-1998 rnordier

Fix path to sio.s


40404 15-Oct-1998 rnordier

Add serial, dual, and probe-keyboard support.


40330 14-Oct-1998 rnordier

Fix btx include path.


40326 14-Oct-1998 rnordier

Include <bsd.prog.mk>. Add install target (to /boot for now).


40325 13-Oct-1998 rnordier

Fix flow of control after directory listing; enable EDD support;
cosmetics.


40323 13-Oct-1998 rnordier

Make v86.ctl default more explicit; simplify read error-handling;
twiddle.


40320 13-Oct-1998 rnordier

Adjust NDEV value.
Optimize reading of system time.


40314 13-Oct-1998 rnordier

Change to a 15-sector boot2.
Refine slice-handling.


40308 13-Oct-1998 rnordier

Don't use an absolute path to objcopy.
Noticed by: Scott Mace <smace@intt.org>


40307 13-Oct-1998 rnordier

Improve drive recognition and handling.


40270 12-Oct-1998 rnordier

This commit was generated by cvs2svn to compensate for changes in r40269,
which included commits to RCS files with non-trunk default branches.


40269 12-Oct-1998 rnordier

New boot blocks: support for /boot/loader; a.out & ELF; cyl > 1023;
multiple 0xa5 slices; etc.