aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/sparc64/loader
Commit message (Collapse)AuthorAgeFilesLines
* Move sys/boot to stand. Fix all references to new locationWarner Losh2017-11-146-1443/+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-15/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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 LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELIWarner Losh2017-11-101-0/+1
| | | | | | | | | | | | | | Transition to WITH/WITHOUT_LOADER_GELI to flag support or not of GELI in the boot loaders. Add HAVE_GELI so components can flag they need support (since it's too large to include everywhere). Add temporary warnings for the old forms to ease transition. Also, update test script to build without GELI on x86. Sponsored by: Netflix Notes: svn path=/head/; revision=325693
* Remove LOADER_ZFS_SUPPORT as a Makefile variableWarner Losh2017-11-101-7/+0
| | | | | | | | | | | | | LOADER_ZFS_SUPPORT is entirely used to select whether or not to support ZFS in the loader. But it's not a user-servicable part (MK_ZFS is what's used for that) Change it to the more conventional HAVE_ZFS and move the ZFS support code into loader.mk. In addition, only build ZFS libraries and boot loaders when ZFS is enabled. Sponsored by: Netflix Notes: svn path=/head/; revision=325690
* loader: set options before including bsd.init.mkRoger Pau Monné2017-11-081-12/+12
| | | | | | | | | | | | | | | | | bsd.init.mk ends up including defs.mk so the per-arch options must be set before including defs.mk, or else the global defaults will be used and the per-arch ones will be ignored. Although better, note that the usage of MK_FDT before the inclusion of bsd.init.mk is incorrect but doesn't lead to build errors. This circular dependency must be broken in order for this to work correctly. Reviewed by: imp Sponsored by: Citrix Systems R&D Notes: svn path=/head/; revision=325556
* For amd64, compile both zfs and zfs32 libraries.Warner Losh2017-10-301-1/+1
| | | | | | | | | | | | We have a separate copy of zfs for userboot. However, we don't need it if we compile both 32 and 64 bit ZFS libraries. Remove redunant copies of zfs related .o files now that both versions are available. Introduce ZFSSRC and use it everywhere. Sponsored by: Netflix Notes: svn path=/head/; revision=325175
* Remove the -nostdlib stuff I added. Instead, fix LDFLAGS to be honoredWarner Losh2017-10-301-3/+1
| | | | | | | | | correctly with the new Makefile.inc include order. Sponsored by: Netflix Notes: svn path=/head/; revision=325172
* Use defs.mk defins in most MD codeWarner Losh2017-10-301-9/+11
| | | | | | | | | | | | Use defines from defs.mk in most MD code (the biggest exception is x86, which will be its own commit due to its size). Prefer including bsd.init.mk over the variations (../Makefile.inc and src.opts.mk being the two biggest ones). Sponsored by: Netflix Notes: svn path=/head/; revision=325114
* End source directories with SRC rather than a hodgepodge of namesWarner Losh2017-10-221-1/+1
| | | | | | | | | | | | | | BOOTDIR->BOOTSRC FICLDIR->FICLSRC LDR_MI->LDRSRC This matches the patterns used in the rest of the system a bit vetter. Suggested by: rgrimes@ Sponsored by: Netflix Notes: svn path=/head/; revision=324877
* LOADER_foo_SUPPORTEDWarner Losh2017-10-161-24/+2
| | | | Notes: svn path=/head/; revision=324653
* Move all the ficl common code into ficl.mkWarner Losh2017-10-161-8/+0
| | | | | | | | There's a number of copies of basically identical code to enable building forth in /boot/loader. Move it all into ficl.mk. Notes: svn path=/head/; revision=324652
* Move common/Makefile.inc to sys/boot/loader.mk.Warner Losh2017-10-161-4/+2
| | | | | | | | | | | | Makefile.inc has a specific meaning in the tree, and common/Makefile.inc doesn't quite fit into that. Rename it to loader.mk and it will be a place to collect common things to all /boot/loader programs there. Sponsored by: Netflix Notes: svn path=/head/; revision=324649
* Rather than laying whack-a-mole with including the path to stand.h,Warner Losh2017-10-101-3/+0
| | | | | | | | | | always include it. Remove places where we explicitly include it. This also helps reduce the 'cut-and-paste' factor of these Makefiles. Sponsored by: Netflix Notes: svn path=/head/; revision=324460
* Define LIBSA* and use them instead of overloaded LIBSTANDWarner Losh2017-10-091-2/+2
| | | | | | | | | | | LIBSA is the current stand alone library. LIBSA32 is the 32-bit version of the library. LIBSAU is the userboot version of libsa. Use the proper define instead of the more generic define. Sponsored by: Netflix Notes: svn path=/head/; revision=324452
* Define SASRC and use itWarner Losh2017-10-091-1/+1
| | | | | | | | | | | | Define SASRC to point to the current libstand sources. Include ../Makefile.inc early enough in a few places so we can .include "${SASRC}/Makefile" and have it work. Create a new pass-up Makefile.inc in sys/boot/userboot to allow this pattern to work. Sponsored by: Netflix Notes: svn path=/head/; revision=324450
* Prefer ${LIBSTAND} to -lstandWarner Losh2017-10-091-1/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=324449
* loader: r316585 did miss sparc/ofwToomas Soome2017-04-101-10/+18
| | | | | | | | | | | | | This update does add the code to pass partition size to vdev_probe() via simple callback. Tested via tinderbox build, but not yet with actual boot. The code can be improved still, but to verify the idea to read media block size and amedia size has to be confirmed first. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D10302 Notes: svn path=/head/; revision=316682
* Fix sparc64 build broken by r316343 and r316076Allan Jude2017-04-021-0/+3
| | | | | | | | Reported by: markj Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=316424
* sys: Replace zero with NULL for pointers.Pedro F. Giffuni2017-02-221-1/+1
| | | | | | | | | Found with: devel/coccinelle MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D9694 Notes: svn path=/head/; revision=314068
* Deduplicate loader vers.c Makefile rulesEd Maste2016-12-191-5/+2
| | | | | | | | | | | | | | The Makefile rule to create vers.c for loader version info was previously duplicated in each of the various loader Makefiles. Instead, share a common rule in Makefile.inc. Reviewed by: bapt MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8841 Notes: svn path=/head/; revision=310267
* Reduce boot loader version string duplicationEd Maste2016-12-181-4/+2
| | | | | | | | | | | | | Instead of repeating "%s, Revision %s" "(%s %s)" in each loader, just create the full version string in vers.c Reviewed by: bapt MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8823 Notes: svn path=/head/; revision=310225
* Stop closing the network device when netbooting for loaders using the commonBaptiste Daroussin2016-10-131-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | dev_net.c code. The NETIF_OPEN_CLOSE_ONCE flag was added in r201932 to prevent that behaviour on some architectures (sparc64 and powerpc64) the default was left to always open and close the device for each open and close of a file by the loader because it was necessary for u-boot on arm. Since it has been added, the flag was turned on for every arches including the u-boot loader for arm. This also fixes netbooting on RPi3 (tested by gonzo@) For the loader.efi it greatly speeds up netbooting Reviewed by: emaste, gonzo, tsoome Approved by: gonzo MFC after: 1 month Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D8230 Notes: svn path=/head/; revision=307238
* Remove guards around overwriting loader.rc and menu.rcAllan Jude2015-08-061-7/+1
| | | | | | | | | | | | | | | | | There have been .local version of each for user modifications for some time This allows users to receive future updates to these files PR: 183765 Submitted by: Bertram Scharpf, Nikolai Lifanov (patch) Reviewed by: dteske, loos, eadler Approved by: bapt (mentor) MFC after: 1 month Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3176 Notes: svn path=/head/; revision=286368
* Fix fallouts from r284590Baptiste Daroussin2015-06-191-0/+1
| | | | | | | Reported by: kib Notes: svn path=/head/; revision=284597
* Fix the loader for sparc64.Andreas Tobler2015-05-011-3/+3
| | | | | | | | | | | The commit from r279799 missed the adaptation of md_load in sparc64/loader/main.c. This resulted in Memory Address Align issues at the early boot stage. Tested on a netbooted Fire 120. Notes: svn path=/head/; revision=282320
* Revert .PATH changes to fix mips build.Jung-uk Kim2015-04-031-0/+1
| | | | | | | | Reported by: bz Pointy hat to: jkim Notes: svn path=/head/; revision=281009
* Install newly added brand-*.4th and logo-*.4th files and reduce duplication.Jung-uk Kim2015-04-021-6/+1
| | | | | | | | Reviewed by: dteske Pointy hat to: dteske Notes: svn path=/head/; revision=281002
* Provide a shim layer in loader to condense the Open Firmware device tree toNathan Whitehorn2015-03-091-1/+2
| | | | | | | | | | an FDT. This is how Linux and OS X boot and can avoid some issues with using Open Firmware at runtime. The code is highly experimental and disabled by default; it can be turned on by setting the loader environment variable "usefdt" to a non-NULL value. Notes: svn path=/head/; revision=279799
* Revert r267233 for now. PIE support needs to be reworked.Bryan Drewery2014-08-191-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=270168
* Give loaders more control over the Forth initialization process. InMarcel Moolenaar2014-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | particular, allow loaders to define the name of the RC script the interpreter needs to use. Use this new-found control to have the PXE loader (when compiled with TFTP support and not NFS support) read from ${bootfile}.4th, where ${bootfile} is the name of the file fetched by the PXE firmware. The normal startup process involves reading the following files: 1. /boot/boot.4th 2. /boot/loader.rc or alternatively /boot/boot.conf When these come from a FreeBSD-defined file system, this is all good. But when we boot over the network, subdirectories and fixed file names are often painful to administrators and there's really no way for them to change the behaviour of the loader. Obtained from: Juniper Networks, Inc. Notes: svn path=/head/; revision=269153
* In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.Bryan Drewery2014-06-081-0/+2
| | | | | | | | | | | | | | | | | | | 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] Notes: svn path=/head/; revision=267233
* Use src.opts.mk in preference to bsd.own.mk except where we need stuffWarner Losh2014-05-061-1/+1
| | | | | | | from the latter. Notes: svn path=/head/; revision=265420
* howto_names: unify declarationRoger Pau Monné2014-03-111-23/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Approved by: gibbs Sponsored by: Citrix Systems R&D boot/i386/efi/bootinfo.c: boot/i386/libi386/bootinfo.c: boot/ia64/common/bootinfo.c: boot/powerpc/ofw/metadata.c: boot/powerpc/ps3/metadata.c: boot/sparc64/loader/metadata.c: boot/uboot/common/metadata.c: boot/userboot/userboot/bootinfo.c: i386/xen/xen_machdep.c: - Include sys/boot.h - Remove custom definition of howto_names. sys/boot.h: - Define howto_names. x86/xen/pv.c: - Include sys/boot.h Notes: svn path=/head/; revision=263005
* - The method introduced as part of r234898 for not altering the boot pathMarius Strobl2013-06-091-24/+24
| | | | | | | | | | | | | | | | when booting from ZFS turned out to also cause the boot path not being adjusted if booting from CD-ROM with firmware versions that do not employ the "cdrom" alias in that case. So shuffle the code around instead in order to achieve the original intent. Ideally, we shouldn't fiddle with the boot path when booting from UFS on a disk either; unfortunately, there doesn't seem to be an universal way of telling disks and CD-ROMs apart, though. [1] - Use NULL instead of 0 for pointers. PR: 179289 MFC after: 1 week Notes: svn path=/head/; revision=251589
* zfs/sparc64 boot: fix booting after r242230Andriy Gapon2013-01-201-8/+12
| | | | | | | | | | | | | arch_zfs_probe method is supposed to only probe for ZFS vdevs, but it can not expect that ZFS data is in a ready state yet. So, move some code from sparc64_zfs_probe to main to meet the constraints. Reported by: Chris Ross <cross+freebsd@distal.com> Tested by: Chris Ross <cross+freebsd@distal.com> MFC after: 4 days Notes: svn path=/head/; revision=245697
* Hook in new files menusets.4th and manual.Devin Teske2012-11-071-1/+1
| | | | | | | Approved by: adrian (co-mentor) (implicit) Notes: svn path=/head/; revision=242688
* Slightly reduce an overhead for the open() call in the zfsloader.Andrey V. Elsukov2012-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. Notes: svn path=/head/; revision=240335
* Pull the tier-2 card and change the sparc64 ZFS loader to no longer probeMarius Strobl2012-07-271-9/+43
| | | | | | | | | | | | | | | all diskN aliases for providers (which more or less corresponds to how the x86 version behaves) but instead probe only those listed in the boot-device OFW environment variable. This has the following advantages: - avoids otherwise unavoidable OFW warnings about failures to open disks for which aliases exist but no actual hardware is connected - avoids issues due to different diskN naming schemes - aligns us with Solaris MFC after: 3 days Notes: svn path=/head/; revision=238851
* The loaddev environment variable is not modifiable once set, so it is notMarius Strobl2012-06-041-14/+16
| | | | | | | | | | | | update for ZFS. It seems that this does not really affect anything except the help command. Nevertheless, rearrange things so loaddev is set only once in all cases in order to get it right. Pointed out by: avg MFC after: r235364 Notes: svn path=/head/; revision=236581
* sparc64/zfs boot: take advantage of new libzfsboot capabilitiesAndriy Gapon2012-05-122-58/+26
| | | | | | | | | | Also drop the now unneeded compatibility shims. Tested by: marius MFC after: 1 month Notes: svn path=/head/; revision=235364
* zfsboot/zfsloader: support accessing filesystems within a poolAndriy Gapon2012-05-121-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=235329
* sys/boot: add common CTASSERT definitionAndriy Gapon2012-05-091-6/+0
| | | | Notes: svn path=/head/; revision=235153
* Add initial support for booting from ZFS on sparc64. At least on Sun FireMarius Strobl2012-05-012-14/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=234898
* Add a command for showing the heap usage.Marius Strobl2012-05-011-0/+12
| | | | | | | | | PR: 165025 Submitted by: Gavin Mu MFC after: 1 week Notes: svn path=/head/; revision=234897
* - For Cheetah- and Zeus-class CPUs don't flush all unlocked entries fromMarius Strobl2011-07-021-25/+63
| | | | | | | | | | | | | | | | | | | | | | the TLBs in order to get rid of the user mappings but instead traverse them an flush only the latter like we also do for the Spitfire-class. Also flushing the unlocked kernel entries can cause instant faults which when called from within cpu_switch() are handled with the scheduler lock held which in turn can cause timeouts on the acquisition of the lock by other CPUs. This was easily seen with a 16-core V890 but occasionally also happened with 2-way machines. While at it, move the SPARC64-V support code entirely to zeus.c. This causes a little bit of duplication but is less confusing than partially using Cheetah-class bits for these. - For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024- entry, 2-way set associative TLB. - In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back. Tested by: Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V) Notes: svn path=/head/; revision=223719
* Include forgotten framework changes to get some of the new menu files ↵Julian Elischer2011-05-301-1/+2
| | | | | | | | | installed correctly on non x86/amd systems. pointy-hut to devin Notes: svn path=/head/; revision=222472
* New boot loader menus from Devin Teske.Julian Elischer2011-05-281-0/+6
| | | | | | | | | | | Discussed on hackers and recommended for inclusion into 9.0 at the devsummit. All support email to devin dteske at vicor dot ignoreme dot com . Submitted by: dteske at vicor dot ignoreme dot com Reviewed by: me and many others Notes: svn path=/head/; revision=222417
* Disconnect sun4v architecture from the three.Attilio Rao2011-05-141-70/+1
| | | | | | | | | | | | Some files keep the SUN4V tags as a code reference, for the future, if any rewamped sun4v support wants to be added again. Reviewed by: marius Tested by: sbruno Approved by: re Notes: svn path=/head/; revision=221869
* Revert rev 165325. The arch_maphint interface hasn't been in use forMarcel Moolenaar2011-04-031-46/+0
| | | | | | | more than 4 years. Notes: svn path=/head/; revision=220290
* Partially revert r203829; as it turns out what the PowerPC OFW loader didMarius Strobl2010-10-291-4/+4
| | | | | | | | | | | was incorrect as further down the road cons_probe() calls malloc() so the former can't be called before init_heap() has succeed. Instead just exit to the firmware in case init_heap() fails like OF_init() does when hitting a problem as we're then likely running in a very broken environment where hardly anything can be trusted to work. Notes: svn path=/head/; revision=214526