summaryrefslogtreecommitdiffstats
path: root/sys/boot/i386
Commit message (Collapse)AuthorAgeFilesLines
* Always update the hw.uart.console hint anytime a change is made to thejhb2013-01-231-18/+7
| | | | | | | | | | | comconsole setup. Previously the hint would be set when if you set a custom port, but it would not be updated if you later set a custom speed. Also, leave the hw.uart.console hint mutable so it can be overridden or unset by the user if needed. Reviewed by: kib (earlier version) MFC after: 1 week
* Fix linking of loader.efi.benno2013-01-221-1/+1
| | | | | | | | | gcc handles -symbolic by passing -Bsymbolic through to ld. clang ignores -symbolic and thus invokes ld without -Bsymbolic which leads to some symbols not being properly linked in loader.efi. Fix this by using -Wl,-Bsymbolic which passes -Bsymbolic to ld in both the gcc and clang cases. Approved by: rpaulo
* Quiesce some clang warnings while we're here doing stuff.sbruno2013-01-143-2/+9
| | | | | Submitted by: Hiren Panchasara <hiren.panchasara@gmail.com> Obtained from: Yahoo! Inc
* amd64 only has rela sections.rpaulo2012-12-171-12/+12
|
* Make this work for 64 bit binaries.rpaulo2012-12-071-9/+22
|
* Remove dead code that clang refuses to compile.rpaulo2012-12-051-10/+0
|
* boot: use packed attribute for edd_params* structures and their substructuresavg2012-11-141-5/+5
| | | | | | | | | | | | | | | | | | | | The sole purpose of this change is to make sure that sizeof produces "canonical" sizes for these structures. This is to avoid triggering bugs in the BIOSes that properly handle only the canonical values of input length provided to INT 13h AH=48h. The canonical sizes are: 30 for v2, 66 for v3, etc. Buggy BIOS code probably looks like: if (input_length > 30) { /* > v2 */ assume that input length is 66 /* assume v3 or later */ } This should fix boot problems at least on Supermicro X8DT6 and possibly on P410i Smart Array Controller (as found in e.g. HP DL360 G7). Reported by: gnn, np, rstone Debugged by: rstone Discussed with: ae, np, rstone MFC after: 4 days
* Shrink boot2 by 8 bytes, by eliminating some unneeded instructions indim2012-11-081-4/+2
| | | | | | | | 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
* Hook in new files menusets.4th and manual.dteske2012-11-071-1/+1
| | | | Approved by: adrian (co-mentor) (implicit)
* Add the flags parameter to the disk_open() function and DISK_F_NOCACHEae2012-10-211-3/+7
| | | | | flag, that disables the caching of partition tables metadata. Use this flag for floppies in the libi386/biosdisk driver.
* boot: use -march=i386 for both i386 and amd64 buildsavg2012-10-201-2/+2
| | | | | | | | | | | | .. so that consistent compilation algorithms are used for both architectures as in practice the binaries are expected to be interchangeable (for time being). Previously i386 used default setting which were equivalent to -march=i486 -mtune=generic. The only difference is using smaller but slower "leave" instructions. Discussed with: jhb, dim MFC after: 29 days
* add detection of serial console presence to btx and boot2-like blocksavg2012-10-066-20/+35
| | | | | | | | 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
* i386 comconsole: don't loop forever if hardware doesn't respondavg2012-10-061-14/+22
| | | | | | | | | | | - clear capability flags when hw timeouts - retire comc_started status variable and directly use c_flags to see if comconsole is selected for use Reviewed by: jhb Tested by: Uffe Jakobsen <uffe@uffe.org>, Olivier Cochard-Labbe <olivier@cochard.me> MFC after: 26 days
* zfsboot: simplify probe_drive() a little bitavg2012-10-061-27/+13
| | | | | | | | | | | The first discovered pool, whether it covers the whole boot disk or not, is going to be first in zfs_pools list. So there is no need at all for spapp parameter. This commit also fixes a bug where NULL would be assigned to NULL pointer when probe_drive was called with the spapp parameter of NULL. MFC after: 21 days
* zfs boot: export boot/primary pool and vdev guid all the way to kenvavg2012-10-062-2/+20
| | | | | | | This is work in progress to for znextboot and it also provides some convenient infrastructure. MFC after: 20 days
* zfsboot: use the same zfs dataset naming format as loaderavg2012-10-061-32/+53
| | | | | | | Also, pool name alone now names a root dataset of the pool regardless of bootfs property value. MFC after: 15 days
* zfs boot: add lszfs command to i386 loaderavg2012-10-061-0/+23
| | | | | | | ... to list child datasets of a specified dataset. Dataset name should be provided in poolname/dsname format. MFC after: 17 days
* Reduce the number of attempts to detect proper kld format for the amd64ae2012-09-302-0/+7
| | | | loader.
* Almost each time when loader opens a file, this leads to callingae2012-09-291-1/+9
| | | | | | | | | | | | | | | | | | disk_open(). Very often this is called several times for one file. This leads to reading partition table metadata for each call. To reduce the number of disk I/O we have a simple block cache, but it is very dumb and more than half of I/O operations related to reading metadata, misses this cache. Introduce new cache layer to resolve this problem. It is independent and doesn't need initialization like bcache, and will work by default for all loaders which use the new DISK API. A successful disk_open() call to each new disk or partition produces new entry in the cache. Even more, when disk was already open, now opening of any nested partitions does not require reading top level partition table. So, if without this cache, partition table metadata was read around 20-50 times during boot, now it reads only once. This affects the booting from GPT and MBR from the UFS.
* Disable splitfs support, since we aren't support floppies for a longae2012-09-291-0/+2
| | | | | time. This slightly reduces an overhead, when loader tries to open file that doesn't exist.
* loader/i386: replace ugly inb/outb re-implementations with cpufunc.havg2012-09-181-18/+4
| | | | | | | | Use of __builtin_constant_p in a function that is only called via a pointer is a good example of how out-of-date it was. Suggested by: bde MFC after: 1 week
* Make pxe device in lsdev really include device name, looking like this:mav2012-09-122-20/+4
| | | | | | pxe0: 192.168.3.1:/storage/nfsroot/amd64 , instead of confusing and less useful: 192.168.3.1:pxeboot
* a bit of trailing whitespace cleanupavg2012-09-111-7/+7
| | | | MFC after: 1 week
* Slightly reduce an overhead for the open() call in the zfsloader.ae2012-09-111-3/+3
| | | | | | libstand(3) tries to detect file system in the predefined order, but zfsloader usually is used for the booting from ZFS, and there is no need to try detect several file system types for each open() call.
* After r239066, reinitialize v86.ctl and v86.addr for int 13 EDD probingdim2012-08-131-0/+2
| | | | | | in sys/boot/i386/libi386/biosdisk.c. Otherwise, when DISK_DEBUG is enabled, the DEBUG() macros will clobber those fields, and cause the probing to always fail mysteriously when debugging is enabled.
* Add another debug message.ae2012-08-121-0/+2
|
* Teach the ZFS use new partitions API when probing.ae2012-08-051-13/+5
| | | | | Note: now ZFS does probe only for partitions with type "freebsd-zfs" and "freebsd".
* Remove unneeded flag.ae2012-08-051-3/+0
|
* Add offset field to the i386_devdesc structure to be compatible withae2012-08-054-1070/+243
| | | | disk_devdesc structure. Update biosdisk driver to the new disk API.
* When GPT signature is invalid in the primary GPT header, then try toae2012-08-051-7/+36
| | | | | | read backup GPT header. Submitted by: hrs (previous version)
* Remove unnecessary initializations. The BSS of boot2 is in factjhb2012-06-011-2/+2
| | | | | | zero'd when boot2 begins execution by the _start() routine in btxcsu.S. MFC after: 1 week
* Make sure that each va_start has one and only one matching va_end,kevlo2012-05-291-0/+1
| | | | especially in error cases.
* Use 32-bit ufs_ino_t instead of ino_t to keep boot2 small and preventgleb2012-05-252-8/+6
| | | | | | unnecessary 64-bit math on 32-bit machines. Sponsored by: Google Summer of Code 2011
* Import work done under project/nand (@235533) into head.gber2012-05-172-0/+6
| | | | | | | | | | | | | | The NAND Flash environment consists of several distinct components: - NAND framework (drivers harness for NAND controllers and NAND chips) - NAND simulator (NANDsim) - NAND file system (NAND FS) - Companion tools and utilities - Documentation (manual pages) This work is still experimental. Please use with caution. Obtained from: Semihalf Supported by: FreeBSD Foundation, Juniper Networks
* zfsboot/zfsloader: support accessing filesystems within a poolavg2012-05-126-55/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In zfs loader zfs device name format now is "zfs:pool/fs", fully qualified file path is "zfs:pool/fs:/path/to/file" loader allows accessing files from various pools and filesystems as well as changing currdev to a different pool/filesystem. zfsboot accepts kernel/loader name in a format pool:fs:path/to/file or, as before, pool:path/to/file; in the latter case a default filesystem is used (pool root or bootfs). zfsboot passes guids of the selected pool and dataset to zfsloader to be used as its defaults. zfs support should be architecture independent and is provided in a separate library, but architectures wishing to use this zfs support still have to provide some glue code and their devdesc should be compatible with zfs_devdesc. arch_zfs_probe method is used to discover all disk devices that may be part of ZFS pool(s). libi386 unconditionally includes zfs support, but some zfs-specific functions are stubbed out as weak symbols. The strong definitions are provided in libzfsboot. This change mean that the size of i386_devspec becomes larger to match zfs_devspec. Backward-compatibility shims are provided for recently added sparc64 zfs boot support. Currently that architecture still works the old way and does not support the new features. TODO: - clear up pool root filesystem vs pool bootfs filesystem distinction - update sparc64 support - set vfs.root.mountfrom based on currdev (for zfs) Mid-future TODO: - loader sub-menu for selecting alternative boot environment Distant future TODO: - support accessing snapshots, using a snapshot as readonly root Reviewed by: marius (sparc64), Gavin Mu <gavin.mu@gmail.com> (sparc64) Tested by: Florian Wagner <florian@wagner-flo.net> (x86), marius (sparc64) No objections: fs@, hackers@ MFC after: 1 month
* Fix sys/boot/i386/cdboot/cdboot.S compilation with clang after r235219.dim2012-05-111-0/+4
| | | | | | | This file uses .code16 directives, which are not yet supported by clang's integrated assembler. MFC after: 1 month
* cdboot, pxeldr: make use of bootargs.h instead of redefining flag constantsavg2012-05-104-11/+8
| | | | | Reviewed by: jhb MFC after: 1 month
* r235154 followup: add stddef.h for offsetofavg2012-05-091-0/+1
| | | | MFC after: 1 month
* i386 zfsloader: rename LIBZFS to LIBZFSBOOTavg2012-05-091-5/+3
| | | | | | ... to avoid name clash with the other libzfs MFC after: 1 month
* i386 boot: consolidate MAXBDDEV definitionavg2012-05-093-4/+2
| | | | MFC after: 1 month
* btxldr: future-proof argument passing from boot1/2-ish to loaderavg2012-05-099-34/+99
| | | | | | | | | | | | | | | Place the arguments at a fixed offset of 0x800 withing the argument area (of size 0x1000). Allow variable size extended arguments first of which should be a size of the extended arguments (including the size parameter). Consolidate all related definitions in a new i386/common/bootargs.h header. Many thanks to jhb and bde for their guidance and reviews. Reviewed by: jhb, bde Approved by: jhb MFC after: 1 month
* sys/boot: add common CTASSERT definitionavg2012-05-091-10/+1
|
* Build a 32-bit EFI loader on amd64. This to match the rest of themarcel2012-04-201-2/+9
| | | | | | | | | code that is used to construct a loader (e.g. libstand, ficl, etc). There is such a thing as a 64-bit EFI application, but it's not as standard as 32-bit is. Let's make the 32-bit functional (as in we can load and actualy boot a kernel) before solving the 64-bit loader problem.
* zfsboot: honor -q if it's present in boot.configavg2012-04-161-2/+8
| | | | | | | | | | | Before r228267 the option was honored but the original content of boot.config was not preserved. I tried to fix that but missed the idea. Now the proper way of doing things is taken from i386/boo2. Also, a comment is added to explain this a little bit unobvious behavior. Inspired by: jhb MFC after: 5 days
* Make boot2 build with Clang again.jkim2012-03-091-4/+2
| | | | | Submitted by: dim (bsd.sys.mk) Reviewed by: dim, jhb
* Add a note to clarify why we create a relocated copy of boot1 in lowerjhb2012-03-061-1/+4
| | | | memory.
* Fix boot2 to handle boot config files that only contain a custom path tojhb2012-03-051-6/+15
| | | | | | | | | | | | 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
* Fix a long standing bug. The caller expects a non-zero value for success.jkim2012-02-291-2/+2
| | | | | | | Luckily keyboard probing was turned off by default from the first revision. Submitted by: Alexander Sack (asack at niksun dot com) MFC after: 3 days
* Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, todim2012-02-289-51/+39
| | | | | | | | | | | | | | | | | | | | | 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
* Wrap changes from svn r212126 inside LOADER_NFS_SUPPORT such thatsbruno2012-01-191-0/+2
| | | | | | | | | | | | using LOADER_TFTP_SUPPORT excludes this code. Fixes compilation of pxeldr with -DLOADER_TFTP_SUPPORT Applicable to stable/9 and stable/8 now. This appears to not be needed on stable/7 as r212126 has not been MFC'd. Obtained from: Yahoo! Inc. MFC after: 2 weeks
OpenPOWER on IntegriCloud