boot: Move boot source code /usr/src/stand. sys/boot becomes stand/boot and lib/libstand becomes stand/lib. My main reason is to have boot out of the way when for example grepping in sys/. It also makes more sense since it's not really userland or kernel code. Other BSDs have moved their boot/standalone code around too, but maybe with different directory layouts. Approved-by: dillon, zrj
world - Change serial port default from 9600 to 115200 * Long overdue change, all serial port defaults are now set to 115200. * NOTE: legacy BIOS boot0/boot1 use int 0x14 to set the serial console baud rate. This BIOS call only supports up to 9600. But once you get into the boot loader it should be able to set the correct baud rate.
btxld(8): Convert to hostprog. There is no point to provide this utility in base. We are not planing to bring back i386 support. Move it into sys/boot/pc32/ for easier handling. This way the AOUT_H_FORCE32 now is confined to the same pc32/ directory. The <sys/imgact_aout.h> has override for it to create proper btx header. For future we should make btxld endian neutral.
sys/boot: Unbreak WORLD_CCVER=gcc47 Fix -Ox flags mess that exploded boot2_32 image size, by ensuring that intended -Ox flags were used were needed (gcc50 unaffected). There is still compilation issue for buildkernel w/ gcc47 but that -Werror=maybe-uninitialized on i915_gem_stolen.c can wait a bit.
i386 removal, part 11/x: Remove wrong machine/ setup in the boot Makefiles. Several of the link targets were pointing to ${.CURDIR}/../../i386/... which doesn't exist. This is from times when our platform-specific headers were differently laid out and it was never noticed that after some point, it was no longer needed. In fact, sys/boot builds properly without all this, because: * -m32 ensures that the i386 platform is targeted by the compiler * Various (needed) __i386__ checks in sys/cpu/x86_64/include ensure that even on x86_64, the basic types have the right sizes. Confirmed by binary compare of /boot without and with the patch.
boot/pc32: specify some flags based on CCVER Some flags are gcc-specific, so only set them if CCVER begins with the substring "gcc". Some assembly files can only be built by the binutils GNU assembler, so define ASSEMBLER flags which CCVER starting with "clang" will augment. There is no change for the current base compilers.
hammer2 - Add hammer2 boot support * Add hammer2 boot loader support. The hammer2 boot loader accesses the hammer2 mount starting at the super-root. To use hammer2 boot support you need to have a PFS called 'boot', which will be seen as "/boot" by the boot loader. The 'boot' PFS can be created either by creating a boot-specific H2 partition with 'newfs_hammer2 -L boot ...', or by using 'hammer2 pfs-create boot' to create a PFS called 'boot'. You can access any super-root if desired. * Since boot is a super-root you can mix boot PFS's and other PFS's on the same hammer2 filesystem, including creating a boot PFS far later on. * WARNING!!!!! The 'boot' PFS must be configured without compression. i.e. 'hammer2 setcomp autozero /boot' (assuming you've mounted it on /boot), before you install anything. The newfs_hammer2 utility will automatically handle this if you specify a label name of 'boot' (i.e. -L boot). * WARNING!!!!! The BIOS may not be able to reliably access very high sector numbers on large hard drives, so to be safe we recommend creating a small 'a' partition anyway, unless the drive / main hammer2 filesystem is small enough to not cause problems. * Add %qx support to boot2's mini printf(). * Fix ipdata->comp_algo propagation bug in hammer2_inode_create() * newfs_hammer2 and the pfs_create ioctl will set comp_algo to AUTOZERO for PFS's called "boot" automatically.
CCVER=gcc46: Adjust Makefile so boot2 remains < 7.5kb A big sticking point with getting gcc46 to successfully buildworld was getting boot2 to come in at 7680 bytes or less. Unmodified it was weighing in 784 bytes too much. Every applying several byte-reducing changes to it from FreeBSD only knocked off about 380 bytes. Comparing the assembly dumps between versions built by the base compiler and gcc46 didn't reveal that much, but using the readelf utility on both did. GCC 4.6 was embedding the .eh_frame section to the object file generated from boot2.c which was adding over 1900 bytes to it. After adding three command line switches to the makefile, the exception handler section is prohibited from building. There are 4968 bytes still available, down from 4988 bytes seen with the base compiler. The updates from FreeBSD can be applied later to free up more memory but for now it's not required.