Home | History | Annotate | Download | only in dosboot
History log of /src/sys/arch/i386/stand/dosboot/Makefile
RevisionDateAuthorComments
 1.39  11-Sep-2024  andvar dosboot(8): remove XMS-specific code. The boot process has been broken for over
a decade, and its relevance has diminished due to the availability of other boot
options.

PR port-i386/58624
 1.38  29-Jun-2024  rin i386: stand: Adjust for DOS-routine migration
 1.37  29-Jun-2024  rin i386: stand: Switch to libsa/getopt, NFCI
 1.36  06-Nov-2023  rin x86/dosboot: Drop no-longer-available -DSLOW for libz

It should be lost during merge from upstream.

We may introduce a similar hack again, if it is *really* required;
inflate_fast() may be dropped by using slow path unconditionally.
 1.35  06-Nov-2023  rin x86/dosboot: Do not page-align data segment

4K alignment is too heavy burden for COM executable with 64K limit :)

Fix binary size overflow for clang/amd64.
 1.34  06-Nov-2023  rin x86/dosboot: Allow NULL dereference to fetch command line arguments

DOS command line arguments are provided as struct psp at 0x0000;
see doscommain.c.

Recent versions of gcc and clang are clever enough to optimize code
block involving NULL dereference into ud2 insn.

Sprinkle -fno-delete-null-pointer-checks to doscommain.c to
prevent this behavior.

Note that dosboot.com for netbsd-9 and later was broken due to
this ``over optimization''. gcc 5.5.0 and clang 4.0.0 in netbsd-8
generate correct codes without this workaround.

XXX
Are there still use cases for dosboot.com? Does anyone want to
boot NetBSD from real-mode DOS in 2023?
 1.33  23-Sep-2019  christos branches: 1.33.26;
Consistently use ${RELEASEDIR}/${RELEASEMACHINE} instead of
${RELEASEDIR}/${MACHINE} (Paul Ripke)
 1.32  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.31  02-Jun-2018  christos branches: 1.31.2; 1.31.6;
- Disable MKSANITIZER
- Redo using NOPIE
- Add NORELRO
 1.30  23-Jan-2016  christos branches: 1.30.10; 1.30.16;
We'll define the kernel types for standalone code.
 1.29  23-Jan-2016  christos Define _KERNTYPES for things that need it.
 1.28  15-Jan-2014  joerg branches: 1.28.6;
Reduce amount of -no-integrated-as on x86 as .code16 is now supported by
LLVM.
 1.27  25-Dec-2011  tsutsui branches: 1.27.6; 1.27.10;
Apply the following patch submitted by Evgeniy Ivanov:
http://mail-index.NetBSD.org/tech-kern/2011/12/15/msg012226.html
http://mail-index.NetBSD.org/tech-kern/2011/12/17/msg012229.html

