Home | History | Annotate | only in /src/sys/arch/i386/stand/pxeboot
History log of /src/sys/arch/i386/stand/pxeboot
RevisionDateAuthorComments
 1.30 29-Jun-2024  rin i386: stand: Tiny clean up for `start_pxeboot.o`, NFC
 1.29 29-Jun-2024  rin i386: stand: Retire its own nfs.c, and switch to libsa/nfs.c. NFC
 1.28 27-Sep-2019  gson branches: 1.28.26;
Incrase pxeboot code size limit from 64k to 128k. Fixes PR kern/54560.
The start_pxe.S part was suggested by mlelstv.
 1.27 23-Sep-2019  christos Consistently use ${RELEASEDIR}/${RELEASEMACHINE} instead of
${RELEASEDIR}/${MACHINE} (Paul Ripke)
 1.26 13-Sep-2019  manu Add multiboot 2 support to x86 bootloaders

multiboot 2 is required to boot Xen on an EFI system.
This also require a kernel patch for properly discovering
the ACPI RSDP, which is available after 20190912, in
src/sys/arch/x86/acpi/acpi_machdep.c 1.26-1.28

There are a few missing bit in this multiboot 2 implementation
(which are unused by Xen):
- Header tags Address, Freambuffer, and Relocatable are ignored
- Tags APM and Network are not provided
- Tags ACPI old and ACP new are only provided for ACPI boot
- Tag boot device does not provides the subpart (BSD disklabel partition)

Notes:
- multiboot2 is disabled in dosboot, otherwise the binary
gets too big and build fails.
- in src/sys/arch/i386/stand/efiboot, consinit() is renamed
as efi_consinit() to avoid prototype conflicts in src/sys/sys/systm.h
 1.25 02-Jun-2018  christos branches: 1.25.2; 1.25.6;
- Disable MKSANITIZER
- Redo using NOPIE
- Add NORELRO
 1.24 23-Jan-2016  christos branches: 1.24.10; 1.24.16;
We'll define the kernel types for standalone code.
 1.23 23-Jan-2016  christos Define _KERNTYPES for things that need it.
 1.22 15-Jan-2014  joerg branches: 1.22.6;
Reduce amount of -no-integrated-as on x86 as .code16 is now supported by
LLVM.
 1.21 20-May-2011  joerg branches: 1.21.4; 1.21.14; 1.21.18;
Disable integrated assembler for files that use .code16 or .code32 for
now. Disable Clang completely for bootxx and netboot for now until the
size issue has been sorted out.
 1.20 17-Jan-2010  drochner branches: 1.20.4; 1.20.6;
fix tyop in default flag definition
 1.19 17-Jan-2010  drochner Invert the flag bits to control module loading: rename
LOADMODULES->NOMODULES and READBOOTCONF->NOBOOTCONF.
This way, the default value (0) wired into old bootxx_* and installed
to file systems remains valid and we avoid problems on partial updates.
 1.18 14-Jan-2010  drochner On i386/amd64, define two flag bits in the boot parameters which control
whether modules are loaded and whether boot.cfg is evaluated, and
set both to "off" per default in the PXE bootloader.
Extend "installboot" to toggle the bits.
This way, pxeboot works with existing dhcp server setups (and as
described in the manpage) out of the box. Also, boot.cfg reading
involves a stat() call which is horribly inefficient with the
TFTP pseudo file system.
 1.17 30-Mar-2009  tsutsui Remove extra trailing slash in ${S} path.
 1.16 14-Feb-2009  abs Convert more MACHINE tests to MACHINE_ARCH
 1.15 20-Oct-2008  christos branches: 1.15.2; 1.15.8;
disable PIE for boot code.
 1.14 27-Feb-2007  he branches: 1.14.40; 1.14.44; 1.14.50;
Install pxeboot_ia32.bin as part of a "make release" on i386 and amd64.
 1.13 04-Oct-2006  salo branches: 1.13.2; 1.13.4;
Fix ypo. (hi abs!)

Noticed at #NetBSD-code.
 1.12 22-Sep-2006  abs Enable EPIA_HACK here too - http://mail-index.netbsd.org/port-i386/2006/08/18/0002.html
 1.11 25-Jun-2006  lukem branches: 1.11.4; 1.11.6;
Use LDFLAGS (with $(CC) syntax) instead of appending to LD.
 1.10 12-May-2006  mrg branches: 1.10.4;
- -mcpu=i386 is gone in GCC4
- we need -Wno-attributes (to avoid __packed__ warnings)
- use -Wno-pointer-sign
- remove some redundancy from pxeboot/Makefile
 1.9 11-Nov-2005  dsl branches: 1.9.6; 1.9.8; 1.9.10; 1.9.14;
Take the console (etc) parameters from the patchable header, instead of
hard-coded constants.
Now the updated installboot can be used to modify the console and baud rate.
 1.8 21-Aug-2005  chs copy some settings from ../boot/Makefile.boot that let us try to load
64-bit kernels on amd64.
 1.7 05-Aug-2004  dbj branches: 1.7.10; 1.7.12;
fix several related bugs that cause sysctl machdep.diskinfo to
lose when booted from pxeboot.
. make sure that i386_alldisks gets initialized even if
bios geometry information is not available in the bootinfo
. if i386_alldisks is not initialized, have sysctl return EOPNOTSUPP
. compile pxeboot with -DPASS_BIOSGEOM and I386_INCLUDE_DISK=yes
this may increase the size of pxeboot which is required to run
in 64k. However, it seems to be working ok on my system
 1.6 01-Apr-2003  mycroft branches: 1.6.2; 1.6.4;
Add -DSLOW to reduce the size of libz a bit.
 1.5 11-Mar-2003  drochner use our own NFS fs implementation, which is smaller, does a better job
in error reporting and coexists with the TFTP fs
 1.4 24-Nov-2002  lukem use NOMAN instead of MKMAN=no. noted by David Bonnafous on port-i386@
 1.3 20-Feb-2002  thorpej branches: 1.3.2; 1.3.4; 1.3.16;
* Rename the pxeboot binary from "pxeboot" to "pxeboot_ia32", since
there are other architectures (e.g. IA64) which also use PXE.
* Get the console right in pxeboot, from Andreas Gustafsson.
* Add a "com0" version of pxeboot, to address the same issue that
biosboot_com0 addresses.
 1.2 17-Feb-2002  thorpej Cleanup of i386 bootloader building:
* Add separate directories for the individual netboot ROMs and
always build them.
* Each bootloader Makefile explicitly specifies the start file
and link address it wishes to use.
* genprom becomes a proper host program.
* Make sure all generated files get cleaned up.
* Set BINDIR in Makefile.inc
* Add compressed image support to pxeboot.
* Make pxeboot use the default serial console speed (9600).
 1.1 16-Feb-2002  thorpej Add a PXE boot loader. PXE interface code is derived by code
written by Alfred Perlstein, Paul Saab, John Baldwin for FreeBSD.

Still needs some work, but this will load a kernel on a Soekris net4501.

