aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/i386/boot2
Commit message (Collapse)AuthorAgeFilesLines
* Move sys/boot to stand. Fix all references to new locationWarner Losh2017-11-146-1240/+0
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=325834
* Install the 4th files in sys/boot/forth instead of each loaderWarner Losh2017-11-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Also, move generation of loader.help into loader.mk. Set HELP_FILES= to disable this (so we only install one help file, for now). At the same time remove some duplicate -I lines. Fix several FILES= and CLEANFILES= into the += form since we're touching both of those in the .mk files. Make sure we only build one loader.help file per platform in a unified way (we were building many on some, with the last to install winning, though often they were the same text). Also, we're now installing loader.rc and menu.rc everywhere. arm and mips uboot installed these as menu.rc.sample, but there's no need since the loader.rc for those platforms doesn't do menu.rc processing by default. pcibios.4th is now installed everywhere, but will failsafe on non x86 platforms (it isn't loaded by default anywhere). These changes are too intertwined to do separately since aspects of each are required to have a bug-free commit. Sponsored by: Netflix Notes: svn path=/head/; revision=325694
* Move machine and other link creation to defs.mkWarner Losh2017-11-061-7/+0
| | | | | | | | | | | | | | | | Steal the code from kmod.mk and use it to automatically create links. Modify it a little for the needs of the loader (no need to guess the OBJS dependency, and we have 32-on-64 cases to contend with). Remove 15 redundant implementations (which were mostly different, but kinda the same). A future commit should factor out this code and that of kmod.mk so we have only one copy of it in the tree. Sposnored by: Netflix Notes: svn path=/head/; revision=325482
* Use defs.mk name and prefer bsd.init.mkWarner Losh2017-10-301-9/+6
| | | | | | | | | | Also need to make some small tweaks to the Makefiles to use += rather than = due to small shift in include file order. Sponsored by: Netflix Notes: svn path=/head/; revision=325171
* i386/boot2: -fno-asynchronous-unwind-tables for gccRyan Libby2017-08-091-0/+1
| | | | | | | | | | | | | | | | | | The amd64 build of boot2 was failing with gcc 6.3.0 due to being more than 1 kB too large. It was apparently generating a .eh_frame section which was not being removed by objcopy -S. The .eh_frame section seems to be mandatory per the amd64 ABI, but boot2 is compiled for i386 (uses -m32), and therefore should be optional in this context. Suppress generation of .eh_frame with the -fno-asynchronous-unwind-tables flag to gcc. This saves 1348 bytes (the limit is 7680 bytes). Reviewed by: dim, imp Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11928 Notes: svn path=/head/; revision=322329
* Revert r321969Enji Cooper2017-08-031-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My change had good intentions, but the implementation was incorrect: - printf was returning the number of characters in the format string plus the NUL, but failed in two regards implementation wise: -- the pathological case, printf(""), wasn't being handled properly since the pointer is always incremented, so the value returned would be off-by-one. -- printf(3) reports the number of characters printed post-conversion via vfprintf, etc. - putchar(3) should return the character printed or EOF, not the number of characters output to the screen. My goal in making the change (again) was to increase parity, but as bde pointed out these are freestanding functions, so they don't have to conform to libc/POSIX. I argued that the functions should be named differently since the implementation is different enough to warrant it and to allow boot2 code to be usable when linked against sys/boot and libstand and other libraries in base. I have no interest in pushing this change forward more though, as the original concern I had behind the change with zfsboottest was resolved in r321849 and r321852. The next person that updates the toolchain gets to deal with the inconsistency if it's flagged by a newer compiler. MFC after: 1 month Reported by: ed, markj Notes: svn path=/head/; revision=321991
* Fix the return types for printf and putchar to match their libc andEnji Cooper2017-08-031-5/+7
| | | | | | | | | | | | | | | POSIX equivalents Both printf and putchar return int, not void. This will allow code that leverages the libcalls and checks/rely on the return type to interchangeably between loader code and non-loader code. MFC after: 1 month Notes: svn path=/head/; revision=321969
* xfsread inlined uses more space, so remove the inline tag. ThisWarner Losh2017-03-291-1/+1
| | | | | | | | | doesn't help clang, but buys us another 32 bytes for gcc 4.2.1. It also eliminates a warning from gcc 6.3.0 that says inlining this would be unhelpful. Notes: svn path=/head/; revision=316171
* Parameterize out 7680 (15 * 512) as BOOT2SIZE, similar to ↵Enji Cooper2017-03-291-2/+4
| | | | | | | | | | | | | | 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. MFC after: 2 months Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316132
* Don't hardcode input files for stage 1/2 bootloaders; use .ALLSRC insteadEnji Cooper2017-03-281-2/+2
| | | | | | | | | | | | 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). MFC after: 3 days Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316109
* Remove -fno-guess-branch-probability and -fno-unit-at-a-time.Warner Losh2017-03-281-2/+0
| | | | | | | | | | | | | | | | | | | | | bde enabled -fno-guess-branch-probability in 2003, well before our current compiler was imported. At the time it produced weirdly orded code. It no longer does that. It also saves 0-4 bytes depending on other options. kan disabled unit-at-a-time in 2004 because it badly mangled boot2 so it wouldn't work. That too was before the 4.2.1 compiler, where it no longer does that. This saves 44 bytes. I had planned to document why they were needed, but when I discovered their antiquity, I removed them and boot2 still works and is smaller. In qemu, the old and new boot2's behaved identically. These are gcc specific hacks, and won't affect clang-built boot2 at all. Notes: svn path=/head/; revision=316100
* Simply retire the sedification of the boot2.s file. It's been obsoleteWarner Losh2017-03-281-17/+1
| | | | | | | | | | | | | for years. clang before 96 free after 100 (+4) gcc before 163 free after 156 (-7) Suggested by: bde@ Sponsored by: Netflix Notes: svn path=/head/; revision=316079
* Fix build with path names with 'align' or 'nop' in them.Warner Losh2017-03-271-2/+10
| | | | | | | | | | | | | | | | | clang is now inserting .file directives with the entire path in them. This is fine, except that our sed peephole optimizer removes them if ${SRCTOP} or ${OBJTOP} contains 'align' or 'nop', leading to build failures. The sed peephole optimizer removes useful things for boot2 when used with clang, so restrict its use to gcc. Also, gcc no longer generates nops to pad things, so there's no point in removing it. Specialize the optimization to just removing the .align 4 lines to preclude inadvertant path matching. Sponsored by: Netflix Commit brought to you the path: /home/xxx/NCD-3592-logsynopts/FreeBSD Notes: svn path=/head/; revision=316064
* Remove unused macro from common/drv.c.Mariusz Zaborski2017-02-251-1/+0
| | | | | | | | | | | | | When we was compering it to code from boot2 it also looks like this code is buggy and boot2 was never updated to use this code. USE_XREAD flag is unused in boot2, and common/drv.c was never build with that flag. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D9780 Notes: svn path=/head/; revision=314275
* dd is currently a bootstrap tool. It really doesn't have any businessWarner Losh2016-12-021-2/+2
| | | | | | | | | | | | | | | 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. Differential Revision: https://reviews.freebsd.org/D8605 Notes: svn path=/head/; revision=309412
* Don't use -N to set the OMAGIC with data and text writeable and dataWarner Losh2016-09-031-1/+1
| | | | | | | | | | | | | | | | | not page aligned. To do this, use the ld script gnu ld installs on my system. This is imperfect: LDFLAGS_BIN and LD_FLAGS_BIN describe different things. The loader script could be better named and take into account other architectures. And having two different mechanisms to do basically the same thing needs study. However, it's blocking forward progress on lld, so I'll work in parallel to sort these out. Differential Revision: https://reviews.freebsd.org/D7409 Reviewed by: emaste Notes: svn path=/head/; revision=305353
* Add SHA512, skein, large blocks support for loader zfs.Toomas Soome2016-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Updated sha512 from illumos. Using skein from freebsd crypto tree. Since loader itself is using 64MB memory for heap, updated zfsboot to use same, and this also allows to support zfs large blocks. Note, adding additional features does increate zfsboot code, therefore this update does increase zfsboot code to 128k, also I have ported gptldr.S update to zfsldr.S to support 64k+ code. With this update, boot1.efi has almost reached the current limit of the size set for it, so one of the future patches for boot1.efi will need to increase the limit. Currently known missing zfs features in boot loader are edonr and gzip support. Reviewed by: delphij, imp Approved by: imp (mentor) Obtained from: sha256.c update and skein_zfs.c stub from illumos. Differential Revision: https://reviews.freebsd.org/D7418 Notes: svn path=/head/; revision=304321
* Implement (ACFLAGS|CFLAGS|CXXFLAGS).SRC globally.Bryan Drewery2016-03-261-1/+0
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=297283
* Remove dd xfer stats emitted during buildworldEd Maste2016-02-181-2/+2
| | | | | | | They result in gratuitous differences when comparing build log output. Notes: svn path=/head/; revision=295757
* Fix mistake when transitioning to the new defines with ZFS loader. IWarner Losh2016-01-271-1/+1
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=294925
* RBX_ defines are in rbx.h, move it there.Warner Losh2016-01-261-39/+2
| | | | | | | Differential Revision: https://reviews.freebsd.org/D5038 Notes: svn path=/head/; revision=294766
* Move all the separate copies of the same strings into paths.h. There'sWarner Losh2016-01-261-5/+1
| | | | | | | | | nothing machine specific about these. Differential Revision: https://reviews.freebsd.org/D5038 Notes: svn path=/head/; revision=294765
* META MODE: Update dependencies with 'the-lot' and add missing directories.Bryan Drewery2015-12-011-0/+3
| | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=291563
* META MODE: Don't create .meta files when symlinking sources into the obj ↵Bryan Drewery2015-11-251-2/+2
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=291320
* META_MODE: Remove DEP_MACHINE from Makefile.depend files.Bryan Drewery2015-09-251-2/+0
| | | | | | | | | This has not been needed since r246865 in projects/bmake. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=288228
* META_MODE: Remove DEP_RELDIR from Makefile.depend files.Bryan Drewery2015-09-251-2/+0
| | | | | | | | | This has not been needed since r284171 in projects/bmake. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=288226
* Reduce warnings:Xin LI2015-06-261-1/+3
| | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=284878
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=284345
| * Merge sync of headSimon J. Gerraty2015-05-272-20/+30
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-191-3/+1
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * \ Merge head from 7/28Simon J. Gerraty2014-08-192-7/+28
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * \ \ Merge from headSimon J. Gerraty2014-05-081-1/+2
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265720
| * \ \ \ Merge headSimon J. Gerraty2014-04-281-7/+9
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265044
| * \ \ \ \ Sync with HEAD.David E. O'Brien2013-02-081-4/+2
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246555
| * \ \ \ \ \ Sync from headSimon J. Gerraty2012-11-043-10/+16
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | | | | Ensure the cross assembler, linker and objcopy are used for the build32Dimitry Andric2015-04-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=280980
* | | | | | | | When compiling boot2 with gcc on i386 and pc98, only use the custom flagDimitry Andric2015-03-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -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 Notes: svn path=/head/; revision=279598
* | | | | | | | Merge ^/head r275262 through r275363.Dimitry Andric2014-12-011-1/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/clang350-import/; revision=275364
| * | | | | | | | Unbreak the code for non-digits below '0' by casting the expressionRoman Divacky2014-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to unsigned int. Pointed out by: bde Notes: svn path=/head/; revision=275305
* | | | | | | | | Merge ^/head r274961 through r275261.Dimitry Andric2014-11-291-6/+10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/clang350-import/; revision=275262
| * | | | | | | | Shrink boot2 a bit more by factoring out common patternRoman Divacky2014-11-291-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of printf();return(-1); This shrinks it by 8bytes using clang35 and by 12bytes using clang34. Notes: svn path=/head/; revision=275237
* | | | | | | | | Merge ^/head r275118 through r275209.Dimitry Andric2014-11-281-2/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/clang350-import/; revision=275210
| * | | | | | | | Revert part of r275059. Comparing unsigned 8 bit valueRoman Divacky2014-11-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | against -'0' is always false so the conditional block is optimized away. Notes: svn path=/head/; revision=275191
* | | | | | | | | r274961 through r275075Dimitry Andric2014-11-251-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/clang350-import/; revision=275078
| * | | | | | | | Fix style(9).Roman Divacky2014-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suggested by: jkim Notes: svn path=/head/; revision=275062
| * | | | | | | | Fix style(9).Roman Divacky2014-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suggested by: jkim Notes: svn path=/head/; revision=275061
| * | | | | | | | Shrink boot2 by a couple more bytes.Roman Divacky2014-11-251-9/+14
| | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed by: jhb Tested by: me, dim Notes: svn path=/head/; revision=275059
* / | | | | | | Ensure boot2 stays below the limit, by applying a patch from RomanDimitry Andric2014-11-242-13/+18
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Divacky which shrinks the code, and by using the custom llvm option to disable the Global Value Numbering optimization pass. Notes: svn path=/projects/clang350-import/; revision=274977
* | | | | | | Remove extra '\'.Yoshihiro Takahashi2014-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/head/; revision=272249