[Midnightbsd-cvs] src [9848] U trunk/sys/boot/i386/loader/version: update boot code
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Tue May 22 22:50:54 EDT 2018
Revision: 9848
http://svnweb.midnightbsd.org/src/?rev=9848
Author: laffer1
Date: 2018-05-22 22:50:53 -0400 (Tue, 22 May 2018)
Log Message:
-----------
update boot code
Modified Paths:
--------------
trunk/sys/boot/i386/boot2/Makefile
trunk/sys/boot/i386/boot2/boot2.c
trunk/sys/boot/i386/btx/btx/btx.S
trunk/sys/boot/i386/common/cons.h
trunk/sys/boot/i386/efi/Makefile
trunk/sys/boot/i386/gptboot/Makefile
trunk/sys/boot/i386/gptzfsboot/Makefile
trunk/sys/boot/i386/libi386/Makefile
trunk/sys/boot/i386/libi386/biosacpi.c
trunk/sys/boot/i386/libi386/bioscd.c
trunk/sys/boot/i386/libi386/biosdisk.c
trunk/sys/boot/i386/libi386/biosmem.c
trunk/sys/boot/i386/libi386/biospci.c
trunk/sys/boot/i386/libi386/biospnp.c
trunk/sys/boot/i386/libi386/biossmap.c
trunk/sys/boot/i386/libi386/bootinfo.c
trunk/sys/boot/i386/libi386/bootinfo32.c
trunk/sys/boot/i386/libi386/bootinfo64.c
trunk/sys/boot/i386/libi386/comconsole.c
trunk/sys/boot/i386/libi386/devicename.c
trunk/sys/boot/i386/libi386/elf32_freebsd.c
trunk/sys/boot/i386/libi386/elf64_freebsd.c
trunk/sys/boot/i386/libi386/i386_copy.c
trunk/sys/boot/i386/libi386/i386_module.c
trunk/sys/boot/i386/libi386/libi386.h
trunk/sys/boot/i386/libi386/nullconsole.c
trunk/sys/boot/i386/libi386/pread.c
trunk/sys/boot/i386/libi386/pxe.c
trunk/sys/boot/i386/libi386/pxe.h
trunk/sys/boot/i386/libi386/smbios.c
trunk/sys/boot/i386/libi386/spinconsole.c
trunk/sys/boot/i386/libi386/time.c
trunk/sys/boot/i386/libi386/vidconsole.c
trunk/sys/boot/i386/loader/Makefile
trunk/sys/boot/i386/loader/conf.c
trunk/sys/boot/i386/loader/loader.rc
trunk/sys/boot/i386/loader/main.c
Added Paths:
-----------
trunk/sys/boot/i386/gptboot/gptboot.8
trunk/sys/boot/i386/gptzfsboot/gptzfsboot.8
Property Changed:
----------------
trunk/sys/boot/i386/btx/btx/btx.S
trunk/sys/boot/i386/kgzldr/crt.s
trunk/sys/boot/i386/kgzldr/sio.s
trunk/sys/boot/i386/kgzldr/start.s
trunk/sys/boot/i386/libi386/amd64_tramp.S
trunk/sys/boot/i386/libi386/pxetramp.s
trunk/sys/boot/i386/loader/help.i386
trunk/sys/boot/i386/loader/loader.rc
trunk/sys/boot/i386/loader/version
Modified: trunk/sys/boot/i386/boot2/Makefile
===================================================================
--- trunk/sys/boot/i386/boot2/Makefile 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/boot2/Makefile 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,5 +1,5 @@
# $MidnightBSD$
-# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.60 2007/05/19 05:07:47 kan Exp $
+# $FreeBSD: stable/9/sys/boot/i386/boot2/Makefile 279796 2015-03-08 22:50:45Z dim $
.include <bsd.own.mk>
@@ -61,7 +61,7 @@
CLEANFILES+= boot1 boot1.out boot1.o
boot1: boot1.out
- ${OBJCOPY} -S -O binary boot1.out ${.TARGET}
+ objcopy -S -O binary boot1.out ${.TARGET}
boot1.out: boot1.o
${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
@@ -69,12 +69,10 @@
CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \
boot2.s boot2.s.tmp boot2.h sio.o
-BOOT2SIZE= 7680
-
boot2: boot2.ld
- @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \
+ @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \
echo "$$x bytes available"; test $$x -ge 0
- ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync
+ dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync
boot2.ld: boot2.ldr boot2.bin ${BTXKERN}
btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \
@@ -81,10 +79,10 @@
-o ${.TARGET} -P 1 boot2.bin
boot2.ldr:
- ${DD} if=/dev/zero of=${.TARGET} bs=512 count=1
+ dd if=/dev/zero of=${.TARGET} bs=512 count=1
boot2.bin: boot2.out
- ${OBJCOPY} -S -O binary boot2.out ${.TARGET}
+ objcopy -S -O binary boot2.out ${.TARGET}
boot2.out: ${BTXCRT} boot2.o sio.o
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
Modified: trunk/sys/boot/i386/boot2/boot2.c
===================================================================
--- trunk/sys/boot/i386/boot2/boot2.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/boot2/boot2.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -25,7 +25,6 @@
#include <machine/bootinfo.h>
#include <machine/elf.h>
-#include <machine/psl.h>
#include <stdarg.h>
Modified: trunk/sys/boot/i386/btx/btx/btx.S
===================================================================
--- trunk/sys/boot/i386/btx/btx/btx.S 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/btx/btx/btx.S 2018-05-23 02:50:53 UTC (rev 9848)
@@ -12,7 +12,7 @@
* warranties of merchantability and fitness for a particular
* purpose.
*
- * $FreeBSD: src/sys/boot/i386/btx/btx/btx.S,v 1.44.2.2.2.1 2008/11/25 02:59:29 kensmith Exp $
+ * $FreeBSD: stable/9/sys/boot/i386/btx/btx/btx.S 258171 2013-11-15 15:08:53Z jhb $
*/
#include <bootargs.h>
@@ -41,6 +41,8 @@
.set PSL_RESERVED_DEFAULT,0x00000002
.set PSL_T,0x00000100 # Trap flag
.set PSL_I,0x00000200 # Interrupt enable flag
+ .set PSL_D,0x00000400 # String instruction direction
+ .set PSL_NT,0x00004000 # Nested task flag
.set PSL_VM,0x00020000 # Virtual 8086 mode flag
.set PSL_AC,0x00040000 # Alignment check flag
/*
@@ -611,8 +613,8 @@
pushl %ds # regs
pushl %es
pushfl # Save %eflags
- cli # Disable interrupts
- std # String ops dec
+ pushl $PSL_RESERVED_DEFAULT|PSL_D # Use clean %eflags with
+ popfl # string ops dec
xorw %ax,%ax # Reset seg
movw %ax,%ds # regs
movw %ax,%es # (%ss is already 0)
@@ -675,6 +677,7 @@
testl $V86F_FLAGS,%edx # User wants flags?
jz rret_tramp.3 # No
movl MEM_ESPR-0x3c,%eax # Read real mode flags
+ andl $~(PSL_T|PSL_NT),%eax # Clear unsafe flags
movw %ax,-0x08(%esi) # Update user flags (low 16)
/*
* Return to the user task
Property changes on: trunk/sys/boot/i386/btx/btx/btx.S
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/i386/common/cons.h
===================================================================
--- trunk/sys/boot/i386/common/cons.h 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/common/cons.h 2018-05-23 02:50:53 UTC (rev 9848)
@@ -13,6 +13,7 @@
* purpose.
*
* $MidnightBSD$
+ * $FreeBSD: stable/9/sys/boot/i386/common/cons.h 300462 2016-05-23 05:25:34Z ngie $
*/
#ifndef _CONS_H_
@@ -28,6 +29,7 @@
void putchar(int c);
int getc(int fn);
int xgetc(int fn);
+int getchar(void);
int keyhit(unsigned int secs);
void getstr(char *cmdstr, size_t cmdstrsize);
Modified: trunk/sys/boot/i386/efi/Makefile
===================================================================
--- trunk/sys/boot/i386/efi/Makefile 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/efi/Makefile 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,10 +1,11 @@
# $MidnightBSD$
+# $FreeBSD: stable/9/sys/boot/i386/efi/Makefile 256266 2013-10-10 12:46:26Z bdrewery $
NO_MAN=
-WITHOUT_SSP=
BUILDING_EFI=
.include <bsd.own.mk>
+MK_SSP= no
PROG= loader.sym
INTERNALPROG=
Modified: trunk/sys/boot/i386/gptboot/Makefile
===================================================================
--- trunk/sys/boot/i386/gptboot/Makefile 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/gptboot/Makefile 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,9 +1,10 @@
-# $MidnightBSD: src/sys/boot/i386/gptboot/Makefile,v 1.1 2011/10/16 21:11:44 laffer1 Exp $
-# $FreeBSD: src/sys/boot/i386/gptboot/Makefile,v 1.62.2.1.2.1 2008/11/25 02:59:29 kensmith Exp $
+# $MidnightBSD$
+# $FreeBSD: stable/9/sys/boot/i386/gptboot/Makefile 260497 2014-01-09 23:08:56Z dim $
.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common
FILES= gptboot
+MAN= gptboot.8
NM?= nm
@@ -35,10 +36,12 @@
-Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
- -Winline --param max-inline-insns-single=100
+ -Winline
-LDFLAGS=-static -N --gc-sections
+CFLAGS.gcc+= --param max-inline-insns-single=100
+LD_FLAGS=-static -N --gc-sections
+
# Pick up ../Makefile.inc early.
.include <bsd.init.mk>
@@ -54,7 +57,7 @@
objcopy -S -O binary gptldr.out ${.TARGET}
gptldr.out: gptldr.o
- ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
+ ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o gpt.o crc32.o drv.o \
cons.o util.o
@@ -63,7 +66,7 @@
objcopy -S -O binary gptboot.out ${.TARGET}
gptboot.out: ${BTXCRT} gptboot.o sio.o gpt.o crc32.o drv.o cons.o util.o
- ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
+ ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
gptboot.o: ${.CURDIR}/../../common/ufsread.c
Added: trunk/sys/boot/i386/gptboot/gptboot.8
===================================================================
--- trunk/sys/boot/i386/gptboot/gptboot.8 (rev 0)
+++ trunk/sys/boot/i386/gptboot/gptboot.8 2018-05-23 02:50:53 UTC (rev 9848)
@@ -0,0 +1,246 @@
+.\" $MidnightBSD$
+.\" Copyright (c) 2013 Warren Block
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD: stable/9/sys/boot/i386/gptboot/gptboot.8 261721 2014-02-10 17:41:40Z wblock $
+.\"
+.Dd February 5, 2014
+.Dt GPTBOOT 8
+.Os
+.Sh NAME
+.Nm gptboot
+.Nd GPT bootcode for UFS on BIOS-based computers
+.Sh DESCRIPTION
+.Nm
+is used on BIOS-based computers to boot from a UFS partition on a
+GPT-partitioned disk.
+.Nm
+is installed in a
+.Cm freebsd-boot
+partition with
+.Xr gpart 8 .
+.Sh IMPLEMENTATION NOTES
+The GPT standard allows a variable number of partitions, but
+.Nm
+only boots from tables with 128 partitions or less.
+.Sh PARTITION ATTRIBUTES
+.Nm
+checks and manages several attributes of GPT UFS partitions.
+.Bl -tag -width ".Cm bootfailed"
+.It Cm bootme
+Attempt to boot from this partition.
+If more than one partition has the
+.Cm bootme
+attribute set,
+.Nm
+will attempt to boot each one until successful.
+.It Cm bootonce
+Attempt to boot from this partition only one time.
+Setting this attribute with
+.Xr gpart 8
+automatically also sets the
+.Cm bootme
+attribute.
+Multiple partitions may have the
+.Cm bootonce
+and
+.Cm bootme
+attributes set.
+.It Cm bootfailed
+The
+.Cm bootfailed
+attribute marks partitions that had the
+.Cm bootonce
+attribute set, but failed to boot.
+This attribute is managed by the system.
+See
+.Sx "BOOTING"
+and
+.Sx "POST-BOOT ACTIONS"
+below for details.
+.El
+.Sh USAGE
+For normal usage, the user does not have to set or manage any of the
+partition attributes.
+.Nm
+will boot from the first UFS partition found.
+.Pp
+The
+.Cm bootonce
+attribute can be used for testing an upgraded operating system on
+an already-working computer.
+The existing system partition is left untouched, and the new version
+of the operating system to be tested is installed on another partition.
+The
+.Cm bootonce
+attribute is set on that new test partition.
+The next boot is attempted from the test partition.
+Success or failure will be shown in the system log files.
+After a successful boot of the test partition, a user script can check
+the logs and change the
+.Cm bootme
+attributes so the test partition becomes the new system partition.
+Because the
+.Cm bootonce
+attribute is cleared after an attempted boot, a failed boot will not
+leave the system attempting to boot from a partition that will never
+succeed.
+Instead, the system will boot from the older, known-working operating
+system that has not been modified.
+If the
+.Cm bootme
+attribute is set on any partitions, booting will be attempted from them
+first.
+If no partitions with
+.Cm bootme
+attributes are found, booting will be attempted from the first UFS
+partition found.
+.Sh BOOTING
+.Nm
+first reads the partition table.
+All
+.Cm freebsd-ufs
+partitions with only the
+.Cm bootonce
+attribute set, indicating a failed boot, are set to
+.Cm bootfailed .
+.Nm
+then scans through all of the
+.Cm freebsd-ufs
+partitions.
+Boot behavior depends on the combination of
+.Cm bootme
+and
+.Cm bootonce
+attributes set on those partitions.
+.Bl -tag -width ".Cm bootonce + .Cm bootme"
+.It Cm bootonce + Cm bootme
+Highest priority: booting is attempted from each of the
+.Cm freebsd-ufs
+partitions with both of these attributes.
+On each partition, the
+.Cm bootme
+attribute is removed and the boot attempted.
+.It Cm bootme
+Middle priority: booting is attempted from each of the
+.Cm freebsd-ufs
+partitions with the
+.Cm bootme
+attribute.
+.El
+.Pp
+If neither
+.Cm bootonce
+nor
+.Cm bootme
+attributes are found on any partitions, booting is attempted from the
+first
+.Cm freebsd-ufs
+partition on the disk.
+.Sh POST-BOOT ACTIONS
+The startup script
+.Pa /etc/rc.d/gptboot
+checks the attributes of
+.Cm freebsd-ufs
+partitions on all GPT disks.
+Partitions with the
+.Cm bootfailed
+attribute generate a
+.Dq boot from X failed
+system log message.
+Partitions with only the
+.Cm bootonce
+attribute, indicating a partition that successfully booted, generate a
+.Dq boot from X succeeded
+system log message.
+The
+.Cm bootfailed
+attributes are cleared from all the partitions.
+The
+.Cm bootonce
+attribute is cleared from the partition that successfully booted.
+There is normally only one of these.
+.Sh FILES
+.Bl -tag -width /boot/gptboot -compact
+.It Pa /boot/gptboot
+bootcode binary
+.It Pa /boot.config
+parameters for the boot blocks
+.Pq optional
+.El
+.Sh EXAMPLES
+.Nm
+is installed in a
+.Cm freebsd-boot
+partition, usually the first partition on the disk.
+A
+.Dq protective MBR
+.Po
+see
+.Xr gpart 8
+.Pc
+is typically installed in combination with
+.Nm .
+.Pp
+Install
+.Nm
+on the
+.Pa ada0
+drive:
+.Bd -literal -offset indent
+gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0
+.Ed
+.Pp
+.Nm
+can also be installed without the PMBR:
+.Bd -literal -offset indent
+gpart bootcode -p /boot/gptboot -i 1 ada0
+.Ed
+.Pp
+Set the
+.Cm bootme
+attribute for partition 2:
+.Bd -literal -offset indent
+gpart set -a bootme -i 2 ada0
+.Ed
+.Pp
+Set the
+.Cm bootonce
+attribute for partition 2, automatically also setting the
+.Cm bootme
+attribute:
+.Bd -literal -offset indent
+gpart set -a bootonce -i 2 ada0
+.Ed
+.Sh SEE ALSO
+.Xr boot.config 5 ,
+.Xr rc.conf 5 ,
+.Xr boot 8 ,
+.Xr gpart 8
+.Sh HISTORY
+.Nm
+appeared in FreeBSD 7.1.
+.Sh AUTHORS
+.An
+This manual page written by Warren Block <wblock at FreeBSD.org>.
Property changes on: trunk/sys/boot/i386/gptboot/gptboot.8
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/sys/boot/i386/gptzfsboot/Makefile
===================================================================
--- trunk/sys/boot/i386/gptzfsboot/Makefile 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/gptzfsboot/Makefile 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,4 +1,5 @@
# $MidnightBSD$
+# $FreeBSD: stable/9/sys/boot/i386/gptzfsboot/Makefile 272697 2014-10-07 13:37:10Z avg $
.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../gptboot \
${.CURDIR}/../zfsboot ${.CURDIR}/../common \
@@ -5,6 +6,7 @@
${.CURDIR}/../../common
FILES= gptzfsboot
+MAN= gptzfsboot.8
NM?= nm
@@ -32,10 +34,12 @@
-Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
- -Winline --param max-inline-insns-single=100
+ -Winline
-LDFLAGS=-static -N --gc-sections
+CFLAGS.gcc+= --param max-inline-insns-single=100
+LD_FLAGS=-static -N --gc-sections
+
# Pick up ../Makefile.inc early.
.include <bsd.init.mk>
@@ -51,7 +55,7 @@
objcopy -S -O binary gptldr.out ${.TARGET}
gptldr.out: gptldr.o
- ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
+ ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \
drv.o gpt.o util.o
@@ -60,7 +64,7 @@
objcopy -S -O binary gptzfsboot.out ${.TARGET}
gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o
- ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
+ ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c
Added: trunk/sys/boot/i386/gptzfsboot/gptzfsboot.8
===================================================================
--- trunk/sys/boot/i386/gptzfsboot/gptzfsboot.8 (rev 0)
+++ trunk/sys/boot/i386/gptzfsboot/gptzfsboot.8 2018-05-23 02:50:53 UTC (rev 9848)
@@ -0,0 +1,194 @@
+.\" $MidnightBSD$
+.\" Copyright (c) 2014 Andriy Gapon <avg at FreeBSD.org>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD: stable/9/sys/boot/i386/gptzfsboot/gptzfsboot.8 272697 2014-10-07 13:37:10Z avg $
+.\"
+.Dd September 15, 2014
+.Dt GPTZFSBOOT 8
+.Os
+.Sh NAME
+.Nm gptzfsboot
+.Nd GPT bootcode for ZFS on BIOS-based computers
+.Sh DESCRIPTION
+.Nm
+is used on BIOS-based computers to boot from a filesystem in
+a ZFS pool.
+.Nm
+is installed in a
+.Cm freebsd-boot
+partition of a GPT-partitioned disk with
+.Xr gpart 8 .
+.Sh IMPLEMENTATION NOTES
+The GPT standard allows a variable number of partitions, but
+.Nm
+only boots from tables with 128 partitions or less.
+.Sh BOOTING
+.Nm
+tries to find all ZFS pools that are composed of BIOS-visible
+hard disks or partitions on them.
+.Nm
+looks for ZFS device labels on all visible disks and in discovered
+supported partitions for all supported partition scheme types.
+The search starts with the disk from which
+.Nm
+itself was loaded.
+Other disks are probed in BIOS defined order.
+After a disk is probed and
+.Nm
+determines that the whole disk is not a ZFS pool member, then
+individual partitions are probed in their partition table order.
+Currently GPT and MBR partition schemes are supported.
+With the GPT scheme, only partitions of type
+.Cm freebsd-zfs
+are probed.
+The first pool seen during probing is used as a default boot pool.
+.Pp
+The filesystem specified by the
+.Cm bootfs
+property of the pool is used as a default boot filesystem.
+If the
+.Cm bootfs
+property is not set, then the root filesystem of the pool is used as
+the default.
+.Xr zfsloader 8
+is loaded from the boot filesystem.
+If
+.Pa /boot.config
+or
+.Pa /boot/config
+is present in the boot filesystem, boot options are read from it
+in the same way as
+.Xr boot 8 .
+.Pp
+The ZFS GUIDs of the first successfully probed device and the first
+detected pool are made available to
+.Xr zfsloader 8
+in the
+.Cm vfs.zfs.boot.primary_vdev
+and
+.Cm vfs.zfs.boot.primary_pool
+variables.
+.Sh USAGE
+Normally
+.Nm
+will boot in fully automatic mode.
+However, like
+.Xr boot 8 ,
+it is possible to interrupt the automatic boot process and interact with
+.Nm
+through a prompt.
+.Nm
+accepts all the options that
+.Xr boot 8
+supports.
+.Pp
+Filesystem specification and the path to
+.Xr zfsloader 8
+is different from
+.Xr boot 8 .
+The format is
+.Pp
+.Sm off
+.Oo zfs:pool/filesystem: Oc Oo /path/to/loader Oc
+.Sm on
+.Pp
+Both the filesystem and the path can be specified.
+If only a path is specified, then the default filesystem is used.
+If only a pool and filesystem are specified, then
+.Pa /boot/zfsloader
+is used as a path.
+.Pp
+Additionally, the
+.Ic status
+command can be used to query information about discovered pools.
+The output format is similar to that of
+.Cm zpool status
+.Pq see Xr zpool 8 .
+.Pp
+The configured or automatically determined ZFS boot filesystem is
+stored in the
+.Xr zfsloader 8
+.Cm loaddev
+variable, and also set as the initial value of the
+.Cm currdev
+variable.
+.Sh FILES
+.Bl -tag -width /boot/gptzfsboot -compact
+.It Pa /boot/gptzfsboot
+boot code binary
+.It Pa /boot.config
+parameters for the boot block
+.Pq optional
+.It Pa /boot/config
+alternative parameters for the boot block
+.Pq optional
+.El
+.Sh EXAMPLES
+.Nm
+is typically installed in combination with a
+.Dq protective MBR
+.Po
+see
+.Xr gpart 8
+.Pc .
+To install
+.Nm
+on the
+.Pa ada0
+drive:
+.Bd -literal -offset indent
+gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
+.Ed
+.Pp
+.Nm
+can also be installed without the PMBR:
+.Bd -literal -offset indent
+gpart bootcode -p /boot/gptzfsboot -i 1 ada0
+.Ed
+.Sh SEE ALSO
+.Xr boot.config 5 ,
+.Xr boot 8 ,
+.Xr gpart 8 ,
+.Xr loader 8 ,
+.Xr zfsloader 8 ,
+.Xr zpool 8
+.Sh HISTORY
+.Nm
+appeared in FreeBSD 7.3.
+.Sh BUGS
+.Nm
+looks for ZFS meta-data only in MBR partitions
+.Pq known on FreeBSD as slices .
+It does not look into BSD
+.Xr disklabel 8
+partitions that are traditionally called partitions.
+If a disklabel partition happens to be placed so that ZFS meta-data can be
+found at the fixed offsets relative to a slice, then
+.Nm
+will recognize the partition as a part of a ZFS pool,
+but this is not guaranteed to happen.
+.Sh AUTHORS
+This manual page was written by
+.An Andriy Gapon Aq avg at FreeBSD.org .
Property changes on: trunk/sys/boot/i386/gptzfsboot/gptzfsboot.8
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: trunk/sys/boot/i386/kgzldr/crt.s
===================================================================
--- trunk/sys/boot/i386/kgzldr/crt.s 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/kgzldr/crt.s 2018-05-23 02:50:53 UTC (rev 9848)
Property changes on: trunk/sys/boot/i386/kgzldr/crt.s
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Index: trunk/sys/boot/i386/kgzldr/sio.s
===================================================================
--- trunk/sys/boot/i386/kgzldr/sio.s 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/kgzldr/sio.s 2018-05-23 02:50:53 UTC (rev 9848)
Property changes on: trunk/sys/boot/i386/kgzldr/sio.s
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Index: trunk/sys/boot/i386/kgzldr/start.s
===================================================================
--- trunk/sys/boot/i386/kgzldr/start.s 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/kgzldr/start.s 2018-05-23 02:50:53 UTC (rev 9848)
Property changes on: trunk/sys/boot/i386/kgzldr/start.s
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/i386/libi386/Makefile
===================================================================
--- trunk/sys/boot/i386/libi386/Makefile 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/Makefile 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,4 +1,5 @@
-# $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.42.6.1 2008/11/25 02:59:29 kensmith Exp $
+# $MidnightBSD$
+# $FreeBSD: stable/9/sys/boot/i386/libi386/Makefile 294852 2016-01-26 21:35:47Z jkim $
#
LIB= i386
INTERNALLIB=
@@ -36,6 +37,9 @@
.if defined(BOOT_LITTLE_ENDIAN_UUID)
# Use little-endian UUID format as defined in SMBIOS 2.6.
CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID
+.elif defined(BOOT_NETWORK_ENDIAN_UUID)
+# Use network-endian UUID format for backward compatibility.
+CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID
.endif
.endif
Index: trunk/sys/boot/i386/libi386/amd64_tramp.S
===================================================================
--- trunk/sys/boot/i386/libi386/amd64_tramp.S 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/amd64_tramp.S 2018-05-23 02:50:53 UTC (rev 9848)
Property changes on: trunk/sys/boot/i386/libi386/amd64_tramp.S
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/i386/libi386/biosacpi.c
===================================================================
--- trunk/sys/boot/i386/libi386/biosacpi.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/biosacpi.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2001 Michael Smith <msmith at freebsd.org>
* All rights reserved.
Modified: trunk/sys/boot/i386/libi386/bioscd.c
===================================================================
--- trunk/sys/boot/i386/libi386/bioscd.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/bioscd.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* Copyright (c) 2001 John H. Baldwin <jhb at FreeBSD.org>
Modified: trunk/sys/boot/i386/libi386/biosdisk.c
===================================================================
--- trunk/sys/boot/i386/libi386/biosdisk.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/biosdisk.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -42,6 +42,7 @@
#include <stand.h>
#include <machine/bootinfo.h>
#include <stdarg.h>
+#include <stdint.h>
#include <bootstrap.h>
#include <btxv86.h>
@@ -266,9 +267,11 @@
int i;
for (i = 0; i < nbdinfo; i++) {
- sprintf(line, " disk%d: BIOS drive %c:\n", i,
+ sprintf(line, " disk%d: BIOS drive %c (%ju X %u):\n", i,
(bdinfo[i].bd_unit < 0x80) ? ('A' + bdinfo[i].bd_unit):
- ('C' + bdinfo[i].bd_unit - 0x80));
+ ('C' + bdinfo[i].bd_unit - 0x80),
+ (uintmax_t)bdinfo[i].bd_sectors,
+ bdinfo[i].bd_sectorsize);
pager_output(line);
dev.d_dev = &biosdisk;
dev.d_unit = i;
Modified: trunk/sys/boot/i386/libi386/biosmem.c
===================================================================
--- trunk/sys/boot/i386/libi386/biosmem.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/biosmem.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
Modified: trunk/sys/boot/i386/libi386/biospci.c
===================================================================
--- trunk/sys/boot/i386/libi386/biospci.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/biospci.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
Modified: trunk/sys/boot/i386/libi386/biospnp.c
===================================================================
--- trunk/sys/boot/i386/libi386/biospnp.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/biospnp.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
Modified: trunk/sys/boot/i386/libi386/biossmap.c
===================================================================
--- trunk/sys/boot/i386/libi386/biossmap.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/biossmap.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
Modified: trunk/sys/boot/i386/libi386/bootinfo.c
===================================================================
--- trunk/sys/boot/i386/libi386/bootinfo.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/bootinfo.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
@@ -25,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/bootinfo.c,v 1.39.6.1 2008/11/25 02:59:29 kensmith Exp $");
+__FBSDID("$FreeBSD$");
#include <stand.h>
#include <sys/param.h>
Modified: trunk/sys/boot/i386/libi386/bootinfo32.c
===================================================================
--- trunk/sys/boot/i386/libi386/bootinfo32.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/bootinfo32.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
Modified: trunk/sys/boot/i386/libi386/bootinfo64.c
===================================================================
--- trunk/sys/boot/i386/libi386/bootinfo64.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/bootinfo64.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
Modified: trunk/sys/boot/i386/libi386/comconsole.c
===================================================================
--- trunk/sys/boot/i386/libi386/comconsole.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/comconsole.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith (msmith at freebsd.org)
*
@@ -24,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/comconsole.c,v 1.11.6.1 2008/11/25 02:59:29 kensmith Exp $");
+__FBSDID("$FreeBSD: stable/9/sys/boot/i386/libi386/comconsole.c 261574 2014-02-07 04:10:30Z mav $");
#include <stand.h>
#include <bootstrap.h>
@@ -50,7 +51,6 @@
static void comc_putchar(int c);
static int comc_getchar(void);
static int comc_getspeed(void);
-static void set_hw_console_hint(void);
static int comc_ischar(void);
static int comc_parseint(const char *string);
static uint32_t comc_parse_pcidev(const char *string);
@@ -182,8 +182,7 @@
return (CMD_ERROR);
}
- if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 &&
- comc_curspeed != speed)
+ if (comc_curspeed != speed)
comc_setup(speed, comc_port);
env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL);
@@ -201,11 +200,8 @@
return (CMD_ERROR);
}
- if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 &&
- comc_port != port) {
+ if (comc_port != port)
comc_setup(comc_curspeed, port);
- set_hw_console_hint();
- }
env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL);
@@ -212,17 +208,6 @@
return (CMD_OK);
}
-static void
-set_hw_console_hint(void)
-{
- char intbuf[64];
-
- unsetenv("hw.uart.console");
- sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed);
- env_setenv("hw.uart.console", EV_VOLATILE, intbuf,
- env_noset, env_nounset);
-}
-
/*
* Input: bus:dev:func[:bar]. If bar is not specified, it is 0x10.
* Output: bar[24:16] bus[15:8] dev[7:3] func[2:0]
@@ -288,7 +273,6 @@
comc_port_set, env_nounset);
comc_setup(comc_curspeed, port);
- set_hw_console_hint();
comc_locator = locator;
return (CMD_OK);
@@ -318,10 +302,14 @@
comc_setup(int speed, int port)
{
static int TRY_COUNT = 1000000;
+ char intbuf[64];
int tries;
+ unsetenv("hw.uart.console");
comc_curspeed = speed;
comc_port = port;
+ if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) == 0)
+ return;
outb(comc_port + com_cfcr, CFCR_DLAB | COMC_FMT);
outb(comc_port + com_dlbl, COMC_BPS(speed) & 0xff);
@@ -334,9 +322,11 @@
inb(comc_port + com_data);
while (inb(comc_port + com_lsr) & LSR_RXRDY && ++tries < TRY_COUNT);
- if (tries < TRY_COUNT)
+ if (tries < TRY_COUNT) {
comconsole.c_flags |= (C_PRESENTIN | C_PRESENTOUT);
- else
+ sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed);
+ env_setenv("hw.uart.console", EV_VOLATILE, intbuf, NULL, NULL);
+ } else
comconsole.c_flags &= ~(C_PRESENTIN | C_PRESENTOUT);
}
Modified: trunk/sys/boot/i386/libi386/devicename.c
===================================================================
--- trunk/sys/boot/i386/libi386/devicename.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/devicename.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
Modified: trunk/sys/boot/i386/libi386/elf32_freebsd.c
===================================================================
--- trunk/sys/boot/i386/libi386/elf32_freebsd.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/elf32_freebsd.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
Modified: trunk/sys/boot/i386/libi386/elf64_freebsd.c
===================================================================
--- trunk/sys/boot/i386/libi386/elf64_freebsd.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/elf64_freebsd.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
Modified: trunk/sys/boot/i386/libi386/i386_copy.c
===================================================================
--- trunk/sys/boot/i386/libi386/i386_copy.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/i386_copy.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
@@ -25,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/i386_copy.c,v 1.12.6.1 2008/11/25 02:59:29 kensmith Exp $");
+__FBSDID("$FreeBSD$");
/*
* MD primitives supporting placement of module data
Modified: trunk/sys/boot/i386/libi386/i386_module.c
===================================================================
--- trunk/sys/boot/i386/libi386/i386_module.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/i386_module.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
Modified: trunk/sys/boot/i386/libi386/libi386.h
===================================================================
--- trunk/sys/boot/i386/libi386/libi386.h 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/libi386.h 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
Modified: trunk/sys/boot/i386/libi386/nullconsole.c
===================================================================
--- trunk/sys/boot/i386/libi386/nullconsole.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/nullconsole.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* nullconsole.c
*
@@ -36,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/nullconsole.c,v 1.2.28.1 2008/11/25 02:59:29 kensmith Exp $");
+__FBSDID("$FreeBSD$");
#include <stand.h>
#include <bootstrap.h>
Modified: trunk/sys/boot/i386/libi386/pread.c
===================================================================
--- trunk/sys/boot/i386/libi386/pread.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/pread.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* $NetBSD: pread.c,v 1.2 1997/03/22 01:48:38 thorpej Exp $
*/
@@ -34,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/pread.c,v 1.3.28.1 2008/11/25 02:59:29 kensmith Exp $");
+__FBSDID("$FreeBSD$");
/* read into destination in flat addr space */
Modified: trunk/sys/boot/i386/libi386/pxe.c
===================================================================
--- trunk/sys/boot/i386/libi386/pxe.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/pxe.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2000 Alfred Perlstein <alfred at freebsd.org>
* Copyright (c) 2000 Paul Saab <ps at freebsd.org>
Modified: trunk/sys/boot/i386/libi386/pxe.h
===================================================================
--- trunk/sys/boot/i386/libi386/pxe.h 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/pxe.h 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* Copyright (c) 2000 Alfred Perlstein <alfred at freebsd.org>
* All rights reserved.
Index: trunk/sys/boot/i386/libi386/pxetramp.s
===================================================================
--- trunk/sys/boot/i386/libi386/pxetramp.s 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/pxetramp.s 2018-05-23 02:50:53 UTC (rev 9848)
Property changes on: trunk/sys/boot/i386/libi386/pxetramp.s
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/i386/libi386/smbios.c
===================================================================
--- trunk/sys/boot/i386/libi386/smbios.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/smbios.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2005-2009 Jung-uk Kim <jkim at FreeBSD.org>
* All rights reserved.
@@ -25,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/smbios.c,v 1.7.6.1 2008/11/25 02:59:29 kensmith Exp $");
+__FBSDID("$FreeBSD: stable/9/sys/boot/i386/libi386/smbios.c 294852 2016-01-26 21:35:47Z jkim $");
#include <stand.h>
#include <bootstrap.h>
@@ -122,7 +123,7 @@
smbios_setuuid(const char *name, const caddr_t addr, const int ver)
{
char uuid[37];
- int i, ones, zeros;
+ int byteorder, i, ones, zeros;
UUID_TYPE n;
uint32_t f1;
uint16_t f2, f3;
@@ -152,14 +153,18 @@
* Note: We use network byte order for backward compatibility
* unless SMBIOS version is 2.6+ or little-endian is forced.
*/
-#ifndef SMBIOS_LITTLE_ENDIAN_UUID
- if (ver < 0x0206) {
+#if defined(SMBIOS_LITTLE_ENDIAN_UUID)
+ byteorder = LITTLE_ENDIAN;
+#elif defined(SMBIOS_NETWORK_ENDIAN_UUID)
+ byteorder = BIG_ENDIAN;
+#else
+ byteorder = ver < 0x0206 ? BIG_ENDIAN : LITTLE_ENDIAN;
+#endif
+ if (byteorder != LITTLE_ENDIAN) {
f1 = ntohl(SMBIOS_GET32(addr, 0));
f2 = ntohs(SMBIOS_GET16(addr, 4));
f3 = ntohs(SMBIOS_GET16(addr, 6));
- } else
-#endif
- {
+ } else {
f1 = le32toh(SMBIOS_GET32(addr, 0));
f2 = le16toh(SMBIOS_GET16(addr, 4));
f3 = le16toh(SMBIOS_GET16(addr, 6));
Modified: trunk/sys/boot/i386/libi386/spinconsole.c
===================================================================
--- trunk/sys/boot/i386/libi386/spinconsole.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/spinconsole.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* spinconsole.c
*
Modified: trunk/sys/boot/i386/libi386/time.c
===================================================================
--- trunk/sys/boot/i386/libi386/time.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/time.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
Modified: trunk/sys/boot/i386/libi386/vidconsole.c
===================================================================
--- trunk/sys/boot/i386/libi386/vidconsole.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/libi386/vidconsole.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith (msmith at freebsd.org)
* Copyright (c) 1997 Kazutaka YOKOTA (yokota at zodiac.mech.utsunomiya-u.ac.jp)
Modified: trunk/sys/boot/i386/loader/Makefile
===================================================================
--- trunk/sys/boot/i386/loader/Makefile 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/loader/Makefile 2018-05-23 02:50:53 UTC (rev 9848)
@@ -100,8 +100,7 @@
FILES+= loader.help loader.4th support.4th loader.conf
FILES+= screen.4th frames.4th beastie.4th
FILES+= brand.4th check-password.4th color.4th delay.4th
-FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th
-FILES+= vm.4th
+FILES+= menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th
FILESDIR_loader.conf= /boot/defaults
.if !exists(${DESTDIR}/boot/loader.rc)
Modified: trunk/sys/boot/i386/loader/conf.c
===================================================================
--- trunk/sys/boot/i386/loader/conf.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/loader/conf.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
@@ -25,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/9/sys/boot/i386/loader/conf.c 277947 2015-01-30 18:55:16Z jhb $");
#include <stand.h>
#include <bootstrap.h>
@@ -77,9 +78,12 @@
&ext2fs_fsops,
&dosfs_fsops,
&cd9660_fsops,
-#ifdef LOADER_SPLIT_SUPPORT
- &splitfs_fsops,
+#ifdef LOADER_NFS_SUPPORT
+ &nfs_fsops,
#endif
+#ifdef LOADER_TFTP_SUPPORT
+ &tftp_fsops,
+#endif
#ifdef LOADER_GZIP_SUPPORT
&gzipfs_fsops,
#endif
@@ -86,12 +90,9 @@
#ifdef LOADER_BZIP2_SUPPORT
&bzipfs_fsops,
#endif
-#ifdef LOADER_NFS_SUPPORT
- &nfs_fsops,
+#ifdef LOADER_SPLIT_SUPPORT
+ &splitfs_fsops,
#endif
-#ifdef LOADER_TFTP_SUPPORT
- &tftp_fsops,
-#endif
NULL
};
Index: trunk/sys/boot/i386/loader/help.i386
===================================================================
--- trunk/sys/boot/i386/loader/help.i386 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/loader/help.i386 2018-05-23 02:50:53 UTC (rev 9848)
Property changes on: trunk/sys/boot/i386/loader/help.i386
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/i386/loader/loader.rc
===================================================================
--- trunk/sys/boot/i386/loader/loader.rc 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/loader/loader.rc 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,15 +1,12 @@
\ Loader.rc
-\ $FreeBSD: src/sys/boot/i386/loader/loader.rc,v 1.4.2.1 2005/10/30 14:37:02 scottl Exp $
+\ $MidnightBSD$
\
\ Includes additional commands
include /boot/loader.4th
+try-include /boot/loader.rc.local
-\ Virtual machine detection
-include /boot/vm.4th
-setup-vm
-
\ Reads and processes loader.conf variables
-start
+initialize
\ Tests for password -- executes autoboot first if a password was defined
check-password
Property changes on: trunk/sys/boot/i386/loader/loader.rc
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/boot/i386/loader/main.c
===================================================================
--- trunk/sys/boot/i386/loader/main.c 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/loader/main.c 2018-05-23 02:50:53 UTC (rev 9848)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
* All rights reserved.
Index: trunk/sys/boot/i386/loader/version
===================================================================
--- trunk/sys/boot/i386/loader/version 2018-05-23 02:32:43 UTC (rev 9847)
+++ trunk/sys/boot/i386/loader/version 2018-05-23 02:50:53 UTC (rev 9848)
Property changes on: trunk/sys/boot/i386/loader/version
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list