Many thanks to Frank van der Linden and his simulator wizardry for
helping me debug the low-level startup code.
 1.3.16.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.16.1 20-Feb-2002  jdolecek file Makefile was added on branch kqueue on 2002-06-23 17:37:35 +0000
 1.3.4.3 11-Dec-2002  thorpej Sync with HEAD.
 1.3.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.3.4.1 20-Feb-2002  nathanw file Makefile was added on branch nathanw_sa on 2002-02-28 04:10:29 +0000
 1.3.2.2 20-Feb-2002  thorpej * Rename the pxeboot binary from "pxeboot" to "pxeboot_ia32", since
there are other architectures (e.g. IA64) which also use PXE.
* Get the console right in pxeboot, from Andreas Gustafsson.
* Add a "com0" version of pxeboot, to address the same issue that
biosboot_com0 addresses.
 1.3.2.1 20-Feb-2002  thorpej file Makefile was added on branch sommerfeld_i386mp_1 on 2002-02-20 03:00:28 +0000
 1.6.4.1 16-Aug-2004  jmc Pullup rev 1.7 (requested by dbj in ticket #767)

Add support to pxeboot for reading the bios disk geometry
as well as fixing several related bugs that occur when the bios
geometry is not read by the boot loader.
 1.6.2.5 11-Dec-2005  christos Sync with head.
 1.6.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 12-Aug-2004  skrll Sync with HEAD.
 1.7.12.3 03-Sep-2007  yamt sync with head.
 1.7.12.2 30-Dec-2006  yamt sync with head.
 1.7.12.1 21-Jun-2006  yamt sync with head.
 1.7.10.1 15-Sep-2005  tron Pull up following revision(s) (requested by chs in ticket #783):
sys/arch/i386/stand/pxeboot/Makefile: revision 1.8
copy some settings from ../boot/Makefile.boot that let us try to load
64-bit kernels on amd64.
 1.9.14.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.9.10.2 26-Jun-2006  yamt sync with head.
 1.9.10.1 24-May-2006  yamt sync with head.
 1.9.8.1 01-Jun-2006  kardel Sync with head.
 1.9.6.1 09-Sep-2006  rpaulo sync with head
 1.10.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.11.6.1 22-Oct-2006  yamt sync with head
 1.11.4.1 18-Nov-2006  ad Sync with head.
 1.13.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.13.2.1 04-Mar-2007  bouyer Pull up following revision(s) (requested by he in ticket #469):
sys/arch/i386/stand/pxeboot/Makefile: revision 1.14
etc/etc.amd64/Makefile.inc: revision 1.6
etc/etc.i386/Makefile.inc: revision 1.48
Install pxeboot_ia32.bin as part of a "make release" on i386 and amd64.
 1.14.50.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.14.44.2 11-Mar-2010  yamt sync with head
 1.14.44.1 04-May-2009  yamt sync with head.
 1.14.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.15.8.4 27-Aug-2011  jym Sync with HEAD. Most notably: uvm/pmap work done by rmind@, and MP Xen
work of cherry@.

No regression observed on suspend/restore.
 1.15.8.3 29-Mar-2011  jym More sync fixes. And add the mbr_gpt files.
 1.15.8.2 01-Nov-2009  jym Sync with HEAD.
 1.15.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.15.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.15.2.1 03-Mar-2009  skrll Sync with HEAD.
 1.20.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.20.4.1 31-May-2011  rmind sync with head
 1.21.18.1 18-May-2014  rmind sync with head
 1.21.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.22.6.1 19-Mar-2016  skrll Sync with HEAD
 1.24.16.1 25-Jun-2018  pgoyette Sync with HEAD
 1.24.10.2 04-Oct-2019  martin Pull up following revision(s) (requested by manu in ticket #1400):

sys/arch/i386/stand/pxeboot/start_pxe.S: revision 1.7
sys/arch/i386/stand/pxeboot/Makefile: revision 1.28

Incrase pxeboot code size limit from 64k to 128k. Fixes PR kern/54560.
The start_pxe.S part was suggested by mlelstv.
 1.24.10.1 18-Sep-2019  martin Pull up following revision(s) [adapted, via patch]
(requested by manu in ticket #1382):

sys/arch/i386/include/multiboot2.h: revision 1.1
sys/arch/i386/stand/lib/exec.c: revision 1.74
sys/arch/i386/stand/efiboot/efiboot.c: revision 1.11
sys/arch/i386/stand/efiboot/bootia32/multiboot32.S: revision 1.1
sys/arch/i386/stand/lib/biosdisk.c: revision 1.52
sys/arch/i386/stand/efiboot/bootx64/efibootx64.c: revision 1.5
distrib/sets/lists/comp/md.amd64: revision 1.273
sys/arch/i386/stand/efiboot/eficons.c: revision 1.7
sys/arch/i386/stand/efiboot/bootia32/efibootia32.c: revision 1.5
distrib/sets/lists/comp/md.i386: revision 1.191
sys/arch/i386/stand/lib/libi386.h: revision 1.45
sys/arch/i386/stand/lib/bootinfo_memmap.c: revision 1.6
sys/arch/i386/stand/lib/pread.c: revision 1.8
sys/arch/i386/stand/efiboot/efiboot.h: revision 1.10
sys/arch/i386/stand/efiboot/bootia32/Makefile: revision 1.3
sys/arch/i386/stand/lib/Makefile: revision 1.47
sys/arch/i386/stand/efiboot/bootx64/Makefile: revision 1.2
sys/arch/i386/stand/lib/multiboot.S: revision 1.3
sys/arch/i386/stand/efiboot/bootx64/multiboot64.S: revision 1.1
sys/arch/i386/stand/efiboot/efimemory.c: revision 1.9
sys/arch/i386/stand/efiboot/boot.c: revision 1.16
sys/arch/i386/include/Makefile: revision 1.50
sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.16
share/man/man8/man8.x86/boot.8: revision 1.20
sys/arch/i386/stand/boot/Makefile.boot: revision 1.73
sys/arch/i386/stand/pxeboot/Makefile: revision 1.26
sys/arch/i386/stand/lib/exec_multiboot1.c: revision 1.1
sys/arch/i386/stand/netboot/Makefile.netboot: revision 1.11
sys/arch/i386/stand/lib/exec_multiboot2.c: revision 1.1
sys/arch/i386/stand/lib/biosdisk.h: revision 1.12
sys/arch/i386/stand/lib/exec_multiboot2.c: revision 1.2
sys/arch/i386/stand/dosboot/Makefile: revision 1.32
sys/external/bsd/gnu-efi/dist/inc/efiapi.h (apply patch)

Add multiboot 2 support to x86 bootloaders

multiboot 2 is required to boot Xen on an EFI system.

This also require a kernel patch for properly discovering
the ACPI RSDP, which is available after 20190912, in
src/sys/arch/x86/acpi/acpi_machdep.c 1.26-1.28

There are a few missing bit in this multiboot 2 implementation
(which are unused by Xen):
- Header tags Address, Freambuffer, and Relocatable are ignored
- Tags APM and Network are not provided
- Tags ACPI old and ACP new are only provided for ACPI boot
- Tag boot device does not provides the subpart (BSD disklabel partition)

Notes:
- multiboot2 is disabled in dosboot, otherwise the binary
gets too big and build fails.
- in src/sys/arch/i386/stand/efiboot, consinit() is renamed
as efi_consinit() to avoid prototype conflicts in src/sys/sys/systm.h

Remove debug define.

It remained there unseen because it was misspelled!

Remove obsoeolete BUGS note that UEFI bootloader does not support multiboot

Add new multiboot2.h header.
 1.25.6.2 03-Oct-2019  martin Pull up following revision(s) (requested by manu in ticket #277):

sys/arch/i386/stand/pxeboot/start_pxe.S: revision 1.7
sys/arch/i386/stand/pxeboot/Makefile: revision 1.28

Incrase pxeboot code size limit from 64k to 128k. Fixes PR kern/54560.
The start_pxe.S part was suggested by mlelstv.
 1.25.6.1 17-Sep-2019  martin Pull up following revision(s) (requested by manu in ticket #203):

sys/arch/i386/include/multiboot2.h: revision 1.1
sys/arch/i386/stand/lib/exec.c: revision 1.74
sys/arch/i386/stand/efiboot/efiboot.c: revision 1.11
sys/arch/i386/stand/efiboot/bootia32/multiboot32.S: revision 1.1
sys/arch/i386/stand/lib/biosdisk.c: revision 1.52
sys/arch/i386/stand/efiboot/bootx64/efibootx64.c: revision 1.5
sys/arch/i386/stand/efiboot/eficons.c: revision 1.7
sys/arch/i386/stand/efiboot/bootia32/efibootia32.c: revision 1.5
sys/arch/i386/stand/lib/libi386.h: revision 1.45
sys/arch/i386/stand/lib/bootinfo_memmap.c: revision 1.6
sys/arch/i386/stand/lib/pread.c: revision 1.8
sys/arch/i386/stand/efiboot/efiboot.h: revision 1.10
sys/arch/i386/stand/efiboot/bootia32/Makefile: revision 1.3
sys/arch/i386/stand/lib/Makefile: revision 1.47
sys/arch/i386/stand/efiboot/bootx64/Makefile: revision 1.2
sys/arch/i386/stand/lib/multiboot.S: revision 1.3
sys/arch/i386/stand/efiboot/bootx64/multiboot64.S: revision 1.1
sys/arch/i386/stand/efiboot/efimemory.c: revision 1.9
sys/arch/i386/stand/efiboot/boot.c: revision 1.16
sys/arch/i386/include/Makefile: revision 1.50
sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.16
share/man/man8/man8.x86/boot.8: revision 1.20
sys/arch/i386/stand/boot/Makefile.boot: revision 1.73
sys/arch/i386/stand/pxeboot/Makefile: revision 1.26
sys/arch/i386/stand/lib/exec_multiboot1.c: revision 1.1
sys/arch/i386/stand/netboot/Makefile.netboot: revision 1.11
sys/arch/i386/stand/lib/exec_multiboot2.c: revision 1.1
sys/arch/i386/stand/lib/biosdisk.h: revision 1.12
sys/arch/i386/stand/lib/exec_multiboot2.c: revision 1.2
sys/arch/i386/stand/dosboot/Makefile: revision 1.32

Add multiboot 2 support to x86 bootloaders

multiboot 2 is required to boot Xen on an EFI system.

This also require a kernel patch for properly discovering
the ACPI RSDP, which is available after 20190912, in
src/sys/arch/x86/acpi/acpi_machdep.c 1.26-1.28

There are a few missing bit in this multiboot 2 implementation
(which are unused by Xen):
- Header tags Address, Freambuffer, and Relocatable are ignored
- Tags APM and Network are not provided
- Tags ACPI old and ACP new are only provided for ACPI boot
- Tag boot device does not provides the subpart (BSD disklabel partition)
Notes:
- multiboot2 is disabled in dosboot, otherwise the binary
gets too big and build fails.
- in src/sys/arch/i386/stand/efiboot, consinit() is renamed
as efi_consinit() to avoid prototype conflicts in src/sys/sys/systm.h

Remove debug define.

It remained there unseen because it was misspelled!

Remove obsoeolete BUGS note that UEFI bootloader does not support multiboot
 1.25.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.28.26.1 20-Sep-2024  martin Pull up following revision(s) (requested by rin in ticket #894):

sys/arch/i386/stand/Makefile.booters: revision 1.98
sys/lib/libsa/nfsv3.h: revision 1.1
sys/lib/libsa/rpcv2.h: revision 1.4
sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.23
sys/lib/libsa/nfsv2.h: revision 1.5
sys/lib/libsa/nfs.c: revision 1.51
sys/lib/libsa/nfs.c: revision 1.52
sys/arch/i386/stand/libsa/nfs.c: file removal
sys/lib/libsa/nfs.c: revision 1.53
sys/arch/i386/stand/libsa/nfs.c: revision 1.20
sys/arch/i386/stand/libsa/nfs.c: revision 1.21
sys/arch/i386/stand/pxeboot/Makefile: revision 1.29

Add NFSv3 support. Try NFSv3 and fall back to NFSv2.

Merge with generic libsa NFS code to minimize differences and to learn NFSv3.

libsa: nfs: Fix NFS_NOSYMLINK option for previous
Used only by mvme68k.

Align again with libsa (NFS_NOSYMLINK fix).

libsa/nfs.c: Add `LIBSA_NFS_IMPLICIT_MOUNT` compile-time option
by which nfs_mount() is automatically called from nfs_open(),
as done for nfs.c in i386/stand.

This is only functional difference b/w two copies of nfs.c.
Now, we can safely retire the latter.
XXX
It would be really nice to drop this option also. However,
unfortunately, it is too much for me at the very moment...

i386: stand: Retire its own nfs.c, and switch to libsa/nfs.c. NFC
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 28-Jun-2005  junyoung #include <lib/libsa/stand.h> rather than <stand.h> or "stand.h"
 1.3 23-Jun-2005  junyoung Use FS_OPS() macro.
 1.2 12-Mar-2003  drochner branches: 1.2.2;
kick out mi libsa/netif.c references
 1.1 16-Feb-2002  thorpej branches: 1.1.2; 1.1.4; 1.1.16;
Add a PXE boot loader. PXE interface code is derived by code
written by Alfred Perlstein, Paul Saab, John Baldwin for FreeBSD.

Still needs some work, but this will load a kernel on a Soekris net4501.

Many thanks to Frank van der Linden and his simulator wizardry for
helping me debug the low-level startup code.
 1.1.16.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.16.1 16-Feb-2002  jdolecek file conf.c was added on branch kqueue on 2002-06-23 17:37:35 +0000
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 16-Feb-2002  nathanw file conf.c was added on branch nathanw_sa on 2002-02-28 04:10:29 +0000
 1.1.2.2 16-Feb-2002  thorpej Add a PXE boot loader. PXE interface code is derived by code
written by Alfred Perlstein, Paul Saab, John Baldwin for FreeBSD.

Still needs some work, but this will load a kernel on a Soekris net4501.

Many thanks to Frank van der Linden and his simulator wizardry for
helping me debug the low-level startup code.
 1.1.2.1 16-Feb-2002  thorpej file conf.c was added on branch sommerfeld_i386mp_1 on 2002-02-16 03:37:41 +0000
 1.2.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11 17-Jul-2011  joerg Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.10 13-Dec-2009  jakllsch Shut down the PXE network stack when we are done with it.

This fixes an issue where a CK804 nfe(4) would have a
byte-reversed MAC address after pxeboot(8).
 1.9 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.8 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.7 11-May-2008  chris branches: 1.7.6; 1.7.12;
Add support to pxeboot to allow the loading of modules. Changes to main.c
are taken from boot/boot2.c.

This allows an install to be started by running:
load tftp:miniroot.kmod
boot tftp:netbsd-GENERIC

Note that the change to dev_net.c to comment out the network shutdown,
suggests we need to hook the network shutdown in the the common exec code.
If the network is shutdown, it fails to reinitialise and so fails to load
the module.
 1.6 28-Apr-2008  martin branches: 1.6.2;
Remove clause 3 and 4 from TNF licenses
 1.5 12-Mar-2003  drochner branches: 1.5.104; 1.5.106; 1.5.108;
-use our own netif layer
-call the pxe unload function only on close(), not on open() errors,
so we have a chance to retry
-remove some remaining references to NFS
 1.4 12-Mar-2003  drochner cleanup:
-update comments
-remove remaining references to "bootparam"
-don't try to interpret extra arguments to net_open() - we
get only passed a NULL anyway (see devopen.c)
 1.3 11-Mar-2003  drochner kick out RARP/bootparam - PXE uses BOOTP anyway
 1.2 11-Mar-2003  drochner use our own NFS fs implementation, which is smaller, does a better job
in error reporting and coexists with the TFTP fs
 1.1 16-Feb-2002  thorpej branches: 1.1.2; 1.1.4; 1.1.16;
Need private copies of these files for now.
 1.1.16.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.16.1 16-Feb-2002  jdolecek file dev_net.c was added on branch kqueue on 2002-06-23 17:37:35 +0000
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 16-Feb-2002  nathanw file dev_net.c was added on branch nathanw_sa on 2002-02-28 04:10:30 +0000
 1.1.2.2 16-Feb-2002  thorpej Need private copies of these files for now.
 1.1.2.1 16-Feb-2002  thorpej file dev_net.c was added on branch sommerfeld_i386mp_1 on 2002-02-16 16:26:24 +0000
 1.5.108.3 11-Mar-2010  yamt sync with head
 1.5.108.2 04-May-2009  yamt sync with head.
 1.5.108.1 16-May-2008  yamt sync with head.
 1.5.106.1 18-May-2008  yamt sync with head.
 1.5.104.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.7.12.4 27-Aug-2011  jym Sync with HEAD. Most notably: uvm/pmap work done by rmind@, and MP Xen
work of cherry@.

No regression observed on suspend/restore.
 1.7.12.3 28-Mar-2011  jym Cure sync hiccups. Code with compile errors is not really useful, heh.
 1.7.12.2 01-Nov-2009  jym Sync with HEAD.
 1.7.12.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.6.1 28-Apr-2009  skrll Sync with HEAD.
 1.2 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.1 16-Feb-2002  thorpej branches: 1.1.2; 1.1.4; 1.1.16; 1.1.128; 1.1.136; 1.1.142;
Need private copies of these files for now.
 1.1.142.2 01-Nov-2009  jym Sync with HEAD.
 1.1.142.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.136.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.128.1 04-May-2009  yamt sync with head.
 1.1.16.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.16.1 16-Feb-2002  jdolecek file dev_net.h was added on branch kqueue on 2002-06-23 17:37:35 +0000
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 16-Feb-2002  nathanw file dev_net.h was added on branch nathanw_sa on 2002-02-28 04:10:30 +0000
 1.1.2.2 16-Feb-2002  thorpej Need private copies of these files for now.
 1.1.2.1 16-Feb-2002  thorpej file dev_net.h was added on branch sommerfeld_i386mp_1 on 2002-02-16 16:26:24 +0000
 1.9 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.8 18-Mar-2009  cegger bcopy -> memcpy
 1.7 11-Dec-2005  christos branches: 1.7.78; 1.7.86; 1.7.92;
merge ktrace-lwp.
 1.6 28-Jun-2005  junyoung #include <lib/libsa/stand.h> rather than <stand.h> or "stand.h"
 1.5 12-Nov-2003  drochner Uhm - the last change broke everything but very simple setups.
(it only allowed to boot an nfs /netbsd automatically)
To make it work for people who can't tell the DHCP server to pass
the right kernel file to pxeboot, without losing flexibility for
people who can, do the following:
Use the filename given by the DHCP server if it contains a ":". A ":"
was already used to seperate filesystem and filename, so we don't
lose anything. Otoh, a path to pxeboot usually doesn't contain a ":",
so it should still work if we got the old pxeboot filename again.
 1.4 05-Nov-2003  mycroft So, on other platforms we use the BOOTP/DHCP file name for the boot program
and use a default file name of "netbsd" for the kernel. Do the same thing
here, as it hardly makes sense any other way.
 1.3 11-Mar-2003  drochner branches: 1.3.2;
If we get passed a filename (from the command line or default "netbsd"),
pass it to the BOOTP server in the "filename" field.
(as the "netboot" bootROMs already did)
So the user can easily switch between different kernels/configurations.
 1.2 17-Feb-2002  thorpej branches: 1.2.2; 1.2.4; 1.2.16;
Pay attention to the file name provided by the DHCP server, using
it rather than the default of "netbsd" if it's in the reply.
 1.1 16-Feb-2002  thorpej Add a PXE boot loader. PXE interface code is derived by code
written by Alfred Perlstein, Paul Saab, John Baldwin for FreeBSD.

Still needs some work, but this will load a kernel on a Soekris net4501.

Many thanks to Frank van der Linden and his simulator wizardry for
helping me debug the low-level startup code.
 1.2.16.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.16.1 17-Feb-2002  jdolecek file devopen.c was added on branch kqueue on 2002-06-23 17:37:35 +0000
 1.2.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.1 17-Feb-2002  nathanw file devopen.c was added on branch nathanw_sa on 2002-02-28 04:10:30 +0000
 1.2.2.2 17-Feb-2002  thorpej Pay attention to the file name provided by the DHCP server, using
it rather than the default of "netbsd" if it's in the reply.
 1.2.2.1 17-Feb-2002  thorpej file devopen.c was added on branch sommerfeld_i386mp_1 on 2002-02-17 20:14:09 +0000
 1.3.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.92.2 01-Nov-2009  jym Sync with HEAD.
 1.7.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.7.78.2 11-Mar-2010  yamt sync with head
 1.7.78.1 04-May-2009  yamt sync with head.
 1.35 06-May-2025  pgoyette Allow the dev= command when processing /boot.cfg file. This
addresses kern/59207
 1.34 10-Nov-2024  riastradh i386/pxeboot: Nix trailing whitespace.

No functional change intended.
 1.33 09-Nov-2024  mlelstv Support baudrate in consdev command.
 1.32 07-Sep-2021  nia branches: 1.32.10;
Remove banner printing code from bootloaders, add it to libsa.

This harmonizes efiboot and the various x86 bootloaders to use shared
code for printing the banner. By friendly coincidence, it also adds
support for specifying 'banner=' in arm efiboot's boot.cfg, as on x86.
 1.31 28-Jun-2014  rtr patch posted to tech-kern@ 2014/06/25 for review with minor changes
resulting from feedback.

move multiple copies of code for parsing boot.cfg file from sparc, i386
and zaurus into libsa/bootcfg.{h,c}. largely retained i386 parsing logic
in addition to keeping sparc dispatch function while remaining consistent
with boot.cfg(5).

previous sparc64 file format has been obsoleted but only used by boot
CDs distrib/sparc64/bootfs/boot.cfg has been updated to compensate.

exported names have been prefixed with either BOOTCFG_ or bootcfg_ as per
feedback from christos@

tested on amd64 & sparc64 but not zaurus.
 1.30 06-Mar-2013  yamt branches: 1.30.10;
update help
 1.29 26-May-2011  uebayasi branches: 1.29.4; 1.29.14;
Support userconf(4) command in boot(8)/boot.cfg(5) on i386/amd64.

From jmmv@, no objections seen in the proposed thread:

http://mail-index.netbsd.org/tech-kern/2009/01/22/msg004081.html
 1.28 18-Mar-2011  jakllsch Honor bp_timeout even when X86_BP_FLAGS_NOBOOTCONF is set.
Or, in other words, bring back the 5 second countdown in pxeboot(8).
 1.27 20-Dec-2010  jakllsch branches: 1.27.2;
MI libsa provides panic() and exit() functions, no need to provide our own.
As MI libsa exit() calls panic() with a "exit" message, don't use it if we
print our own farewell or have already panic()ed.
 1.26 06-Nov-2010  jym Bring the help command output from boot and pxeboot on par with their
code.
 1.25 06-Apr-2010  tnn Add multiboot command. This lets us netboot the xen+dom0 kernel combo.
 1.24 17-Jan-2010  drochner branches: 1.24.2; 1.24.4;
Invert the flag bits to control module loading: rename
LOADMODULES->NOMODULES and READBOOTCONF->NOBOOTCONF.
This way, the default value (0) wired into old bootxx_* and installed
to file systems remains valid and we avoid problems on partial updates.
 1.23 14-Jan-2010  drochner On i386/amd64, define two flag bits in the boot parameters which control
whether modules are loaded and whether boot.cfg is evaluated, and
set both to "off" per default in the PXE bootloader.
Extend "installboot" to toggle the bits.
This way, pxeboot works with existing dhcp server setups (and as
described in the manpage) out of the box. Also, boot.cfg reading
involves a stat() call which is horribly inefficient with the
TFTP pseudo file system.
 1.22 13-Dec-2009  jakllsch Shut down the PXE network stack when we are done with it.

This fixes an issue where a CK804 nfe(4) would have a
byte-reversed MAC address after pxeboot(8).
 1.21 14-Sep-2009  jmcneill Don't commit the selected VBE mode until the loader is past the point of
no return; need to stick in text mode as long as possible since libsa does
not include a rasops library. While here, add the 'vesa' command to pxeboot
to mirror biosboot behaviour.
 1.20 21-Mar-2009  ad Fix 'boot -z' bogons.
 1.19 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.18 30-Jan-2009  christos branches: 1.18.2;
don't clear the screen unconditionally. Now controlled by an option.
Thanks enami
 1.17 13-Dec-2008  christos add a boot.cfg option to clear the screen; default off. From Anon Ymous
 1.16 25-Nov-2008  ad Make pxeboot understand boot.cfg.
 1.15 26-Sep-2008  christos branches: 1.15.2;
The structure of our elf kernel is:

elf header/program headers/text/data/note/
section headers/symbol table/string table

We need to read the section headers first to find the offset of the note
and thus we requite backwards seek. The only reason we need to read the
note is to find the version of the kernel, and this seems not to be used
anywhere. We could potentially change the kernel ldscript to add the note
information in the program headers, but dealing with ldscripts is painful
and producing a more complex binary could break some dumb standalone loader.
So the simple solution is to just disable the note loading for floppies
which is what this patch does. If someone wants to fix it in a better way,
be my guest.
 1.14 15-Jul-2008  perry Change the x86 boot blocks so they don't include builder login and date.

For now, we include kernel revision as a way of allowing users to
notice that boot blocks have gotten very old, so the first line of the
printout looks like this (depending on the particular block):

>> NetBSD/x86 BIOS Boot, Revision 3.4 (from NetBSD 5.0)

This may be changed a bit pending feedback. (Some people think that
the kernel revision shouldn't be there at all, for example.)

Part of the project to assure that bit-identical sources produce
bit-identical release binaries.
 1.13 11-May-2008  chris branches: 1.13.2; 1.13.4;
Add support to pxeboot to allow the loading of modules. Changes to main.c
are taken from boot/boot2.c.

This allows an install to be started by running:
load tftp:miniroot.kmod
boot tftp:netbsd-GENERIC

Note that the change to dev_net.c to comment out the network shutdown,
suggests we need to hook the network shutdown in the the common exec code.
If the network is shutdown, it fails to reinitialise and so fails to load
the module.
 1.12 12-Feb-2008  joerg branches: 1.12.6; 1.12.8; 1.12.10; 1.12.12;
Garbage collect the remaining parts of COMPAT_OLDBOOT. The boot loader
support has been removed at least 4 years ago and NetBSD 1.3 is ancient.
 1.11 13-Nov-2005  dsl branches: 1.11.52; 1.11.58;
Pull the boot timeout for the boot_params header.
Allows it to be set to a very large number so the boot on Soekris systems
can be interrupted.
 1.10 11-Nov-2005  dsl Take the console (etc) parameters from the patchable header, instead of
hard-coded constants.
Now the updated installboot can be used to modify the console and baud rate.
 1.9 21-Aug-2005  chs add "consdev" from ../boot.
make "quit" work like it does in ../boot
(ie. let us try again with a bootloader from a different device).
 1.8 22-Jun-2005  dyoung branches: 1.8.2;
De-__P().

Consistently pass 'int *' arguments to parsebootfile.
 1.7 23-Jun-2003  martin branches: 1.7.2; 1.7.16;
Backout previous, this file is not affected by kernel options.
 1.6 23-Jun-2003  martin Make sure to include opt_foo.h if a defflag option FOO is used.
 1.5 11-Mar-2003  drochner kick out RARP/bootparam - PXE uses BOOTP anyway
 1.4 20-Feb-2002  thorpej branches: 1.4.2; 1.4.4; 1.4.16;
* Rename the pxeboot binary from "pxeboot" to "pxeboot_ia32", since
there are other architectures (e.g. IA64) which also use PXE.
* Get the console right in pxeboot, from Andreas Gustafsson.
* Add a "com0" version of pxeboot, to address the same issue that
biosboot_com0 addresses.
 1.3 17-Feb-2002  thorpej Pay attention to the file name provided by the DHCP server, using
it rather than the default of "netbsd" if it's in the reply.
 1.2 16-Feb-2002  thorpej * Remove a debug-breakpoint that is no longer needed.
* Move the pxe_init() call to when we open the virtual netif.
* Make sure to call pxe_fini() when we close the virtual netif.
 1.1 16-Feb-2002  thorpej Add a PXE boot loader. PXE interface code is derived by code
written by Alfred Perlstein, Paul Saab, John Baldwin for FreeBSD.

Still needs some work, but this will load a kernel on a Soekris net4501.

Many thanks to Frank van der Linden and his simulator wizardry for
helping me debug the low-level startup code.
 1.4.16.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.16.1 20-Feb-2002  jdolecek file main.c was added on branch kqueue on 2002-06-23 17:37:35 +0000
 1.4.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.4.4.1 20-Feb-2002  nathanw file main.c was added on branch nathanw_sa on 2002-02-28 04:10:30 +0000
 1.4.2.2 20-Feb-2002  thorpej * Rename the pxeboot binary from "pxeboot" to "pxeboot_ia32", since
there are other architectures (e.g. IA64) which also use PXE.
* Get the console right in pxeboot, from Andreas Gustafsson.
* Add a "com0" version of pxeboot, to address the same issue that
biosboot_com0 addresses.
 1.4.2.1 20-Feb-2002  thorpej file main.c was added on branch sommerfeld_i386mp_1 on 2002-02-20 03:00:28 +0000
 1.7.16.1 15-Sep-2005  tron Pull up following revision(s) (requested by chs in ticket #783):
sys/arch/i386/stand/pxeboot/main.c: revision 1.9
add "consdev" from ../boot.
make "quit" work like it does in ../boot
(ie. let us try again with a bootloader from a different device).
 1.7.2.2 11-Dec-2005  christos Sync with head.
 1.7.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.2 27-Feb-2008  yamt sync with head.
 1.8.2.1 21-Jun-2006  yamt sync with head.
 1.11.58.1 18-Feb-2008  mjf Sync with HEAD.
 1.11.52.1 23-Mar-2008  matt sync with HEAD
 1.12.12.3 10-Oct-2008  skrll Sync with HEAD.
 1.12.12.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.12.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.12.10.5 11-Aug-2010  yamt sync with head.
 1.12.10.4 11-Mar-2010  yamt sync with head
 1.12.10.3 16-Sep-2009  yamt sync with head
 1.12.10.2 04-May-2009  yamt sync with head.
 1.12.10.1 16-May-2008  yamt sync with head.
 1.12.8.1 18-May-2008  yamt sync with head.
 1.12.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.12.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.12.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.13.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.13.4.1 19-Oct-2008  haad Sync with HEAD.
 1.13.2.1 18-Jul-2008  simonb Sync with head.
 1.15.2.3 28-Apr-2009  skrll Sync with HEAD.
 1.15.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.15.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.18.2.5 27-Aug-2011  jym Sync with HEAD. Most notably: uvm/pmap work done by rmind@, and MP Xen
work of cherry@.

No regression observed on suspend/restore.
 1.18.2.4 28-Mar-2011  jym Cure sync hiccups. Code with compile errors is not really useful, heh.
 1.18.2.3 28-Mar-2011  jym Sync with HEAD. TODO before merge:
- shortcut for suspend code in sysmon, when powerd(8) is not running.
Borrow ``xs_watch'' thread context?
- bug hunting in xbd + xennet resume. Rings are currently thrashed upon
resume, so current implementation force flush them on suspend. It's not
really needed.
 1.18.2.2 01-Nov-2009  jym Sync with HEAD.
 1.18.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.24.4.4 31-May-2011  rmind sync with head
 1.24.4.3 21-Apr-2011  rmind sync with head
 1.24.4.2 05-Mar-2011  rmind sync with head
 1.24.4.1 30-May-2010  rmind sync with head
 1.24.2.2 09-Nov-2010  uebayasi Sync with HEAD.
 1.24.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.27.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.29.14.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.29.14.1 23-Jun-2013  tls resync from head
 1.29.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.30.10.1 10-Aug-2014  tls Rebase.
 1.32.10.1 02-Aug-2025  perseant Sync with HEAD
 1.18 20-Oct-2013  christos Revert previous code move to accommodate relocation that does not fit.
Move pxe_command_buf declaration next to the code so
that it fits on the 16 bit relocation. It is in the text segment, but
it does not matter since it is mapped read-write.
 1.17 13-Dec-2009  jakllsch branches: 1.17.12; 1.17.22; 1.17.26;
Shut down the PXE network stack when we are done with it.

This fixes an issue where a CK804 nfe(4) would have a
byte-reversed MAC address after pxeboot(8).
 1.16 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.15 18-Mar-2009  cegger bcopy -> memcpy
 1.14 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.13 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.12 12-Jan-2009  tsutsui branches: 1.12.2;
Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
numbers in seconds returned by the machine dependent getsecs() function
which are used to measure relative time

saseconds_t (currently int):
numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
 1.11 11-Jan-2009  christos merge christos-time_t
 1.10 14-Apr-2006  dyoung branches: 1.10.62; 1.10.64; 1.10.68; 1.10.76;
Remove a call, pxe_call(PXENV_UNLOAD_STACK), that causes Soekris
net45x1 boards to hang at boot---the call never returns. This
fixes PR/25174 for me.
 1.9 26-Dec-2005  perry branches: 1.9.4; 1.9.6; 1.9.8; 1.9.10; 1.9.12;
u_intN_t -> uintN_t
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 14-Jun-2005  tron branches: 1.7.2;
Get rid off the ugly S_SIZE() macro which breaks the build now that
bcmp() is a macro, too.
 1.6 12-Mar-2003  drochner branches: 1.6.2;
Kick out the netif layer from mi libsa and implement an own, smaller, one
(we really don't need to support multiple interfaces)
Also arrange things so that we are able to unload the PXE stacks only
when we are sure that we don't need them anymore. (To make this more
useful, a hook in exec() is needed.
 1.5 11-Mar-2003  drochner Fix bug in readudp(): we have to return the correct length
of the received packet to the caller.
TFTP works now.
 1.4 26-Mar-2002  kanaoka branches: 1.4.2; 1.4.8;
Change scan step from 16 to 2, when pxe_init() check the presence of PXE.
This change improve checking the presence of PXE.
 1.3 18-Feb-2002  thorpej branches: 1.3.4;
Don't ask bootp() to put a "PXEClient" Vendor Class Identifier option
in the DHCP request.
 1.2 16-Feb-2002  thorpej * Remove a debug-breakpoint that is no longer needed.
* Move the pxe_init() call to when we open the virtual netif.
* Make sure to call pxe_fini() when we close the virtual netif.
 1.1 16-Feb-2002  thorpej Add a PXE boot loader. PXE interface code is derived by code
written by Alfred Perlstein, Paul Saab, John Baldwin for FreeBSD.

Still needs some work, but this will load a kernel on a Soekris net4501.

Many thanks to Frank van der Linden and his simulator wizardry for
helping me debug the low-level startup code.
 1.3.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.3.4.1 18-Feb-2002  nathanw file pxe.c was added on branch nathanw_sa on 2002-02-28 04:10:30 +0000
 1.4.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.8.1 26-Mar-2002  jdolecek file pxe.c was added on branch kqueue on 2002-06-23 17:37:36 +0000
 1.4.2.2 26-Mar-2002  kanaoka Change scan step from 16 to 2, when pxe_init() check the presence of PXE.
This change improve checking the presence of PXE.
 1.4.2.1 26-Mar-2002  kanaoka file pxe.c was added on branch sommerfeld_i386mp_1 on 2002-03-26 08:02:06 +0000
 1.6.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.7.2.1 21-Jun-2006  yamt sync with head.
 1.9.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.9.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.9.8.1 24-May-2006  yamt sync with head.
 1.9.6.1 22-Apr-2006  simonb Sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.10.76.2 28-Apr-2009  skrll Sync with HEAD.
 1.10.76.1 19-Jan-2009  skrll Sync with HEAD.
 1.10.68.2 11-Mar-2010  yamt sync with head
 1.10.68.1 04-May-2009  yamt sync with head.
 1.10.64.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.10.62.1 17-Jan-2009  mjf Sync with HEAD.
 1.12.2.3 28-Mar-2011  jym Cure sync hiccups. Code with compile errors is not really useful, heh.
 1.12.2.2 01-Nov-2009  jym Sync with HEAD.
 1.12.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.17.26.1 18-May-2014  rmind sync with head
 1.17.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.17.12.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.9 09-Jul-2025  andvar Fix typos in comments:
s/mulicast/multicast/
s/muticast/multicast/
s/muliplicator/multiplicator/
s/muti-precision/multi-precision/
 1.8 18-Oct-2019  msaitoh branches: 1.8.32;
Fix typos.
 1.7 28-May-2019  msaitoh s/recieve/receive/
 1.6 22-Dec-2010  jakllsch branches: 1.6.60;
It just so happens we don't need -Wno-attributes if we
place __packed in the right place.
 1.5 25-Dec-2007  perry branches: 1.5.24; 1.5.32;
Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
 1.4 11-Dec-2005  christos branches: 1.4.50; 1.4.56; 1.4.60; 1.4.64;
merge ktrace-lwp.
 1.3 14-Jun-2005  tron branches: 1.3.2;
Get rid off the ugly S_SIZE() macro which breaks the build now that
bcmp() is a macro, too.
 1.2 10-Nov-2003  wiz Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.1 16-Feb-2002  thorpej branches: 1.1.2; 1.1.4; 1.1.16; 1.1.22;
Add a PXE boot loader. PXE interface code is derived by code
written by Alfred Perlstein, Paul Saab, John Baldwin for FreeBSD.

Still needs some work, but this will load a kernel on a Soekris net4501.

Many thanks to Frank van der Linden and his simulator wizardry for
helping me debug the low-level startup code.
 1.1.22.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.1.16.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.16.1 16-Feb-2002  jdolecek file pxe.h was added on branch kqueue on 2002-06-23 17:37:36 +0000
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 16-Feb-2002  nathanw file pxe.h was added on branch nathanw_sa on 2002-02-28 04:10:30 +0000
 1.1.2.2 16-Feb-2002  thorpej Add a PXE boot loader. PXE interface code is derived by code
written by Alfred Perlstein, Paul Saab, John Baldwin for FreeBSD.

Still needs some work, but this will load a kernel on a Soekris net4501.

Many thanks to Frank van der Linden and his simulator wizardry for
helping me debug the low-level startup code.
 1.1.2.1 16-Feb-2002  thorpej file pxe.h was added on branch sommerfeld_i386mp_1 on 2002-02-16 03:37:41 +0000
 1.3.2.1 21-Jan-2008  yamt sync with head
 1.4.64.1 02-Jan-2008  bouyer Sync with HEAD
 1.4.60.1 26-Dec-2007  ad Sync with head.
 1.4.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.4.50.1 09-Jan-2008  matt sync with HEAD
 1.5.32.1 05-Mar-2011  rmind sync with head
 1.5.24.1 10-Jan-2011  jym Sync with HEAD
 1.6.60.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.6.60.1 10-Jun-2019  christos Sync with HEAD
 1.8.32.1 02-Aug-2025  perseant Sync with HEAD
 1.5 20-Oct-2013  christos Revert previous code move to accommodate relocation that does not fit.
Move pxe_command_buf declaration next to the code so
that it fits on the 16 bit relocation. It is in the text segment, but
it does not matter since it is mapped read-write.
 1.4 20-Oct-2013  christos Move an instruction above .code16 so that it produces an R_386_32 instead
of an R_386_16 relocation, which is truncated to fit. XXX: untested.
 1.3 01-Feb-2003  dsl branches: 1.3.142; 1.3.152; 1.3.158;
Change all .S files to use .code16 and .code32
Support 32bit addresses >64k as valid on bios calls.
Move stack for dosboot and biosboot to >64 so stack doesn't hit data.
Use disk sector number passed by mbr code to select default partition
(the mbr code doesn't do this yet).
NB only biosboot and dosboot have been tested so far.
(changes approved by christos and fvdl)
 1.2 27-Mar-2002  kanaoka branches: 1.2.2; 1.2.8;
Add (missing)pushl/popl for %edi in ENTRY(pxecall_pxenv).
 1.1 16-Feb-2002  thorpej branches: 1.1.4;
Add a PXE boot loader. PXE interface code is derived by code
written by Alfred Perlstein, Paul Saab, John Baldwin for FreeBSD.

Still needs some work, but this will load a kernel on a Soekris net4501.

Many thanks to Frank van der Linden and his simulator wizardry for
helping me debug the low-level startup code.
 1.1.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 16-Feb-2002  nathanw file pxe_call.S was added on branch nathanw_sa on 2002-02-28 04:10:30 +0000
 1.2.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.8.1 27-Mar-2002  jdolecek file pxe_call.S was added on branch kqueue on 2002-06-23 17:37:36 +0000
 1.2.2.2 27-Mar-2002  kanaoka Add (missing)pushl/popl for %edi in ENTRY(pxecall_pxenv).
 1.2.2.1 27-Mar-2002  kanaoka file pxe_call.S was added on branch sommerfeld_i386mp_1 on 2002-03-27 17:24:23 +0000
 1.3.158.1 18-May-2014  rmind sync with head
 1.3.152.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.142.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2 13-Dec-2009  jakllsch Shut down the PXE network stack when we are done with it.

This fixes an issue where a CK804 nfe(4) would have a
byte-reversed MAC address after pxeboot(8).
 1.1 12-Mar-2003  drochner branches: 1.1.108; 1.1.122;
Kick out the netif layer from mi libsa and implement an own, smaller, one
(we really don't need to support multiple interfaces)
Also arrange things so that we are able to unload the PXE stacks only
when we are sure that we don't need them anymore. (To make this more
useful, a hook in exec() is needed.
 1.1.122.1 24-Oct-2010  jym Sync with HEAD
 1.1.108.1 11-Mar-2010  yamt sync with head
 1.1 16-Feb-2002  thorpej branches: 1.1.2; 1.1.4; 1.1.16;
Add a PXE boot loader. PXE interface code is derived by code
written by Alfred Perlstein, Paul Saab, John Baldwin for FreeBSD.

Still needs some work, but this will load a kernel on a Soekris net4501.

Many thanks to Frank van der Linden and his simulator wizardry for
helping me debug the low-level startup code.
 1.1.16.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.16.1 16-Feb-2002  jdolecek file pxeboot.h was added on branch kqueue on 2002-06-23 17:37:36 +0000
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 16-Feb-2002  nathanw file pxeboot.h was added on branch nathanw_sa on 2002-02-28 04:10:30 +0000
 1.1.2.2 16-Feb-2002  thorpej Add a PXE boot loader. PXE interface code is derived by code
written by Alfred Perlstein, Paul Saab, John Baldwin for FreeBSD.

Still needs some work, but this will load a kernel on a Soekris net4501.

Many thanks to Frank van der Linden and his simulator wizardry for
helping me debug the low-level startup code.
 1.1.2.1 16-Feb-2002  thorpej file pxeboot.h was added on branch sommerfeld_i386mp_1 on 2002-02-16 03:37:41 +0000
 1.7 27-Sep-2019  gson Incrase pxeboot code size limit from 64k to 128k. Fixes PR kern/54560.
The start_pxe.S part was suggested by mlelstv.
 1.6 18-Mar-2011  jakllsch branches: 1.6.48; 1.6.56; 1.6.60;
Automatically adjust pxeboot(8) stack based on the end of .bss, like is already
done in biosboot.S for boot(8).
(The heap location will need to be adjusted if pxeboot expands much more.)
 1.5 20-Dec-2010  jakllsch branches: 1.5.2;
MI libsa provides panic() and exit() functions, no need to provide our own.
As MI libsa exit() calls panic() with a "exit" message, don't use it if we
print our own farewell or have already panic()ed.
 1.4 11-Nov-2005  dsl branches: 1.4.94; 1.4.102;
Take the console (etc) parameters from the patchable header, instead of
hard-coded constants.
Now the updated installboot can be used to modify the console and baud rate.
 1.3 19-Aug-2004  junyoung branches: 1.3.12;
Rename bootparams to boot_params for consistency.
 1.2 09-Oct-2003  dsl branches: 1.2.4;
Use real_to_prot (etc) from stand/lib.
Add a patchable header for boot parameters (eg console type).
 1.1 09-Oct-2003  dsl Move start_pxe.S to a more sensible place
 1.2.4.6 11-Dec-2005  christos Sync with head.
 1.2.4.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.4.4 18-Sep-2004  skrll Sync with HEAD.
 1.2.4.3 25-Aug-2004  skrll Sync with HEAD.
 1.2.4.2 03-Aug-2004  skrll Sync with HEAD
 1.2.4.1 09-Oct-2003  skrll file start_pxe.S was added on branch ktrace-lwp on 2004-08-03 10:36:25 +0000
 1.3.12.1 21-Jun-2006  yamt sync with head.
 1.4.102.2 21-Apr-2011  rmind sync with head
 1.4.102.1 05-Mar-2011  rmind sync with head
 1.4.94.2 28-Mar-2011  jym Sync with HEAD. TODO before merge:
- shortcut for suspend code in sysmon, when powerd(8) is not running.
Borrow ``xs_watch'' thread context?
- bug hunting in xbd + xennet resume. Rings are currently thrashed upon
resume, so current implementation force flush them on suspend. It's not
really needed.
 1.4.94.1 10-Jan-2011  jym Sync with HEAD
 1.5.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.6.60.1 03-Oct-2019  martin Pull up following revision(s) (requested by manu in ticket #277):

sys/arch/i386/stand/pxeboot/start_pxe.S: revision 1.7
sys/arch/i386/stand/pxeboot/Makefile: revision 1.28

Incrase pxeboot code size limit from 64k to 128k. Fixes PR kern/54560.
The start_pxe.S part was suggested by mlelstv.
 1.6.56.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.6.48.1 04-Oct-2019  martin Pull up following revision(s) (requested by manu in ticket #1400):

sys/arch/i386/stand/pxeboot/start_pxe.S: revision 1.7
sys/arch/i386/stand/pxeboot/Makefile: revision 1.28

Incrase pxeboot code size limit from 64k to 128k. Fixes PR kern/54560.
The start_pxe.S part was suggested by mlelstv.
 1.5 21-Sep-2024  rin i386/stand: Document NFSv3 support to {efi,pxe}boot/version
 1.4 20-Sep-2024  mrg x86/boot: fill in a bunch of missed changes and bump some versions.

missed features included:
- support for partition labels
- recursive labels inside RAID partitions
- booting a directory with kernel and modules
- multiBoot 2
- "root" command that changes default root
- "vesa" command to control graphical modes
- bi-endian support in disklabel, RAID and UFS
- fixes for buggy ACPI implementations
- fix PXE device path type
- fixes for buggy ACPI implementations
- serial console support with raw I/O accessors
- ASCII art

XXX: perhaps we could pullup some of these as minor version to release
branches but it seems extreme for a largely cosmetic issue. the
version across releases has a different build ID, so you can
already tell the difference between versions that changed.
 1.3 15-Jul-2008  perry branches: 1.3.118;
Update the version numbers following commit, and make them all identical.
 1.2 01-Feb-2003  dsl branches: 1.2.104; 1.2.108; 1.2.110; 1.2.112; 1.2.114;
Change all .S files to use .code16 and .code32
Support 32bit addresses >64k as valid on bios calls.
Move stack for dosboot and biosboot to >64 so stack doesn't hit data.
Use disk sector number passed by mbr code to select default partition
(the mbr code doesn't do this yet).
NB only biosboot and dosboot have been tested so far.
(changes approved by christos and fvdl)
 1.1 16-Feb-2002  thorpej branches: 1.1.2; 1.1.4; 1.1.16;
Add a PXE boot loader. PXE interface code is derived by code
written by Alfred Perlstein, Paul Saab, John Baldwin for FreeBSD.

Still needs some work, but this will load a kernel on a Soekris net4501.

Many thanks to Frank van der Linden and his simulator wizardry for
helping me debug the low-level startup code.
 1.1.16.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.16.1 16-Feb-2002  jdolecek file version was added on branch kqueue on 2002-06-23 17:37:36 +0000
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 16-Feb-2002  nathanw file version was added on branch nathanw_sa on 2002-02-28 04:10:30 +0000
 1.1.2.2 16-Feb-2002  thorpej Add a PXE boot loader. PXE interface code is derived by code
written by Alfred Perlstein, Paul Saab, John Baldwin for FreeBSD.

Still needs some work, but this will load a kernel on a Soekris net4501.

Many thanks to Frank van der Linden and his simulator wizardry for
helping me debug the low-level startup code.
 1.1.2.1 16-Feb-2002  thorpej file version was added on branch sommerfeld_i386mp_1 on 2002-02-16 03:37:41 +0000
 1.2.114.1 19-Oct-2008  haad Sync with HEAD.
 1.2.112.1 18-Jul-2008  simonb Sync with head.
 1.2.110.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.2.108.1 04-May-2009  yamt sync with head.
 1.2.104.1 28-Sep-2008  mjf Sync with HEAD.
 1.3.118.1 02-Aug-2025  perseant Sync with HEAD

RSS XML Feed