summaryrefslogtreecommitdiffstats
path: root/sys/boot
Commit message (Collapse)AuthorAgeFilesLines
* Add initial support for booting from ZFS on sparc64. At least on Sun Firemarius2012-05-019-43/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | V100, the firmware is known to be broken and not allowing to simultaneously open disk devices, causing attempts to boot from a mirror or RAIDZ to cause a crash. This will be worked around later. The firmwares of newer sun4u models don't seem to exhibit this problem though. Steps for ZFS booting: 1. create VTOC8 label # gpart create -s vtoc8 da0 2. add partitions, f.e.: # gpart add -t freebsd-zfs -s 60g da0 # gpart add -t freebsd-swap da0 resulting in something like: # gpart show => 0 143331930 da0 VTOC8 (68G) 0 125821080 1 freebsd-zfs (60G) 125821080 17510850 2 freebsd-swap (8.4G) 3. create zpool # zpool create bunker da0a or for mirror/RAIDZ (after preparing additional disks as in steps 1. + 2.): # zpool create bunker mirror da0a da1a # zpool create bunker raidz da0a da1a da2a ... 4. set bootfs # zpool set bootfs=bunker bunker 5. install zfsboot # zpool export bunker # gpart bootcode -p /boot/zfsboot da0 6. write zfsloader to the ZFS Boot Block (so far, there's no dedicated tool for this, so dd(1) has to be used for this purpose) When using mirror/RAIDZ, step 4. and the dd(1) invocation should be repeated for the additional disks in order to be able to boot from another disk in case of failure. # sysctl kern.geom.debugflags=0x10 # dd if=/boot/zfsloader of=/dev/da0a bs=512 oseek=1024 conv=notrunc # zpool import bunker 7. install system on ZFS filesystem Don't forget to set 'zfs_load="YES"' and vfs.root.mountfrom="zfs:bunker" in loader.conf as well as 'zfs_enable="YES"'in rc.conf. 8. copy zpool.cache to the ZFS filesystem cp -p /boot/zfs/zpool.cache /bunker/boot/zfs/zpool.cache 9. set mountpoint # zfs set mountpoint=/ bunker 10. Now, given that aliases for all disks in the zpool exists (check with the `devalias` command on the boot monitor prompt) and disk0 corresponds to da0 (likewise for additional disks), the system can be booted from the ZFS with: {1} ok boot disk0 PR: 165025 Submitted by: Gavin Mu
* Add a command for showing the heap usage.marius2012-05-011-0/+12
| | | | | | PR: 165025 Submitted by: Gavin Mu MFC after: 1 week
* Teach ubldr(8) about simple MBR partitioning.kientzle2012-05-013-2/+103
|
* Add multiple inclusion protection.marius2012-04-291-0/+5
| | | | | | PR: 165025 Submitted by: Gavin Mu MFC after: 1 week
* Build a 32-bit EFI loader on amd64. This to match the rest of themarcel2012-04-202-2/+16
| | | | | | | | | 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
* Read backup GPT header from the last LBA only when primary GPT header andae2012-04-121-7/+7
| | | | | | | | | table aren't valid. If they are ok, use hdr_lba_alt value to read backup header. This will make gptboot happy when GPT used atop of some GEOM provider, e.g. GEOM_MIRROR. Reviewed by: pjd MFC after: 2 weeks
* retrofit Safe Mode loader menu item actionsavg2012-04-061-15/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The menu item is now made completely independent with the ACPI item - most modern systems seem to require ACPI and become even more "unsafe" without it. Safe Mode no longer disables APIC for the same reason. kbdmux is not disabled as this feature has proven itself stable. New actions: - SMP is disabled in the Safe Mode now - eventtimers are forced to periodic mode (some real and virtual systems seem to have problems otherwise) - geom extra vigorous integrity checking is disabled, this is to facilitate migration from previous versions Possible short term to do: - make SMP switch a separate menu item - restore APIC switch as a separate menu item Longer term to do: - turn various tweaks into separate menu items in a Safe Mode sub-menu Please consider adding a safety tweak to Safe Mode when introducing new major features or changes that may cause instabilities. Discussed with: jhb, scottl, Devin Teske MFC after: 3 weeks (stable/9 only)
* Fix build after changes to trap headers.nwhitehorn2012-03-291-0/+2
|
* Remove trailing whitespace per mdoc lint warningeadler2012-03-292-2/+2
| | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days
* Remove second consts in r233288 in order to appease C++ compilers.marius2012-03-261-1/+1
| | | | | | While at it, remove some style(9) bugs in libkern.h. Submitted by: kan
* Improve FDT handling in loader(8) and make it more robust.raj2012-03-221-24/+71
| | | | | | | | | | | o Fix buffer overflows when using a long property body in node paths. o Fix loop end condition when iterating through the symbol table. o Better error handling during node modification, better problem reporting. o Eliminate build time warnings. Submitted by: Lukasz Wojcik Obtained from: Semihalf MFC after: 1 week
* Declare the CRC lookup-tables const as they hardly should change atmarius2012-03-211-1/+1
| | | | run-time.
* Use the common/shared CRC-32 implementation instead of duplicating it.marius2012-03-212-69/+7
| | | | MFC after: 1 week
* Improve device tree blob (DTB) handling in loader(8).raj2012-03-202-25/+113
| | | | | | | | | | Enable using the statically embedded blob from the kernel, if present. The KLD loaded DTB takes precedence, but they are both recognized and handled in the same way. Submitted by: Lukasz Wojcik Obtained from: Semihalf MFC after: 1 week
* Declare some variables static in order to reduce the object size andmarius2012-03-181-31/+18
| | | | | | | redo r232822 in a less hackish way. The latter now no longer breaks compiling the x86 boot2 with clang. MFC after: 1 week
* Fix a bug introduced in r223938; on big-endian machines coping a 32-bitmarius2012-03-111-0/+15
| | | | | | | | | | | | | quantum bytewise to the address of a 64-bit variable results in writing to the "wrong" 32-bit half so adjust the address accordingly. This fix is implemented in a hackish way for two reasons: o in order to be able to get it into 8.3 with zero impact on the little- endian architectures where this bug has no effect and o to avoid blowing the x86 boot2 out of the water again when compiling it with clang, which all sane versions of this fix tested do. This change fixes booting from UFS1 file systems on big-endian machines. MFC after: 3 days
* MFi386: revisions 232570 and 232754nyan2012-03-101-7/+15
| | | | | Fix boot2 to handle boot config files that only contain a custom path to a loader or kernel.
* 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.
* Provide wbwd(4), a driver for the watchdog timer found on variousbz2012-03-061-0/+1
| | | | | | | | | | | | | Winbond Super I/O chips. With minor efforts it should be possible the extend the driver to support further chips/revisions available from Winbond. In the simplest case only new IDs need to be added, while different chipsets might require their own function to enter extended function mode, etc. Sponsored by: Sandvine Incorporated ULC (in 2011) Reviewed by: emaste, brueffer MFC after: 2 weeks
* 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
* Respect phy-handle property in Ethernet nodes of the device tree.raj2012-03-041-11/+4
| | | | | | | | This lets specify whereabouts of the parent PHY for a given MAC node (and get rid of ugly kludges in mge(4) and tsec(4)). Obtained from: Semihalf 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-2811-61/+47
| | | | | | | | | | | | | | | | | | | | | 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
* Whitespace cleanup:gjb2012-02-251-8/+16
| | | | | | | | | o Wrap sentences on to new lines o Cleanup trailing whitespace Found with: textproc/igor MFC after: 1 week X-MFC-With: r232157
* Fix various typos in manual pages.gjb2012-02-251-2/+2
| | | | | | Submitted by: amdmi3 PR: 165431 MFC after: 1 week
* Make sure to synchronize icache for the newly loaded loader. Not an issuenwhitehorn2012-02-162-3/+7
| | | | | | on most systems, when the relevant icache lines are not full. MFC after: 2 weeks
* Reduce diffs against i386.nyan2012-02-101-12/+14
| | | | MFC after: 1 week
* Fix clang warnings.rpaulo2012-02-052-3/+3
|
* Clarify and improve the boot menu with some small changes:pluknet2012-01-251-18/+18
| | | | | | | | | | | | | | | | | | - Enter instead of ENTER - Remove colons - Line up option values - Use dots to provide a line to visually connect the menu selections with their values - Replace Enabled/Disabled with off/On (bigger inital cap for "On" is a visual indicator) - Remove confusing "Boot" from selections that don't boot. - With loader_color=1 in /boot/loader.conf, use reverse video to highlight enabled options PR: misc/160818 Submitted by: Warren Block <wblock wonkity com> Reviewed by: Devin Teske <devin dot teske fisglobal com>, current@ MFC after: 1 week
* Experimental support for booting CHRP-type PowerPC systems from hard disks.nwhitehorn2012-01-251-1/+0
|
* 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
* Fix some unreliability problems related to MSR bits inherited from kboot bynwhitehorn2012-01-151-1/+1
| | | | | setting an absolute MSR when during on the MMU. This prevents delay(), in particular, from intermittently malfunctioning.
* - Document TheDraw splash screens in the default loader.confeadler2012-01-141-1/+2
| | | | | | Submitted by: Jason Hellenthal Approved by: glebius MFC after: 3 days
* Get rid of a spurious warning on the console when booting the kernelpluknet2012-01-091-2/+13
| | | | | | | | | | | | | | | | | | | | from the interactive loader(8) prompt and beastie_disable="YES" is set in loader.conf(5). In this case menu.rc is not evaluated and consequently menu-unset does not have a body yet. This results in the ficl warning "menu-unset not found" when try-menu-unset invokes menu-unset. Check for beastie_disable="YES" explicitly, so that the try-menu-unset word will not attempt to invoke menu-unset because the menu will have never been configured. [1] Use the sfind primitive as a last resort as an additional safer approach conjuring a foreign word safely. [2] PR: kern/163938 Submitted by: Devin Teske [1] Reviewed by: Devin Teske [2] Reported and tested by: dim MFC after: 1 week X-MFC with: r228985
* Document comconsole_port and comconsole_pcidev loader variables.kib2012-01-071-1/+38
| | | | MFC after: 2 weeks
* MFi386: revision 229435nyan2012-01-041-31/+188
| | | | | | | Add special loader environment variables 'comconsole_port' and 'comconsole_pcidev'. MFC after: 2 weeks
* Fix 230MB MO support.nyan2012-01-041-1/+1
| | | | | Submitted by: Kaho Toshikazu MFC after: 1 week
* Add special loader environment variables 'comconsole_port' andkib2012-01-033-31/+195
| | | | | | | | | | | | | | | | | | 'comconsole_pcidev'. The former allows to set the base address of the serial console i/o port. The later takes the string of the format 'bus:device:function:[bar]' as a value and uses the serial port attached as PCI device at the specified location for console. Both variants pass 'hw.uart.console' variable to the uart driver to properly hand-over the kernel console. Change allows to use ISA serial ports other than COM1 for the loader/kernel console without loader recompilation. Also, you can use PCI-attached port as the console, e.g. Intel AMT serial pseudo-port on some motherboards based on Q67 chipset. Reviewed by: jhb MFC after: 2 weeks
* Replace index() and rindex() calls with strchr() and strrchr().ed2012-01-033-3/+3
| | | | | | | | | | The index() and rindex() functions were marked LEGACY in the 2001 revision of POSIX and were subsequently removed from the 2008 revision. The strchr() and strrchr() functions are part of the C standard. This makes the source code a lot more consistent, as most of these C files also call into other str*() routines. In fact, about a dozen already perform strchr() calls.
* Merge index() and strchr() together.ed2012-01-031-4/+4
| | | | | | | | | | | | | | | | | As I looked through the C library, I noticed the FreeBSD MIPS port has a hand-written version of index(). This is nice, if it weren't for the fact that most applications call strchr() instead. Also, on the other architectures index() and strchr() are identical, meaning we have two identical pieces of code in the C library and statically linked applications. Solve this by naming the actual file strchr.[cS] and let it use __strong_reference()/STRONG_ALIAS() to provide the index() routine. Do the same for rindex()/strrchr(). This seems to make the C libraries and static binaries slightly smaller, but this reduction in size seems negligible.
* Unset the environment variables associated with individual menu itemspluknet2011-12-303-18/+81
| | | | | | | | | | | | | | | | | | | | | | before invoking the kernel. Quoting submitter: The issue is with the new boot loader menu. It adds many loader variables including ones that contain ANSI color escapes. Obviously, these ANSI codes don't play well with serial consoles when kenv(1) is executed without arguments (reports vary as to what happens, but it's never pretty). The net-effect is that kenv(1) no longer reports menu-related variables. In essence, kenv(1) output should now appear the same as on RELENG_8 (which lacks the new boot loader and didn't use any such variables). Thus, restoring serial console glory. Submitted by: Devin Teske <devin dott teske fisglobal.com> MFC after: 2 weeks
* Clean up from the 4.x era.pluknet2011-12-271-3/+3
| | | | | | | | | | | | In an example of boot command: - rename wd(4) IDE disk drives name to ad(4) for the time being. - update the used kernel path "/kernel" to the current default. [It still worked occasionally by looking into the /boot/kernel directory, so the resulting path was "/boot//kernel/kernel", with two slashes.] Bump .Dd for this and previous changes. MFC after: 1 week
* Make the RTC checking for QEMU even more aggressive.ed2011-12-211-4/+6
| | | | | | | | | | | At work, where we use use KVM+QEMU, we notice that pxeboot is pratically impossible because of network timeouts. This is due to the fact that the RTC code makes aggressive jumps. Two RTC reads does not seem to be sufficient. Change the code to check for 8 identical RTC values. Sponsored by: Kumina bv
* Allow boot0cfg to force a PXE boot via boot0 on the next boot.jhb2011-12-201-1/+1
| | | | | | | | | | - Fix boot0 to check for PXE when using the pre-set setting for the preferred slice. - Update boot0cfg to use slice 6 to select PXE. Accept a 'pxe' argument instead of a number for the 's' option as a way to select PXE as well. Submitted by: Andrew Boyer aboyer averesystems MFC after: 2 weeks
* - Rename if_carp.ko to carp.ko.glebius2011-12-161-1/+1
| | | | - carp.ko depends on sha1.c
* Replace `inline static' by `static inline'.ed2011-12-131-2/+2
| | | | | | If I interpret the C standard correctly, the storage specifier should be placed before the inline keyword. While at it, replace __inline by inline in the files affected.
* zfsboot: print boot.config contents before parsing itavg2011-12-041-2/+2
| | | | | | as parsing can be a destructive operation MFC after: 2 weeks
* zfs boot: allow file vdevs to be used in testing (e.g. with zfsboottest)avg2011-12-041-0/+3
| | | | MFC after: 1 week
OpenPOWER on IntegriCloud