Commit Graph

18 Commits

Author SHA1 Message Date
Pedro F. Giffuni
8a13944bc7 Split the ficl CFLAGS when they refer to an arch-specific include path.
This is a minimal attempt to keep consistency in the Makefiles so that
moving ficl to somwehere like contrib will be less error prone.

MFC after:	1 week
2017-03-01 19:36:32 +00:00
Toomas Soome
1ecc859193 dosfs support in libstand is broken since r298230
Apparently the libstand dosfs optimization is a bit too optimistic
and did introduce possible memory corruption.

This patch is backing out the bad part and since this results in
dosfs reading full blocks now, we can also remove extra offset argument
from dv_strategy callback.

The analysis of the issue and the backout patch is provided by Mikhail Kupchik.

PR:		214423
Submitted by:	Mikhail Kupchik
Reported by:	Mikhail Kupchik
Reviewed by:	bapt, allanjude
Approved by:	allanjude (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D8644
2016-12-30 19:06:29 +00:00
Ed Maste
bc814587a9 Deduplicate loader vers.c Makefile rules
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
2016-12-19 14:40:59 +00:00
Ed Maste
0bf23e313e Reduce boot loader version string duplication
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
2016-12-18 13:57:23 +00:00
Toomas Soome
cbd6713146 Loader paged/pageable data is not always paged.
This change does modify devsw dv_print() to return the int value,
enabling walkers to interrupt the walk on non zero value from dv_print().

This will allow the pager_print actually to stop displaying data on
user input, and additionally pager is used in various *dev_print callbacks,
where it was missing.

For test, lsdev [-v] command should display data by screenfuls and should
stop when the key 'q' is pressed on pager prompt.

Reviewed by:	allanjude
Approved by:	allanjude (mentor)
Differential Revision:	https://reviews.freebsd.org/D5461
2016-11-08 06:50:18 +00:00
Baptiste Daroussin
1b46e63d3c Stop closing the network device when netbooting for loaders using the common
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
2016-10-13 22:43:49 +00:00
Stephen J. Kiernan
5c6b397ff1 The getsecs() function is implemented in platform- and bootfw-specific
files and, in a number of these places, there were problems with how they
were declared.

Some used int return instead of time_t. On some architectures the bit
width of time_t did not naturally fit into an integer and could lead to
some unexpected behavior. (For example, 32-bit ARM builds uses a 64-bit
time_t.)

Make sure the function prototypes always specify void for the argument
list when they do not have any arguemnts, otherwise some compilers can
complain about the prototype.

Reported by:	Kevin Zheng
Reviewed by:	sjg
Approved by:	sjg (mentor)
Obtained from:	Juniper Networks, Inc.
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D7463
2016-09-22 06:24:40 +00:00
Allan Jude
87ed2b7f5a A new implementation of the loader block cache
The block cache implementation in loader has proven to be almost useless, and in worst case even slowing down the disk reads due to insufficient cache size and extra memory copy.
Also the current cache implementation does not cache reads from CDs, or work with zfs built on top of multiple disks.
Instead of an LRU, this code uses a simple hash (O(1) read from cache), and instead of a single global cache, a separate cache per block device.
The cache also implements limited read-ahead to increase performance.
To simplify read ahead management, the read ahead will not wrap over bcache end, so in worst case, single block physical read will be performed to fill the last block in bcache.

Booting from a virtual CD over IPMI:
0ms latency, before: 27 second, after: 7 seconds
60ms latency, before: over 12 minutes, after: under 5 minutes.

Submitted by:	Toomas Soome <tsoome@me.com>
Reviewed by:	delphij (previous version), emaste (previous version)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D4713
2016-04-18 23:09:22 +00:00
Nathan Whitehorn
b931a53849 Allow loader to load 64-bit ELFv2 PowerPC kernels. 2015-12-01 17:01:27 +00:00
Nathan Whitehorn
0df013a065 The Linux kexec boot loader doesn't need a font built in to it. This got
copied-and-pasted from the PS3 loader.
2015-11-19 01:57:23 +00:00
Allan Jude
9322ac3f6e Remove guards around overwriting loader.rc and menu.rc
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
2015-08-06 16:07:27 +00:00
Baptiste Daroussin
27823c59c5 Fix fallouts from r284590
Reported by:	kib
2015-06-19 14:20:21 +00:00
Jung-uk Kim
11823c5f1e Revert .PATH changes to fix mips build.
Reported by:	bz
Pointy hat to:	jkim
2015-04-03 02:27:40 +00:00
Jung-uk Kim
bf64b1d71c Install newly added brand-*.4th and logo-*.4th files and reduce duplication.
Reviewed by:	dteske
Pointy hat to:	dteske
2015-04-02 20:07:05 +00:00
Nathan Whitehorn
cb46e6c2af Allow this to work with disks greater than 4 GB and with names not beginning
with "s".
2015-02-01 02:02:50 +00:00
Nathan Whitehorn
878eae988b Relocate kernel to high address space (a static + 64 MB for now) to avoid
conflicts with the Linux host kernel. This lets you kexec an unmodified
GENERIC64.
2015-01-31 19:42:08 +00:00
Nathan Whitehorn
79215b4a3d Add FDT reservations for memory areas used by OPAL or RTAS runtime firmware.
This allows a kexec'ed kernel to boot multiuser under PHYP.
2015-01-31 19:18:09 +00:00
Nathan Whitehorn
a4f7863238 Add kexec-based Linux shim loader for use with the firmware petitboot
loader on PS3 and POWER8 systems. This is reasonably portable to other
architectures, especially FDT-based ones, if similar features are useful
elsewhere.

Netboot support is missing for now and will be added in a future commit,
at which time loader.ps3 will be garbage collected.

Done at:	Hackathon
2015-01-05 04:33:39 +00:00