History log of /netbsd-current/sys/arch/i386/stand/Makefile.booters
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: perseant-exfatfs-base
# 1.101 29-Jun-2024 rin

i386: stand: Tiny clean up for `start_pxeboot.o`, NFC


# 1.100 29-Jun-2024 rin

i386: stand: Adjust for DOS-routine migration


# 1.99 29-Jun-2024 rin

i386: stand: Drop `*.rom` support; only used for netboot


# 1.98 29-Jun-2024 rin

i386: stand: Retire its own nfs.c, and switch to libsa/nfs.c. NFC


# 1.97 29-Jun-2024 rin

i386: stand: G/C `genprom`; used only by netboot


Revision tags: thorpej-ifq-base thorpej-altq-separation-base
# 1.96 03-Jun-2023 lukem

bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBER

Provide a single variable
CC_WNO_ADDRESS_OF_PACKED_MEMBER
with options for both clang and gcc, to replace
CLANG_NO_ADDR_OF_PACKED_MEMBER
CC_NO_ADDR_OF_PACKED_MEMBER
GCC_NO_ADDR_OF_PACKED_MEMBER

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.


# 1.95 18-Jan-2023 christos

Fix the clang build by setting -z noseparate-code


Revision tags: netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.94 06-Sep-2020 mrg

branches: 1.94.20;
add support for new GCC 9 warnings that may be too much to fix
right now. new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree. mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it. (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.) clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.


Revision tags: netbsd-9-4-RELEASE netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728
# 1.93 25-Jul-2018 kamil

Specify NOLIBCSANITIZER in x86 bootloader-like code under sys/arch/

Set NOLIBCSANITIZER for i386 and amd64 specific bootloader-like code.


Revision tags: phil-wifi-base pgoyette-compat-0625
# 1.92 02-Jun-2018 christos

branches: 1.92.2;
- Disable MKSANITIZER
- Redo using NOPIE
- Add NORELRO


Revision tags: netbsd-8-3-RELEASE netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base
# 1.91 08-Apr-2017 christos

branches: 1.91.12;
centralize vers.c building for standalone programs.


Revision tags: pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.90 08-Mar-2015 martin

branches: 1.90.2; 1.90.4;
Compile the bootblocks for i386 CPUs, even when the main target architecture
is amd64.
Fixes PR port-i386/49725.


Revision tags: nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.89 12-Jan-2014 tsutsui

branches: 1.89.4; 1.89.6;
Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.


# 1.88 21-Aug-2013 matt

Set KLINK_MACHINE


# 1.87 21-Aug-2013 matt

Use <bsd.klinks.mk>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.86 10-Aug-2012 joerg

branches: 1.86.2; 1.86.4;
Don't depend on HAVE_GCC being always present.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-nbase jym-xensuspend-base
# 1.85 20-Jun-2011 mrg

branches: 1.85.2;
remove all the code that supported HAVE_GCC=3. mostly from chuq.


# 1.84 16-Jun-2011 joerg

Refactor compiler-specific optimizer flags. Mark bootxx as supported
with clang.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.83 09-Apr-2011 joerg

branches: 1.83.2;
Do not ignore errors from genprom.


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base
# 1.82 22-Jan-2011 joerg

Drop bootprog_maker (formerly enabled by -M) and bootprog_date (formerly
disabled by -D) from the output of newvers_stand.sh. Change -D to the
inverted logic, so that it adds the date to bootprog_rev in ().

Change all platforms accordingly. -D is added if MKREPRO is not yes and
wasn't present before. Platforms that didn't use -D don't depend on
MKREPRO now either.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.81 22-Dec-2010 jakllsch

branches: 1.81.2; 1.81.4;
It just so happens we don't need -Wno-attributes if we
place __packed in the right place.


Revision tags: uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.80 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.79 27-May-2010 dholland

Introduce .WAIT into the cleandir rule for blasting the libsa/libkern/etc.
trees, because it can race with the libsa/libkern/etc. makefiles' own
cleandir rules. I think I've found all of the uses of the offending idiom...
Closes PR 43360.


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.78 30-Mar-2009 tsutsui

branches: 1.78.2; 1.78.4;
Remove extra trailing slash in ${S} path.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.77 08-Jan-2009 jakllsch

branches: 1.77.2;
Use ${VERSIONFILE} instead of ${.ALLSRC} to match Makefile.boot.

This change stops the full path of newvers_stand.sh from showing up in
pxeboot_ia32.bin.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base
# 1.76 29-Aug-2008 gmcgarry

branches: 1.76.2; 1.76.4;
Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC.


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.75 16-Jul-2008 perry

Call newvers_stand.sh with -DM so we don't include the (unused) date
and builder in the data segment.


# 1.74 16-Jul-2008 perry

make vers.c also depend on the script that builds vers.c


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.73 17-Oct-2007 garbled

branches: 1.73.16; 1.73.20; 1.73.22; 1.73.24; 1.73.26;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: yamt-x86pmap-base3 yamt-x86pmap-base2 ppcoea-renovation-base vmlocking-base
# 1.72 27-Sep-2007 ad

Remove -DBOOT_ELF64 to make build on amd64.


# 1.71 27-Sep-2007 ad

- Make i386 bootblocks boot amd64 kernels, and change to say "NetBSD/x86..."
- Don't bother booting a.out kernels any more.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase nick-csl-alignment-base5 wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 yamt-x86pmap-base netbsd-4-0-RC1 nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 wrstuden-fixsa-base thorpej-atomic-base mjf-ufs-trans-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base rpaulo-netinet-merge-pcb-base
# 1.70 12-Jul-2006 yamt

branches: 1.70.14; 1.70.22; 1.70.32; 1.70.34; 1.70.36;
revert the previous because it doesn't work without destdir populated.
pointed by Valeriy E. Ushakov.


# 1.69 12-Jul-2006 yamt

-I${S}/../common/include for libprop.


Revision tags: yamt-pdpolicy-base6
# 1.68 25-Jun-2006 lukem

Convert to using CC instead of LD, as LDFLAGS is for CC not LD.


# 1.67 25-Jun-2006 lukem

whitespace consistency


Revision tags: chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.66 12-Jun-2006 dogcow

branches: 1.66.2;
Add -Wno-attributes for amd64, too.


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.65 13-May-2006 lukem

branches: 1.65.2;
When creating BASE.rom, don't use BASE.bin as a temporary filename,
since the latter is a valid target name.


# 1.64 13-May-2006 lukem

support MAKEVERBOSE


# 1.63 12-May-2006 mrg

- -mcpu=i386 is gone in GCC4
- we need -Wno-attributes (to avoid __packed__ warnings)
- use -Wno-pointer-sign
- remove some redundancy from pxeboot/Makefile


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.62 11-Dec-2005 christos

branches: 1.62.4; 1.62.6; 1.62.8; 1.62.12;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.61 17-Sep-2005 chs

use a .BEGIN target to make the various symlinks,
the previous way had problems with parallel make.


# 1.60 05-May-2005 christos

branches: 1.60.2;
add dependall and realdepend to the targets that we need to call in the
beginning. XXX: The real fix (handle dependencies in .BEGIN) is forthcoming.


# 1.59 01-May-2005 christos

PR/9567: Arne H. Juul: .BEGIN targets should not use dependencies.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.58 06-Sep-2004 thorpej

branches: 1.58.10;
Use CPUFLAGS for codegen options.


# 1.57 21-Jun-2004 jmc

Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022


Revision tags: netbsd-2-0-base
# 1.56 07-Nov-2003 dsl

branches: 1.56.2;
stand/lib/crt/rom is no more, no need for it in .PATH


# 1.55 26-Oct-2003 lukem

Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.


# 1.54 08-Oct-2003 dsl

Need to explicitly create directory behing symlink.
Clean share lib directory.


# 1.53 08-Oct-2003 dsl

Only build the libraries once,


# 1.52 08-Oct-2003 dsl

BSSTART was only used for the (now depracated) old stand/biosboot code.


# 1.51 08-Oct-2003 lukem

Overhaul MBR handling (part 1):

<sys/bootblock.h>:
* Added definitions for the Master Boot Record (MBR) used by
a variety of systems (primarily i386), including the format
of the BIOS Parameter Block (BPB).
This information was cribbed from a variety of sources
including <sys/disklabel_mbr.h> which this is a superset of.

As part of this, some data structure elements and #defines
were renamed to be more "namespace friendly" and consistent
with other bootblocks and MBR documentation.
Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
* Deprecated in favor of <sys/bootblock.h> (the latter is more
"host tool" friendly).

amd64 & i386:
* Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
be consistent with the naming convention of the msdosfs tools.

* Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
and it's confusing to have two functionally equivalent bootblocks,
especially given that "ufs" has multiple meanings (it could be
a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

* Rework pbr.S (the first sector of bootxx_*):
+ Ensure that BPB (bytes 11..89) and the partition table
(bytes 446..509) do not contain code.
+ Add support for booting from FAT partitions if BOOT_FROM_FAT
is defined. (Only set for bootxx_msdos).
+ Remove "dummy" partition 3; if people want to installboot(8)
these to the start of the disk they can use fdisk(8) to
create a real MBR partition table...
+ Compile with TERSE_ERROR so it fits because of the above.
Whilst this is less user friendly, I feel it's important
to have a valid partition table and BPB in the MBR/PBR.

* Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
with other platforms.

* Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
we can boot off FAT partitions.

* Crank version of /usr/mdec/boot to 3.1, and fix some of the other
entries in the version file.

installboot(8) (i386):
* Read the existing MBR of the filesystem and retain the BIOS
Parameter Block (BPB) in bytes 11..89 and the MBR partition
table in bytes 446..509. (Previously installboot(8) would
trash those two sections of the MBR.)

mbrlabel(8):
* Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).


# 1.50 05-May-2003 fvdl

branches: 1.50.2;
Use ${MACHINE} when generating the version string, not plain 'i386'.


# 1.49 04-May-2003 lukem

be consistent with other Makefiles here and invoke "rm -f" separately to ln -s


# 1.48 04-May-2003 lukem

replace "ln -sf .... $@" with "rm -f $@ && ln -s .... $@"
since the latter works correctly ...


# 1.47 03-May-2003 fvdl

Clean up machine include dir handling a tad.


# 1.46 16-Apr-2003 dsl

Remove definition of LIBSA_SUPPORT_UFS2, the source will only build separate
ufsv1 and ufsv2 objects (the merged one was too large for the code that only
supported a single fs type).


# 1.45 02-Apr-2003 fvdl

Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.


# 1.44 11-Mar-2003 drochner

create a symlink so that eg <x86/trap.h> is found


# 1.43 03-Feb-2003 briggs

Revert my last change. While it actually allows a build to finish,
an iso-image created from the resulting release won't boot. I don't
know if this change is the source of that, but one more knowledgable
than I about the x86 booter needs to look at this, and I don't want
the waters muddied any more than necessary.


# 1.42 03-Feb-2003 briggs

Add CPPFLAGS+= -D__daddr_t=int32_t.


# 1.41 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.40 29-Jan-2003 fvdl

Make the ld workaround work on x88_64, and add the temporary ld script
to CLEANFILES.


# 1.39 28-Jan-2003 dsl

Remove the 4k between code and data to increase the stack space.
Support for 64bit disk blocks seems to have exploded the code.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.38 14-Jan-2003 thorpej

Stub out LIBCRT0, LIBCRTBEGIN, LIBCRTEND, and LIBC.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.37 23-Nov-2002 fvdl

Some hacks to make this compile on x86_64.


Revision tags: kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.36 02-Sep-2002 jdolecek

make vers.c depend on ${SOURCES} and remove .PHONY tag for it, so that it
would only be regenerated if any of the input files changed


Revision tags: gehenna-devsw-base sommerfeld_i386mpnext sommerfeld_i386mpbase_1
# 1.35 27-Jun-2002 pooka