- add 'ls' op to struct fs_ops to support ls command on each fs,
enabled by -DLIBSA_ENABLE_LS_OP and SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes"
in libsa
- split sys/lib/libsa/ufs_ls.c into UFS specific part and MI part (ls.c)
that opens the target fs and calls fs-depedent XXX_ls() functions
- add a ls op for ext2fs
(all other fs than ufs and ext2fs don't have actual ls ops yet)
- replace existing MD ufs_ls() calls with this new MI ls()

The original patch was written for i386 and ext2fs.
zaurus zboot has been tested by nonaka@.
ews4800mips and x68k loaders have been tested by me (with several fixes).
landisk might be okay since it was almost copied from i386.

XXX1: "ls" op in fs_ops looks a bit inconsistent, but we will be able to
replace it with real fs ops like readdir if it's really worth
XXX2: someone might have to check sys/arch/ia64/stand/efi/libefi/efifs_ls.c
 1.26  20-May-2011  joerg branches: 1.26.4; 1.26.8;
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.25  30-Mar-2009  tsutsui branches: 1.25.4; 1.25.6;
Remove extra trailing slash in ${S} path.
 1.24  20-Oct-2008  christos branches: 1.24.2; 1.24.8;
disable PIE for boot code.
 1.23  01-Apr-2003  mycroft branches: 1.23.104; 1.23.108; 1.23.114;
Add -DSLOW to reduce the size of libz a bit.
 1.22  01-Feb-2003  dsl 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.21  03-Jan-2003  lukem Install release files under "${RELEASEDIR}/${MACHINE}/..." instead of
"${RELEASEDIR}/...".

${RELEASEDIR} is never cleaned , and ${RELEASEDIR}/${MACHINE} is only
cleaned if UPDATE is not defined.
 1.20  17-Feb-2002  thorpej branches: 1.20.2;
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.19  12-Dec-2001  tv MKfoo=no -> NOfoo
 1.18  01-Jun-2001  jdolecek branches: 1.18.4;
g/c COMPAT_OLDBOOT from bootblocks, sprinkle some const
bump bootblock version to 2.10
 1.17  15-Oct-2000  wiz branches: 1.17.4;
Get RELEASEDIR setting from /etc/mk.conf. Fixes misc/11104 by Markus Kurek.
 1.16  05-Sep-2000  enami Fix to work with objdir.
 1.15  23-Aug-2000  jhawk install dosboot.com in the release(7) hierarchy.
 1.14  06-Jul-2000  jhawk Enable "old partition ID" compatibility by default, just as in biosboot.
 1.13  14-Apr-1999  drochner branches: 1.13.2; 1.13.14;
add prototypes, use ufs_ls() from mi libsa,
compile with -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-main
 1.12  08-Apr-1999  drochner define VERSIONFILE, from John Darrow <John.P.Darrow@wheaton.edu>
per PR port-i386/7336
 1.11  13-Feb-1999  lukem branches: 1.11.2; 1.11.4;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.10  30-Jan-1999  christos Add exec.c here and bump version for elf.
XXX: This code has not been tested!
 1.9  28-Sep-1997  drochner Use the "proginstall" rule from <bsd.prog.mk> to get the UPDATE
behaviour right.
 1.8  14-Aug-1997  drochner Make new memory detection default.
Introduce a new option, "CONSERVATIVE_MEMDETECT", which disables the
new BIOS calls.
 1.7  14-Aug-1997  drochner Prepare definition for EXTENDED_MEMDETECT.
Not yet default.
 1.6  26-Jul-1997  thorpej branches: 1.6.2;
New welcome banner code, modeled after NetBSD/hp300's boot program
welcome banner code. Includes additional build information, and it
generally nicer to look at.
 1.5  13-Jun-1997  drochner Allow to boot from DOS if a XMS manager is installed.
XMS is recognized and used as temporary buffer for the kernel image.
The processor must still be in real mode at program start, so EMM386
or QEMM are not allowed. W*95 is OK.
Written by Martin Husemann (pr port-i386/3336).
Completely separated from other bootloaders for sanity.
 1.4  13-Jun-1997  drochner Remove some relicts from the time before libsa/Makefile got
"SAMISCCPPFLAGS".
Enable -Wall.
 1.3  07-May-1997  mycroft Override the proginstall target to do our special hackery. (Yuck.)
 1.2  14-Mar-1997  thorpej Make this work with obj* dirs.
 1.1  14-Mar-1997  perry branches: 1.1.1;
Initial revision
 1.1.1.1  14-Mar-1997  perry Initial import of new boot code, created by Matthias Drochner with a
little hacking by me. This isn't strictly identical to his 920312
release -- I've hacked it a bit -- but since we are taking over change
control it doesn't matter much.
 1.6.2.2  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.2.1  23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.11.4.1  21-Jun-1999  thorpej Sync w/ -current.
 1.11.2.1  06-Jul-2000  he Pull up revision 1.14 (requested by jhawk):
Enable "old partition ID" compatibility by default, just as in
biosboot.
 1.13.14.4  19-Oct-2000  he Pull up revision 1.17 (requested by wiz):
Get RELEASEDIR setting from /etc/mk.conf. Fixes PR#11104.
 1.13.14.3  06-Sep-2000  enami Pull up rev. 1.16 (approved by jhawk):
date: 2000/09/05 05:05:16; author: enami; state: Exp; lines: +2 -2
Fix to work with objdir.
 1.13.14.2  04-Sep-2000  jhawk Pullup etc/etc.i386/Makefile.inc rev 1.23, arch/i386/stand/dosboot/Makefile
rev 1.15, approved by thorpej:
install dosboot.com in the release(7) hierarchy.
 1.13.14.1  06-Jul-2000  jhawk Pullup revv 1.14, approved by thorpej:

Enable "old partition ID" compatibility by default, just as in biosboot.
 1.13.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.17.4.4  07-Jan-2003  thorpej Sync with HEAD.
 1.17.4.3  28-Feb-2002  nathanw Catch up to -current.
 1.17.4.2  08-Jan-2002  nathanw Catch up to -current.
 1.17.4.1  21-Jun-2001  nathanw Catch up to -current.
 1.18.4.2  16-Mar-2002  jdolecek Catch up with -current.
 1.18.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.20.2.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.20.2.1  17-Feb-2002  thorpej file Makefile was added on branch sommerfeld_i386mp_1 on 2002-02-17 20:03:10 +0000
 1.23.114.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.23.108.1  04-May-2009  yamt sync with head.
 1.23.104.1  17-Jan-2009  mjf Sync with HEAD.
 1.24.8.3  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.24.8.2  01-Nov-2009  jym Sync with HEAD.
 1.24.8.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.24.2.1  28-Apr-2009  skrll Sync with HEAD.
 1.25.6.1  06-Jun-2011  jruoho Sync with HEAD.
 1.25.4.1  31-May-2011  rmind sync with head
 1.26.8.1  18-Feb-2012  mrg merge to -current.
 1.26.4.2  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.26.4.1  17-Apr-2012  yamt sync with head
 1.27.10.1  18-May-2014  rmind sync with head
 1.27.6.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.28.6.1  19-Mar-2016  skrll Sync with HEAD
 1.30.16.1  25-Jun-2018  pgoyette Sync with HEAD
 1.30.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.31.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.31.2.1  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.33.26.1  14-Dec-2023  martin Pull up following revision(s) (requested by rin in ticket #498):

sys/arch/i386/stand/dosboot/Makefile: revision 1.35
sys/arch/i386/stand/Makefile.booters: revision 1.95
sys/arch/i386/stand/bootxx/bootxx_msdos/Makefile: revision 1.5
sys/arch/i386/stand/Makefile.inc: revision 1.19
sys/arch/i386/stand/bootxx/bootxx_ustarfs/Makefile: revision 1.4
sys/arch/i386/stand/dosboot/Makefile: revision 1.34

Fix the clang build by setting -z noseparate-code

Merge the OPT_SIZE flags. -Oz is not always producing smaller code that -Os,
so default to -Os for both, and we'll override where needed.

Override these two booters with -Oz for clang since it produces smaller code
here.

x86/dosboot: Allow NULL dereference to fetch command line arguments
DOS command line arguments are provided as struct psp at 0x0000;
see doscommain.c.

Recent versions of gcc and clang are clever enough to optimize code
block involving NULL dereference into ud2 insn.

Sprinkle -fno-delete-null-pointer-checks to doscommain.c to
prevent this behavior.

Note that dosboot.com for netbsd-9 and later was broken due to
this ``over optimization''. gcc 5.5.0 and clang 4.0.0 in netbsd-8
generate correct codes without this workaround.

XXX
Are there still use cases for dosboot.com? Does anyone want to
boot NetBSD from real-mode DOS in 2023?

x86/dosboot: Do not page-align data segment
4K alignment is too heavy burden for COM executable with 64K limit :)
Fix binary size overflow for clang/amd64.

RSS XML Feed