branches: 1.35.2;
Assign COPTS instead of adding to it, avoids situation where -mi386
is mixed with -march=something_incompatible

suggested by thorpej


# 1.34 31-May-2002 thorpej

Build with -ffreestanding.


Revision tags: i386mp_plus16_stable netbsd-1-6-base eeh-devprop-base
# 1.33 19-Mar-2002 thorpej

branches: 1.33.6; 1.33.8;
Make sure we override any optimization options specified by the
user; the boot blocks don't work when built with e.g. -mcpu=i486
(probably due to how branches are aligned in that case, causing
segment boundaries to be crossed).


Revision tags: newlock-base ifpoll-base
# 1.32 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.31 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.30 22-Nov-2001 jmc

Don't make the symlinks on clean rules as well as obj rules. Breaks r/o source
trees that haven't gotten to the make obj recursion part of make build
otherwise.


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2
# 1.29 23-Sep-2001 tls

GCC 2.95 generates significantly larger code with -O2 than our old compiler did; this can cause the second-stage bootblock to exceed the number of blocks that fit in the list in the first-stage bootblock. I thought we used to explicitly set -Os in here; anyway, with this change, we do now!


# 1.28 22-Sep-2001 tv

objcopy -> ${OBJCOPY}; remove redundant definitions of OBJCOPY?= (it is
now in bsd.own.mk).


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.27 18-Aug-2001 enami

branches: 1.27.4;
Include bsd.own.mk a bit earlier so that make cleandir works.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.26 12-Jul-2000 jdolecek

branches: 1.26.4; 1.26.6;
switch to MI newvers_stand.sh version info generator


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 sommerfeld_i386mp_houseclean netbsd-1-5-base minoura-xpg4dl-base sommerfeld_i386mpbase_20000422 chs-ubc2-newbase
# 1.25 23-Jan-2000 mycroft

Fix the symlink hack.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.24 08-Jul-1999 drochner

branches: 1.24.2;
fix creation of DOS / ROM images from ELF executables: use "objcopy"


# 1.23 11-May-1999 drochner

make sure the ./machine link is created early enough for specific targets,
fixes PR port-i386/7553 by David Rankin <drankin@bohemians.lexington.ky.us>


# 1.22 28-Apr-1999 christos

Use new loadfile.c


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 kame_141_19991130 netbsd-1-4-PATCH001 kame_14_19990705 kame_14_19990628 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.21 14-Mar-1999 fvdl

branches: 1.21.4;
Hack to make biosboot_ser work.

XXX The makefile structure in src/sys/arch/i386/stand is very bad.


# 1.20 13-Mar-1999 tron

$(OBJS) -> ${OBJS}


# 1.19 12-Mar-1999 sommerfe

Also build serial bootblocks by default, installing into
/usr/mdec/biosboot_ser.sym
Change Makefile.booters to not assume `version' file is in source directory.


# 1.18 07-Feb-1999 tron

Remove "lib" directory only during "make cleandir" so that ".depend"
doesn't get nuked during "make clean".


# 1.17 07-Feb-1999 tron

Remove "lib" directory created during build process while doing
"make clean" or "make cleandir".


# 1.16 30-Jan-1999 christos

Remove exec.o, and make necessary changes for elf.


# 1.15 29-Jan-1999 christos

Both booters need exec.o now.


Revision tags: kenh-if-detach-base chs-ubc-base eeh-paddr_t-base
# 1.14 08-Jul-1998 drochner

add dependency to get the version number right


# 1.13 27-Mar-1998 cgd

add -nostdinc to CPPFLAGS, so that /usr/include won't be used


# 1.12 22-Feb-1998 mycroft

Nuke the override of libkern SRCS from orbit.


# 1.11 22-Jan-1998 drochner

strchr.c disappeared from libkern, use index.c instead
(we can't control the libkern build as we want, but it works...)


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.10 18-Oct-1997 hubertf

Prevent error if machine-symlink isn't already there (rm -> rm -f)


Revision tags: marc-pcmcia-base
# 1.9 28-Sep-1997 drochner

Use the "proginstall" rule from <bsd.prog.mk> to get the UPDATE
behaviour right.


Revision tags: thorpej-signal-base
# 1.8 20-Aug-1997 drochner

Make "genprom" work in objdir.
Minor cleanup to ease bootcode development at non-standard locations.
Closes PR port-i386/4013 by Luke Mewburn.


Revision tags: marc-pcmcia-bp
# 1.7 26-Jul-1997 thorpej

branches: 1.7.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.6 15-Jul-1997 drochner

Use include files from kernel source, not userland. Create a
"machine" link automatically for this.


# 1.5 26-Jun-1997 drochner

Define _STANDALONE for standalone programs.


# 1.4 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.3 13-Jun-1997 drochner

Force inclusion of "diskbuf" into bootsectors.
This allows to build bootsectors containing netboot code
("make netboot.sym" in the netboot directory).


# 1.2 17-Apr-1997 thorpej

STRIP -> STRIPFLAG


# 1.1 14-Mar-1997 perry

branches: 1.1.1;
Initial revision


# 1.96 03-Jun-2023 lukem

bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBER

Provide a single variable
CC_WNO_ADDRESS_OF_PACKED_MEMBER
with options for both clang and gcc, to replace
CLANG_NO_ADDR_OF_PACKED_MEMBER
CC_NO_ADDR_OF_PACKED_MEMBER
GCC_NO_ADDR_OF_PACKED_MEMBER

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.


# 1.95 18-Jan-2023 christos

Fix the clang build by setting -z noseparate-code


Revision tags: netbsd-10-base bouyer-sunxi-drm-base thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.94 06-Sep-2020 mrg

add support for new GCC 9 warnings that may be too much to fix
right now. new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree. mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it. (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.) clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728
# 1.93 25-Jul-2018 kamil

Specify NOLIBCSANITIZER in x86 bootloader-like code under sys/arch/

Set NOLIBCSANITIZER for i386 and amd64 specific bootloader-like code.


Revision tags: phil-wifi-base pgoyette-compat-0625
# 1.92 02-Jun-2018 christos

branches: 1.92.2;
- Disable MKSANITIZER
- Redo using NOPIE
- Add NORELRO


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base
# 1.91 08-Apr-2017 christos

branches: 1.91.12;
centralize vers.c building for standalone programs.


Revision tags: pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.90 08-Mar-2015 martin

branches: 1.90.2; 1.90.4;
Compile the bootblocks for i386 CPUs, even when the main target architecture
is amd64.
Fixes PR port-i386/49725.


Revision tags: nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.89 12-Jan-2014 tsutsui

branches: 1.89.4; 1.89.6;
Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.


# 1.88 21-Aug-2013 matt

Set KLINK_MACHINE


# 1.87 21-Aug-2013 matt

Use <bsd.klinks.mk>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.86 10-Aug-2012 joerg

branches: 1.86.2; 1.86.4;
Don't depend on HAVE_GCC being always present.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-nbase jym-xensuspend-base
# 1.85 20-Jun-2011 mrg

branches: 1.85.2;
remove all the code that supported HAVE_GCC=3. mostly from chuq.


# 1.84 16-Jun-2011 joerg

Refactor compiler-specific optimizer flags. Mark bootxx as supported
with clang.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.83 09-Apr-2011 joerg

branches: 1.83.2;
Do not ignore errors from genprom.


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base
# 1.82 22-Jan-2011 joerg

Drop bootprog_maker (formerly enabled by -M) and bootprog_date (formerly
disabled by -D) from the output of newvers_stand.sh. Change -D to the
inverted logic, so that it adds the date to bootprog_rev in ().

Change all platforms accordingly. -D is added if MKREPRO is not yes and
wasn't present before. Platforms that didn't use -D don't depend on
MKREPRO now either.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.81 22-Dec-2010 jakllsch

branches: 1.81.2; 1.81.4;
It just so happens we don't need -Wno-attributes if we
place __packed in the right place.


Revision tags: uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.80 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.79 27-May-2010 dholland

Introduce .WAIT into the cleandir rule for blasting the libsa/libkern/etc.
trees, because it can race with the libsa/libkern/etc. makefiles' own
cleandir rules. I think I've found all of the uses of the offending idiom...
Closes PR 43360.


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.78 30-Mar-2009 tsutsui

branches: 1.78.2; 1.78.4;
Remove extra trailing slash in ${S} path.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.77 08-Jan-2009 jakllsch

branches: 1.77.2;
Use ${VERSIONFILE} instead of ${.ALLSRC} to match Makefile.boot.

This change stops the full path of newvers_stand.sh from showing up in
pxeboot_ia32.bin.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base
# 1.76 29-Aug-2008 gmcgarry

branches: 1.76.2; 1.76.4;
Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC.


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.75 16-Jul-2008 perry

Call newvers_stand.sh with -DM so we don't include the (unused) date
and builder in the data segment.


# 1.74 16-Jul-2008 perry

make vers.c also depend on the script that builds vers.c


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.73 17-Oct-2007 garbled

branches: 1.73.16; 1.73.20; 1.73.22; 1.73.24; 1.73.26;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: yamt-x86pmap-base3 yamt-x86pmap-base2 ppcoea-renovation-base vmlocking-base
# 1.72 27-Sep-2007 ad

Remove -DBOOT_ELF64 to make build on amd64.


# 1.71 27-Sep-2007 ad

- Make i386 bootblocks boot amd64 kernels, and change to say "NetBSD/x86..."
- Don't bother booting a.out kernels any more.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase nick-csl-alignment-base5 wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 yamt-x86pmap-base netbsd-4-0-RC1 nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 wrstuden-fixsa-base thorpej-atomic-base mjf-ufs-trans-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base rpaulo-netinet-merge-pcb-base
# 1.70 12-Jul-2006 yamt

branches: 1.70.14; 1.70.22; 1.70.32; 1.70.34; 1.70.36;
revert the previous because it doesn't work without destdir populated.
pointed by Valeriy E. Ushakov.


# 1.69 12-Jul-2006 yamt

-I${S}/../common/include for libprop.


Revision tags: yamt-pdpolicy-base6
# 1.68 25-Jun-2006 lukem

Convert to using CC instead of LD, as LDFLAGS is for CC not LD.


# 1.67 25-Jun-2006 lukem

whitespace consistency


Revision tags: chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.66 12-Jun-2006 dogcow

branches: 1.66.2;
Add -Wno-attributes for amd64, too.


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.65 13-May-2006 lukem

branches: 1.65.2;
When creating BASE.rom, don't use BASE.bin as a temporary filename,
since the latter is a valid target name.


# 1.64 13-May-2006 lukem

support MAKEVERBOSE


# 1.63 12-May-2006 mrg

- -mcpu=i386 is gone in GCC4
- we need -Wno-attributes (to avoid __packed__ warnings)
- use -Wno-pointer-sign
- remove some redundancy from pxeboot/Makefile


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.62 11-Dec-2005 christos

branches: 1.62.4; 1.62.6; 1.62.8; 1.62.12;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.61 17-Sep-2005 chs

use a .BEGIN target to make the various symlinks,
the previous way had problems with parallel make.


# 1.60 05-May-2005 christos

branches: 1.60.2;
add dependall and realdepend to the targets that we need to call in the
beginning. XXX: The real fix (handle dependencies in .BEGIN) is forthcoming.


# 1.59 01-May-2005 christos

PR/9567: Arne H. Juul: .BEGIN targets should not use dependencies.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.58 06-Sep-2004 thorpej

branches: 1.58.10;
Use CPUFLAGS for codegen options.


# 1.57 21-Jun-2004 jmc

Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022


Revision tags: netbsd-2-0-base
# 1.56 07-Nov-2003 dsl

branches: 1.56.2;
stand/lib/crt/rom is no more, no need for it in .PATH


# 1.55 26-Oct-2003 lukem

Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.


# 1.54 08-Oct-2003 dsl

Need to explicitly create directory behing symlink.
Clean share lib directory.


# 1.53 08-Oct-2003 dsl

Only build the libraries once,


# 1.52 08-Oct-2003 dsl

BSSTART was only used for the (now depracated) old stand/biosboot code.


# 1.51 08-Oct-2003 lukem

Overhaul MBR handling (part 1):

<sys/bootblock.h>:
* Added definitions for the Master Boot Record (MBR) used by
a variety of systems (primarily i386), including the format
of the BIOS Parameter Block (BPB).
This information was cribbed from a variety of sources
including <sys/disklabel_mbr.h> which this is a superset of.

As part of this, some data structure elements and #defines
were renamed to be more "namespace friendly" and consistent
with other bootblocks and MBR documentation.
Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
* Deprecated in favor of <sys/bootblock.h> (the latter is more
"host tool" friendly).

amd64 & i386:
* Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
be consistent with the naming convention of the msdosfs tools.

* Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
and it's confusing to have two functionally equivalent bootblocks,
especially given that "ufs" has multiple meanings (it could be
a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

* Rework pbr.S (the first sector of bootxx_*):
+ Ensure that BPB (bytes 11..89) and the partition table
(bytes 446..509) do not contain code.
+ Add support for booting from FAT partitions if BOOT_FROM_FAT
is defined. (Only set for bootxx_msdos).
+ Remove "dummy" partition 3; if people want to installboot(8)
these to the start of the disk they can use fdisk(8) to
create a real MBR partition table...
+ Compile with TERSE_ERROR so it fits because of the above.
Whilst this is less user friendly, I feel it's important
to have a valid partition table and BPB in the MBR/PBR.

* Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
with other platforms.

* Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
we can boot off FAT partitions.

* Crank version of /usr/mdec/boot to 3.1, and fix some of the other
entries in the version file.

installboot(8) (i386):
* Read the existing MBR of the filesystem and retain the BIOS
Parameter Block (BPB) in bytes 11..89 and the MBR partition
table in bytes 446..509. (Previously installboot(8) would
trash those two sections of the MBR.)

mbrlabel(8):
* Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).


# 1.50 05-May-2003 fvdl

branches: 1.50.2;
Use ${MACHINE} when generating the version string, not plain 'i386'.


# 1.49 04-May-2003 lukem

be consistent with other Makefiles here and invoke "rm -f" separately to ln -s


# 1.48 04-May-2003 lukem

replace "ln -sf .... $@" with "rm -f $@ && ln -s .... $@"
since the latter works correctly ...


# 1.47 03-May-2003 fvdl

Clean up machine include dir handling a tad.


# 1.46 16-Apr-2003 dsl

Remove definition of LIBSA_SUPPORT_UFS2, the source will only build separate
ufsv1 and ufsv2 objects (the merged one was too large for the code that only
supported a single fs type).


# 1.45 02-Apr-2003 fvdl

Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.


# 1.44 11-Mar-2003 drochner

create a symlink so that eg <x86/trap.h> is found


# 1.43 03-Feb-2003 briggs

Revert my last change. While it actually allows a build to finish,
an iso-image created from the resulting release won't boot. I don't
know if this change is the source of that, but one more knowledgable
than I about the x86 booter needs to look at this, and I don't want
the waters muddied any more than necessary.


# 1.42 03-Feb-2003 briggs

Add CPPFLAGS+= -D__daddr_t=int32_t.


# 1.41 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.40 29-Jan-2003 fvdl

Make the ld workaround work on x88_64, and add the temporary ld script
to CLEANFILES.


# 1.39 28-Jan-2003 dsl

Remove the 4k between code and data to increase the stack space.
Support for 64bit disk blocks seems to have exploded the code.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.38 14-Jan-2003 thorpej

Stub out LIBCRT0, LIBCRTBEGIN, LIBCRTEND, and LIBC.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.37 23-Nov-2002 fvdl

Some hacks to make this compile on x86_64.


Revision tags: kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.36 02-Sep-2002 jdolecek

make vers.c depend on ${SOURCES} and remove .PHONY tag for it, so that it
would only be regenerated if any of the input files changed


Revision tags: gehenna-devsw-base sommerfeld_i386mpnext sommerfeld_i386mpbase_1
# 1.35 27-Jun-2002 pooka

branches: 1.35.2;
Assign COPTS instead of adding to it, avoids situation where -mi386
is mixed with -march=something_incompatible

suggested by thorpej


# 1.34 31-May-2002 thorpej

Build with -ffreestanding.


Revision tags: i386mp_plus16_stable netbsd-1-6-base eeh-devprop-base
# 1.33 19-Mar-2002 thorpej

branches: 1.33.6; 1.33.8;
Make sure we override any optimization options specified by the
user; the boot blocks don't work when built with e.g. -mcpu=i486
(probably due to how branches are aligned in that case, causing
segment boundaries to be crossed).


Revision tags: newlock-base ifpoll-base
# 1.32 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.31 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.30 22-Nov-2001 jmc

Don't make the symlinks on clean rules as well as obj rules. Breaks r/o source
trees that haven't gotten to the make obj recursion part of make build
otherwise.


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2
# 1.29 23-Sep-2001 tls

GCC 2.95 generates significantly larger code with -O2 than our old compiler did; this can cause the second-stage bootblock to exceed the number of blocks that fit in the list in the first-stage bootblock. I thought we used to explicitly set -Os in here; anyway, with this change, we do now!


# 1.28 22-Sep-2001 tv

objcopy -> ${OBJCOPY}; remove redundant definitions of OBJCOPY?= (it is
now in bsd.own.mk).


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.27 18-Aug-2001 enami

branches: 1.27.4;
Include bsd.own.mk a bit earlier so that make cleandir works.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.26 12-Jul-2000 jdolecek

branches: 1.26.4; 1.26.6;
switch to MI newvers_stand.sh version info generator


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 sommerfeld_i386mp_houseclean netbsd-1-5-base minoura-xpg4dl-base sommerfeld_i386mpbase_20000422 chs-ubc2-newbase
# 1.25 23-Jan-2000 mycroft

Fix the symlink hack.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.24 08-Jul-1999 drochner

branches: 1.24.2;
fix creation of DOS / ROM images from ELF executables: use "objcopy"


# 1.23 11-May-1999 drochner

make sure the ./machine link is created early enough for specific targets,
fixes PR port-i386/7553 by David Rankin <drankin@bohemians.lexington.ky.us>


# 1.22 28-Apr-1999 christos

Use new loadfile.c


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 kame_141_19991130 netbsd-1-4-PATCH001 kame_14_19990705 kame_14_19990628 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.21 14-Mar-1999 fvdl

branches: 1.21.4;
Hack to make biosboot_ser work.

XXX The makefile structure in src/sys/arch/i386/stand is very bad.


# 1.20 13-Mar-1999 tron

$(OBJS) -> ${OBJS}


# 1.19 12-Mar-1999 sommerfe

Also build serial bootblocks by default, installing into
/usr/mdec/biosboot_ser.sym
Change Makefile.booters to not assume `version' file is in source directory.


# 1.18 07-Feb-1999 tron

Remove "lib" directory only during "make cleandir" so that ".depend"
doesn't get nuked during "make clean".


# 1.17 07-Feb-1999 tron

Remove "lib" directory created during build process while doing
"make clean" or "make cleandir".


# 1.16 30-Jan-1999 christos

Remove exec.o, and make necessary changes for elf.


# 1.15 29-Jan-1999 christos

Both booters need exec.o now.


Revision tags: kenh-if-detach-base chs-ubc-base eeh-paddr_t-base
# 1.14 08-Jul-1998 drochner

add dependency to get the version number right


# 1.13 27-Mar-1998 cgd

add -nostdinc to CPPFLAGS, so that /usr/include won't be used


# 1.12 22-Feb-1998 mycroft

Nuke the override of libkern SRCS from orbit.


# 1.11 22-Jan-1998 drochner

strchr.c disappeared from libkern, use index.c instead
(we can't control the libkern build as we want, but it works...)


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.10 18-Oct-1997 hubertf

Prevent error if machine-symlink isn't already there (rm -> rm -f)


Revision tags: marc-pcmcia-base
# 1.9 28-Sep-1997 drochner

Use the "proginstall" rule from <bsd.prog.mk> to get the UPDATE
behaviour right.


Revision tags: thorpej-signal-base
# 1.8 20-Aug-1997 drochner

Make "genprom" work in objdir.
Minor cleanup to ease bootcode development at non-standard locations.
Closes PR port-i386/4013 by Luke Mewburn.


Revision tags: marc-pcmcia-bp
# 1.7 26-Jul-1997 thorpej

branches: 1.7.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.6 15-Jul-1997 drochner

Use include files from kernel source, not userland. Create a
"machine" link automatically for this.


# 1.5 26-Jun-1997 drochner

Define _STANDALONE for standalone programs.


# 1.4 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.3 13-Jun-1997 drochner

Force inclusion of "diskbuf" into bootsectors.
This allows to build bootsectors containing netboot code
("make netboot.sym" in the netboot directory).


# 1.2 17-Apr-1997 thorpej

STRIP -> STRIPFLAG


# 1.1 14-Mar-1997 perry

branches: 1.1.1;
Initial revision


# 1.95 18-Jan-2023 christos

Fix the clang build by setting -z noseparate-code


Revision tags: netbsd-10-base bouyer-sunxi-drm-base thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.94 06-Sep-2020 mrg

add support for new GCC 9 warnings that may be too much to fix
right now. new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree. mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it. (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.) clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728
# 1.93 25-Jul-2018 kamil

Specify NOLIBCSANITIZER in x86 bootloader-like code under sys/arch/

Set NOLIBCSANITIZER for i386 and amd64 specific bootloader-like code.


Revision tags: phil-wifi-base pgoyette-compat-0625
# 1.92 02-Jun-2018 christos

branches: 1.92.2;
- Disable MKSANITIZER
- Redo using NOPIE
- Add NORELRO


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base
# 1.91 08-Apr-2017 christos

branches: 1.91.12;
centralize vers.c building for standalone programs.


Revision tags: pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.90 08-Mar-2015 martin

branches: 1.90.2; 1.90.4;
Compile the bootblocks for i386 CPUs, even when the main target architecture
is amd64.
Fixes PR port-i386/49725.


Revision tags: nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.89 12-Jan-2014 tsutsui

branches: 1.89.4; 1.89.6;
Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.


# 1.88 21-Aug-2013 matt

Set KLINK_MACHINE


# 1.87 21-Aug-2013 matt

Use <bsd.klinks.mk>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.86 10-Aug-2012 joerg

branches: 1.86.2; 1.86.4;
Don't depend on HAVE_GCC being always present.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-nbase jym-xensuspend-base
# 1.85 20-Jun-2011 mrg

branches: 1.85.2;
remove all the code that supported HAVE_GCC=3. mostly from chuq.


# 1.84 16-Jun-2011 joerg

Refactor compiler-specific optimizer flags. Mark bootxx as supported
with clang.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.83 09-Apr-2011 joerg

branches: 1.83.2;
Do not ignore errors from genprom.


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base
# 1.82 22-Jan-2011 joerg

Drop bootprog_maker (formerly enabled by -M) and bootprog_date (formerly
disabled by -D) from the output of newvers_stand.sh. Change -D to the
inverted logic, so that it adds the date to bootprog_rev in ().

Change all platforms accordingly. -D is added if MKREPRO is not yes and
wasn't present before. Platforms that didn't use -D don't depend on
MKREPRO now either.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.81 22-Dec-2010 jakllsch

branches: 1.81.2; 1.81.4;
It just so happens we don't need -Wno-attributes if we
place __packed in the right place.


Revision tags: uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.80 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.79 27-May-2010 dholland

Introduce .WAIT into the cleandir rule for blasting the libsa/libkern/etc.
trees, because it can race with the libsa/libkern/etc. makefiles' own
cleandir rules. I think I've found all of the uses of the offending idiom...
Closes PR 43360.


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.78 30-Mar-2009 tsutsui

branches: 1.78.2; 1.78.4;
Remove extra trailing slash in ${S} path.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.77 08-Jan-2009 jakllsch

branches: 1.77.2;
Use ${VERSIONFILE} instead of ${.ALLSRC} to match Makefile.boot.

This change stops the full path of newvers_stand.sh from showing up in
pxeboot_ia32.bin.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base
# 1.76 29-Aug-2008 gmcgarry

branches: 1.76.2; 1.76.4;
Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC.


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.75 16-Jul-2008 perry

Call newvers_stand.sh with -DM so we don't include the (unused) date
and builder in the data segment.


# 1.74 16-Jul-2008 perry

make vers.c also depend on the script that builds vers.c


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.73 17-Oct-2007 garbled

branches: 1.73.16; 1.73.20; 1.73.22; 1.73.24; 1.73.26;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: yamt-x86pmap-base3 yamt-x86pmap-base2 ppcoea-renovation-base vmlocking-base
# 1.72 27-Sep-2007 ad

Remove -DBOOT_ELF64 to make build on amd64.


# 1.71 27-Sep-2007 ad

- Make i386 bootblocks boot amd64 kernels, and change to say "NetBSD/x86..."
- Don't bother booting a.out kernels any more.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase nick-csl-alignment-base5 wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 yamt-x86pmap-base netbsd-4-0-RC1 nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 wrstuden-fixsa-base thorpej-atomic-base mjf-ufs-trans-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base rpaulo-netinet-merge-pcb-base
# 1.70 12-Jul-2006 yamt

branches: 1.70.14; 1.70.22; 1.70.32; 1.70.34; 1.70.36;
revert the previous because it doesn't work without destdir populated.
pointed by Valeriy E. Ushakov.


# 1.69 12-Jul-2006 yamt

-I${S}/../common/include for libprop.


Revision tags: yamt-pdpolicy-base6
# 1.68 25-Jun-2006 lukem

Convert to using CC instead of LD, as LDFLAGS is for CC not LD.


# 1.67 25-Jun-2006 lukem

whitespace consistency


Revision tags: chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.66 12-Jun-2006 dogcow

branches: 1.66.2;
Add -Wno-attributes for amd64, too.


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.65 13-May-2006 lukem

branches: 1.65.2;
When creating BASE.rom, don't use BASE.bin as a temporary filename,
since the latter is a valid target name.


# 1.64 13-May-2006 lukem

support MAKEVERBOSE


# 1.63 12-May-2006 mrg

- -mcpu=i386 is gone in GCC4
- we need -Wno-attributes (to avoid __packed__ warnings)
- use -Wno-pointer-sign
- remove some redundancy from pxeboot/Makefile


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.62 11-Dec-2005 christos

branches: 1.62.4; 1.62.6; 1.62.8; 1.62.12;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.61 17-Sep-2005 chs

use a .BEGIN target to make the various symlinks,
the previous way had problems with parallel make.


# 1.60 05-May-2005 christos

branches: 1.60.2;
add dependall and realdepend to the targets that we need to call in the
beginning. XXX: The real fix (handle dependencies in .BEGIN) is forthcoming.


# 1.59 01-May-2005 christos

PR/9567: Arne H. Juul: .BEGIN targets should not use dependencies.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.58 06-Sep-2004 thorpej

branches: 1.58.10;
Use CPUFLAGS for codegen options.


# 1.57 21-Jun-2004 jmc

Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022


Revision tags: netbsd-2-0-base
# 1.56 07-Nov-2003 dsl

branches: 1.56.2;
stand/lib/crt/rom is no more, no need for it in .PATH


# 1.55 26-Oct-2003 lukem

Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.


# 1.54 08-Oct-2003 dsl

Need to explicitly create directory behing symlink.
Clean share lib directory.


# 1.53 08-Oct-2003 dsl

Only build the libraries once,


# 1.52 08-Oct-2003 dsl

BSSTART was only used for the (now depracated) old stand/biosboot code.


# 1.51 08-Oct-2003 lukem

Overhaul MBR handling (part 1):

<sys/bootblock.h>:
* Added definitions for the Master Boot Record (MBR) used by
a variety of systems (primarily i386), including the format
of the BIOS Parameter Block (BPB).
This information was cribbed from a variety of sources
including <sys/disklabel_mbr.h> which this is a superset of.

As part of this, some data structure elements and #defines
were renamed to be more "namespace friendly" and consistent
with other bootblocks and MBR documentation.
Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
* Deprecated in favor of <sys/bootblock.h> (the latter is more
"host tool" friendly).

amd64 & i386:
* Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
be consistent with the naming convention of the msdosfs tools.

* Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
and it's confusing to have two functionally equivalent bootblocks,
especially given that "ufs" has multiple meanings (it could be
a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

* Rework pbr.S (the first sector of bootxx_*):
+ Ensure that BPB (bytes 11..89) and the partition table
(bytes 446..509) do not contain code.
+ Add support for booting from FAT partitions if BOOT_FROM_FAT
is defined. (Only set for bootxx_msdos).
+ Remove "dummy" partition 3; if people want to installboot(8)
these to the start of the disk they can use fdisk(8) to
create a real MBR partition table...
+ Compile with TERSE_ERROR so it fits because of the above.
Whilst this is less user friendly, I feel it's important
to have a valid partition table and BPB in the MBR/PBR.

* Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
with other platforms.

* Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
we can boot off FAT partitions.

* Crank version of /usr/mdec/boot to 3.1, and fix some of the other
entries in the version file.

installboot(8) (i386):
* Read the existing MBR of the filesystem and retain the BIOS
Parameter Block (BPB) in bytes 11..89 and the MBR partition
table in bytes 446..509. (Previously installboot(8) would
trash those two sections of the MBR.)

mbrlabel(8):
* Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).


# 1.50 05-May-2003 fvdl

branches: 1.50.2;
Use ${MACHINE} when generating the version string, not plain 'i386'.


# 1.49 04-May-2003 lukem

be consistent with other Makefiles here and invoke "rm -f" separately to ln -s


# 1.48 04-May-2003 lukem

replace "ln -sf .... $@" with "rm -f $@ && ln -s .... $@"
since the latter works correctly ...


# 1.47 03-May-2003 fvdl

Clean up machine include dir handling a tad.


# 1.46 16-Apr-2003 dsl

Remove definition of LIBSA_SUPPORT_UFS2, the source will only build separate
ufsv1 and ufsv2 objects (the merged one was too large for the code that only
supported a single fs type).


# 1.45 02-Apr-2003 fvdl

Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.


# 1.44 11-Mar-2003 drochner

create a symlink so that eg <x86/trap.h> is found


# 1.43 03-Feb-2003 briggs

Revert my last change. While it actually allows a build to finish,
an iso-image created from the resulting release won't boot. I don't
know if this change is the source of that, but one more knowledgable
than I about the x86 booter needs to look at this, and I don't want
the waters muddied any more than necessary.


# 1.42 03-Feb-2003 briggs

Add CPPFLAGS+= -D__daddr_t=int32_t.


# 1.41 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.40 29-Jan-2003 fvdl

Make the ld workaround work on x88_64, and add the temporary ld script
to CLEANFILES.


# 1.39 28-Jan-2003 dsl

Remove the 4k between code and data to increase the stack space.
Support for 64bit disk blocks seems to have exploded the code.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.38 14-Jan-2003 thorpej

Stub out LIBCRT0, LIBCRTBEGIN, LIBCRTEND, and LIBC.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.37 23-Nov-2002 fvdl

Some hacks to make this compile on x86_64.


Revision tags: kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.36 02-Sep-2002 jdolecek

make vers.c depend on ${SOURCES} and remove .PHONY tag for it, so that it
would only be regenerated if any of the input files changed


Revision tags: gehenna-devsw-base sommerfeld_i386mpnext sommerfeld_i386mpbase_1
# 1.35 27-Jun-2002 pooka

branches: 1.35.2;
Assign COPTS instead of adding to it, avoids situation where -mi386
is mixed with -march=something_incompatible

suggested by thorpej


# 1.34 31-May-2002 thorpej

Build with -ffreestanding.


Revision tags: i386mp_plus16_stable netbsd-1-6-base eeh-devprop-base
# 1.33 19-Mar-2002 thorpej

branches: 1.33.6; 1.33.8;
Make sure we override any optimization options specified by the
user; the boot blocks don't work when built with e.g. -mcpu=i486
(probably due to how branches are aligned in that case, causing
segment boundaries to be crossed).


Revision tags: newlock-base ifpoll-base
# 1.32 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.31 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.30 22-Nov-2001 jmc

Don't make the symlinks on clean rules as well as obj rules. Breaks r/o source
trees that haven't gotten to the make obj recursion part of make build
otherwise.


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2
# 1.29 23-Sep-2001 tls

GCC 2.95 generates significantly larger code with -O2 than our old compiler did; this can cause the second-stage bootblock to exceed the number of blocks that fit in the list in the first-stage bootblock. I thought we used to explicitly set -Os in here; anyway, with this change, we do now!


# 1.28 22-Sep-2001 tv

objcopy -> ${OBJCOPY}; remove redundant definitions of OBJCOPY?= (it is
now in bsd.own.mk).


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.27 18-Aug-2001 enami

branches: 1.27.4;
Include bsd.own.mk a bit earlier so that make cleandir works.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.26 12-Jul-2000 jdolecek

branches: 1.26.4; 1.26.6;
switch to MI newvers_stand.sh version info generator


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 sommerfeld_i386mp_houseclean netbsd-1-5-base minoura-xpg4dl-base sommerfeld_i386mpbase_20000422 chs-ubc2-newbase
# 1.25 23-Jan-2000 mycroft

Fix the symlink hack.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.24 08-Jul-1999 drochner

branches: 1.24.2;
fix creation of DOS / ROM images from ELF executables: use "objcopy"


# 1.23 11-May-1999 drochner

make sure the ./machine link is created early enough for specific targets,
fixes PR port-i386/7553 by David Rankin <drankin@bohemians.lexington.ky.us>


# 1.22 28-Apr-1999 christos

Use new loadfile.c


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 kame_141_19991130 netbsd-1-4-PATCH001 kame_14_19990705 kame_14_19990628 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.21 14-Mar-1999 fvdl

branches: 1.21.4;
Hack to make biosboot_ser work.

XXX The makefile structure in src/sys/arch/i386/stand is very bad.


# 1.20 13-Mar-1999 tron

$(OBJS) -> ${OBJS}


# 1.19 12-Mar-1999 sommerfe

Also build serial bootblocks by default, installing into
/usr/mdec/biosboot_ser.sym
Change Makefile.booters to not assume `version' file is in source directory.


# 1.18 07-Feb-1999 tron

Remove "lib" directory only during "make cleandir" so that ".depend"
doesn't get nuked during "make clean".


# 1.17 07-Feb-1999 tron

Remove "lib" directory created during build process while doing
"make clean" or "make cleandir".


# 1.16 30-Jan-1999 christos

Remove exec.o, and make necessary changes for elf.


# 1.15 29-Jan-1999 christos

Both booters need exec.o now.


Revision tags: kenh-if-detach-base chs-ubc-base eeh-paddr_t-base
# 1.14 08-Jul-1998 drochner

add dependency to get the version number right


# 1.13 27-Mar-1998 cgd

add -nostdinc to CPPFLAGS, so that /usr/include won't be used


# 1.12 22-Feb-1998 mycroft

Nuke the override of libkern SRCS from orbit.


# 1.11 22-Jan-1998 drochner

strchr.c disappeared from libkern, use index.c instead
(we can't control the libkern build as we want, but it works...)


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.10 18-Oct-1997 hubertf

Prevent error if machine-symlink isn't already there (rm -> rm -f)


Revision tags: marc-pcmcia-base
# 1.9 28-Sep-1997 drochner

Use the "proginstall" rule from <bsd.prog.mk> to get the UPDATE
behaviour right.


Revision tags: thorpej-signal-base
# 1.8 20-Aug-1997 drochner

Make "genprom" work in objdir.
Minor cleanup to ease bootcode development at non-standard locations.
Closes PR port-i386/4013 by Luke Mewburn.


Revision tags: marc-pcmcia-bp
# 1.7 26-Jul-1997 thorpej

branches: 1.7.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.6 15-Jul-1997 drochner

Use include files from kernel source, not userland. Create a
"machine" link automatically for this.


# 1.5 26-Jun-1997 drochner

Define _STANDALONE for standalone programs.


# 1.4 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.3 13-Jun-1997 drochner

Force inclusion of "diskbuf" into bootsectors.
This allows to build bootsectors containing netboot code
("make netboot.sym" in the netboot directory).


# 1.2 17-Apr-1997 thorpej

STRIP -> STRIPFLAG


# 1.1 14-Mar-1997 perry

branches: 1.1.1;
Initial revision


# 1.94 06-Sep-2020 mrg

add support for new GCC 9 warnings that may be too much to fix
right now. new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree. mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it. (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.) clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728
# 1.93 25-Jul-2018 kamil

Specify NOLIBCSANITIZER in x86 bootloader-like code under sys/arch/

Set NOLIBCSANITIZER for i386 and amd64 specific bootloader-like code.


Revision tags: phil-wifi-base pgoyette-compat-0625
# 1.92 02-Jun-2018 christos

branches: 1.92.2;
- Disable MKSANITIZER
- Redo using NOPIE
- Add NORELRO


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base
# 1.91 08-Apr-2017 christos

branches: 1.91.12;
centralize vers.c building for standalone programs.


Revision tags: pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.90 08-Mar-2015 martin

branches: 1.90.2; 1.90.4;
Compile the bootblocks for i386 CPUs, even when the main target architecture
is amd64.
Fixes PR port-i386/49725.


Revision tags: nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.89 12-Jan-2014 tsutsui

branches: 1.89.4; 1.89.6;
Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.


# 1.88 21-Aug-2013 matt

Set KLINK_MACHINE


# 1.87 21-Aug-2013 matt

Use <bsd.klinks.mk>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.86 10-Aug-2012 joerg

branches: 1.86.2; 1.86.4;
Don't depend on HAVE_GCC being always present.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-nbase jym-xensuspend-base
# 1.85 20-Jun-2011 mrg

branches: 1.85.2;
remove all the code that supported HAVE_GCC=3. mostly from chuq.


# 1.84 16-Jun-2011 joerg

Refactor compiler-specific optimizer flags. Mark bootxx as supported
with clang.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.83 09-Apr-2011 joerg

branches: 1.83.2;
Do not ignore errors from genprom.


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base
# 1.82 22-Jan-2011 joerg

Drop bootprog_maker (formerly enabled by -M) and bootprog_date (formerly
disabled by -D) from the output of newvers_stand.sh. Change -D to the
inverted logic, so that it adds the date to bootprog_rev in ().

Change all platforms accordingly. -D is added if MKREPRO is not yes and
wasn't present before. Platforms that didn't use -D don't depend on
MKREPRO now either.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.81 22-Dec-2010 jakllsch

branches: 1.81.2; 1.81.4;
It just so happens we don't need -Wno-attributes if we
place __packed in the right place.


Revision tags: uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.80 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.79 27-May-2010 dholland

Introduce .WAIT into the cleandir rule for blasting the libsa/libkern/etc.
trees, because it can race with the libsa/libkern/etc. makefiles' own
cleandir rules. I think I've found all of the uses of the offending idiom...
Closes PR 43360.


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.78 30-Mar-2009 tsutsui

branches: 1.78.2; 1.78.4;
Remove extra trailing slash in ${S} path.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.77 08-Jan-2009 jakllsch

branches: 1.77.2;
Use ${VERSIONFILE} instead of ${.ALLSRC} to match Makefile.boot.

This change stops the full path of newvers_stand.sh from showing up in
pxeboot_ia32.bin.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base
# 1.76 29-Aug-2008 gmcgarry

branches: 1.76.2; 1.76.4;
Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC.


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.75 16-Jul-2008 perry

Call newvers_stand.sh with -DM so we don't include the (unused) date
and builder in the data segment.


# 1.74 16-Jul-2008 perry

make vers.c also depend on the script that builds vers.c


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.73 17-Oct-2007 garbled

branches: 1.73.16; 1.73.20; 1.73.22; 1.73.24; 1.73.26;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: yamt-x86pmap-base3 yamt-x86pmap-base2 ppcoea-renovation-base vmlocking-base
# 1.72 27-Sep-2007 ad

Remove -DBOOT_ELF64 to make build on amd64.


# 1.71 27-Sep-2007 ad

- Make i386 bootblocks boot amd64 kernels, and change to say "NetBSD/x86..."
- Don't bother booting a.out kernels any more.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase nick-csl-alignment-base5 wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 yamt-x86pmap-base netbsd-4-0-RC1 nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 wrstuden-fixsa-base thorpej-atomic-base mjf-ufs-trans-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base rpaulo-netinet-merge-pcb-base
# 1.70 12-Jul-2006 yamt

branches: 1.70.14; 1.70.22; 1.70.32; 1.70.34; 1.70.36;
revert the previous because it doesn't work without destdir populated.
pointed by Valeriy E. Ushakov.


# 1.69 12-Jul-2006 yamt

-I${S}/../common/include for libprop.


Revision tags: yamt-pdpolicy-base6
# 1.68 25-Jun-2006 lukem

Convert to using CC instead of LD, as LDFLAGS is for CC not LD.


# 1.67 25-Jun-2006 lukem

whitespace consistency


Revision tags: chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.66 12-Jun-2006 dogcow

branches: 1.66.2;
Add -Wno-attributes for amd64, too.


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.65 13-May-2006 lukem

branches: 1.65.2;
When creating BASE.rom, don't use BASE.bin as a temporary filename,
since the latter is a valid target name.


# 1.64 13-May-2006 lukem

support MAKEVERBOSE


# 1.63 12-May-2006 mrg

- -mcpu=i386 is gone in GCC4
- we need -Wno-attributes (to avoid __packed__ warnings)
- use -Wno-pointer-sign
- remove some redundancy from pxeboot/Makefile


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.62 11-Dec-2005 christos

branches: 1.62.4; 1.62.6; 1.62.8; 1.62.12;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.61 17-Sep-2005 chs

use a .BEGIN target to make the various symlinks,
the previous way had problems with parallel make.


# 1.60 05-May-2005 christos

branches: 1.60.2;
add dependall and realdepend to the targets that we need to call in the
beginning. XXX: The real fix (handle dependencies in .BEGIN) is forthcoming.


# 1.59 01-May-2005 christos

PR/9567: Arne H. Juul: .BEGIN targets should not use dependencies.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.58 06-Sep-2004 thorpej

branches: 1.58.10;
Use CPUFLAGS for codegen options.


# 1.57 21-Jun-2004 jmc

Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022


Revision tags: netbsd-2-0-base
# 1.56 07-Nov-2003 dsl

branches: 1.56.2;
stand/lib/crt/rom is no more, no need for it in .PATH


# 1.55 26-Oct-2003 lukem

Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.


# 1.54 08-Oct-2003 dsl

Need to explicitly create directory behing symlink.
Clean share lib directory.


# 1.53 08-Oct-2003 dsl

Only build the libraries once,


# 1.52 08-Oct-2003 dsl

BSSTART was only used for the (now depracated) old stand/biosboot code.


# 1.51 08-Oct-2003 lukem

Overhaul MBR handling (part 1):

<sys/bootblock.h>:
* Added definitions for the Master Boot Record (MBR) used by
a variety of systems (primarily i386), including the format
of the BIOS Parameter Block (BPB).
This information was cribbed from a variety of sources
including <sys/disklabel_mbr.h> which this is a superset of.

As part of this, some data structure elements and #defines
were renamed to be more "namespace friendly" and consistent
with other bootblocks and MBR documentation.
Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
* Deprecated in favor of <sys/bootblock.h> (the latter is more
"host tool" friendly).

amd64 & i386:
* Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
be consistent with the naming convention of the msdosfs tools.

* Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
and it's confusing to have two functionally equivalent bootblocks,
especially given that "ufs" has multiple meanings (it could be
a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

* Rework pbr.S (the first sector of bootxx_*):
+ Ensure that BPB (bytes 11..89) and the partition table
(bytes 446..509) do not contain code.
+ Add support for booting from FAT partitions if BOOT_FROM_FAT
is defined. (Only set for bootxx_msdos).
+ Remove "dummy" partition 3; if people want to installboot(8)
these to the start of the disk they can use fdisk(8) to
create a real MBR partition table...
+ Compile with TERSE_ERROR so it fits because of the above.
Whilst this is less user friendly, I feel it's important
to have a valid partition table and BPB in the MBR/PBR.

* Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
with other platforms.

* Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
we can boot off FAT partitions.

* Crank version of /usr/mdec/boot to 3.1, and fix some of the other
entries in the version file.

installboot(8) (i386):
* Read the existing MBR of the filesystem and retain the BIOS
Parameter Block (BPB) in bytes 11..89 and the MBR partition
table in bytes 446..509. (Previously installboot(8) would
trash those two sections of the MBR.)

mbrlabel(8):
* Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).


# 1.50 05-May-2003 fvdl

branches: 1.50.2;
Use ${MACHINE} when generating the version string, not plain 'i386'.


# 1.49 04-May-2003 lukem

be consistent with other Makefiles here and invoke "rm -f" separately to ln -s


# 1.48 04-May-2003 lukem

replace "ln -sf .... $@" with "rm -f $@ && ln -s .... $@"
since the latter works correctly ...


# 1.47 03-May-2003 fvdl

Clean up machine include dir handling a tad.


# 1.46 16-Apr-2003 dsl

Remove definition of LIBSA_SUPPORT_UFS2, the source will only build separate
ufsv1 and ufsv2 objects (the merged one was too large for the code that only
supported a single fs type).


# 1.45 02-Apr-2003 fvdl

Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.


# 1.44 11-Mar-2003 drochner

create a symlink so that eg <x86/trap.h> is found


# 1.43 03-Feb-2003 briggs

Revert my last change. While it actually allows a build to finish,
an iso-image created from the resulting release won't boot. I don't
know if this change is the source of that, but one more knowledgable
than I about the x86 booter needs to look at this, and I don't want
the waters muddied any more than necessary.


# 1.42 03-Feb-2003 briggs

Add CPPFLAGS+= -D__daddr_t=int32_t.


# 1.41 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.40 29-Jan-2003 fvdl

Make the ld workaround work on x88_64, and add the temporary ld script
to CLEANFILES.


# 1.39 28-Jan-2003 dsl

Remove the 4k between code and data to increase the stack space.
Support for 64bit disk blocks seems to have exploded the code.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.38 14-Jan-2003 thorpej

Stub out LIBCRT0, LIBCRTBEGIN, LIBCRTEND, and LIBC.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.37 23-Nov-2002 fvdl

Some hacks to make this compile on x86_64.


Revision tags: kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.36 02-Sep-2002 jdolecek

make vers.c depend on ${SOURCES} and remove .PHONY tag for it, so that it
would only be regenerated if any of the input files changed


Revision tags: gehenna-devsw-base sommerfeld_i386mpnext sommerfeld_i386mpbase_1
# 1.35 27-Jun-2002 pooka

branches: 1.35.2;
Assign COPTS instead of adding to it, avoids situation where -mi386
is mixed with -march=something_incompatible

suggested by thorpej


# 1.34 31-May-2002 thorpej

Build with -ffreestanding.


Revision tags: i386mp_plus16_stable netbsd-1-6-base eeh-devprop-base
# 1.33 19-Mar-2002 thorpej

branches: 1.33.6; 1.33.8;
Make sure we override any optimization options specified by the
user; the boot blocks don't work when built with e.g. -mcpu=i486
(probably due to how branches are aligned in that case, causing
segment boundaries to be crossed).


Revision tags: newlock-base ifpoll-base
# 1.32 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.31 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.30 22-Nov-2001 jmc

Don't make the symlinks on clean rules as well as obj rules. Breaks r/o source
trees that haven't gotten to the make obj recursion part of make build
otherwise.


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2
# 1.29 23-Sep-2001 tls

GCC 2.95 generates significantly larger code with -O2 than our old compiler did; this can cause the second-stage bootblock to exceed the number of blocks that fit in the list in the first-stage bootblock. I thought we used to explicitly set -Os in here; anyway, with this change, we do now!


# 1.28 22-Sep-2001 tv

objcopy -> ${OBJCOPY}; remove redundant definitions of OBJCOPY?= (it is
now in bsd.own.mk).


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.27 18-Aug-2001 enami

branches: 1.27.4;
Include bsd.own.mk a bit earlier so that make cleandir works.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.26 12-Jul-2000 jdolecek

branches: 1.26.4; 1.26.6;
switch to MI newvers_stand.sh version info generator


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 sommerfeld_i386mp_houseclean netbsd-1-5-base minoura-xpg4dl-base sommerfeld_i386mpbase_20000422 chs-ubc2-newbase
# 1.25 23-Jan-2000 mycroft

Fix the symlink hack.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.24 08-Jul-1999 drochner

branches: 1.24.2;
fix creation of DOS / ROM images from ELF executables: use "objcopy"


# 1.23 11-May-1999 drochner

make sure the ./machine link is created early enough for specific targets,
fixes PR port-i386/7553 by David Rankin <drankin@bohemians.lexington.ky.us>


# 1.22 28-Apr-1999 christos

Use new loadfile.c


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 kame_141_19991130 netbsd-1-4-PATCH001 kame_14_19990705 kame_14_19990628 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.21 14-Mar-1999 fvdl

branches: 1.21.4;
Hack to make biosboot_ser work.

XXX The makefile structure in src/sys/arch/i386/stand is very bad.


# 1.20 13-Mar-1999 tron

$(OBJS) -> ${OBJS}


# 1.19 12-Mar-1999 sommerfe

Also build serial bootblocks by default, installing into
/usr/mdec/biosboot_ser.sym
Change Makefile.booters to not assume `version' file is in source directory.


# 1.18 07-Feb-1999 tron

Remove "lib" directory only during "make cleandir" so that ".depend"
doesn't get nuked during "make clean".


# 1.17 07-Feb-1999 tron

Remove "lib" directory created during build process while doing
"make clean" or "make cleandir".


# 1.16 30-Jan-1999 christos

Remove exec.o, and make necessary changes for elf.


# 1.15 29-Jan-1999 christos

Both booters need exec.o now.


Revision tags: kenh-if-detach-base chs-ubc-base eeh-paddr_t-base
# 1.14 08-Jul-1998 drochner

add dependency to get the version number right


# 1.13 27-Mar-1998 cgd

add -nostdinc to CPPFLAGS, so that /usr/include won't be used


# 1.12 22-Feb-1998 mycroft

Nuke the override of libkern SRCS from orbit.


# 1.11 22-Jan-1998 drochner

strchr.c disappeared from libkern, use index.c instead
(we can't control the libkern build as we want, but it works...)


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.10 18-Oct-1997 hubertf

Prevent error if machine-symlink isn't already there (rm -> rm -f)


Revision tags: marc-pcmcia-base
# 1.9 28-Sep-1997 drochner

Use the "proginstall" rule from <bsd.prog.mk> to get the UPDATE
behaviour right.


Revision tags: thorpej-signal-base
# 1.8 20-Aug-1997 drochner

Make "genprom" work in objdir.
Minor cleanup to ease bootcode development at non-standard locations.
Closes PR port-i386/4013 by Luke Mewburn.


Revision tags: marc-pcmcia-bp
# 1.7 26-Jul-1997 thorpej

branches: 1.7.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.6 15-Jul-1997 drochner

Use include files from kernel source, not userland. Create a
"machine" link automatically for this.


# 1.5 26-Jun-1997 drochner

Define _STANDALONE for standalone programs.


# 1.4 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.3 13-Jun-1997 drochner

Force inclusion of "diskbuf" into bootsectors.
This allows to build bootsectors containing netboot code
("make netboot.sym" in the netboot directory).


# 1.2 17-Apr-1997 thorpej

STRIP -> STRIPFLAG


# 1.1 14-Mar-1997 perry

branches: 1.1.1;
Initial revision


Revision tags: isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728
# 1.93 25-Jul-2018 kamil

Specify NOLIBCSANITIZER in x86 bootloader-like code under sys/arch/

Set NOLIBCSANITIZER for i386 and amd64 specific bootloader-like code.


Revision tags: phil-wifi-base pgoyette-compat-0625
# 1.92 02-Jun-2018 christos

- Disable MKSANITIZER
- Redo using NOPIE
- Add NORELRO


Revision tags: netbsd-8-0-RELEASE netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base
# 1.91 08-Apr-2017 christos

branches: 1.91.12;
centralize vers.c building for standalone programs.


Revision tags: pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.90 08-Mar-2015 martin

branches: 1.90.2; 1.90.4;
Compile the bootblocks for i386 CPUs, even when the main target architecture
is amd64.
Fixes PR port-i386/49725.


Revision tags: nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.89 12-Jan-2014 tsutsui

branches: 1.89.4; 1.89.6;
Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.


# 1.88 21-Aug-2013 matt

Set KLINK_MACHINE


# 1.87 21-Aug-2013 matt

Use <bsd.klinks.mk>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.86 10-Aug-2012 joerg

branches: 1.86.2; 1.86.4;
Don't depend on HAVE_GCC being always present.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-nbase jym-xensuspend-base
# 1.85 20-Jun-2011 mrg

branches: 1.85.2;
remove all the code that supported HAVE_GCC=3. mostly from chuq.


# 1.84 16-Jun-2011 joerg

Refactor compiler-specific optimizer flags. Mark bootxx as supported
with clang.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.83 09-Apr-2011 joerg

branches: 1.83.2;
Do not ignore errors from genprom.


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base
# 1.82 22-Jan-2011 joerg

Drop bootprog_maker (formerly enabled by -M) and bootprog_date (formerly
disabled by -D) from the output of newvers_stand.sh. Change -D to the
inverted logic, so that it adds the date to bootprog_rev in ().

Change all platforms accordingly. -D is added if MKREPRO is not yes and
wasn't present before. Platforms that didn't use -D don't depend on
MKREPRO now either.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.81 22-Dec-2010 jakllsch

branches: 1.81.2; 1.81.4;
It just so happens we don't need -Wno-attributes if we
place __packed in the right place.


Revision tags: uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.80 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.79 27-May-2010 dholland

Introduce .WAIT into the cleandir rule for blasting the libsa/libkern/etc.
trees, because it can race with the libsa/libkern/etc. makefiles' own
cleandir rules. I think I've found all of the uses of the offending idiom...
Closes PR 43360.


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.78 30-Mar-2009 tsutsui

branches: 1.78.2; 1.78.4;
Remove extra trailing slash in ${S} path.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.77 08-Jan-2009 jakllsch

branches: 1.77.2;
Use ${VERSIONFILE} instead of ${.ALLSRC} to match Makefile.boot.

This change stops the full path of newvers_stand.sh from showing up in
pxeboot_ia32.bin.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base
# 1.76 29-Aug-2008 gmcgarry

branches: 1.76.2; 1.76.4;
Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC.


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.75 16-Jul-2008 perry

Call newvers_stand.sh with -DM so we don't include the (unused) date
and builder in the data segment.


# 1.74 16-Jul-2008 perry

make vers.c also depend on the script that builds vers.c


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.73 17-Oct-2007 garbled

branches: 1.73.16; 1.73.20; 1.73.22; 1.73.24; 1.73.26;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: yamt-x86pmap-base3 yamt-x86pmap-base2 ppcoea-renovation-base vmlocking-base
# 1.72 27-Sep-2007 ad

Remove -DBOOT_ELF64 to make build on amd64.


# 1.71 27-Sep-2007 ad

- Make i386 bootblocks boot amd64 kernels, and change to say "NetBSD/x86..."
- Don't bother booting a.out kernels any more.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase nick-csl-alignment-base5 wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 yamt-x86pmap-base netbsd-4-0-RC1 nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 wrstuden-fixsa-base thorpej-atomic-base mjf-ufs-trans-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base rpaulo-netinet-merge-pcb-base
# 1.70 12-Jul-2006 yamt

branches: 1.70.14; 1.70.22; 1.70.32; 1.70.34; 1.70.36;
revert the previous because it doesn't work without destdir populated.
pointed by Valeriy E. Ushakov.


# 1.69 12-Jul-2006 yamt

-I${S}/../common/include for libprop.


Revision tags: yamt-pdpolicy-base6
# 1.68 25-Jun-2006 lukem

Convert to using CC instead of LD, as LDFLAGS is for CC not LD.


# 1.67 25-Jun-2006 lukem

whitespace consistency


Revision tags: chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.66 12-Jun-2006 dogcow

branches: 1.66.2;
Add -Wno-attributes for amd64, too.


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.65 13-May-2006 lukem

branches: 1.65.2;
When creating BASE.rom, don't use BASE.bin as a temporary filename,
since the latter is a valid target name.


# 1.64 13-May-2006 lukem

support MAKEVERBOSE


# 1.63 12-May-2006 mrg

- -mcpu=i386 is gone in GCC4
- we need -Wno-attributes (to avoid __packed__ warnings)
- use -Wno-pointer-sign
- remove some redundancy from pxeboot/Makefile


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.62 11-Dec-2005 christos

branches: 1.62.4; 1.62.6; 1.62.8; 1.62.12;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.61 17-Sep-2005 chs

use a .BEGIN target to make the various symlinks,
the previous way had problems with parallel make.


# 1.60 05-May-2005 christos

branches: 1.60.2;
add dependall and realdepend to the targets that we need to call in the
beginning. XXX: The real fix (handle dependencies in .BEGIN) is forthcoming.


# 1.59 01-May-2005 christos

PR/9567: Arne H. Juul: .BEGIN targets should not use dependencies.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.58 06-Sep-2004 thorpej

branches: 1.58.10;
Use CPUFLAGS for codegen options.


# 1.57 21-Jun-2004 jmc

Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022


Revision tags: netbsd-2-0-base
# 1.56 07-Nov-2003 dsl

branches: 1.56.2;
stand/lib/crt/rom is no more, no need for it in .PATH


# 1.55 26-Oct-2003 lukem

Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.


# 1.54 08-Oct-2003 dsl

Need to explicitly create directory behing symlink.
Clean share lib directory.


# 1.53 08-Oct-2003 dsl

Only build the libraries once,


# 1.52 08-Oct-2003 dsl

BSSTART was only used for the (now depracated) old stand/biosboot code.


# 1.51 08-Oct-2003 lukem

Overhaul MBR handling (part 1):

<sys/bootblock.h>:
* Added definitions for the Master Boot Record (MBR) used by
a variety of systems (primarily i386), including the format
of the BIOS Parameter Block (BPB).
This information was cribbed from a variety of sources
including <sys/disklabel_mbr.h> which this is a superset of.

As part of this, some data structure elements and #defines
were renamed to be more "namespace friendly" and consistent
with other bootblocks and MBR documentation.
Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
* Deprecated in favor of <sys/bootblock.h> (the latter is more
"host tool" friendly).

amd64 & i386:
* Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
be consistent with the naming convention of the msdosfs tools.

* Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
and it's confusing to have two functionally equivalent bootblocks,
especially given that "ufs" has multiple meanings (it could be
a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

* Rework pbr.S (the first sector of bootxx_*):
+ Ensure that BPB (bytes 11..89) and the partition table
(bytes 446..509) do not contain code.
+ Add support for booting from FAT partitions if BOOT_FROM_FAT
is defined. (Only set for bootxx_msdos).
+ Remove "dummy" partition 3; if people want to installboot(8)
these to the start of the disk they can use fdisk(8) to
create a real MBR partition table...
+ Compile with TERSE_ERROR so it fits because of the above.
Whilst this is less user friendly, I feel it's important
to have a valid partition table and BPB in the MBR/PBR.

* Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
with other platforms.

* Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
we can boot off FAT partitions.

* Crank version of /usr/mdec/boot to 3.1, and fix some of the other
entries in the version file.

installboot(8) (i386):
* Read the existing MBR of the filesystem and retain the BIOS
Parameter Block (BPB) in bytes 11..89 and the MBR partition
table in bytes 446..509. (Previously installboot(8) would
trash those two sections of the MBR.)

mbrlabel(8):
* Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).


# 1.50 05-May-2003 fvdl

branches: 1.50.2;
Use ${MACHINE} when generating the version string, not plain 'i386'.


# 1.49 04-May-2003 lukem

be consistent with other Makefiles here and invoke "rm -f" separately to ln -s


# 1.48 04-May-2003 lukem

replace "ln -sf .... $@" with "rm -f $@ && ln -s .... $@"
since the latter works correctly ...


# 1.47 03-May-2003 fvdl

Clean up machine include dir handling a tad.


# 1.46 16-Apr-2003 dsl

Remove definition of LIBSA_SUPPORT_UFS2, the source will only build separate
ufsv1 and ufsv2 objects (the merged one was too large for the code that only
supported a single fs type).


# 1.45 02-Apr-2003 fvdl

Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.


# 1.44 11-Mar-2003 drochner

create a symlink so that eg <x86/trap.h> is found


# 1.43 03-Feb-2003 briggs

Revert my last change. While it actually allows a build to finish,
an iso-image created from the resulting release won't boot. I don't
know if this change is the source of that, but one more knowledgable
than I about the x86 booter needs to look at this, and I don't want
the waters muddied any more than necessary.


# 1.42 03-Feb-2003 briggs

Add CPPFLAGS+= -D__daddr_t=int32_t.


# 1.41 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.40 29-Jan-2003 fvdl

Make the ld workaround work on x88_64, and add the temporary ld script
to CLEANFILES.


# 1.39 28-Jan-2003 dsl

Remove the 4k between code and data to increase the stack space.
Support for 64bit disk blocks seems to have exploded the code.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.38 14-Jan-2003 thorpej

Stub out LIBCRT0, LIBCRTBEGIN, LIBCRTEND, and LIBC.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.37 23-Nov-2002 fvdl

Some hacks to make this compile on x86_64.


Revision tags: kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.36 02-Sep-2002 jdolecek

make vers.c depend on ${SOURCES} and remove .PHONY tag for it, so that it
would only be regenerated if any of the input files changed


Revision tags: gehenna-devsw-base sommerfeld_i386mpnext sommerfeld_i386mpbase_1
# 1.35 27-Jun-2002 pooka

branches: 1.35.2;
Assign COPTS instead of adding to it, avoids situation where -mi386
is mixed with -march=something_incompatible

suggested by thorpej


# 1.34 31-May-2002 thorpej

Build with -ffreestanding.


Revision tags: i386mp_plus16_stable netbsd-1-6-base eeh-devprop-base
# 1.33 19-Mar-2002 thorpej

branches: 1.33.6; 1.33.8;
Make sure we override any optimization options specified by the
user; the boot blocks don't work when built with e.g. -mcpu=i486
(probably due to how branches are aligned in that case, causing
segment boundaries to be crossed).


Revision tags: newlock-base ifpoll-base
# 1.32 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.31 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.30 22-Nov-2001 jmc

Don't make the symlinks on clean rules as well as obj rules. Breaks r/o source
trees that haven't gotten to the make obj recursion part of make build
otherwise.


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2
# 1.29 23-Sep-2001 tls

GCC 2.95 generates significantly larger code with -O2 than our old compiler did; this can cause the second-stage bootblock to exceed the number of blocks that fit in the list in the first-stage bootblock. I thought we used to explicitly set -Os in here; anyway, with this change, we do now!


# 1.28 22-Sep-2001 tv

objcopy -> ${OBJCOPY}; remove redundant definitions of OBJCOPY?= (it is
now in bsd.own.mk).


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.27 18-Aug-2001 enami

branches: 1.27.4;
Include bsd.own.mk a bit earlier so that make cleandir works.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.26 12-Jul-2000 jdolecek

branches: 1.26.4; 1.26.6;
switch to MI newvers_stand.sh version info generator


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 sommerfeld_i386mp_houseclean netbsd-1-5-base minoura-xpg4dl-base sommerfeld_i386mpbase_20000422 chs-ubc2-newbase
# 1.25 23-Jan-2000 mycroft

Fix the symlink hack.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.24 08-Jul-1999 drochner

branches: 1.24.2;
fix creation of DOS / ROM images from ELF executables: use "objcopy"


# 1.23 11-May-1999 drochner

make sure the ./machine link is created early enough for specific targets,
fixes PR port-i386/7553 by David Rankin <drankin@bohemians.lexington.ky.us>


# 1.22 28-Apr-1999 christos

Use new loadfile.c


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 kame_141_19991130 netbsd-1-4-PATCH001 kame_14_19990705 kame_14_19990628 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.21 14-Mar-1999 fvdl

branches: 1.21.4;
Hack to make biosboot_ser work.

XXX The makefile structure in src/sys/arch/i386/stand is very bad.


# 1.20 13-Mar-1999 tron

$(OBJS) -> ${OBJS}


# 1.19 12-Mar-1999 sommerfe

Also build serial bootblocks by default, installing into
/usr/mdec/biosboot_ser.sym
Change Makefile.booters to not assume `version' file is in source directory.


# 1.18 07-Feb-1999 tron

Remove "lib" directory only during "make cleandir" so that ".depend"
doesn't get nuked during "make clean".


# 1.17 07-Feb-1999 tron

Remove "lib" directory created during build process while doing
"make clean" or "make cleandir".


# 1.16 30-Jan-1999 christos

Remove exec.o, and make necessary changes for elf.


# 1.15 29-Jan-1999 christos

Both booters need exec.o now.


Revision tags: kenh-if-detach-base chs-ubc-base eeh-paddr_t-base
# 1.14 08-Jul-1998 drochner

add dependency to get the version number right


# 1.13 27-Mar-1998 cgd

add -nostdinc to CPPFLAGS, so that /usr/include won't be used


# 1.12 22-Feb-1998 mycroft

Nuke the override of libkern SRCS from orbit.


# 1.11 22-Jan-1998 drochner

strchr.c disappeared from libkern, use index.c instead
(we can't control the libkern build as we want, but it works...)


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.10 18-Oct-1997 hubertf

Prevent error if machine-symlink isn't already there (rm -> rm -f)


Revision tags: marc-pcmcia-base
# 1.9 28-Sep-1997 drochner

Use the "proginstall" rule from <bsd.prog.mk> to get the UPDATE
behaviour right.


Revision tags: thorpej-signal-base
# 1.8 20-Aug-1997 drochner

Make "genprom" work in objdir.
Minor cleanup to ease bootcode development at non-standard locations.
Closes PR port-i386/4013 by Luke Mewburn.


Revision tags: marc-pcmcia-bp
# 1.7 26-Jul-1997 thorpej

branches: 1.7.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.6 15-Jul-1997 drochner

Use include files from kernel source, not userland. Create a
"machine" link automatically for this.


# 1.5 26-Jun-1997 drochner

Define _STANDALONE for standalone programs.


# 1.4 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.3 13-Jun-1997 drochner

Force inclusion of "diskbuf" into bootsectors.
This allows to build bootsectors containing netboot code
("make netboot.sym" in the netboot directory).


# 1.2 17-Apr-1997 thorpej

STRIP -> STRIPFLAG


# 1.1 14-Mar-1997 perry

branches: 1.1.1;
Initial revision


Revision tags: prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base
# 1.91 08-Apr-2017 christos

centralize vers.c building for standalone programs.


Revision tags: pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.90 08-Mar-2015 martin

branches: 1.90.2; 1.90.4;
Compile the bootblocks for i386 CPUs, even when the main target architecture
is amd64.
Fixes PR port-i386/49725.


Revision tags: nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.89 12-Jan-2014 tsutsui

branches: 1.89.4; 1.89.6;
Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.


# 1.88 21-Aug-2013 matt

Set KLINK_MACHINE


# 1.87 21-Aug-2013 matt

Use <bsd.klinks.mk>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.86 10-Aug-2012 joerg

branches: 1.86.2; 1.86.4;
Don't depend on HAVE_GCC being always present.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-nbase jym-xensuspend-base
# 1.85 20-Jun-2011 mrg

branches: 1.85.2;
remove all the code that supported HAVE_GCC=3. mostly from chuq.


# 1.84 16-Jun-2011 joerg

Refactor compiler-specific optimizer flags. Mark bootxx as supported
with clang.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.83 09-Apr-2011 joerg

branches: 1.83.2;
Do not ignore errors from genprom.


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base
# 1.82 22-Jan-2011 joerg

Drop bootprog_maker (formerly enabled by -M) and bootprog_date (formerly
disabled by -D) from the output of newvers_stand.sh. Change -D to the
inverted logic, so that it adds the date to bootprog_rev in ().

Change all platforms accordingly. -D is added if MKREPRO is not yes and
wasn't present before. Platforms that didn't use -D don't depend on
MKREPRO now either.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.81 22-Dec-2010 jakllsch

branches: 1.81.2; 1.81.4;
It just so happens we don't need -Wno-attributes if we
place __packed in the right place.


Revision tags: uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.80 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.79 27-May-2010 dholland

Introduce .WAIT into the cleandir rule for blasting the libsa/libkern/etc.
trees, because it can race with the libsa/libkern/etc. makefiles' own
cleandir rules. I think I've found all of the uses of the offending idiom...
Closes PR 43360.


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.78 30-Mar-2009 tsutsui

branches: 1.78.2; 1.78.4;
Remove extra trailing slash in ${S} path.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.77 08-Jan-2009 jakllsch

branches: 1.77.2;
Use ${VERSIONFILE} instead of ${.ALLSRC} to match Makefile.boot.

This change stops the full path of newvers_stand.sh from showing up in
pxeboot_ia32.bin.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base
# 1.76 29-Aug-2008 gmcgarry

branches: 1.76.2; 1.76.4;
Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC.


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.75 16-Jul-2008 perry

Call newvers_stand.sh with -DM so we don't include the (unused) date
and builder in the data segment.


# 1.74 16-Jul-2008 perry

make vers.c also depend on the script that builds vers.c


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.73 17-Oct-2007 garbled

branches: 1.73.16; 1.73.20; 1.73.22; 1.73.24; 1.73.26;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: yamt-x86pmap-base3 yamt-x86pmap-base2 ppcoea-renovation-base vmlocking-base
# 1.72 27-Sep-2007 ad

Remove -DBOOT_ELF64 to make build on amd64.


# 1.71 27-Sep-2007 ad

- Make i386 bootblocks boot amd64 kernels, and change to say "NetBSD/x86..."
- Don't bother booting a.out kernels any more.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase nick-csl-alignment-base5 wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 yamt-x86pmap-base netbsd-4-0-RC1 nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 wrstuden-fixsa-base thorpej-atomic-base mjf-ufs-trans-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base rpaulo-netinet-merge-pcb-base
# 1.70 12-Jul-2006 yamt

branches: 1.70.14; 1.70.22; 1.70.32; 1.70.34; 1.70.36;
revert the previous because it doesn't work without destdir populated.
pointed by Valeriy E. Ushakov.


# 1.69 12-Jul-2006 yamt

-I${S}/../common/include for libprop.


Revision tags: yamt-pdpolicy-base6
# 1.68 25-Jun-2006 lukem

Convert to using CC instead of LD, as LDFLAGS is for CC not LD.


# 1.67 25-Jun-2006 lukem

whitespace consistency


Revision tags: chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.66 12-Jun-2006 dogcow

branches: 1.66.2;
Add -Wno-attributes for amd64, too.


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.65 13-May-2006 lukem

branches: 1.65.2;
When creating BASE.rom, don't use BASE.bin as a temporary filename,
since the latter is a valid target name.


# 1.64 13-May-2006 lukem

support MAKEVERBOSE


# 1.63 12-May-2006 mrg

- -mcpu=i386 is gone in GCC4
- we need -Wno-attributes (to avoid __packed__ warnings)
- use -Wno-pointer-sign
- remove some redundancy from pxeboot/Makefile


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.62 11-Dec-2005 christos

branches: 1.62.4; 1.62.6; 1.62.8; 1.62.12;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.61 17-Sep-2005 chs

use a .BEGIN target to make the various symlinks,
the previous way had problems with parallel make.


# 1.60 05-May-2005 christos

branches: 1.60.2;
add dependall and realdepend to the targets that we need to call in the
beginning. XXX: The real fix (handle dependencies in .BEGIN) is forthcoming.


# 1.59 01-May-2005 christos

PR/9567: Arne H. Juul: .BEGIN targets should not use dependencies.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.58 06-Sep-2004 thorpej

branches: 1.58.10;
Use CPUFLAGS for codegen options.


# 1.57 21-Jun-2004 jmc

Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022


Revision tags: netbsd-2-0-base
# 1.56 07-Nov-2003 dsl

branches: 1.56.2;
stand/lib/crt/rom is no more, no need for it in .PATH


# 1.55 26-Oct-2003 lukem

Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.


# 1.54 08-Oct-2003 dsl

Need to explicitly create directory behing symlink.
Clean share lib directory.


# 1.53 08-Oct-2003 dsl

Only build the libraries once,


# 1.52 08-Oct-2003 dsl

BSSTART was only used for the (now depracated) old stand/biosboot code.


# 1.51 08-Oct-2003 lukem

Overhaul MBR handling (part 1):

<sys/bootblock.h>:
* Added definitions for the Master Boot Record (MBR) used by
a variety of systems (primarily i386), including the format
of the BIOS Parameter Block (BPB).
This information was cribbed from a variety of sources
including <sys/disklabel_mbr.h> which this is a superset of.

As part of this, some data structure elements and #defines
were renamed to be more "namespace friendly" and consistent
with other bootblocks and MBR documentation.
Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
* Deprecated in favor of <sys/bootblock.h> (the latter is more
"host tool" friendly).

amd64 & i386:
* Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
be consistent with the naming convention of the msdosfs tools.

* Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
and it's confusing to have two functionally equivalent bootblocks,
especially given that "ufs" has multiple meanings (it could be
a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

* Rework pbr.S (the first sector of bootxx_*):
+ Ensure that BPB (bytes 11..89) and the partition table
(bytes 446..509) do not contain code.
+ Add support for booting from FAT partitions if BOOT_FROM_FAT
is defined. (Only set for bootxx_msdos).
+ Remove "dummy" partition 3; if people want to installboot(8)
these to the start of the disk they can use fdisk(8) to
create a real MBR partition table...
+ Compile with TERSE_ERROR so it fits because of the above.
Whilst this is less user friendly, I feel it's important
to have a valid partition table and BPB in the MBR/PBR.

* Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
with other platforms.

* Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
we can boot off FAT partitions.

* Crank version of /usr/mdec/boot to 3.1, and fix some of the other
entries in the version file.

installboot(8) (i386):
* Read the existing MBR of the filesystem and retain the BIOS
Parameter Block (BPB) in bytes 11..89 and the MBR partition
table in bytes 446..509. (Previously installboot(8) would
trash those two sections of the MBR.)

mbrlabel(8):
* Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).


# 1.50 05-May-2003 fvdl

branches: 1.50.2;
Use ${MACHINE} when generating the version string, not plain 'i386'.


# 1.49 04-May-2003 lukem

be consistent with other Makefiles here and invoke "rm -f" separately to ln -s


# 1.48 04-May-2003 lukem

replace "ln -sf .... $@" with "rm -f $@ && ln -s .... $@"
since the latter works correctly ...


# 1.47 03-May-2003 fvdl

Clean up machine include dir handling a tad.


# 1.46 16-Apr-2003 dsl

Remove definition of LIBSA_SUPPORT_UFS2, the source will only build separate
ufsv1 and ufsv2 objects (the merged one was too large for the code that only
supported a single fs type).


# 1.45 02-Apr-2003 fvdl

Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.


# 1.44 11-Mar-2003 drochner

create a symlink so that eg <x86/trap.h> is found


# 1.43 03-Feb-2003 briggs

Revert my last change. While it actually allows a build to finish,
an iso-image created from the resulting release won't boot. I don't
know if this change is the source of that, but one more knowledgable
than I about the x86 booter needs to look at this, and I don't want
the waters muddied any more than necessary.


# 1.42 03-Feb-2003 briggs

Add CPPFLAGS+= -D__daddr_t=int32_t.


# 1.41 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.40 29-Jan-2003 fvdl

Make the ld workaround work on x88_64, and add the temporary ld script
to CLEANFILES.


# 1.39 28-Jan-2003 dsl

Remove the 4k between code and data to increase the stack space.
Support for 64bit disk blocks seems to have exploded the code.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.38 14-Jan-2003 thorpej

Stub out LIBCRT0, LIBCRTBEGIN, LIBCRTEND, and LIBC.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.37 23-Nov-2002 fvdl

Some hacks to make this compile on x86_64.


Revision tags: kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.36 02-Sep-2002 jdolecek

make vers.c depend on ${SOURCES} and remove .PHONY tag for it, so that it
would only be regenerated if any of the input files changed


Revision tags: gehenna-devsw-base sommerfeld_i386mpnext sommerfeld_i386mpbase_1
# 1.35 27-Jun-2002 pooka

branches: 1.35.2;
Assign COPTS instead of adding to it, avoids situation where -mi386
is mixed with -march=something_incompatible

suggested by thorpej


# 1.34 31-May-2002 thorpej

Build with -ffreestanding.


Revision tags: i386mp_plus16_stable netbsd-1-6-base eeh-devprop-base
# 1.33 19-Mar-2002 thorpej

branches: 1.33.6; 1.33.8;
Make sure we override any optimization options specified by the
user; the boot blocks don't work when built with e.g. -mcpu=i486
(probably due to how branches are aligned in that case, causing
segment boundaries to be crossed).


Revision tags: newlock-base ifpoll-base
# 1.32 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.31 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.30 22-Nov-2001 jmc

Don't make the symlinks on clean rules as well as obj rules. Breaks r/o source
trees that haven't gotten to the make obj recursion part of make build
otherwise.


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2
# 1.29 23-Sep-2001 tls

GCC 2.95 generates significantly larger code with -O2 than our old compiler did; this can cause the second-stage bootblock to exceed the number of blocks that fit in the list in the first-stage bootblock. I thought we used to explicitly set -Os in here; anyway, with this change, we do now!


# 1.28 22-Sep-2001 tv

objcopy -> ${OBJCOPY}; remove redundant definitions of OBJCOPY?= (it is
now in bsd.own.mk).


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.27 18-Aug-2001 enami

branches: 1.27.4;
Include bsd.own.mk a bit earlier so that make cleandir works.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.26 12-Jul-2000 jdolecek

branches: 1.26.4; 1.26.6;
switch to MI newvers_stand.sh version info generator


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 sommerfeld_i386mp_houseclean netbsd-1-5-base minoura-xpg4dl-base sommerfeld_i386mpbase_20000422 chs-ubc2-newbase
# 1.25 23-Jan-2000 mycroft

Fix the symlink hack.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.24 08-Jul-1999 drochner

branches: 1.24.2;
fix creation of DOS / ROM images from ELF executables: use "objcopy"


# 1.23 11-May-1999 drochner

make sure the ./machine link is created early enough for specific targets,
fixes PR port-i386/7553 by David Rankin <drankin@bohemians.lexington.ky.us>


# 1.22 28-Apr-1999 christos

Use new loadfile.c


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 kame_141_19991130 netbsd-1-4-PATCH001 kame_14_19990705 kame_14_19990628 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.21 14-Mar-1999 fvdl

branches: 1.21.4;
Hack to make biosboot_ser work.

XXX The makefile structure in src/sys/arch/i386/stand is very bad.


# 1.20 13-Mar-1999 tron

$(OBJS) -> ${OBJS}


# 1.19 12-Mar-1999 sommerfe

Also build serial bootblocks by default, installing into
/usr/mdec/biosboot_ser.sym
Change Makefile.booters to not assume `version' file is in source directory.


# 1.18 07-Feb-1999 tron

Remove "lib" directory only during "make cleandir" so that ".depend"
doesn't get nuked during "make clean".


# 1.17 07-Feb-1999 tron

Remove "lib" directory created during build process while doing
"make clean" or "make cleandir".


# 1.16 30-Jan-1999 christos

Remove exec.o, and make necessary changes for elf.


# 1.15 29-Jan-1999 christos

Both booters need exec.o now.


Revision tags: kenh-if-detach-base chs-ubc-base eeh-paddr_t-base
# 1.14 08-Jul-1998 drochner

add dependency to get the version number right


# 1.13 27-Mar-1998 cgd

add -nostdinc to CPPFLAGS, so that /usr/include won't be used


# 1.12 22-Feb-1998 mycroft

Nuke the override of libkern SRCS from orbit.


# 1.11 22-Jan-1998 drochner

strchr.c disappeared from libkern, use index.c instead
(we can't control the libkern build as we want, but it works...)


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.10 18-Oct-1997 hubertf

Prevent error if machine-symlink isn't already there (rm -> rm -f)


Revision tags: marc-pcmcia-base
# 1.9 28-Sep-1997 drochner

Use the "proginstall" rule from <bsd.prog.mk> to get the UPDATE
behaviour right.


Revision tags: thorpej-signal-base
# 1.8 20-Aug-1997 drochner

Make "genprom" work in objdir.
Minor cleanup to ease bootcode development at non-standard locations.
Closes PR port-i386/4013 by Luke Mewburn.


Revision tags: marc-pcmcia-bp
# 1.7 26-Jul-1997 thorpej

branches: 1.7.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.6 15-Jul-1997 drochner

Use include files from kernel source, not userland. Create a
"machine" link automatically for this.


# 1.5 26-Jun-1997 drochner

Define _STANDALONE for standalone programs.


# 1.4 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.3 13-Jun-1997 drochner

Force inclusion of "diskbuf" into bootsectors.
This allows to build bootsectors containing netboot code
("make netboot.sym" in the netboot directory).


# 1.2 17-Apr-1997 thorpej

STRIP -> STRIPFLAG


# 1.1 14-Mar-1997 perry

branches: 1.1.1;
Initial revision