Home | History | Annotate | only in /src/sys/arch/x68k/stand
History log of /src/sys/arch/x68k/stand
RevisionDateAuthorComments
 1.15 16-Aug-2020  isaki Replace boot_ustar with xxboot_ustarfs.
The old boot_ustar had many hard coding and was small(<1KB).
The new xxboot_ustarfs is a part of integrated larger(<8KB) xxboot.
We had to maintain three similar but not the same bootloaders, but
now we have two!
 1.14 14-Aug-2020  isaki Style fixes. One entry per line for some parts.
 1.13 12-Oct-2012  tsutsui First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.12 12-Oct-2012  tsutsui Tweak SUBDIR build order and add comments about each dir.
 1.11 19-Jun-2012  minoura branches: 1.11.2;
Descend to xxboot.
 1.10 06-Apr-2012  isaki put library first.
 1.9 05-Apr-2012  isaki mboot now depends on libiocs. noticed by tsutsui@.
 1.8 27-Jan-2002  minoura branches: 1.8.156; 1.8.160; 1.8.162;
omit xxboot, old a.out-only bootblock.
 1.7 02-Dec-2001  minoura Descend to new boot programs.
 1.6 09-Jan-2001  lukem branches: 1.6.4; 1.6.8;
convert to using .WAIT
 1.5 24-Dec-1999  minoura Replace shell script version of newdisk utility with C version.
Add the man page newdisk(8).
 1.4 04-Jul-1999  minoura branches: 1.4.2;
Enable mboot.
 1.3 01-Sep-1998  itohy branches: 1.3.10;
Use subdirs.
 1.2 30-Jun-1998  msaitoh sync with -current after a long silence
 1.1 19-Oct-1997  oki branches: 1.1.2;
New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.1.2.1 13-Oct-1998  cgd fix various bugs in the installation and operation of 'writefdboot'
(which has since been removed from -current), via patch. (minoura)
 1.3.10.1 02-Aug-1999  thorpej Update from trunk.
 1.4.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.4.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.6.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.6.4.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.162.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.8.162.1 09-Apr-2012  riz Pull up following revision(s) (requested by isaki in ticket #171):
sys/arch/x68k/stand/mboot/mboot.c: revision 1.10
sys/arch/x68k/stand/mboot/Makefile: revision 1.16
sys/arch/x68k/stand/Makefile: revision 1.9
Use common library libiocs.a. suggested by tsutsui@.
o Originally, mboot had an IOCS_S_READEXT() inline function but
its expansion corrupted (from somewhere after branching netbsd-5).
This solves PR#46293 by using the common library.
This problem was reported by Y.Sugahara at NetBSD booth at
Open Source Conference (OSC) 2012 Ehime in March.
o As a side effect, it also correct the different problem that
IOCS_S_READ() calls _S_READEXT not _S_READ.
Should be pulled up to netbsd-6.
mboot now depends on libiocs. noticed by tsutsui@.
 1.8.160.2 29-Apr-2012  mrg sync to latest -current.
 1.8.160.1 05-Apr-2012  mrg sync to latest -current.
 1.8.156.2 30-Oct-2012  yamt sync with head
 1.8.156.1 17-Apr-2012  yamt sync with head
 1.11.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.10 17-Sep-2016  christos Kill ssp
 1.9 17-Sep-2016  christos Kill the PIE
 1.8 12-Jan-2014  tsutsui branches: 1.8.6; 1.8.10;
Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.7 11-Oct-2011  tsutsui branches: 1.7.2; 1.7.12; 1.7.16;
Fix "Error occurs, please reset" boot problem on
X68030 + 060turbo in 060 mode, found on NetBSD booth
at OSC 2011 Hiroshima:

- use -D__daddr_t=int32_t for all bootloader files
to avoid 64 bit ops in FFS
- explicitly specify -m68020-60 to avoid 64 bit mulsl/mulul
instructions which need to be handled by 060SP emulation
but not available in 060turbo IPL ROM
(LFS still has uint64_t members even with 32bit daddr_t)

The problem was investigated (at least 1.6.2 bootloaders worked)
by Yasushi Oshima at OSC booth, and fixes have been confirmed
by Y.Sugahara on his 060turbo. Thanks everyone!

Should also be pulled up to netbsd-5.
 1.6 11-Apr-2011  tsutsui Use bsd.klinks.mk to create machine and ${MACHINE_ARCH} symlinks.
 1.5 12-Jan-2009  tsutsui branches: 1.5.6; 1.5.8;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.4 11-Dec-2005  christos branches: 1.4.74; 1.4.78; 1.4.86; 1.4.88;
merge ktrace-lwp.
 1.3 30-Oct-2003  he Add -ffreestanding to CFLAGS to avoid type conflicts with built-in
functions in gcc.
 1.2 08-Oct-2003  simonb Define LIB{CRT0,C,CRTBEGIN,CRTEND} as nothing, we don't need to link
against them.
 1.1 05-May-2002  isaki branches: 1.1.6; 1.1.8; 1.1.14;
libsa/Makefile: Fix rules to create symlinks on read-only source tree.
{boot,libsa,mboot}/Makefile, Makefile.booters:
move that common rule to Makefile.booters
 1.1.14.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.14.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.14.1 03-Aug-2004  skrll Sync with HEAD
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 05-May-2002  jdolecek file Makefile.booters was added on branch kqueue on 2002-06-23 17:43:18 +0000
 1.1.6.2 20-Jun-2002  nathanw Catch up to -current.
 1.1.6.1 05-May-2002  nathanw file Makefile.booters was added on branch nathanw_sa on 2002-06-20 03:42:32 +0000
 1.4.88.1 17-Mar-2012  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1731):
sys/arch/x68k/stand/boot_ufs/Makefile: revision 1.26 via patch
sys/arch/x68k/stand/boot/version: revision 1.4 via patch
sys/arch/x68k/stand/libsa/Makefile: revision 1.27 via patch
sys/arch/x68k/stand/Makefile.booters: revision 1.7 via patch
sys/arch/x68k/stand/boot_ustar/Makefile: revision 1.19 via patch
Fix "Error occurs, please reset" boot problem on
X68030 + 060turbo in 060 mode, found on NetBSD booth
at OSC 2011 Hiroshima:
- use -D__daddr_t=int32_t for all bootloader files
to avoid 64 bit ops in FFS
- explicitly specify -m68020-60 to avoid 64 bit mulsl/mulul
instructions which need to be handled by 060SP emulation
but not available in 060turbo IPL ROM
(LFS still has uint64_t members even with 32bit daddr_t)
The problem was investigated (at least 1.6.2 bootloaders worked)
by Yasushi Oshima at OSC booth, and fixes have been confirmed
by Y.Sugahara on his 060turbo. Thanks everyone!
Should also be pulled up to netbsd-5.
Bump version to denote 060turbo boot fix.
 1.4.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.4.78.1 04-May-2009  yamt sync with head.
 1.4.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.5.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.6.1 21-Apr-2011  rmind sync with head
 1.7.16.1 18-May-2014  rmind sync with head
 1.7.12.2 03-Dec-2017  jdolecek update from HEAD
 1.7.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8.10.1 04-Nov-2016  pgoyette Sync with HEAD
 1.8.6.1 05-Oct-2016  skrll Sync with HEAD
 1.4 15-Apr-2021  mrg more -fcommon for boot programs.
 1.3 10-Aug-2020  rin branches: 1.3.4;
Make x68k/stand compile with GCC8. Tested with XEiJ.
 1.2 12-Aug-2013  joerg Build boot loaders without unwind tables.
 1.1 07-Jan-2002  minoura branches: 1.1.2; 1.1.4; 1.1.160; 1.1.170; 1.1.176;
Use -Os optimization.
 1.1.176.1 28-Aug-2013  rmind sync with head
 1.1.170.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.160.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.4.2 11-Jan-2002  nathanw More catchup.
 1.1.4.1 07-Jan-2002  nathanw file Makefile.inc was added on branch nathanw_sa on 2002-01-11 23:38:46 +0000
 1.1.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 07-Jan-2002  thorpej file Makefile.inc was added on branch kqueue on 2002-01-10 19:50:25 +0000
 1.3.4.1 17-Apr-2021  thorpej Sync with HEAD.
 1.3 16-Aug-2020  isaki Update and fix.
All primary bootloaders can recognize Human68k partition table.
 1.2 16-Aug-2020  isaki Replace boot_ustar with xxboot_ustarfs.
The old boot_ustar had many hard coding and was small(<1KB).
The new xxboot_ustarfs is a part of integrated larger(<8KB) xxboot.
We had to maintain three similar but not the same bootloaders, but
now we have two!
 1.1 18-Jan-2020  isaki branches: 1.1.2; 1.1.6;
Add a document about this directory.
Reviewed by tsutsui@ on port-x68k.
 1.1.6.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1.6.1 18-Jan-2020  martin file README was added on branch phil-wifi on 2020-04-08 14:07:57 +0000
 1.1.2.2 25-Jan-2020  ad Sync with head.
 1.1.2.1 18-Jan-2020  ad file README was added on branch ad-namecache on 2020-01-25 22:38:44 +0000
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 30-Jun-1998  msaitoh sync with -current after a long silence
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.4 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.3 30-Jun-1998  msaitoh sync with -current after a long silence
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki branches: 1.1.2;
New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.1.2.1 13-Oct-1998  cgd fix various bugs in the installation and operation of 'writefdboot'
(which has since been removed from -current), via patch. (minoura)
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.8 27-Jan-2019  dholland fix duplicated chunk from merge
 1.7 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.6 01-May-2018  christos branches: 1.6.2;
more NOMAN= removal.
 1.5 01-May-2018  christos Create a new bsd.hostinit.mk file and put the build definitions for all host
programs there; make all Makefiles that use bsd.hostprog.mk include it.
Namely turn off MKREPRO and don't make lint, man pages, info files etc.
Remove the Makefile.inc files that contained these same settings, and
remove the settings from Makefile.host
 1.4 12-Dec-2001  tv branches: 1.4.28;
MKfoo=no -> NOfoo
 1.3 15-May-2000  itohy branches: 1.3.8; 1.3.12;
Use bsd.hostprog.mk to allow ELF target on a.out host.
 1.2 17-Mar-1999  minoura branches: 1.2.8;
Move aout2hux manpage to share/man/man1/man1.x68k/.
 1.1 01-Sep-1998  itohy New utility program.
Convert a.out to Human68k ".x" format executable.
 1.2.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.12.1 08-Jan-2002  nathanw Catch up to -current.
 1.3.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.28.1 02-May-2018  pgoyette Synch with HEAD
 1.6.2.1 10-Jun-2019  christos Sync with HEAD
 1.2 17-Mar-1999  minoura Move aout2hux manpage to share/man/man1/man1.x68k/.
 1.1 01-Sep-1998  itohy New utility program.
Convert a.out to Human68k ".x" format executable.
 1.14 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.13 21-Feb-2011  itohy Cleanup my copyright notice.
 1.12 15-Nov-2009  dholland branches: 1.12.4; 1.12.6; 1.12.8;
Remove PROTO(), which is like _P() only spelled differently.

The change causes gcc to harmlessly permute two instructions in the output
for some reason, but otherwise has no effect on the generated code.
 1.11 15-Nov-2009  dholland Since this is a host program, fix some 64-bit cleanliness issues.
 1.10 18-Mar-2009  cegger bzero -> memset
 1.9 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.8 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.7 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.6 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.5 19-Nov-1999  itohy branches: 1.5.134; 1.5.142; 1.5.148;
Oops, I misspelt a macro name.
 1.4 16-Nov-1999  itohy Support conversion from ELF, as well as from a.out.
 1.3 16-Mar-1999  minoura branches: 1.3.8; 1.3.14;
Merged minoura_x68k_bus_h branch.
 1.2 02-Feb-1999  itohy Fix typo.
 1.1 01-Sep-1998  itohy branches: 1.1.6;
New utility program.
Convert a.out to Human68k ".x" format executable.
 1.1.6.1 14-Mar-1999  minoura Sync.
 1.3.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.148.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.142.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.134.2 11-Mar-2010  yamt sync with head
 1.5.134.1 04-May-2009  yamt sync with head.
 1.12.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.12.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.12.4.1 05-Mar-2011  rmind sync with head
 1.4 21-Feb-2011  itohy Cleanup my copyright notice.
 1.3 19-Nov-1999  itohy branches: 1.3.156; 1.3.162; 1.3.164;
Oops, I misspelt a macro name.
 1.2 16-Nov-1999  itohy Support conversion from ELF, as well as from a.out.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.20;
New utility program.
Convert a.out to Human68k ".x" format executable.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.164.1 05-Mar-2011  bouyer Sync with HEAD
 1.3.162.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.156.1 05-Mar-2011  rmind sync with head
 1.4 21-Feb-2011  itohy Cleanup my copyright notice.
 1.3 16-Mar-1999  minoura branches: 1.3.170; 1.3.176; 1.3.178;
Merged minoura_x68k_bus_h branch.
 1.2 02-Feb-1999  itohy Fix typo.
 1.1 01-Sep-1998  itohy branches: 1.1.6;
New utility program.
Convert a.out to Human68k ".x" format executable.
 1.1.6.1 14-Mar-1999  minoura Sync.
 1.3.178.1 05-Mar-2011  bouyer Sync with HEAD
 1.3.176.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.170.1 05-Mar-2011  rmind sync with head
 1.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 15-Nov-2009  dholland branches: 1.2.4; 1.2.6; 1.2.8;
Remove PROTO(), which is like _P() only spelled differently.

The change causes gcc to harmlessly permute two instructions in the output
for some reason, but otherwise has no effect on the generated code.
 1.1 01-Sep-1998  itohy branches: 1.1.154;
New utility program.
Convert a.out to Human68k ".x" format executable.
 1.1.154.1 11-Mar-2010  yamt sync with head
 1.2.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.4.1 05-Mar-2011  rmind sync with head
 1.34 10-Aug-2020  rin Make x68k/stand compile with GCC8. Tested with XEiJ.
 1.33 18-Jan-2020  isaki Add 0x prefix when defining variables, not when using it.
This was necessary for bc(1) but it's no longer necessary.
 1.32 18-Jan-2020  isaki Pass address constants from Makefile to ldscript.
 1.31 14-Jun-2019  isaki branches: 1.31.4;
boot_ufs (primary bootloader) expects /boot OMAGIC a.out.
 1.30 02-Jan-2019  christos use the right version of ELF2AOUT
 1.29 31-Dec-2018  christos use elf2aout for boot.
 1.28 08-Apr-2017  christos branches: 1.28.12; 1.28.14;
centralize vers.c building for standalone programs.
 1.27 25-Jun-2016  isaki branches: 1.27.2; 1.27.4;
Unify netboot and boot (into boot).
Now boot becomes to be able to load the NFS kernel and
netboot also becomes to be able to load the local kernel.
The only difference is the default kernel which loads.
I.e., netboot's default is nfs.

Bump boot_ustar's BOOT_MAXSIZE.
 1.26 08-Aug-2014  isaki branches: 1.26.4;
Remove STRIP?=strip.
Falling back to the hosttool is not a good way now.
 1.25 06-Aug-2014  isaki Remove unused variable.
 1.24 05-Aug-2014  isaki Support a 'switch' command.
It displays/modifies some SRAM parameters on X680x0, like as
memswitch(1) or Human68k's SWITCH.X .
It makes easy to change the boot devices or correct the inconsistency
of SRAM/real memory size.

sample usage:
> switch show .. show all supported parameters
> switch boot=std .. set boot order to 'STD'
> switch memory=12 .. set memory size to 12MB
 1.23 06-Jul-2014  tsutsui Merge and share boot.c between normal boot and netboot by dumb #ifdefs.

Tested on XM6i.
 1.22 20-Mar-2012  minoura branches: 1.22.2; 1.22.12;
Be silent.
 1.21 25-Dec-2011  tsutsui Apply the following patch submitted by Evgeniy Ivanov:
http://mail-index.NetBSD.org/tech-kern/2011/12/15/msg012226.html
http://mail-index.NetBSD.org/tech-kern/2011/12/17/msg012229.html

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

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

XXX1: "ls" op in fs_ops looks a bit inconsistent, but we will be able to
replace it with real fs ops like readdir if it's really worth
XXX2: someone might have to check sys/arch/ia64/stand/efi/libefi/efifs_ls.c
 1.20 12-Apr-2011  tsutsui branches: 1.20.4; 1.20.8;
Make x68k bootloader to use MI libsa, libkern, and libz Makefiles in
src/sys/lib dirs for maintainability. Tested on X68030, ok from isaki@.
 1.19 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.
 1.18 06-Jul-2010  mrg branches: 1.18.2; 1.18.4;
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.17 14-Feb-2009  abs branches: 1.17.2; 1.17.4;
Use relative paths so we can avoid using ${MACHINE} in a path
 1.16 12-Jan-2009  tsutsui branches: 1.16.2;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.15 19-Oct-2008  apb branches: 1.15.2;
Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.14 11-Nov-2007  isaki branches: 1.14.14; 1.14.18; 1.14.24;
${PROG} depends on libsa and libiocs.
 1.13 29-Jun-2006  lukem branches: 1.13.14; 1.13.32; 1.13.34; 1.13.38; 1.13.40;
Support MAKEVERBOSE
 1.12 29-Jun-2006  lukem Rename LDFLAGS to LINKFLAGS, as the former is for CC not LD.
 1.11 11-Dec-2005  christos branches: 1.11.4; 1.11.8; 1.11.16;
merge ktrace-lwp.
 1.10 26-Oct-2003  lukem branches: 1.10.16;
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.9 05-May-2002  isaki branches: 1.9.10;
libsa/Makefile: Fix rules to create symlinks on read-only source tree.
{boot,libsa,mboot}/Makefile, Makefile.booters:
move that common rule to Makefile.booters
 1.8 12-Dec-2001  lukem branches: 1.8.2;
Set NOxxx= before <bsd.own.mk> is pulled in (even indirectly).
Otherwise the appropriate MKxxx=no won't be defined .
 1.7 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.6 14-Nov-2001  tv ${MAKE} print-objdir -> ${PRINTOBJDIR}
 1.5 15-Oct-2001  minoura branches: 1.5.4;
Use newvers_stand.sh to record the version.
 1.4 29-Sep-2001  minoura -D_STANDALONE
 1.3 28-Sep-2001  minoura Create stripped version by default.
 1.2 27-Sep-2001  minoura Make these compile with the old (a.out) toolchain.
 1.1 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.5.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.5.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.5.4.1 15-Oct-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:28:44 +0000
 1.8.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.2.1 12-Dec-2001  thorpej file Makefile was added on branch kqueue on 2002-01-10 19:50:26 +0000
 1.9.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.10.1 03-Aug-2004  skrll Sync with HEAD
 1.10.16.2 15-Nov-2007  yamt sync with head.
 1.10.16.1 30-Dec-2006  yamt sync with head.
 1.11.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.11.8.1 11-Aug-2006  yamt sync with head
 1.11.4.1 09-Sep-2006  rpaulo sync with head
 1.13.40.1 19-Nov-2007  mjf Sync with HEAD.
 1.13.38.1 13-Nov-2007  bouyer Sync with HEAD
 1.13.34.1 09-Jan-2008  matt sync with HEAD
 1.13.32.1 11-Nov-2007  joerg Sync with HEAD.
 1.13.14.1 03-Dec-2007  ad Sync with HEAD.
 1.14.24.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.14.18.2 11-Aug-2010  yamt sync with head.
 1.14.18.1 04-May-2009  yamt sync with head.
 1.14.14.1 17-Jan-2009  mjf Sync with HEAD.
 1.15.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.15.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.16.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.17.4.2 21-Apr-2011  rmind sync with head
 1.17.4.1 05-Mar-2011  rmind sync with head
 1.17.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.18.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.18.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.20.8.2 05-Apr-2012  mrg sync to latest -current.
 1.20.8.1 18-Feb-2012  mrg merge to -current.
 1.20.4.1 17-Apr-2012  yamt sync with head
 1.22.12.1 10-Aug-2014  tls Rebase.
 1.22.2.2 03-Dec-2017  jdolecek update from HEAD
 1.22.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.26.4.2 28-Aug-2017  skrll Sync with HEAD
 1.26.4.1 09-Jul-2016  skrll Sync with HEAD
 1.27.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.27.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.28.14.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.28.14.1 10-Jun-2019  christos Sync with HEAD
 1.28.12.1 18-Jan-2019  pgoyette Synch with HEAD
 1.31.4.1 25-Jan-2020  ad Sync with head.
 1.33 08-Aug-2025  isaki Fix an issue where the boot device was set to "sd0`" when sd_getbsdpartition()
returned an error.
 1.32 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.31 14-Jan-2020  isaki consio_init() should be done before printf().
 1.30 04-Aug-2016  isaki branches: 1.30.16; 1.30.22;
gets -> kgets. the last part of PR/51200.
It was using libsa's gets, so it's possible to change to kgets
as rev 1.23. I've confirmed that it works.
 1.29 26-Jun-2016  isaki branches: 1.29.2;
Add SCSI host adaptor selector to "boot" command of /boot.
By this function, /boot which booted from non-SCSI
(in other words, floppy) can load SCSI kernel.
Now, single /boot can load kernel of all supported filesystems
of all supported boot devices.

---
New "boot" command's syntax is: boot [hostadaptor@][dev:][file]

If you booted from SCSI, hostadaptor is already set (from IOCS)
and you can omit hostadaptor in this case. You can type like
"boot sd0a:netbsd" as before.

If you booted from floppy (hostadaptor is not set) and want to
load the SCSI kernel (hostadaptor is needed), you have to select
your hostadaptor in boot command, like "boot spc0@sd0a:netbsd".
 1.28 25-Jun-2016  isaki Fix my mistake of previous commit.
 1.27 25-Jun-2016  isaki Unify netboot and boot (into boot).
Now boot becomes to be able to load the NFS kernel and
netboot also becomes to be able to load the local kernel.
The only difference is the default kernel which loads.
I.e., netboot's default is nfs.

Bump boot_ustar's BOOT_MAXSIZE.
 1.26 19-Jun-2016  isaki Display debug messages before loading the kernel.
It makes easy to read.
 1.25 19-Jun-2016  isaki Split variable.
'dev' is the device number in devspec[] and
'bootdev' is the boot device parameter made from 'dev'.
 1.24 11-Jun-2016  dholland Revert this one; I can't tell for sure if it's using libsa gets or its
own firmware one in ../libdos. If the latter, switching and bringing
in the libsa one (a) might not work and (b) might make the bootloader
overflow size limits.

PR 51200.
 1.23 11-Jun-2016  dholland PR 51200 gets in libsa considered harmful: use kgets
 1.22 05-Aug-2014  isaki branches: 1.22.4;
Support a 'switch' command.
It displays/modifies some SRAM parameters on X680x0, like as
memswitch(1) or Human68k's SWITCH.X .
It makes easy to change the boot devices or correct the inconsistency
of SRAM/real memory size.

sample usage:
> switch show .. show all supported parameters
> switch boot=std .. set boot order to 'STD'
> switch memory=12 .. set memory size to 12MB
 1.21 06-Jul-2014  tsutsui Probe the actual memory size and warn if it's different from SRAM value.

Without this, ancient X680x0 machines with a dead SRAM battery will
fail to boot silently (or hang right after early copyright messages).

Discussed with and reviewed by isaki@.

XXX: probably we should rather pass the probed memory size to a kernel
XXX: than the size value stored in SRAM..
 1.20 06-Jul-2014  tsutsui Merge and share boot.c between normal boot and netboot by dumb #ifdefs.

Tested on XM6i.
 1.19 06-Jul-2014  tsutsui Reduce diffs to prepare to merge these files.
 1.18 20-Mar-2012  minoura branches: 1.18.2; 1.18.12;
Be silent.
 1.17 25-Dec-2011  tsutsui Apply the following patch submitted by Evgeniy Ivanov:
http://mail-index.NetBSD.org/tech-kern/2011/12/15/msg012226.html
http://mail-index.NetBSD.org/tech-kern/2011/12/17/msg012229.html

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

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

XXX1: "ls" op in fs_ops looks a bit inconsistent, but we will be able to
replace it with real fs ops like readdir if it's really worth
XXX2: someone might have to check sys/arch/ia64/stand/efi/libefi/efifs_ls.c
 1.16 22-Jan-2011  joerg branches: 1.16.4; 1.16.8;
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.
 1.15 25-Aug-2010  christos branches: 1.15.2; 1.15.4;
s/LOAD_NOTE/LOAD_BACKWARDS/
 1.14 31-Jan-2009  tsutsui branches: 1.14.4; 1.14.6;
Disable LOAD_NOTE on floppy boot.
Tested by isaki@ and fixes PR install/38943 on x68k.
 1.13 17-Oct-2007  garbled branches: 1.13.20; 1.13.28; 1.13.30;
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.
 1.12 12-May-2007  isaki branches: 1.12.10;
Remove a local block for readability.
 1.11 04-Mar-2007  christos branches: 1.11.2; 1.11.4; 1.11.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.10 11-Dec-2005  christos branches: 1.10.26;
merge ktrace-lwp.
 1.9 18-Sep-2005  nsmrtks Add diagnostic message. (for debugging with 060)
 1.8 02-Dec-2001  minoura branches: 1.8.2; 1.8.18; 1.8.34;
Small message fixes.
 1.7 15-Oct-2001  minoura branches: 1.7.4;
Use newvers_stand.sh to record the version.
 1.6 15-Oct-2001  minoura Prepare to set WARNS=2.
 1.5 01-Oct-2001  minoura Add a prompt message.
 1.4 29-Sep-2001  minoura Implement ls command.
Correct bootdev detection.
Other minor changes.
 1.3 29-Sep-2001  minoura Minor KNF.
 1.2 28-Sep-2001  minoura Message cosmetics.
 1.1 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.7.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.7.4.1 15-Oct-2001  nathanw file boot.c was added on branch nathanw_sa on 2002-01-08 00:28:44 +0000
 1.8.34.2 03-Sep-2007  yamt sync with head.
 1.8.34.1 21-Jun-2006  yamt sync with head.
 1.8.18.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.2.1 02-Dec-2001  thorpej file boot.c was added on branch kqueue on 2002-01-10 19:50:26 +0000
 1.10.26.2 17-May-2007  yamt sync with head.
 1.10.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.10.1 22-May-2007  matt Update to HEAD.
 1.11.4.1 11-Jul-2007  mjf Sync with head.
 1.11.2.1 27-May-2007  ad Sync with head.
 1.12.10.1 06-Nov-2007  matt sync with HEAD
 1.13.30.1 02-Feb-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #407):
sys/arch/x68k/stand/boot/boot.c: revision 1.14
Disable LOAD_NOTE on floppy boot.
Tested by isaki@ and fixes PR install/38943 on x68k.
 1.13.28.1 03-Mar-2009  skrll Sync with HEAD.
 1.13.20.2 09-Oct-2010  yamt sync with head
 1.13.20.1 04-May-2009  yamt sync with head.
 1.14.6.1 05-Mar-2011  rmind sync with head
 1.14.4.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.15.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.15.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.16.8.2 05-Apr-2012  mrg sync to latest -current.
 1.16.8.1 18-Feb-2012  mrg merge to -current.
 1.16.4.1 17-Apr-2012  yamt sync with head
 1.18.12.1 10-Aug-2014  tls Rebase.
 1.18.2.2 03-Dec-2017  jdolecek update from HEAD
 1.18.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.22.4.2 05-Oct-2016  skrll Sync with HEAD
 1.22.4.1 09-Jul-2016  skrll Sync with HEAD
 1.29.2.1 06-Aug-2016  pgoyette Sync with HEAD
 1.30.22.1 17-Jan-2020  ad Sync with head.
 1.30.16.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.10 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.9 18-Jan-2020  isaki Remove commented out ALIGN() operation.
It looks unnecessary and has never been used.
 1.8 18-Jan-2020  isaki Pass address constants from Makefile to ldscript.
 1.7 31-Dec-2018  christos branches: 1.7.6;
use elf2aout for boot.
 1.6 02-Mar-2014  isaki branches: 1.6.28; 1.6.30;
Discard .SUNW_ctf section just in case.
patch from martin@, see PR/48623.
 1.5 12-Aug-2013  joerg Discard ELF unwind sections for the boot loader.
 1.4 24-May-2013  christos branches: 1.4.2;
discard debug sections that are not representable in the a.out object format.
 1.3 20-Mar-2012  minoura branches: 1.3.2;
Comment fix.
 1.2 30-Oct-2003  he branches: 1.2.140; 1.2.144; 1.2.146;
Add .rodata.str1.1 to the text segment, and discard the .comment section.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.22;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file boot.ldscript was added on branch kqueue on 2002-01-10 19:50:26 +0000
 1.1.4.2 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.4.1 27-Sep-2001  minoura file boot.ldscript was added on branch nathanw_sa on 2001-09-27 10:14:50 +0000
 1.2.146.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.144.1 05-Apr-2012  mrg sync to latest -current.
 1.2.140.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.140.1 17-Apr-2012  yamt sync with head
 1.3.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.2.1 23-Jun-2013  tls resync from head
 1.4.2.2 18-May-2014  rmind sync with head
 1.4.2.1 28-Aug-2013  rmind sync with head
 1.6.30.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.6.30.1 10-Jun-2019  christos Sync with HEAD
 1.6.28.1 18-Jan-2019  pgoyette Synch with HEAD
 1.7.6.1 25-Jan-2020  ad Sync with head.
 1.13 23-Jun-2022  isaki x68k/stand: Merge {sd,cd}strategy and {sd,cd}close respectively.
For sd and cd devs, only open differs and the rest is the same.
No functional changes intended.
Suggested by tsutsui@ at port-x68k.
 1.12 25-Apr-2022  mlelstv libsa now needs ioctl to support media with large sectors. Provide
missing functions.

libsa defines files[] array itself, just reference it.
This also adds another global variable that tracks the root
filesystem module.
 1.11 25-Jun-2016  isaki Unify netboot and boot (into boot).
Now boot becomes to be able to load the NFS kernel and
netboot also becomes to be able to load the local kernel.
The only difference is the default kernel which loads.
I.e., netboot's default is nfs.

Bump boot_ustar's BOOT_MAXSIZE.
 1.10 12-Oct-2012  tsutsui branches: 1.10.14;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.9 20-Mar-2012  minoura branches: 1.9.2;
Add FFSv2 support.
 1.8 11-Dec-2005  christos branches: 1.8.112; 1.8.116; 1.8.118;
merge ktrace-lwp.
 1.7 28-Jun-2005  junyoung Cosmetic changes.
 1.6 23-Jun-2005  junyoung Use FS_OPS() macro.
 1.5 23-Jun-2005  junyoung Drop trailing spaces.
 1.4 23-Feb-2003  simonb branches: 1.4.2;
Update for LFSv2 support. Ports that have "bootxx_lfs"-style
bootblocks currently only support LFSv2, but the second level
"boot" program supports both LFS versions.
 1.3 17-Mar-2002  minoura Make this compile again.
 1.2 28-Sep-2001  minoura branches: 1.2.4; 1.2.6;
Add ustarfs support.
 1.1 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.2.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.6.1 28-Sep-2001  thorpej file conf.c was added on branch kqueue on 2002-01-10 19:50:26 +0000
 1.2.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.4.1 28-Sep-2001  nathanw file conf.c was added on branch nathanw_sa on 2002-04-01 07:43:42 +0000
 1.4.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.118.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.8.116.1 05-Apr-2012  mrg sync to latest -current.
 1.8.112.2 30-Oct-2012  yamt sync with head
 1.8.112.1 17-Apr-2012  yamt sync with head
 1.9.2.2 03-Dec-2017  jdolecek update from HEAD
 1.9.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.10.14.1 09-Jul-2016  skrll Sync with HEAD
 1.2 01-Nov-2012  isaki branches: 1.2.2; 1.2.4;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file dp8390.c was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.4.2 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.4.1 01-Nov-2012  tls file dp8390.c was added on branch tls-maxphys on 2012-11-20 03:01:49 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file dp8390.c was added on branch netbsd-6 on 2012-11-18 19:05:19 +0000
 1.2 01-Nov-2012  isaki branches: 1.2.2; 1.2.4;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file dp8390.h was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.4.2 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.4.1 01-Nov-2012  tls file dp8390.h was added on branch tls-maxphys on 2012-11-20 03:01:49 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file dp8390.h was added on branch netbsd-6 on 2012-11-18 19:05:19 +0000
 1.3 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.2 01-Nov-2012  isaki branches: 1.2.2; 1.2.4;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file if_ne.c was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.4.2 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.4.1 01-Nov-2012  tls file if_ne.c was added on branch tls-maxphys on 2012-11-20 03:01:49 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file if_ne.c was added on branch netbsd-6 on 2012-11-18 19:05:19 +0000
 1.3 11-Jul-2015  kamil Improve spelling: regsiter -> register

This change is non-functional.

Approved by <riastradh>, <pgoyette>
 1.2 01-Nov-2012  isaki branches: 1.2.2; 1.2.4; 1.2.18;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file ne.c was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.18.1 22-Sep-2015  skrll Sync with HEAD
 1.2.4.3 03-Dec-2017  jdolecek update from HEAD
 1.2.4.2 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.4.1 01-Nov-2012  tls file ne.c was added on branch tls-maxphys on 2012-11-20 03:01:49 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file ne.c was added on branch netbsd-6 on 2012-11-18 19:05:18 +0000
 1.1 12-Oct-2012  tsutsui branches: 1.1.2; 1.1.4; 1.1.6;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.6.2 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.6.1 12-Oct-2012  tls file ne.h was added on branch tls-maxphys on 2012-11-20 03:01:49 +0000
 1.1.4.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.1.4.1 12-Oct-2012  riz file ne.h was added on branch netbsd-6 on 2012-11-18 19:05:19 +0000
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file ne.h was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.3 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.2 12-Apr-2011  tsutsui Make x68k bootloader to use MI libsa, libkern, and libz Makefiles in
src/sys/lib dirs for maintainability. Tested on X68030, ok from isaki@.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.150; 1.1.156;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.156.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.150.1 21-Apr-2011  rmind sync with head
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file srt0.S was added on branch kqueue on 2002-01-10 19:50:27 +0000
 1.1.4.2 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.4.1 27-Sep-2001  minoura file srt0.S was added on branch nathanw_sa on 2001-09-27 10:14:50 +0000
 1.2 10-Aug-2014  isaki branches: 1.2.4;
Unify all arch/*/stand's atoi() to MI libsa.
lib/libsa/atoi.c was separated from lib/libsa/bootcfg.c.
PR/49084
 1.1 05-Aug-2014  isaki branches: 1.1.2;
Support a 'switch' command.
It displays/modifies some SRAM parameters on X680x0, like as
memswitch(1) or Human68k's SWITCH.X .
It makes easy to change the boot devices or correct the inconsistency
of SRAM/real memory size.

sample usage:
> switch show .. show all supported parameters
> switch boot=std .. set boot order to 'STD'
> switch memory=12 .. set memory size to 12MB
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 05-Aug-2014  tls file switch.c was added on branch tls-earlyentropy on 2014-08-10 06:54:10 +0000
 1.2.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.4.1 10-Aug-2014  tls file switch.c was added on branch tls-maxphys on 2014-08-20 00:03:28 +0000
 1.1 05-Aug-2014  isaki branches: 1.1.2; 1.1.6;
Support a 'switch' command.
It displays/modifies some SRAM parameters on X680x0, like as
memswitch(1) or Human68k's SWITCH.X .
It makes easy to change the boot devices or correct the inconsistency
of SRAM/real memory size.

sample usage:
> switch show .. show all supported parameters
> switch boot=std .. set boot order to 'STD'
> switch memory=12 .. set memory size to 12MB
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 05-Aug-2014  tls file switch.h was added on branch tls-maxphys on 2014-08-20 00:03:28 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 05-Aug-2014  tls file switch.h was added on branch tls-earlyentropy on 2014-08-10 06:54:10 +0000
 1.9 21-Jun-2022  isaki x68k/stand: Bump boot's version. Fix blocksize parameter passes to SCSI IOCS.
 1.8 25-Jun-2016  isaki Unify netboot and boot (into boot).
Now boot becomes to be able to load the NFS kernel and
netboot also becomes to be able to load the local kernel.
The only difference is the default kernel which loads.
I.e., netboot's default is nfs.

Bump boot_ustar's BOOT_MAXSIZE.
 1.7 17-Jan-2016  tsutsui Enable LIBSA_CREAD_NOCRC. PR/50638

Bump version to denote user visible change.
XXX: recent visible changes (memsize probe, SRAM switch command)
were not denoted in versions
Tested on (real) X68030.
 1.6 12-Oct-2012  tsutsui branches: 1.6.14;
Bump version to denote check_getchar() bug fix.
 1.5 20-Mar-2012  minoura branches: 1.5.2;
Add FFSv2 support.
 1.4 13-Oct-2011  tsutsui branches: 1.4.2; 1.4.6; 1.4.8;
Bump version to denote 060turbo boot fix.
 1.3 11-Apr-2011  tsutsui Bump version to denote serial console fix.
 1.2 09-Nov-2001  scw branches: 1.2.2; 1.2.4; 1.2.136; 1.2.148; 1.2.154;
Bump the version numbers of all bootloaders which use loadfile_elfXX() now
that it tries hard to avoid backwards seeks.
 1.1 15-Oct-2001  minoura branches: 1.1.2;
Use newvers_stand.sh to record the version.
 1.1.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.2.154.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.148.1 21-Apr-2011  rmind sync with head
 1.2.136.1 17-Mar-2012  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1731):
sys/arch/x68k/stand/boot_ufs/Makefile: revision 1.26 via patch
sys/arch/x68k/stand/boot/version: revision 1.4 via patch
sys/arch/x68k/stand/libsa/Makefile: revision 1.27 via patch
sys/arch/x68k/stand/Makefile.booters: revision 1.7 via patch
sys/arch/x68k/stand/boot_ustar/Makefile: revision 1.19 via patch
Fix "Error occurs, please reset" boot problem on
X68030 + 060turbo in 060 mode, found on NetBSD booth
at OSC 2011 Hiroshima:
- use -D__daddr_t=int32_t for all bootloader files
to avoid 64 bit ops in FFS
- explicitly specify -m68020-60 to avoid 64 bit mulsl/mulul
instructions which need to be handled by 060SP emulation
but not available in 060turbo IPL ROM
(LFS still has uint64_t members even with 32bit daddr_t)
The problem was investigated (at least 1.6.2 bootloaders worked)
by Yasushi Oshima at OSC booth, and fixes have been confirmed
by Y.Sugahara on his 060turbo. Thanks everyone!
Should also be pulled up to netbsd-5.
Bump version to denote 060turbo boot fix.
 1.2.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1 09-Nov-2001  thorpej file version was added on branch kqueue on 2002-01-10 19:50:27 +0000
 1.2.2.2 09-Nov-2001  scw Bump the version numbers of all bootloaders which use loadfile_elfXX() now
that it tries hard to avoid backwards seeks.
 1.2.2.1 09-Nov-2001  scw file version was added on branch nathanw_sa on 2001-11-09 19:53:17 +0000
 1.4.8.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.4.6.1 05-Apr-2012  mrg sync to latest -current.
 1.4.2.2 30-Oct-2012  yamt sync with head
 1.4.2.1 17-Apr-2012  yamt sync with head
 1.5.2.2 03-Dec-2017  jdolecek update from HEAD
 1.5.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.6.14.2 09-Jul-2016  skrll Sync with HEAD
 1.6.14.1 19-Mar-2016  skrll Sync with HEAD
 1.39 11-Jan-2023  isaki Add udivdi3/umoddi3 (and ashldi3) that were required by recent UFS change.
This increases xxboot_ufs from about 4.5KB to 5.5KB (The upper limit is 8KB).
Thanks tsutsui@ for advices.
 1.38 15-Dec-2021  christos branches: 1.38.4;
-W === -Wextra
 1.37 15-Dec-2021  christos remove naked -W
 1.36 18-Jan-2020  isaki Check whether the text+data+bss doesn't reach 0x6000 where secondary
bootloader should be.
 1.35 18-Jan-2020  isaki Use ASSERT() in ldscript to check first_kbyte (etc) restrictions,
rather than complicated shell expressions in Makefile.
 1.34 18-Jan-2020  isaki Change primary bootloader's load address from 0x0f0000 to 0x003000.
- Moving addresses closer eliminates bunch of this linker errors:
in function `entry0':
relocation truncated to fit: R_68K_16 against `edata'+ffffffffffff8000
:
- By this change, harmful -noinhibit-exec option can also be removed.
Finally, we can break the builds when assemble error occurs!
- Load address of secondary is 0x6000, so that this change limits
text+data+bss 12KB or less. Current actual size is 5~7KB.
I think it should be fine.
- cd9660 can have up to 30KB text+data in its bootarea. Even in this
case, this change limits text+data+bss 12KB or less (currently, it's
about 6KB). However, I take breaking the builds on errors rather than
future size limitation.
There is no user visible changes or interface changes.
 1.33 18-Jan-2020  isaki Add 0x prefix when defining variables, not when using it.
This was necessary for bc(1) but it's no longer necessary.
 1.32 18-Jan-2020  isaki Pass address constants from Makefile to ldscript.
 1.31 16-Jan-2020  isaki Rewrite limit check using cross-build tools.
This eliminates use of hosts tr(1) and bc(1).
(But I'm going to remove this again soon due to other reason)
 1.30 08-Apr-2017  christos branches: 1.30.14; 1.30.20;
centralize vers.c building for standalone programs.
 1.29 12-Aug-2013  joerg branches: 1.29.6; 1.29.10; 1.29.14;
Build boot loaders without unwind tables.
 1.28 15-Jun-2013  christos branches: 1.28.2;
revert previous
 1.27 15-Jun-2013  christos adjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs split
 1.26 11-Oct-2011  tsutsui branches: 1.26.2; 1.26.12;
Fix "Error occurs, please reset" boot problem on
X68030 + 060turbo in 060 mode, found on NetBSD booth
at OSC 2011 Hiroshima:

- use -D__daddr_t=int32_t for all bootloader files
to avoid 64 bit ops in FFS
- explicitly specify -m68020-60 to avoid 64 bit mulsl/mulul
instructions which need to be handled by 060SP emulation
but not available in 060turbo IPL ROM
(LFS still has uint64_t members even with 32bit daddr_t)

The problem was investigated (at least 1.6.2 bootloaders worked)
by Yasushi Oshima at OSC booth, and fixes have been confirmed
by Y.Sugahara on his 060turbo. Thanks everyone!

Should also be pulled up to netbsd-5.
 1.25 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.
 1.24 06-Jul-2010  mrg branches: 1.24.2; 1.24.4;
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.23 25-Oct-2008  apb branches: 1.23.4; 1.23.14; 1.23.16;
Use ${TOOL_SED} instead if plain sed in Makefiles.
 1.22 19-Oct-2008  apb Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.21 03-Mar-2007  isaki branches: 1.21.40; 1.21.44; 1.21.50;
-Wconversion is too strict.
 1.20 29-Jun-2006  lukem branches: 1.20.10;
Support MAKEVERBOSE
 1.19 29-Jun-2006  lukem Rename LDFLAGS to LINKFLAGS, as the former is for CC not LD.
 1.18 27-Dec-2005  he branches: 1.18.4; 1.18.8; 1.18.16;
Make this build again by using ${S}/../common/lib/libc/Makefile.inc,
after the libc/libkern consolidation.
 1.17 11-Dec-2005  christos merge ktrace-lwp.
 1.16 21-Mar-2004  itohy branches: 1.16.16;
Add notice on "relocation truncated to fit: R_68K_16" errors of ld.
Cleanup consistency check.
 1.15 30-Oct-2003  he Add -I${S} for <lib/libsa/stand.h> inclusion, and add
include of ../Makefile.booters for -ffreestanding.
 1.14 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.13 09-Apr-2003  itohy branches: 1.13.2;
Support UFS2 format for FFS.
 1.12 02-Feb-2003  isaki Use 32bit daddr_t.
 1.11 17-Mar-2002  minoura LFSv2 support.
Note that secondary boot does not support LFSv2.
Code written by itohy.
 1.10 12-Dec-2001  lukem branches: 1.10.2;
Set NOxxx= before <bsd.own.mk> is pulled in (even indirectly).
Otherwise the appropriate MKxxx=no won't be defined .
 1.9 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.8 05-Dec-2001  minoura Correct LINKS to install sdboot_ufs properly.
 1.7 24-Nov-2001  minoura Emit the binaries directly from the loader.
 1.6 15-Oct-2001  minoura branches: 1.6.4;
Use newvers_stand.sh to record the version.
 1.5 01-Oct-2001  minoura Install as xxboot_*, and create links as fdboot_* and sdboot_*.
 1.4 28-Sep-2001  minoura Install as `boot_ufs'.
 1.3 27-Sep-2001  minoura Make these compile with the old (a.out) toolchain.
 1.2 27-Sep-2001  minoura Add some missing definitions.
 1.1 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.6.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.6.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.6.4.1 15-Oct-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:28:45 +0000
 1.10.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.10.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.2.1 12-Dec-2001  thorpej file Makefile was added on branch kqueue on 2002-01-10 19:50:27 +0000
 1.13.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.13.2.1 03-Aug-2004  skrll Sync with HEAD
 1.16.16.3 03-Sep-2007  yamt sync with head.
 1.16.16.2 30-Dec-2006  yamt sync with head.
 1.16.16.1 21-Jun-2006  yamt sync with head.
 1.18.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.18.8.1 11-Aug-2006  yamt sync with head
 1.18.4.1 09-Sep-2006  rpaulo sync with head
 1.20.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.21.50.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.21.44.2 11-Aug-2010  yamt sync with head.
 1.21.44.1 04-May-2009  yamt sync with head.
 1.21.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.23.16.1 05-Mar-2011  rmind sync with head
 1.23.14.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.23.4.1 17-Mar-2012  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1731):
sys/arch/x68k/stand/boot_ufs/Makefile: revision 1.26 via patch
sys/arch/x68k/stand/boot/version: revision 1.4 via patch
sys/arch/x68k/stand/libsa/Makefile: revision 1.27 via patch
sys/arch/x68k/stand/Makefile.booters: revision 1.7 via patch
sys/arch/x68k/stand/boot_ustar/Makefile: revision 1.19 via patch
Fix "Error occurs, please reset" boot problem on
X68030 + 060turbo in 060 mode, found on NetBSD booth
at OSC 2011 Hiroshima:
- use -D__daddr_t=int32_t for all bootloader files
to avoid 64 bit ops in FFS
- explicitly specify -m68020-60 to avoid 64 bit mulsl/mulul
instructions which need to be handled by 060SP emulation
but not available in 060turbo IPL ROM
(LFS still has uint64_t members even with 32bit daddr_t)
The problem was investigated (at least 1.6.2 bootloaders worked)
by Yasushi Oshima at OSC booth, and fixes have been confirmed
by Y.Sugahara on his 060turbo. Thanks everyone!
Should also be pulled up to netbsd-5.
Bump version to denote 060turbo boot fix.
 1.24.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.24.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.26.12.2 03-Dec-2017  jdolecek update from HEAD
 1.26.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.26.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.28.2.1 28-Aug-2013  rmind sync with head
 1.29.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.29.10.1 26-Apr-2017  pgoyette Sync with HEAD
 1.29.6.1 28-Aug-2017  skrll Sync with HEAD
 1.30.20.2 25-Jan-2020  ad Sync with head.
 1.30.20.1 17-Jan-2020  ad Sync with head.
 1.30.14.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.38.4.1 15-May-2023  martin Pull up following revision(s) (requested by chs in ticket #166):

sys/arch/x68k/stand/boot_ufs/Makefile: revision 1.39

Add udivdi3/umoddi3 (and ashldi3) that were required by recent UFS change.

This increases xxboot_ufs from about 4.5KB to 5.5KB (The upper limit is 8KB).

Thanks tsutsui@ for advices.
 1.19 28-Jan-2020  isaki Revert placing .bss right after .data, and make .bss fixed at 0x5000.
.bss placed right after .data was overwritten when first 1KB loads full
.text+.data.
 1.18 28-Jan-2020  isaki Use __bss_start rather than edata to point the beginning of .bss.
Currently the .bss is placed right after .data. In that case, edata
points to the beginning of .bss so that there is no visible changes at
least currently.
 1.17 18-Jan-2020  isaki Change primary bootloader's load address from 0x0f0000 to 0x003000.
- Moving addresses closer eliminates bunch of this linker errors:
in function `entry0':
relocation truncated to fit: R_68K_16 against `edata'+ffffffffffff8000
:
- By this change, harmful -noinhibit-exec option can also be removed.
Finally, we can break the builds when assemble error occurs!
- Load address of secondary is 0x6000, so that this change limits
text+data+bss 12KB or less. Current actual size is 5~7KB.
I think it should be fine.
- cd9660 can have up to 30KB text+data in its bootarea. Even in this
case, this change limits text+data+bss 12KB or less (currently, it's
about 6KB). However, I take breaking the builds on errors rather than
future size limitation.
There is no user visible changes or interface changes.
 1.16 18-Jan-2020  isaki Typo in comment. s/availble/available/
 1.15 18-Jan-2020  isaki Add comment and figure of address map.
 1.14 18-Jan-2020  isaki Initialize the screen in all primary bootloaders.
- Some IPL (or boot selector) don't do it, but current secondary bootloader
expects the screen to be initialized to display logo.
To keep messages (like version signature) displayed by primary bootloader,
this initialization should be done early in all primary bootloaders.
- For boot_ustar.S, relocates some registers to save bootinfo (%d0).
- Bumps version.

Confirmed on X68030+060turbo and my X68030. This problem was found on
X68030+060turbo at NetBSD booth in OSC 2011 Hiroshima (8+ years ago).
 1.13 16-Jan-2020  isaki Use .org directive to fix disklabel location instead of hand calculation.
If the code size before disklabel is less, zero is filled automatically.
If the code size before disklabel is exceeded, assembler stops with error.
Note that this changes a padding word in the current output binary from
a NOP instruction to zero but there are no functional changes.
 1.12 14-Jan-2020  isaki Clean up.
- B_KEYINP is no longer called from C.
- B_COLOR is no longer used.
 1.11 13-Jan-2020  isaki Typo in comment. s/LABELLOFFSET/LABELOFFSET/
 1.10 01-Nov-2012  isaki branches: 1.10.38; 1.10.44;
Fix typo in comment. s/d1/d0/
 1.9 21-Feb-2011  itohy branches: 1.9.4; 1.9.10; 1.9.14;
Cleanup my copyright notice.
 1.8 04-Mar-2007  christos branches: 1.8.66; 1.8.72; 1.8.74;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.7 11-Dec-2005  christos branches: 1.7.26;
merge ktrace-lwp.
 1.6 04-Dec-2003  keihan branches: 1.6.16;
netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.5 09-Jun-2002  isaki branches: 1.5.6;
Divided 406 bytes disklabel area into 'nop' and 404 bytes area.
 1.4 24-Nov-2001  minoura branches: 1.4.2; 1.4.10;
boot_ufs can now used as the disk primary boot.
 1.3 28-Sep-2001  minoura branches: 1.3.4;
Update authors' mail addresses.
 1.2 27-Sep-2001  minoura Make these compile with the old (a.out) toolchain.
 1.1 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.3.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.3.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.4.1 28-Sep-2001  nathanw file boot.S was added on branch nathanw_sa on 2002-01-08 00:28:45 +0000
 1.4.10.1 15-Jul-2002  gehenna catch up with -current.
 1.4.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 24-Nov-2001  thorpej file boot.S was added on branch kqueue on 2002-01-10 19:50:28 +0000
 1.5.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 03-Sep-2007  yamt sync with head.
 1.7.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.74.1 05-Mar-2011  bouyer Sync with HEAD
 1.8.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.66.1 05-Mar-2011  rmind sync with head
 1.9.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.9.10.1 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.9.4.1 16-Jan-2013  yamt sync with (a bit old) head
 1.10.44.3 29-Feb-2020  ad Sync with head.
 1.10.44.2 25-Jan-2020  ad Sync with head.
 1.10.44.1 17-Jan-2020  ad Sync with head.
 1.10.38.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.6 14-Jan-2020  isaki Clean up.
- B_KEYINP is no longer called from C.
- B_COLOR is no longer used.
 1.5 14-Mar-2009  dsl branches: 1.5.64; 1.5.70;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.4 24-Dec-2007  perry branches: 1.4.10; 1.4.18; 1.4.24;
Remove __attribute__((__noreturn__)) from things already marked __dead
Found by the department of redundancy department.
 1.3 04-Aug-2006  mhitch branches: 1.3.34; 1.3.44; 1.3.48;
gcc4 fix: gcc4 more strict on checking signed/unsigned.
 1.2 17-Mar-2002  minoura branches: 1.2.28; 1.2.42; 1.2.46;
LFSv2 support.
Note that secondary boot does not support LFSv2.
Code written by itohy.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file boot_ufs.h was added on branch kqueue on 2002-01-10 19:50:28 +0000
 1.1.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.4.1 27-Sep-2001  nathanw file boot_ufs.h was added on branch nathanw_sa on 2002-04-01 07:43:43 +0000
 1.2.46.1 11-Aug-2006  yamt sync with head
 1.2.42.1 09-Sep-2006  rpaulo sync with head
 1.2.28.2 21-Jan-2008  yamt sync with head
 1.2.28.1 30-Dec-2006  yamt sync with head.
 1.3.48.1 02-Jan-2008  bouyer Sync with HEAD
 1.3.44.1 26-Dec-2007  ad Sync with head.
 1.3.34.1 09-Jan-2008  matt sync with HEAD
 1.4.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.18.1 28-Apr-2009  skrll Sync with HEAD.
 1.4.10.1 04-May-2009  yamt sync with head.
 1.5.70.1 17-Jan-2020  ad Sync with head.
 1.5.64.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.8 28-Jan-2020  isaki Revert placing .bss right after .data, and make .bss fixed at 0x5000.
.bss placed right after .data was overwritten when first 1KB loads full
.text+.data.
 1.7 18-Jan-2020  isaki Check whether the text+data+bss doesn't reach 0x6000 where secondary
bootloader should be.
 1.6 18-Jan-2020  isaki Make .bss follows .data to detect size restriction easier.
Previously, if text+data exceeds the restricted size, it will conflict
with manually fixed .bss area and ldscript makes it an error.
By this change, ASSERT() can detect it.
 1.5 18-Jan-2020  isaki Use ASSERT() in ldscript to check first_kbyte (etc) restrictions,
rather than complicated shell expressions in Makefile.
 1.4 18-Jan-2020  isaki Remove commented out ALIGN() operation.
It looks unnecessary and has never been used.
 1.3 18-Jan-2020  isaki Pass address constants from Makefile to ldscript.
 1.2 24-Nov-2001  minoura branches: 1.2.2; 1.2.208; 1.2.214;
Emit the binaries directly from the loader.
 1.1 27-Sep-2001  minoura branches: 1.1.4;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.4.1 27-Sep-2001  nathanw file boot_ufs.ldscript was added on branch nathanw_sa on 2002-01-08 00:28:45 +0000
 1.2.214.2 29-Feb-2020  ad Sync with head.
 1.2.214.1 25-Jan-2020  ad Sync with head.
 1.2.208.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 24-Nov-2001  thorpej file boot_ufs.ldscript was added on branch kqueue on 2002-01-10 19:50:28 +0000
 1.14 14-Jun-2019  isaki Add missing newline.
 1.13 17-Jul-2010  isaki branches: 1.13.60;
Add a missing newline in BOOT_DEBUG mode.
 1.12 18-Mar-2009  cegger branches: 1.12.2; 1.12.4;
Ansify function definitions w/o arguments. Generated with sed.
 1.11 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.10 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.9 18-Dec-2008  isaki branches: 1.9.2;
Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.8 11-Dec-2005  christos branches: 1.8.74; 1.8.78; 1.8.86;
merge ktrace-lwp.
 1.7 25-Aug-2005  he Make these first-stage boot loaders use a locally-defined ino32_t
instead of introducing 64-bit operations in these space-constrained
pieces of code with the recent change to ino_t. This is patterned
slightly after recent changes to libsa's ufs.c.

Approved by christos.
 1.6 30-Oct-2003  he branches: 1.6.16;
Add include of <lib/libsa/stand.h> for memcpy() and memset() prototypes.
 1.5 09-Apr-2003  itohy branches: 1.5.2;
Support UFS2 format for FFS.
 1.4 24-Nov-2001  minoura branches: 1.4.2;
boot_ufs can now used as the disk primary boot.
 1.3 15-Oct-2001  minoura branches: 1.3.4;
Use newvers_stand.sh to record the version.
 1.2 15-Oct-2001  minoura Prepare to set WARNS=2.
 1.1 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.3.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.4.1 15-Oct-2001  nathanw file bootmain.c was added on branch nathanw_sa on 2002-01-08 00:28:45 +0000
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 24-Nov-2001  thorpej file bootmain.c was added on branch kqueue on 2002-01-10 19:50:29 +0000
 1.5.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.8.86.2 28-Apr-2009  skrll Sync with HEAD.
 1.8.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.78.2 11-Aug-2010  yamt sync with head.
 1.8.78.1 04-May-2009  yamt sync with head.
 1.8.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.9.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.12.4.1 05-Mar-2011  rmind sync with head
 1.12.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.13.60.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.15 22-Jan-2013  dholland Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
ROOTINO -> UFS_ROOTINO
WINO -> UFS_WINO
NXADDR -> UFS_NXADDR
NDADDR -> UFS_NDADDR
NIADDR -> UFS_NIADDR
MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.

No functional change intended.
 1.14 21-Feb-2011  itohy branches: 1.14.4; 1.14.14;
Cleanup my copyright notice.
 1.13 18-Mar-2009  cegger branches: 1.13.4; 1.13.6; 1.13.8;
Ansify function definitions w/o arguments. Generated with sed.
 1.12 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.11 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.10 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.9 12-Jan-2009  tsutsui branches: 1.9.2;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.8 04-Mar-2007  christos branches: 1.8.40; 1.8.44; 1.8.52;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.7 11-Dec-2005  christos branches: 1.7.26;
merge ktrace-lwp.
 1.6 25-Aug-2005  he Make these first-stage boot loaders use a locally-defined ino32_t
instead of introducing 64-bit operations in these space-constrained
pieces of code with the recent change to ino_t. This is patterned
slightly after recent changes to libsa's ufs.c.

Approved by christos.
 1.5 04-Dec-2003  keihan branches: 1.5.16;
netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.4 09-Apr-2003  itohy branches: 1.4.2;
Support UFS2 format for FFS.
 1.3 24-Jan-2003  fvdl Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
 1.2 17-Mar-2002  minoura LFSv2 support.
Note that secondary boot does not support LFSv2.
Code written by itohy.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file readufs.c was added on branch kqueue on 2002-01-10 19:50:29 +0000
 1.1.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.4.1 27-Sep-2001  nathanw file readufs.c was added on branch nathanw_sa on 2002-04-01 07:43:43 +0000
 1.4.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.2 03-Sep-2007  yamt sync with head.
 1.5.16.1 21-Jun-2006  yamt sync with head.
 1.7.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.52.2 28-Apr-2009  skrll Sync with HEAD.
 1.8.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.44.1 04-May-2009  yamt sync with head.
 1.8.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.9.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.13.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.13.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.13.4.1 05-Mar-2011  rmind sync with head
 1.14.14.1 25-Feb-2013  tls resync with head
 1.14.4.1 23-Jan-2013  yamt sync with head
 1.13 21-Aug-2015  christos fix build (dholland)
 1.12 18-Jun-2013  christos branches: 1.12.10;
Prefix most of the cpp macros with lfs_ and LFS_ to avoid conflicts with ffs.
This was done so that boot blocks that want to compile both FFS and LFS in
the same file work.
 1.11 15-Jun-2013  christos adjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs split
 1.10 21-Feb-2011  itohy branches: 1.10.4; 1.10.14;
Cleanup my copyright notice.
 1.9 14-Mar-2009  dsl branches: 1.9.4; 1.9.6; 1.9.8;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.8 11-Dec-2005  christos branches: 1.8.78; 1.8.86; 1.8.92;
merge ktrace-lwp.
 1.7 25-Aug-2005  he Make these first-stage boot loaders use a locally-defined ino32_t
instead of introducing 64-bit operations in these space-constrained
pieces of code with the recent change to ino_t. This is patterned
slightly after recent changes to libsa's ufs.c.

Approved by christos.
 1.6 04-Dec-2003  keihan branches: 1.6.16;
netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.5 22-Oct-2003  itohy Fix in debug code (no functional changes).
 1.4 09-Apr-2003  itohy branches: 1.4.2;
Support UFS2 format for FFS.
 1.3 24-Jan-2003  fvdl Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
 1.2 17-Mar-2002  minoura LFSv2 support.
Note that secondary boot does not support LFSv2.
Code written by itohy.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file readufs.h was added on branch kqueue on 2002-01-10 19:50:29 +0000
 1.1.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.4.1 27-Sep-2001  nathanw file readufs.h was added on branch nathanw_sa on 2002-04-01 07:43:44 +0000
 1.4.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.8.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.8.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.8.78.1 04-May-2009  yamt sync with head.
 1.9.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.9.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.4.1 05-Mar-2011  rmind sync with head
 1.10.14.2 03-Dec-2017  jdolecek update from HEAD
 1.10.14.1 23-Jun-2013  tls resync from head
 1.10.4.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.12.10.1 22-Sep-2015  skrll Sync with HEAD
 1.15 17-Nov-2022  chs Restore backward compatibility of UFS2 with previous NetBSD releases by
disabling support in UFS2 for extended attributes (including ACLs).
Add a new variant of UFS2 called "UFS2ea" that does support extended attributes.
Add new fsck_ffs operations "-c ea" and "-c no-ea" to convert file systems
from UFS2 to UFS2ea and vice-versa (both of which delete all existing extended
attributes in the process).
 1.14 23-Jun-2013  dholland fsbtodb() -> FFS_FSBTODB(), EXT2_FSBTODB(), or MFS_FSBTODB()
dbtofsb() -> FFS_DBTOFSB() or EXT2_DBTOFSB()

(Christos already did the lfs ones a few days back)
 1.13 21-Feb-2011  itohy branches: 1.13.4; 1.13.14;
Cleanup my copyright notice.
 1.12 18-Mar-2009  cegger branches: 1.12.4; 1.12.6; 1.12.8;
Ansify function definitions w/o arguments. Generated with sed.
 1.11 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.10 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.9 11-Dec-2005  christos branches: 1.9.78; 1.9.86; 1.9.92;
merge ktrace-lwp.
 1.8 25-Aug-2005  he Make these first-stage boot loaders use a locally-defined ino32_t
instead of introducing 64-bit operations in these space-constrained
pieces of code with the recent change to ino_t. This is patterned
slightly after recent changes to libsa's ufs.c.

Approved by christos.
 1.7 27-Mar-2004  dsl branches: 1.7.16;
Rework previous to avoid checking FS_FLAGS_UPDATED for ffsv2
 1.6 21-Mar-2004  dsl A better fix for PR kern/24809, old filesystems should work ok now!
 1.5 20-Mar-2004  dsl When searching for the superblock, check that the fs_sblockloc field
matches the location we read it from to ensure we don't have one of the
alternate superblocks.
Fixes part of PR kern/24809
 1.4 04-Dec-2003  keihan netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.3 09-Apr-2003  itohy branches: 1.3.2;
Support UFS2 format for FFS.
 1.2 17-Mar-2002  minoura LFSv2 support.
Note that secondary boot does not support LFSv2.
Code written by itohy.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file readufs_ffs.c was added on branch kqueue on 2002-01-10 19:50:29 +0000
 1.1.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.4.1 27-Sep-2001  nathanw file readufs_ffs.c was added on branch nathanw_sa on 2002-04-01 07:43:44 +0000
 1.3.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.9.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.9.78.1 04-May-2009  yamt sync with head.
 1.12.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.12.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.12.4.1 05-Mar-2011  rmind sync with head
 1.13.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.4.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.18 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.17 21-Aug-2015  christos fix build (dholland)
 1.16 28-Jul-2015  christos fix build
 1.15 09-Dec-2013  wiz branches: 1.15.6;
Fix typo ("then" instead of "than")
 1.14 18-Jun-2013  christos branches: 1.14.2;
Prefix most of the cpp macros with lfs_ and LFS_ to avoid conflicts with ffs.
This was done so that boot blocks that want to compile both FFS and LFS in
the same file work.
 1.13 15-Jun-2013  christos adjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs split
 1.12 21-Feb-2011  itohy branches: 1.12.4; 1.12.14;
Cleanup my copyright notice.
 1.11 18-Mar-2009  cegger branches: 1.11.4; 1.11.6; 1.11.8;
Ansify function definitions w/o arguments. Generated with sed.
 1.10 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.9 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.8 11-Dec-2005  christos branches: 1.8.78; 1.8.86; 1.8.92;
merge ktrace-lwp.
 1.7 25-Aug-2005  he Make these first-stage boot loaders use a locally-defined ino32_t
instead of introducing 64-bit operations in these space-constrained
pieces of code with the recent change to ino_t. This is patterned
slightly after recent changes to libsa's ufs.c.

Approved by christos.
 1.6 04-Dec-2003  keihan branches: 1.6.16;
netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.5 22-Oct-2003  itohy Fix in debug code (no functional changes).
 1.4 09-Apr-2003  itohy branches: 1.4.2;
Support UFS2 format for FFS.
 1.3 24-Jan-2003  fvdl Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
 1.2 17-Mar-2002  minoura LFSv2 support.
Note that secondary boot does not support LFSv2.
Code written by itohy.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file readufs_lfs.c was added on branch kqueue on 2002-01-10 19:50:29 +0000
 1.1.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.4.1 27-Sep-2001  nathanw file readufs_lfs.c was added on branch nathanw_sa on 2002-04-01 07:43:44 +0000
 1.4.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.8.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.8.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.8.78.1 04-May-2009  yamt sync with head.
 1.11.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.11.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.4.1 05-Mar-2011  rmind sync with head
 1.12.14.3 03-Dec-2017  jdolecek update from HEAD
 1.12.14.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.14.1 23-Jun-2013  tls resync from head
 1.12.4.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.14.2.1 18-May-2014  rmind sync with head
 1.15.6.1 22-Sep-2015  skrll Sync with HEAD
 1.4 18-Jan-2020  isaki Initialize the screen in all primary bootloaders.
- Some IPL (or boot selector) don't do it, but current secondary bootloader
expects the screen to be initialized to display logo.
To keep messages (like version signature) displayed by primary bootloader,
this initialization should be done early in all primary bootloaders.
- For boot_ustar.S, relocates some registers to save bootinfo (%d0).
- Bumps version.

Confirmed on X68030+060turbo and my X68030. This problem was found on
X68030+060turbo at NetBSD booth in OSC 2011 Hiroshima (8+ years ago).
 1.3 12-Jan-2020  isaki Fix broken RCS NetBSD tag.
 1.2 17-Mar-2002  minoura branches: 1.2.204; 1.2.210;
LFSv2 support.
Note that secondary boot does not support LFSv2.
Code written by itohy.
 1.1 15-Oct-2001  minoura branches: 1.1.4; 1.1.6;
Use newvers_stand.sh to record the version.
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 15-Oct-2001  thorpej file version was added on branch kqueue on 2002-01-10 19:50:30 +0000
 1.1.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.4.1 15-Oct-2001  nathanw file version was added on branch nathanw_sa on 2002-04-01 07:43:44 +0000
 1.2.210.2 25-Jan-2020  ad Sync with head.
 1.2.210.1 17-Jan-2020  ad Sync with head.
 1.2.204.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2 21-Feb-2011  itohy Cleanup my copyright notice.
 1.1 27-Sep-2001  minoura branches: 1.1.2; 1.1.6; 1.1.8; 1.1.152; 1.1.158; 1.1.160;
libsa for the new bootloader of x68k port.
 1.1.160.1 05-Mar-2011  bouyer Sync with HEAD
 1.1.158.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.152.1 05-Mar-2011  rmind sync with head
 1.1.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.8.1 27-Sep-2001  thorpej file chkfmt.s was added on branch kqueue on 2002-01-10 19:50:31 +0000
 1.1.6.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.6.1 27-Sep-2001  minoura file chkfmt.s was added on branch nathanw_sa on 2001-09-27 10:03:28 +0000
 1.1.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.1.2.1 27-Sep-2001  fvdl file chkfmt.s was added on branch thorpej-devvp on 2001-10-01 12:43:07 +0000
 1.3 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.2 27-Sep-2001  minoura branches: 1.2.2; 1.2.6; 1.2.8;
Make these compile with the old (a.out) toolchain.
 1.1 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.2.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.8.1 27-Sep-2001  thorpej file exec_image.S was added on branch kqueue on 2002-01-10 19:50:32 +0000
 1.2.6.2 27-Sep-2001  minoura Make these compile with the old (a.out) toolchain.
 1.2.6.1 27-Sep-2001  minoura file exec_image.S was added on branch nathanw_sa on 2001-09-27 14:08:29 +0000
 1.2.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.2.2.1 27-Sep-2001  fvdl file exec_image.S was added on branch thorpej-devvp on 2001-10-01 12:43:08 +0000
 1.1 27-Sep-2001  minoura branches: 1.1.2; 1.1.6; 1.1.8;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.8.1 27-Sep-2001  thorpej file exec_image.h was added on branch kqueue on 2002-01-10 19:50:32 +0000
 1.1.6.2 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.6.1 27-Sep-2001  minoura file exec_image.h was added on branch nathanw_sa on 2001-09-27 10:14:51 +0000
 1.1.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.1.2.1 27-Sep-2001  fvdl file exec_image.h was added on branch thorpej-devvp on 2001-10-01 12:43:08 +0000
 1.6 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.5 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.4 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.3 24-Dec-2005  perry branches: 1.3.78; 1.3.86; 1.3.92;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.2 10-Dec-2002  thorpej branches: 1.2.22;
Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is.
 1.1 18-May-2002  isaki branches: 1.1.4; 1.1.6; 1.1.8;
Make ELF kernel loadable, by itohy-san.
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 18-May-2002  jdolecek file exec_sub.c was added on branch kqueue on 2002-06-23 17:43:22 +0000
 1.1.6.3 11-Dec-2002  thorpej Sync with HEAD.
 1.1.6.2 20-Jun-2002  nathanw Catch up to -current.
 1.1.6.1 18-May-2002  nathanw file exec_sub.c was added on branch nathanw_sa on 2002-06-20 03:42:34 +0000
 1.1.4.2 30-May-2002  gehenna Catch up with -current.
 1.1.4.1 18-May-2002  gehenna file exec_sub.c was added on branch gehenna-devsw on 2002-05-30 15:36:38 +0000
 1.2.22.1 21-Jun-2006  yamt sync with head.
 1.3.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.3.78.1 04-May-2009  yamt sync with head.
 1.4 21-Feb-2011  itohy Cleanup my copyright notice.
 1.3 18-May-2002  isaki branches: 1.3.136; 1.3.142; 1.3.144;
Make ELF kernel loadable, by itohy-san.
 1.2 12-Jun-2001  minoura branches: 1.2.2; 1.2.8; 1.2.16;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.1 01-Sep-1998  itohy branches: 1.1.26;
Files used in common.
 1.1.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.16.1 30-May-2002  gehenna Catch up with -current.
 1.2.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.2.8.1 12-Jun-2001  nathanw file execkern.S was added on branch nathanw_sa on 2002-06-20 03:42:34 +0000
 1.2.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.144.1 05-Mar-2011  bouyer Sync with HEAD
 1.3.142.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.136.1 05-Mar-2011  rmind sync with head
 1.5 21-Feb-2011  itohy Cleanup my copyright notice.
 1.4 14-Mar-2009  dsl branches: 1.4.4; 1.4.6; 1.4.8;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.3 24-Dec-2007  perry branches: 1.3.10; 1.3.18; 1.3.24;
Remove __attribute__((__noreturn__)) from things already marked __dead
Found by the department of redundancy department.
 1.2 18-May-2002  isaki branches: 1.2.24; 1.2.86; 1.2.96; 1.2.100;
Make ELF kernel loadable, by itohy-san.
 1.1 01-Sep-1998  itohy branches: 1.1.28; 1.1.32; 1.1.40;
Files used in common.
 1.1.40.1 30-May-2002  gehenna Catch up with -current.
 1.1.32.1 20-Jun-2002  nathanw Catch up to -current.
 1.1.28.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.100.1 02-Jan-2008  bouyer Sync with HEAD
 1.2.96.1 26-Dec-2007  ad Sync with head.
 1.2.86.1 09-Jan-2008  matt sync with HEAD
 1.2.24.1 21-Jan-2008  yamt sync with head
 1.3.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.18.1 28-Apr-2009  skrll Sync with HEAD.
 1.3.10.1 04-May-2009  yamt sync with head.
 1.4.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.4.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.4.1 05-Mar-2011  rmind sync with head
 1.4 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 11-Nov-1999  itohy branches: 1.2.156; 1.2.162; 1.2.164;
Make it build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
Files used in common.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.164.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.162.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.156.1 05-Mar-2011  rmind sync with head
 1.5 21-Feb-2011  itohy Cleanup my copyright notice.
 1.4 14-Mar-2009  dsl branches: 1.4.4; 1.4.6; 1.4.8;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.3 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.2 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.1 01-Sep-1998  itohy branches: 1.1.154; 1.1.162; 1.1.168;
Files used in common.
 1.1.168.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.162.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.154.1 04-May-2009  yamt sync with head.
 1.4.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.4.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.4.1 05-Mar-2011  rmind sync with head
 1.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 14-Mar-2009  dsl branches: 1.2.4; 1.2.6; 1.2.8;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.1 01-Sep-1998  itohy branches: 1.1.154; 1.1.162; 1.1.168;
Files used in common.
 1.1.168.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.162.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.154.1 04-May-2009  yamt sync with head.
 1.2.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.4.1 05-Mar-2011  rmind sync with head
 1.5 27-Aug-2002  lukem arch/*/stand stuff should be LDSTATIC=-static and not LDSTATIC?=-static.
It doesn't make sense to have standalone stuff dynamically linked just
because an end-user uses LDSTATIC="".
 1.4 27-Jan-2002  minoura branches: 1.4.8;
Install as /usr/mdec/install instead of installboot.new.
 1.3 12-Dec-2001  tv branches: 1.3.2;
MKfoo=no -> NOfoo
 1.2 02-Dec-2001  minoura Install as installboot.new.
 1.1 24-Nov-2001  minoura C version of installboot(8).
Shell script version required sed, od, etc. which were too big for install
media.
 1.3.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.3.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 12-Dec-2001  thorpej file Makefile was added on branch kqueue on 2002-01-10 19:50:32 +0000
 1.4.8.1 31-Aug-2002  gehenna catch up with -current.
 1.6 14-Oct-2012  tsutsui Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.5 23-Sep-2006  pavel branches: 1.5.90; 1.5.96; 1.5.100;
Replace wrong tests for character device (st.st_mode & S_IFCHR) by
S_ISCHR. Originally discovered by Paul Stoeber in OpenBSD.

OK elad@.
 1.4 04-Aug-2006  mhitch branches: 1.4.4; 1.4.6;
gcc4 fix: need to cast string variable.
 1.3 25-Nov-2001  minoura branches: 1.3.2; 1.3.34; 1.3.48; 1.3.52;
One more floppy fix.
 1.2 24-Nov-2001  minoura Remove debug messages.
Fix bogus floppy check.
 1.1 24-Nov-2001  minoura C version of installboot(8).
Shell script version required sed, od, etc. which were too big for install
media.
 1.3.52.1 11-Aug-2006  yamt sync with head
 1.3.48.1 09-Sep-2006  rpaulo sync with head
 1.3.34.1 30-Dec-2006  yamt sync with head.
 1.3.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 25-Nov-2001  thorpej file installboot.c was added on branch kqueue on 2002-01-10 19:50:33 +0000
 1.4.6.1 22-Oct-2006  yamt sync with head
 1.4.4.1 18-Nov-2006  ad Sync with head.
 1.5.100.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.96.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.5.90.1 30-Oct-2012  yamt sync with head
 1.13 26-May-2013  isaki Fix failed substitution in 1.10 (christos@) and
revert 1.12 (christos@) which was necessary by broken 1.10.
 1.12 24-May-2013  christos Add missing functions needed by loadbsd.
 1.11 24-May-2013  christos fix progress printing.
 1.10 24-May-2013  christos Don't play tricks trying to shortcut source rules because it breaks MKDEBUGLIB.
 1.9 12-Jan-2009  tsutsui branches: 1.9.14; 1.9.24;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.8 19-Oct-2008  apb branches: 1.8.2;
Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.7 29-Jun-2006  lukem branches: 1.7.58; 1.7.62; 1.7.68;
Support MAKEVERBOSE
 1.6 12-Dec-2001  tv branches: 1.6.32; 1.6.46; 1.6.50; 1.6.58;
MKfoo=no -> NOfoo
 1.5 14-Nov-2001  tv Work around <bsd.lib.mk> used for kernel libs in other places. Clean up
include paths.
 1.4 11-Nov-1999  itohy branches: 1.4.8; 1.4.12;
Make Human68k DOS library build on ELF toolchain.
 1.3 16-Mar-1999  minoura branches: 1.3.8; 1.3.10; 1.3.14;
Merged minoura_x68k_bus_h branch.
 1.2 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.1 01-Sep-1998  itohy branches: 1.1.6;
Human68k DOS library.
 1.1.6.1 14-Mar-1999  minoura Sync.
 1.3.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.10.1 15-Nov-1999  fvdl Sync with -current
 1.3.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.12.1 08-Jan-2002  nathanw Catch up to -current.
 1.4.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.58.1 13-Jul-2006  gdamore Merge from HEAD.
 1.6.50.1 11-Aug-2006  yamt sync with head
 1.6.46.1 09-Sep-2006  rpaulo sync with head
 1.6.32.1 30-Dec-2006  yamt sync with head.
 1.7.68.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.7.62.1 04-May-2009  yamt sync with head.
 1.7.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.8.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.9.24.1 23-Jun-2013  tls resync from head
 1.9.14.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8 21-Feb-2011  itohy Cleanup my copyright notice.
 1.7 17-Mar-2009  he branches: 1.7.4; 1.7.6; 1.7.8;
Due to the way these files are used, ref. libdos/makedoscalls.awk and
libiocs/makeiocscalls.awk, we need a space between the function name
and the parameter list in the declaration.
 1.6 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.5 24-Dec-2007  perry branches: 1.5.10; 1.5.18; 1.5.24;
Remove __attribute__((__noreturn__)) from things already marked __dead
Found by the department of redundancy department.
 1.4 11-Dec-2005  christos branches: 1.4.50; 1.4.60; 1.4.64;
merge ktrace-lwp.
 1.3 30-Oct-2003  itohy branches: 1.3.16;
Change __const to __pure for function return type.
 1.2 22-Nov-1999  itohy branches: 1.2.28;
Add a bunch of "__attribute__((__packed__))"s
to get along with the ELF compiler.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.20;
Human68k DOS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.28.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 21-Jan-2008  yamt sync with head
 1.4.64.1 02-Jan-2008  bouyer Sync with HEAD
 1.4.60.1 26-Dec-2007  ad Sync with head.
 1.4.50.1 09-Jan-2008  matt sync with HEAD
 1.5.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.18.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.10.1 04-May-2009  yamt sync with head.
 1.7.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.7.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.4.1 05-Mar-2011  rmind sync with head
 1.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 19-Jun-2000  itohy branches: 1.2.4; 1.2.156; 1.2.162; 1.2.164;
Fix weird macro definitions.
They are internal use only and the typos are no harm, you know. :)
 1.1 11-Nov-1999  itohy branches: 1.1.2; 1.1.4; 1.1.6;
Make Human68k DOS library build on ELF toolchain.
 1.1.6.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.2.2 15-Nov-1999  fvdl Sync with -current
 1.1.2.1 11-Nov-1999  fvdl file dos_asm.h was added on branch fvdl-softdep on 1999-11-15 00:39:55 +0000
 1.2.164.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.162.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.156.1 05-Mar-2011  rmind sync with head
 1.2.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.4.1 19-Jun-2000  bouyer file dos_asm.h was added on branch thorpej_scsipi on 2000-11-20 20:30:12 +0000
 1.2 21-Feb-2011  itohy Cleanup my copyright notice.
 1.1 11-Nov-1999  itohy branches: 1.1.2; 1.1.4; 1.1.10; 1.1.162; 1.1.168; 1.1.170;
Make Human68k DOS library build on ELF toolchain.
 1.1.170.1 05-Mar-2011  bouyer Sync with HEAD
 1.1.168.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.162.1 05-Mar-2011  rmind sync with head
 1.1.10.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.10.1 11-Nov-1999  bouyer file dos_cerror.S was added on branch thorpej_scsipi on 2000-11-20 20:30:13 +0000
 1.1.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.2.2 15-Nov-1999  fvdl Sync with -current
 1.1.2.1 11-Nov-1999  fvdl file dos_cerror.S was added on branch fvdl-softdep on 1999-11-15 00:39:56 +0000
 1.2 11-Nov-1999  itohy Make Human68k DOS library build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
Human68k DOS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.1 01-Sep-1998  itohy Human68k DOS library.
 1.6 21-Feb-2011  itohy Cleanup my copyright notice.
 1.5 14-Mar-2009  dsl branches: 1.5.4; 1.5.6; 1.5.8;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.4 24-Dec-2005  perry branches: 1.4.78; 1.4.86; 1.4.92;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.3 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.2 11-Nov-1999  itohy branches: 1.2.44;
Make Human68k DOS library build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
Human68k DOS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.44.1 21-Jun-2006  yamt sync with head.
 1.4.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.4.78.1 04-May-2009  yamt sync with head.
 1.5.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.5.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.4.1 05-Mar-2011  rmind sync with head
 1.2 21-Feb-2011  itohy Cleanup my copyright notice.
 1.1 11-Nov-1999  itohy branches: 1.1.2; 1.1.4; 1.1.10; 1.1.162; 1.1.168; 1.1.170;
Make Human68k DOS library build on ELF toolchain.
 1.1.170.1 05-Mar-2011  bouyer Sync with HEAD
 1.1.168.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.162.1 05-Mar-2011  rmind sync with head
 1.1.10.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.10.1 11-Nov-1999  bouyer file dos_procerr.S was added on branch thorpej_scsipi on 2000-11-20 20:30:14 +0000
 1.1.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.2.2 15-Nov-1999  fvdl Sync with -current
 1.1.2.1 11-Nov-1999  fvdl file dos_procerr.S was added on branch fvdl-softdep on 1999-11-15 00:39:56 +0000
 1.2 11-Nov-1999  itohy Make Human68k DOS library build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
Human68k DOS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 05-Jul-2001  toshii branches: 1.2.8; 1.2.152; 1.2.158; 1.2.160;
Fix typo. s/extention/extension/
 1.1 11-Nov-1999  itohy branches: 1.1.2; 1.1.4; 1.1.10;
Make Human68k DOS library build on ELF toolchain.
 1.1.10.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.10.1 11-Nov-1999  bouyer file dos_rename.S was added on branch thorpej_scsipi on 2000-11-20 20:30:14 +0000
 1.1.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.2.2 15-Nov-1999  fvdl Sync with -current
 1.1.2.1 11-Nov-1999  fvdl file dos_rename.S was added on branch fvdl-softdep on 1999-11-15 00:39:57 +0000
 1.2.160.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.158.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.152.1 05-Mar-2011  rmind sync with head
 1.2.8.2 05-Jul-2001  toshii Fix typo. s/extention/extension/
 1.2.8.1 05-Jul-2001  toshii file dos_rename.S was added on branch nathanw_sa on 2001-07-05 08:38:27 +0000
 1.2 11-Nov-1999  itohy Make Human68k DOS library build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
Human68k DOS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.4 21-Feb-2011  itohy Cleanup my copyright notice.
 1.3 19-Jun-2000  itohy branches: 1.3.154; 1.3.160; 1.3.162;
Store return value to a0 before calling CERROR function if __SVR4_ABI__.
 1.2 11-Nov-1999  itohy branches: 1.2.2;
Make Human68k DOS library build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
Human68k DOS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.162.1 05-Mar-2011  bouyer Sync with HEAD
 1.3.160.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.154.1 05-Mar-2011  rmind sync with head
 1.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 11-Nov-1999  itohy branches: 1.2.156; 1.2.162; 1.2.164;
Make Human68k DOS library build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
Human68k DOS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.164.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.162.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.156.1 05-Mar-2011  rmind sync with head
 1.11 24-May-2013  christos fix more of the same kind of shortcut rule lossage
 1.10 12-Jan-2009  tsutsui branches: 1.10.14; 1.10.24;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.9 19-Oct-2008  apb branches: 1.9.2;
Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.8 29-Jun-2006  lukem branches: 1.8.58; 1.8.62; 1.8.68;
Support MAKEVERBOSE
 1.7 12-Dec-2001  tv branches: 1.7.32; 1.7.46; 1.7.50; 1.7.58;
MKfoo=no -> NOfoo
 1.6 14-Nov-2001  tv Work around <bsd.lib.mk> used for kernel libs in other places. Clean up
include paths.
 1.5 19-Oct-2000  minoura branches: 1.5.4; 1.5.8;
Use up-to-date (newly installed) header files when DESTDIR is set.
 1.4 11-Nov-1999  itohy branches: 1.4.4;
Make X680x0 IOCS library build on ELF toolchain.
 1.3 16-Mar-1999  minoura branches: 1.3.8; 1.3.10; 1.3.14;
Merged minoura_x68k_bus_h branch.
 1.2 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.1 01-Sep-1998  itohy branches: 1.1.6;
X680x0 IOCS library.
 1.1.6.1 14-Mar-1999  minoura Sync.
 1.3.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.10.1 15-Nov-1999  fvdl Sync with -current
 1.3.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.4.1 22-Oct-2000  tv Pullup 1.5 [minoura]:
Use up-to-date (newly installed) header files when DESTDIR is set.
 1.5.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.5.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.58.1 13-Jul-2006  gdamore Merge from HEAD.
 1.7.50.1 11-Aug-2006  yamt sync with head
 1.7.46.1 09-Sep-2006  rpaulo sync with head
 1.7.32.1 30-Dec-2006  yamt sync with head.
 1.8.68.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.8.62.1 04-May-2009  yamt sync with head.
 1.8.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.9.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.10.24.1 23-Jun-2013  tls resync from head
 1.10.14.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.9 11-Feb-2014  tsutsui Specify default SCSI inquiry size (36 bytes) on IOCS_S_INQUIRY() command.

X680x0 SCSI IOCS stalls if SCSI device doesn't return inquiry data
of specified allocation length size on the INQUIRY command,
and it causes hangup on the XM6 based emulators that return only
upto 36 byte inquiry data on SCSI disk emulation.

Many real SCSI-2 hard drives seem to support >100 byte inquiry data,
but at least there is a harddisk that returns only supported inquiry
data size and quits transfer.

The bootloader checks only the device type and there is no reason
to read 100 bytes that includes vender specific data.

Analyzed and reported by GIMONS, a developer of XM6 TypeG emulator,
which also can run NetBSD/x68k.
 1.8 21-Feb-2011  itohy branches: 1.8.4; 1.8.14; 1.8.18;
Cleanup my copyright notice.
 1.7 17-Mar-2009  he branches: 1.7.4; 1.7.6; 1.7.8;
Due to the way these files are used, ref. libdos/makedoscalls.awk and
libiocs/makeiocscalls.awk, we need a space between the function name
and the parameter list in the declaration.
 1.6 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.5 24-Dec-2007  perry branches: 1.5.10; 1.5.18; 1.5.24;
Remove __attribute__((__noreturn__)) from things already marked __dead
Found by the department of redundancy department.
 1.4 24-Dec-2005  perry branches: 1.4.50; 1.4.60; 1.4.64;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.3 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.2 22-Nov-1999  itohy branches: 1.2.44;
Add a bunch of "__attribute__((__packed__))"s
to get along with the ELF compiler.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.20;
X680x0 IOCS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.44.2 21-Jan-2008  yamt sync with head
 1.2.44.1 21-Jun-2006  yamt sync with head.
 1.4.64.1 02-Jan-2008  bouyer Sync with HEAD
 1.4.60.1 26-Dec-2007  ad Sync with head.
 1.4.50.1 09-Jan-2008  matt sync with HEAD
 1.5.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.18.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.10.1 04-May-2009  yamt sync with head.
 1.7.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.7.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.4.1 05-Mar-2011  rmind sync with head
 1.8.18.1 18-May-2014  rmind sync with head
 1.8.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.4.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.2 18-Jan-2020  isaki Initialize the screen in all primary bootloaders.
- Some IPL (or boot selector) don't do it, but current secondary bootloader
expects the screen to be initialized to display logo.
To keep messages (like version signature) displayed by primary bootloader,
this initialization should be done early in all primary bootloaders.
- For boot_ustar.S, relocates some registers to save bootinfo (%d0).
- Bumps version.

Confirmed on X68030+060turbo and my X68030. This problem was found on
X68030+060turbo at NetBSD booth in OSC 2011 Hiroshima (8+ years ago).
 1.1 27-Sep-2001  minoura branches: 1.1.2; 1.1.6; 1.1.8; 1.1.214; 1.1.220;
libsa for the new bootloader of x68k port.
 1.1.220.1 25-Jan-2020  ad Sync with head.
 1.1.214.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.8.1 27-Sep-2001  thorpej file iocscall.h was added on branch kqueue on 2002-01-10 19:50:33 +0000
 1.1.6.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.6.1 27-Sep-2001  minoura file iocscall.h was added on branch nathanw_sa on 2001-09-27 10:03:28 +0000
 1.1.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.1.2.1 27-Sep-2001  fvdl file iocscall.h was added on branch thorpej-devvp on 2001-10-01 12:43:09 +0000
 1.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 11-Nov-1999  itohy branches: 1.2.156; 1.2.162; 1.2.164;
Make X680x0 IOCS library build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
X680x0 IOCS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.164.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.162.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.156.1 05-Mar-2011  rmind sync with head
 1.3 11-Feb-2014  tsutsui Remove unused inline version of SCSI IOCS functions.
 1.2 24-Dec-2005  perry branches: 1.2.112; 1.2.122; 1.2.128;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.1 27-Sep-2001  minoura branches: 1.1.2; 1.1.6; 1.1.8; 1.1.40;
libsa for the new bootloader of x68k port.
 1.1.40.1 21-Jun-2006  yamt sync with head.
 1.1.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.8.1 27-Sep-2001  thorpej file scsi.h was added on branch kqueue on 2002-01-10 19:50:34 +0000
 1.1.6.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.6.1 27-Sep-2001  minoura file scsi.h was added on branch nathanw_sa on 2001-09-27 10:03:28 +0000
 1.1.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.1.2.1 27-Sep-2001  fvdl file scsi.h was added on branch thorpej-devvp on 2001-10-01 12:43:10 +0000
 1.2.128.1 18-May-2014  rmind sync with head
 1.2.122.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.112.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.31 17-Jan-2016  tsutsui Enable LIBSA_CREAD_NOCRC. PR/50638

Bump version to denote user visible change.
XXX: recent visible changes (memsize probe, SRAM switch command)
were not denoted in versions
Tested on (real) X68030.
 1.30 25-Jul-2015  isaki sysinst is 15*2 sect/cyl (fdXc), not 8*2 sect/cyl (it's fdXa,
DOS compatible). It makes the loading of sysinst a bit faster.
Pointed out by Yosuke Sugahara.
 1.29 12-Oct-2012  tsutsui branches: 1.29.14;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.28 25-Dec-2011  tsutsui branches: 1.28.2; 1.28.6;
Apply the following patch submitted by Evgeniy Ivanov:
http://mail-index.NetBSD.org/tech-kern/2011/12/15/msg012226.html
http://mail-index.NetBSD.org/tech-kern/2011/12/17/msg012229.html

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

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

XXX1: "ls" op in fs_ops looks a bit inconsistent, but we will be able to
replace it with real fs ops like readdir if it's really worth
XXX2: someone might have to check sys/arch/ia64/stand/efi/libefi/efifs_ls.c
 1.27 11-Oct-2011  tsutsui branches: 1.27.2; 1.27.6;
Fix "Error occurs, please reset" boot problem on
X68030 + 060turbo in 060 mode, found on NetBSD booth
at OSC 2011 Hiroshima:

- use -D__daddr_t=int32_t for all bootloader files
to avoid 64 bit ops in FFS
- explicitly specify -m68020-60 to avoid 64 bit mulsl/mulul
instructions which need to be handled by 060SP emulation
but not available in 060turbo IPL ROM
(LFS still has uint64_t members even with 32bit daddr_t)

The problem was investigated (at least 1.6.2 bootloaders worked)
by Yasushi Oshima at OSC booth, and fixes have been confirmed
by Y.Sugahara on his 060turbo. Thanks everyone!

Should also be pulled up to netbsd-5.
 1.26 12-Apr-2011  tsutsui Make x68k bootloader to use MI libsa, libkern, and libz Makefiles in
src/sys/lib dirs for maintainability. Tested on X68030, ok from isaki@.
 1.25 19-Mar-2009  tsutsui branches: 1.25.4; 1.25.6;
Remove bcmp() from MD libsa.

XXX: These ports should be rewritten to use MI libsa for maintainability.
 1.24 12-Jan-2009  tsutsui branches: 1.24.2;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.23 28-Nov-2008  he We now also need globals.c from the common libsa.
 1.22 11-Nov-2007  isaki branches: 1.22.14; 1.22.18; 1.22.24; 1.22.26; 1.22.28;
x68k's floppy is 8*2 sect/cyl, not 18*2 sect/cyl.
 1.21 17-Oct-2007  garbled branches: 1.21.2;
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.
 1.20 23-Jun-2007  isaki branches: 1.20.8; 1.20.10; 1.20.14;
Remove _ZLIB_PRIVATE that should have been removed 10 years ago.
 1.19 16-Jan-2006  he branches: 1.19.28; 1.19.30; 1.19.36;
Adapt to use of $S/../common/dist/zlib.
 1.18 27-Dec-2005  he branches: 1.18.2;
Make this build again by using ${S}/../common/lib/libc/Makefile.inc,
after the libc/libkern consolidation.
 1.17 11-Dec-2005  christos merge ktrace-lwp.
 1.16 23-Aug-2003  he branches: 1.16.16;
Add memmove.c, needed by new ufs.c.
 1.15 30-Mar-2003  isaki branches: 1.15.2;
Make it compilable.
see http://mail-index.netbsd.org/source-changes/2003/03/26/0009.html
 1.14 23-Feb-2003  simonb Update for LFSv2 support. Ports that have "bootxx_lfs"-style
bootblocks currently only support LFSv2, but the second level
"boot" program supports both LFS versions.
 1.13 02-Feb-2003  isaki - sys/lib/libsa/ufs_ls.c rev 1.3 needs strrchr.
- sort.
 1.12 25-Jan-2003  isaki Make it compilable with 64bit daddr_t.
 1.11 05-May-2002  isaki libsa/Makefile: Fix rules to create symlinks on read-only source tree.
{boot,libsa,mboot}/Makefile, Makefile.booters:
move that common rule to Makefile.booters
 1.10 12-Dec-2001  tv branches: 1.10.2;
MKfoo=no -> NOfoo
 1.9 02-Dec-2001  minoura Do not install libsa.a
 1.8 14-Nov-2001  tv Work around <bsd.lib.mk> used for kernel libs in other places. Clean up
include paths.
 1.7 31-Oct-2001  thorpej branches: 1.7.2;
Build the loadfile() a.out, ECOFF, and ELF back-ends as separate
objects.
 1.6 30-Sep-2001  minoura branches: 1.6.2;
Print daemon image on startup.
(any other missing features?)
 1.5 29-Sep-2001  minoura Implement ls command.
Correct bootdev detection.
Other minor changes.
 1.4 29-Sep-2001  minoura Exclude N/W code.
 1.3 28-Sep-2001  minoura Add changedisk_hook().
 1.2 27-Sep-2001  minoura Add some missing definitions.
 1.1 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.6.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.7.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.7.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.7.2.1 31-Oct-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:28:48 +0000
 1.10.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.10.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.2.1 12-Dec-2001  thorpej file Makefile was added on branch kqueue on 2002-01-10 19:50:34 +0000
 1.15.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.16.16.3 15-Nov-2007  yamt sync with head.
 1.16.16.2 03-Sep-2007  yamt sync with head.
 1.16.16.1 21-Jun-2006  yamt sync with head.
 1.18.2.1 01-Feb-2006  yamt sync with head.
 1.19.36.1 26-Jun-2007  garbled Sync with HEAD.
 1.19.30.1 11-Jul-2007  mjf Sync with head.
 1.19.28.2 03-Dec-2007  ad Sync with HEAD.
 1.19.28.1 15-Jul-2007  ad Sync with head.
 1.20.14.1 13-Nov-2007  bouyer Sync with HEAD
 1.20.10.2 09-Jan-2008  matt sync with HEAD
 1.20.10.1 06-Nov-2007  matt sync with HEAD
 1.20.8.1 11-Nov-2007  joerg Sync with HEAD.
 1.21.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.22.28.1 17-Mar-2012  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1731):
sys/arch/x68k/stand/boot_ufs/Makefile: revision 1.26 via patch
sys/arch/x68k/stand/boot/version: revision 1.4 via patch
sys/arch/x68k/stand/libsa/Makefile: revision 1.27 via patch
sys/arch/x68k/stand/Makefile.booters: revision 1.7 via patch
sys/arch/x68k/stand/boot_ustar/Makefile: revision 1.19 via patch
Fix "Error occurs, please reset" boot problem on
X68030 + 060turbo in 060 mode, found on NetBSD booth
at OSC 2011 Hiroshima:
- use -D__daddr_t=int32_t for all bootloader files
to avoid 64 bit ops in FFS
- explicitly specify -m68020-60 to avoid 64 bit mulsl/mulul
instructions which need to be handled by 060SP emulation
but not available in 060turbo IPL ROM
(LFS still has uint64_t members even with 32bit daddr_t)
The problem was investigated (at least 1.6.2 bootloaders worked)
by Yasushi Oshima at OSC booth, and fixes have been confirmed
by Y.Sugahara on his 060turbo. Thanks everyone!
Should also be pulled up to netbsd-5.
Bump version to denote 060turbo boot fix.
 1.22.26.2 28-Apr-2009  skrll Sync with HEAD.
 1.22.26.1 19-Jan-2009  skrll Sync with HEAD.
 1.22.24.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.22.18.1 04-May-2009  yamt sync with head.
 1.22.14.1 17-Jan-2009  mjf Sync with HEAD.
 1.24.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.25.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.25.4.1 21-Apr-2011  rmind sync with head
 1.27.6.1 18-Feb-2012  mrg merge to -current.
 1.27.2.2 30-Oct-2012  yamt sync with head
 1.27.2.1 17-Apr-2012  yamt sync with head
 1.28.6.2 03-Dec-2017  jdolecek update from HEAD
 1.28.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.28.2.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.29.14.2 19-Mar-2016  skrll Sync with HEAD
 1.29.14.1 22-Sep-2015  skrll Sync with HEAD
 1.2 12-Oct-2012  tsutsui First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1 12-Apr-2011  tsutsui branches: 1.1.2; 1.1.6; 1.1.8; 1.1.14; 1.1.18;
Make x68k bootloader to use MI libsa, libkern, and libz Makefiles in
src/sys/lib dirs for maintainability. Tested on X68030, ok from isaki@.
 1.1.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.14.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.1.8.1 30-Oct-2012  yamt sync with head
 1.1.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.1.6.1 12-Apr-2011  jruoho file Makefile.inc was added on branch jruoho-x86intr on 2011-06-06 09:07:03 +0000
 1.1.2.2 21-Apr-2011  rmind sync with head
 1.1.2.1 12-Apr-2011  rmind file Makefile.inc was added on branch rmind-uvmplock on 2011-04-21 01:41:31 +0000
 1.4 11-Apr-2011  tsutsui Some KNF. No binary change.
 1.3 07-Apr-2011  isaki Poll the next medium on both drive of #0 and #1.
 1.2 12-Jan-2009  tsutsui branches: 1.2.6; 1.2.8;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.1 28-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.124; 1.1.128; 1.1.136;
Add changedisk_hook().
 1.1.136.1 19-Jan-2009  skrll Sync with HEAD.
 1.1.128.1 04-May-2009  yamt sync with head.
 1.1.124.1 17-Jan-2009  mjf Sync with HEAD.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 28-Sep-2001  thorpej file chdsk.c was added on branch kqueue on 2002-01-10 19:50:34 +0000
 1.1.4.2 28-Sep-2001  minoura Add changedisk_hook().
 1.1.4.1 28-Sep-2001  minoura file chdsk.c was added on branch nathanw_sa on 2001-09-28 15:19:34 +0000
 1.2.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 21-Apr-2011  rmind sync with head
 1.6 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.5 21-Nov-2014  christos put back missing paren.
 1.4 20-Nov-2014  christos This now needs clock.h
 1.3 17-Nov-2014  christos PR/49207: Kamil Rytarowski: Add sys/clock.h with generic time macros
(derived from clock_subr.h). Keep clock_subr.h with the kernel structures
and functions to reduce diffs, and have clock.h only include standalone
constants and macros.
 1.2 01-Nov-2012  isaki branches: 1.2.2; 1.2.4;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file clock.c was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.4.3 03-Dec-2017  jdolecek update from HEAD
 1.2.4.2 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.4.1 01-Nov-2012  tls file clock.c was added on branch tls-maxphys on 2012-11-20 03:01:50 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file clock.c was added on branch netbsd-6 on 2012-11-18 19:05:20 +0000
 1.12 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.11 17-Oct-2014  snj There's an r in "determine"
 1.10 12-Oct-2012  tsutsui Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.

The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
 1.9 17-Jul-2011  joerg branches: 1.9.2; 1.9.8; 1.9.12;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.8 12-Apr-2011  tsutsui Make x68k bootloader to use MI libsa, libkern, and libz Makefiles in
src/sys/lib dirs for maintainability. Tested on X68030, ok from isaki@.
 1.7 11-Apr-2011  tsutsui Some KNF. No binary change.
 1.6 11-Apr-2011  tsutsui Add missing breaks. No need to output to SERIAL on ITE console.
 1.5 11-Nov-2007  isaki branches: 1.5.40; 1.5.46;
Style fix.
 1.4 02-Dec-2001  minoura branches: 1.4.2; 1.4.34; 1.4.76; 1.4.94; 1.4.96; 1.4.100; 1.4.102;
Small message fixes.
 1.3 30-Sep-2001  minoura branches: 1.3.4;
Print daemon image on startup.
(any other missing features?)
 1.2 28-Sep-2001  minoura Message cosmetics.
 1.1 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.3.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.4.1 30-Sep-2001  nathanw file consio.c was added on branch nathanw_sa on 2002-01-08 00:28:48 +0000
 1.4.102.1 19-Nov-2007  mjf Sync with HEAD.
 1.4.100.1 13-Nov-2007  bouyer Sync with HEAD
 1.4.96.1 09-Jan-2008  matt sync with HEAD
 1.4.94.1 11-Nov-2007  joerg Sync with HEAD.
 1.4.76.1 03-Dec-2007  ad Sync with HEAD.
 1.4.34.1 15-Nov-2007  yamt sync with head.
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 02-Dec-2001  thorpej file consio.c was added on branch kqueue on 2002-01-10 19:50:35 +0000
 1.5.46.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.40.1 21-Apr-2011  rmind sync with head
 1.9.12.2 03-Dec-2017  jdolecek update from HEAD
 1.9.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.9.8.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.9.2.1 30-Oct-2012  yamt sync with head
 1.3 11-Apr-2011  tsutsui Some KNF. No binary change.
 1.2 11-Apr-2011  tsutsui Fix pasto. Now serial console output on bootloader works properly
after ~decade. ok from minoura@
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.150; 1.1.156;
libsa for the new bootloader of x68k port.
 1.1.156.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.150.1 21-Apr-2011  rmind sync with head
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file consio.h was added on branch kqueue on 2002-01-10 19:50:35 +0000
 1.1.4.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.4.1 27-Sep-2001  minoura file consio.h was added on branch nathanw_sa on 2001-09-27 10:03:28 +0000
 1.7 26-Jun-2016  isaki Add SCSI host adaptor selector to "boot" command of /boot.
By this function, /boot which booted from non-SCSI
(in other words, floppy) can load SCSI kernel.
Now, single /boot can load kernel of all supported filesystems
of all supported boot devices.

---
New "boot" command's syntax is: boot [hostadaptor@][dev:][file]

If you booted from SCSI, hostadaptor is already set (from IOCS)
and you can omit hostadaptor in this case. You can type like
"boot sd0a:netbsd" as before.

If you booted from floppy (hostadaptor is not set) and want to
load the SCSI kernel (hostadaptor is needed), you have to select
your hostadaptor in boot command, like "boot spc0@sd0a:netbsd".
 1.6 12-Oct-2012  tsutsui branches: 1.6.14;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.5 11-Apr-2011  tsutsui branches: 1.5.4; 1.5.10; 1.5.14;
Some KNF. No binary change.
 1.4 11-Nov-2007  isaki branches: 1.4.40; 1.4.46;
Style fix.
 1.3 10-May-2006  skrll branches: 1.3.18; 1.3.36; 1.3.38; 1.3.42; 1.3.44;
Fix a bunch of cast lvalues.
 1.2 29-Sep-2001  minoura branches: 1.2.4; 1.2.6; 1.2.38; 1.2.52; 1.2.54; 1.2.56; 1.2.58; 1.2.60;
Implement ls command.
Correct bootdev detection.
Other minor changes.
 1.1 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.2.60.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.58.1 11-May-2006  elad sync with head
 1.2.56.1 24-May-2006  yamt sync with head.
 1.2.54.1 01-Jun-2006  kardel Sync with head.
 1.2.52.1 09-Sep-2006  rpaulo sync with head
 1.2.38.2 15-Nov-2007  yamt sync with head.
 1.2.38.1 21-Jun-2006  yamt sync with head.
 1.2.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.6.1 29-Sep-2001  thorpej file devopen.c was added on branch kqueue on 2002-01-10 19:50:35 +0000
 1.2.4.2 29-Sep-2001  minoura Implement ls command.
Correct bootdev detection.
Other minor changes.
 1.2.4.1 29-Sep-2001  minoura file devopen.c was added on branch nathanw_sa on 2001-09-29 03:50:14 +0000
 1.3.44.1 19-Nov-2007  mjf Sync with HEAD.
 1.3.42.1 13-Nov-2007  bouyer Sync with HEAD
 1.3.38.1 09-Jan-2008  matt sync with HEAD
 1.3.36.1 11-Nov-2007  joerg Sync with HEAD.
 1.3.18.1 03-Dec-2007  ad Sync with HEAD.
 1.4.46.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.40.1 21-Apr-2011  rmind sync with head
 1.5.14.2 03-Dec-2017  jdolecek update from HEAD
 1.5.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.10.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.5.4.1 30-Oct-2012  yamt sync with head
 1.6.14.1 09-Jul-2016  skrll Sync with HEAD
 1.9 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.8 08-Mar-2014  isaki Unused variable, for GCC4.8.
 1.7 17-Jul-2011  joerg branches: 1.7.2; 1.7.12; 1.7.16;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.6 11-Apr-2011  tsutsui Some KNF. No binary change.
 1.5 18-Nov-2007  isaki branches: 1.5.40; 1.5.46;
Use the same prototypes as libx68k.h.
 1.4 11-Nov-2007  isaki Style fix.
 1.3 25-Jan-2006  christos branches: 1.3.28; 1.3.46; 1.3.48; 1.3.52; 1.3.54;
free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.2 15-Oct-2001  minoura branches: 1.2.4; 1.2.6; 1.2.38; 1.2.50;
Prepare to set WARNS=2.
 1.1 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.2.50.1 01-Feb-2006  yamt sync with head.
 1.2.38.3 07-Dec-2007  yamt sync with head
 1.2.38.2 15-Nov-2007  yamt sync with head.
 1.2.38.1 21-Jun-2006  yamt sync with head.
 1.2.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.6.1 15-Oct-2001  thorpej file fd.c was added on branch kqueue on 2002-01-10 19:50:36 +0000
 1.2.4.2 15-Oct-2001  minoura Prepare to set WARNS=2.
 1.2.4.1 15-Oct-2001  minoura file fd.c was added on branch nathanw_sa on 2001-10-15 16:13:41 +0000
 1.3.54.1 19-Nov-2007  mjf Sync with HEAD.
 1.3.52.2 18-Nov-2007  bouyer Sync with HEAD
 1.3.52.1 13-Nov-2007  bouyer Sync with HEAD
 1.3.48.1 09-Jan-2008  matt sync with HEAD
 1.3.46.2 21-Nov-2007  joerg Sync with HEAD.
 1.3.46.1 11-Nov-2007  joerg Sync with HEAD.
 1.3.28.1 03-Dec-2007  ad Sync with HEAD.
 1.5.46.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.40.1 21-Apr-2011  rmind sync with head
 1.7.16.1 18-May-2014  rmind sync with head
 1.7.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6;
libsa for the new bootloader of x68k port.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file fdsub.S was added on branch kqueue on 2002-01-10 19:50:36 +0000
 1.1.4.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.4.1 27-Sep-2001  minoura file fdsub.S was added on branch nathanw_sa on 2001-09-27 10:03:29 +0000
 1.2 11-Nov-2007  isaki Style fix.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.38; 1.1.80; 1.1.98; 1.1.100; 1.1.104; 1.1.106;
libsa for the new bootloader of x68k port.
 1.1.106.1 19-Nov-2007  mjf Sync with HEAD.
 1.1.104.1 13-Nov-2007  bouyer Sync with HEAD
 1.1.100.1 09-Jan-2008  matt sync with HEAD
 1.1.98.1 11-Nov-2007  joerg Sync with HEAD.
 1.1.80.1 03-Dec-2007  ad Sync with HEAD.
 1.1.38.1 15-Nov-2007  yamt sync with head.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file fdvar.h was added on branch kqueue on 2002-01-10 19:50:37 +0000
 1.1.4.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.4.1 27-Sep-2001  minoura file fdvar.h was added on branch nathanw_sa on 2001-09-27 10:03:29 +0000
 1.8 23-Jun-2022  isaki x68k/stand: Merge {sd,cd}strategy and {sd,cd}close respectively.
For sd and cd devs, only open differs and the rest is the same.
No functional changes intended.
Suggested by tsutsui@ at port-x68k.
 1.7 26-Jun-2016  isaki Add SCSI host adaptor selector to "boot" command of /boot.
By this function, /boot which booted from non-SCSI
(in other words, floppy) can load SCSI kernel.
Now, single /boot can load kernel of all supported filesystems
of all supported boot devices.

---
New "boot" command's syntax is: boot [hostadaptor@][dev:][file]

If you booted from SCSI, hostadaptor is already set (from IOCS)
and you can omit hostadaptor in this case. You can type like
"boot sd0a:netbsd" as before.

If you booted from floppy (hostadaptor is not set) and want to
load the SCSI kernel (hostadaptor is needed), you have to select
your hostadaptor in boot command, like "boot spc0@sd0a:netbsd".
 1.6 12-Oct-2012  tsutsui branches: 1.6.14;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.5 18-Nov-2007  isaki branches: 1.5.52; 1.5.58; 1.5.62;
Correct filename in a comment.
 1.4 11-Nov-2007  isaki Style fix.
 1.3 15-Oct-2001  minoura branches: 1.3.4; 1.3.6; 1.3.38; 1.3.80; 1.3.98; 1.3.100; 1.3.104; 1.3.106;
Prepare to set WARNS=2.
 1.2 29-Sep-2001  minoura Implement ls command.
Correct bootdev detection.
Other minor changes.
 1.1 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.3.106.1 19-Nov-2007  mjf Sync with HEAD.
 1.3.104.2 18-Nov-2007  bouyer Sync with HEAD
 1.3.104.1 13-Nov-2007  bouyer Sync with HEAD
 1.3.100.1 09-Jan-2008  matt sync with HEAD
 1.3.98.2 21-Nov-2007  joerg Sync with HEAD.
 1.3.98.1 11-Nov-2007  joerg Sync with HEAD.
 1.3.80.1 03-Dec-2007  ad Sync with HEAD.
 1.3.38.2 07-Dec-2007  yamt sync with head
 1.3.38.1 15-Nov-2007  yamt sync with head.
 1.3.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.6.1 15-Oct-2001  thorpej file libx68k.h was added on branch kqueue on 2002-01-10 19:50:37 +0000
 1.3.4.2 15-Oct-2001  minoura Prepare to set WARNS=2.
 1.3.4.1 15-Oct-2001  minoura file libx68k.h was added on branch nathanw_sa on 2001-10-15 16:13:41 +0000
 1.5.62.2 03-Dec-2017  jdolecek update from HEAD
 1.5.62.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.58.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.5.52.1 30-Oct-2012  yamt sync with head
 1.6.14.1 09-Jul-2016  skrll Sync with HEAD
 1.4 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.3 31-May-2016  dholland PR 51194 David Binderman: simplify redundant conditional
 1.2 11-Nov-2007  isaki branches: 1.2.62; 1.2.82;
Style fix.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.38; 1.1.80; 1.1.98; 1.1.100; 1.1.104; 1.1.106;
libsa for the new bootloader of x68k port.
 1.1.106.1 19-Nov-2007  mjf Sync with HEAD.
 1.1.104.1 13-Nov-2007  bouyer Sync with HEAD
 1.1.100.1 09-Jan-2008  matt sync with HEAD
 1.1.98.1 11-Nov-2007  joerg Sync with HEAD.
 1.1.80.1 03-Dec-2007  ad Sync with HEAD.
 1.1.38.1 15-Nov-2007  yamt sync with head.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file parseutils.c was added on branch kqueue on 2002-01-10 19:50:37 +0000
 1.1.4.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.4.1 27-Sep-2001  minoura file parseutils.c was added on branch nathanw_sa on 2001-09-27 10:03:29 +0000
 1.2.82.1 09-Jul-2016  skrll Sync with HEAD
 1.2.62.1 03-Dec-2017  jdolecek update from HEAD
 1.5 25-Nov-2012  isaki Make the end of image address absolute-long.
It allows to locate the end of image higher than 0x10000.
 1.4 21-Feb-2011  itohy branches: 1.4.4; 1.4.14;
Cleanup my copyright notice.
 1.3 11-Dec-2005  christos branches: 1.3.100; 1.3.106; 1.3.108;
merge ktrace-lwp.
 1.2 04-Dec-2003  keihan netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.1 30-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.22;
Print daemon image on startup.
(any other missing features?)
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 30-Sep-2001  thorpej file putimage.S was added on branch kqueue on 2002-01-10 19:50:37 +0000
 1.1.4.2 30-Sep-2001  minoura Print daemon image on startup.
(any other missing features?)
 1.1.4.1 30-Sep-2001  minoura file putimage.S was added on branch nathanw_sa on 2001-09-30 15:54:39 +0000
 1.3.108.1 05-Mar-2011  bouyer Sync with HEAD
 1.3.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.100.1 05-Mar-2011  rmind sync with head
 1.4.14.1 25-Feb-2013  tls resync with head
 1.4.4.1 16-Jan-2013  yamt sync with (a bit old) head
 1.19 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.18 23-Jun-2022  isaki x68k/stand: Merge {sd,cd}strategy and {sd,cd}close respectively.
For sd and cd devs, only open differs and the rest is the same.
No functional changes intended.
Suggested by tsutsui@ at port-x68k.
 1.17 21-Jun-2022  isaki x68k/stand: Correct blocksize in case of CD.
- Fix calculation of the blocksize passes to SCSI IOCS.
- Use three kind of sector size (blocksize) properly; media's sector size,
DEV_BSIZE from xxstrategy, and Human68k's sector size.
By this change,
- For 512 bytes/sector HDD, no changes are intended.
- For CD, corrects the blocksize (%d5) passes to SCSI IOCS.
It has worked previously though the blocksize was incorrect. Now it
works with correct blocksize.
- As a secondary effect, 256 or 1024 bytes/sector media may work but not
well tested.
Reviewed by tsutsui@ at port-x68k.
 1.16 21-Jun-2022  isaki x68k/stand: Correct a condition expression.
- start is LBA but dblk is relative from this partition.
- The first term was wrong. It should be '(x & 0x1fffff) == x', but
it's more simple to use numerical comparison.
There would have been no impact.
 1.15 11-Feb-2014  tsutsui Specify default SCSI inquiry size (36 bytes) on IOCS_S_INQUIRY() command.

X680x0 SCSI IOCS stalls if SCSI device doesn't return inquiry data
of specified allocation length size on the INQUIRY command,
and it causes hangup on the XM6 based emulators that return only
upto 36 byte inquiry data on SCSI disk emulation.

Many real SCSI-2 hard drives seem to support >100 byte inquiry data,
but at least there is a harddisk that returns only supported inquiry
data size and quits transfer.

The bootloader checks only the device type and there is no reason
to read 100 bytes that includes vender specific data.

Analyzed and reported by GIMONS, a developer of XM6 TypeG emulator,
which also can run NetBSD/x68k.
 1.14 22-Nov-2012  tsutsui branches: 1.14.2;
Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.13 19-Jun-2012  minoura branches: 1.13.2;
Fix CD support (again!).
 1.12 20-Mar-2012  minoura Fix CD support.
 1.11 17-Jul-2011  joerg branches: 1.11.2; 1.11.6; 1.11.8;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.10 09-Jul-2011  mrg don't assign sc->sc_partinfo.size to itself.
 1.9 11-Apr-2011  tsutsui Some KNF. No binary change.
 1.8 18-Nov-2007  isaki branches: 1.8.40; 1.8.46;
Use the same prototypes as libx68k.h.
 1.7 11-Nov-2007  isaki Style fix.
 1.6 25-Jan-2006  christos branches: 1.6.28; 1.6.46; 1.6.48; 1.6.52; 1.6.54;
free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.5 07-Jan-2002  minoura branches: 1.5.2; 1.5.34; 1.5.46;
alloca() is now defined in libkern.h.
 1.4 15-Oct-2001  minoura branches: 1.4.4;
Prepare to set WARNS=2.
 1.3 15-Oct-2001  minoura set current_id properly.
 1.2 29-Sep-2001  minoura Implement ls command.
Correct bootdev detection.
Other minor changes.
 1.1 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.4.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.4.4.2 11-Jan-2002  nathanw More catchup.
 1.4.4.1 15-Oct-2001  nathanw file sdcd.c was added on branch nathanw_sa on 2002-01-11 23:38:47 +0000
 1.5.46.1 01-Feb-2006  yamt sync with head.
 1.5.34.3 07-Dec-2007  yamt sync with head
 1.5.34.2 15-Nov-2007  yamt sync with head.
 1.5.34.1 21-Jun-2006  yamt sync with head.
 1.5.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.2.1 07-Jan-2002  thorpej file sdcd.c was added on branch kqueue on 2002-01-10 19:50:38 +0000
 1.6.54.1 19-Nov-2007  mjf Sync with HEAD.
 1.6.52.2 18-Nov-2007  bouyer Sync with HEAD
 1.6.52.1 13-Nov-2007  bouyer Sync with HEAD
 1.6.48.1 09-Jan-2008  matt sync with HEAD
 1.6.46.2 21-Nov-2007  joerg Sync with HEAD.
 1.6.46.1 11-Nov-2007  joerg Sync with HEAD.
 1.6.28.1 03-Dec-2007  ad Sync with HEAD.
 1.8.46.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.40.1 21-Apr-2011  rmind sync with head
 1.11.8.2 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.11.8.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.11.6.1 05-Apr-2012  mrg sync to latest -current.
 1.11.2.4 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.11.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.11.2.2 30-Oct-2012  yamt sync with head
 1.11.2.1 17-Apr-2012  yamt sync with head
 1.13.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.2.1 25-Feb-2013  tls resync with head
 1.14.2.1 18-May-2014  rmind sync with head
 1.2 11-Apr-2011  tsutsui Some KNF. No binary change.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.150; 1.1.156;
libsa for the new bootloader of x68k port.
 1.1.156.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.150.1 21-Apr-2011  rmind sync with head
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file sdcdvar.h was added on branch kqueue on 2002-01-10 19:50:38 +0000
 1.1.4.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.4.1 27-Sep-2001  minoura file sdcdvar.h was added on branch nathanw_sa on 2001-09-27 10:03:29 +0000
 1.20 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.19 23-Sep-2019  christos Consistently use ${RELEASEDIR}/${RELEASEMACHINE} instead of
${RELEASEDIR}/${MACHINE} (Paul Ripke)
 1.18 10-Dec-2016  rin branches: 1.18.16;
Fix comment. We do not use the a.out format anymore...
 1.17 10-Dec-2016  rin Clear STRIPFLAG after include bsd.own.mk; it can be modified by mk.conf via
bsd.own.mk.
 1.16 21-Aug-2013  matt branches: 1.16.6; 1.16.10;
Use <bsd.klinks.mk>
 1.15 12-Aug-2013  joerg Build boot loaders without unwind tables.
 1.14 08-Feb-2012  joerg branches: 1.14.6; 1.14.10;
Don't depend on cat pages to be installed, just run mandoc here.
Also provide a HTML version for user of modern technology.
 1.13 13-Apr-2011  he branches: 1.13.4; 1.13.8;
Convert to using -nostdinc, and set include paths and create symlinks
so that we include the source tree's sys/, machine/ and m68k/ headers,
and only as a last resort use DESTDIR's /usr/include. For some reason
the host's bootinfo.h got included ahead of the x68k variant, causing
a build failure in my case.
 1.12 29-Jun-2006  lukem branches: 1.12.84; 1.12.90;
Support MAKEVERBOSE
 1.11 03-Jan-2003  lukem branches: 1.11.18; 1.11.32; 1.11.36; 1.11.44;
Install release files under "${RELEASEDIR}/${MACHINE}/..." instead of
"${RELEASEDIR}/...".

${RELEASEDIR} is never cleaned , and ${RELEASEDIR}/${MACHINE} is only
cleaned if UPDATE is not defined.
 1.10 03-Nov-2002  isaki Place catman in RELEASEDIR/installation/misc.
 1.9 18-May-2002  isaki branches: 1.9.2;
Make ELF kernel loadable, by itohy-san.
 1.8 12-Dec-2001  tv branches: 1.8.8;
MKfoo=no -> NOfoo
 1.7 07-Dec-2001  minoura New target: release.
 1.6 14-Nov-2001  tv ${MAKE} print-objdir -> ${PRINTOBJDIR}
 1.5 12-Jun-2001  minoura branches: 1.5.2; 1.5.8;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.4 16-Mar-1999  minoura branches: 1.4.20;
Merged minoura_x68k_bus_h branch.
 1.3 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.2 20-Nov-1998  itohy branches: 1.2.4;
Moved the manual to share.
Added -L for libc.
Use `&&' instead of `;' for cd and print-objdir in order to avoid
infinite fork() if chdir failed.
 1.1 01-Sep-1998  itohy New boot program.
Load and execute NetBSD/x68k kernel from Human68k.
 1.2.4.1 14-Mar-1999  minoura Sync.
 1.4.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.5.8.5 07-Jan-2003  thorpej Sync with HEAD.
 1.5.8.4 11-Nov-2002  nathanw Catch up to -current
 1.5.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.5.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.5.8.1 12-Jun-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:28:48 +0000
 1.5.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.8.1 30-May-2002  gehenna Catch up with -current.
 1.9.2.1 12-Dec-2002  he Pull up revision 1.10 (requested by isaki in ticket #1010):
Place loadbsd manual page in RELEASEDIR/installation/misc.
 1.11.44.1 13-Jul-2006  gdamore Merge from HEAD.
 1.11.36.1 11-Aug-2006  yamt sync with head
 1.11.32.1 09-Sep-2006  rpaulo sync with head
 1.11.18.1 30-Dec-2006  yamt sync with head.
 1.12.90.1 06-Jun-2011  jruoho Sync with HEAD.
 1.12.84.1 21-Apr-2011  rmind sync with head
 1.13.8.1 18-Feb-2012  mrg merge to -current.
 1.13.4.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.4.1 17-Apr-2012  yamt sync with head
 1.14.10.1 28-Aug-2013  rmind sync with head
 1.14.6.2 03-Dec-2017  jdolecek update from HEAD
 1.14.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.10.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.16.6.1 05-Feb-2017  skrll Sync with HEAD
 1.18.16.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2 20-Nov-1998  itohy Moved the manual to share.
Added -L for libc.
Use `&&' instead of `;' for cd and print-objdir in order to avoid
infinite fork() if chdir failed.
 1.1 01-Sep-1998  itohy New boot program.
Load and execute NetBSD/x68k kernel from Human68k.
 1.16 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.15 23-Dec-2023  andvar update usage() and usage comment with missing options.
 1.14 21-Feb-2011  itohy Cleanup my copyright notice.
 1.13 18-Mar-2009  cegger branches: 1.13.4; 1.13.6; 1.13.8;
Ansify function definitions w/o arguments. Generated with sed.
 1.12 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.11 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.10 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.9 24-Dec-2005  perry branches: 1.9.78; 1.9.86; 1.9.92;
bare asm -> __asm
 1.8 18-May-2002  isaki branches: 1.8.24;
Make ELF kernel loadable, by itohy-san.
 1.7 12-Jun-2001  minoura branches: 1.7.2; 1.7.8; 1.7.16;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.6 24-Sep-2000  jdolecek branches: 1.6.2;
add new macro BOOT_FLAG() (defined in <sys/boot_flag.h>) - this
maps standard boot flags to corresponding RB_* values
use BOOT_FLAG() in port's MD code as appropriate

as discussed on tech-kern, add new boot flags -v, -q for booting
verbosely or quietly, and corresponding AB_VERBOSE/AB_QUIET
boot flags; also add FreeBSD-compatible bootverbose macro and
NetBSD-specific bootquiet macro

for hpcmips, use new bootverbose instead of it's own hpcmips_verbose

Tested on i386, and to limited extend (compile of affected files) also for
mvme68k, hp300, luna68k, sun3.
 1.5 29-Jul-2000  jdolecek g/c RB_DFLTROOT

I've tried hard to find also various usage() messages and remove the
appropriate flag from there as well, hopefully all occurences are covered.
 1.4 23-Sep-1999  minoura branches: 1.4.2; 1.4.12;
First step toward network boot.
By Takeshi Nakayama <tn@catvmics.ne.jp>.
 1.3 29-Jul-1999  itohy Fix typo in comment.
 1.2 30-Apr-1999  minoura Branch address was wrong.
 1.1 01-Sep-1998  itohy branches: 1.1.8;
New boot program.
Load and execute NetBSD/x68k kernel from Human68k.
 1.1.8.1 30-Apr-1999  perry branches: 1.1.8.1.2;
pullup 1..1->1.2 (minoura)
 1.1.8.1.2.2 02-Aug-1999  thorpej Update from trunk.
 1.1.8.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.4.12.1 13-Aug-2000  jdolecek pullup from trunk (approved by thorpej):
retire RB_DFLTROOT, it's no longer used

revisions pulled up:
arch/i386/stand/lib/netbsd_opts.c 1.3
arch/i386/stand/biosboot/main.c 1.23
arch/i386/stand/dosboot/main.c 1.15
arch/i386/stand/netboot/main.c 1.6
arch/arc/arc/machdep.c 1.42
arch/bebox/stand/boot/boot.c 1.11
arch/hpcmips/hpcmips/machdep.c 1.32
arch/newsmips/newsmips/machdep.c 1.45
arch/pc532/stand/boot/boot.c 1.2
arch/pmax/pmax/machdep.c 1.178
arch/prep/stand/boot/boot.c 1.2
arch/sparc/sparc/autoconf.c 1.141
arch/sparc64/sparc64/autoconf.c 1.38
arch/x68k/stand/loadbsd/loadbsd.c 1.5
arch/mvme68k/stand/libsa/parse_args.c 1.6
compat/osf1/osf1_cvt.c 1.9
sys/reboot.h 1.17
 1.4.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.16.1 30-May-2002  gehenna Catch up with -current.
 1.7.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.7.8.1 12-Jun-2001  nathanw file loadbsd.c was added on branch nathanw_sa on 2002-06-20 03:42:36 +0000
 1.7.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.24.1 21-Jun-2006  yamt sync with head.
 1.9.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.9.78.1 04-May-2009  yamt sync with head.
 1.13.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.13.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.13.4.1 05-Mar-2011  rmind sync with head
 1.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 12-Jun-2001  minoura branches: 1.2.8; 1.2.152; 1.2.158; 1.2.160;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.1 01-Sep-1998  itohy branches: 1.1.26;
New boot program.
Load and execute NetBSD/x68k kernel from Human68k.
 1.1.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.160.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.158.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.152.1 05-Mar-2011  rmind sync with head
 1.2.8.2 12-Jun-2001  minoura Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.2.8.1 12-Jun-2001  minoura file trampoline.S was added on branch nathanw_sa on 2001-06-12 16:57:29 +0000
 1.2 21-Feb-2011  itohy Cleanup my copyright notice.
 1.1 01-Sep-1998  itohy branches: 1.1.176; 1.1.182; 1.1.184;
New boot program.
Load and execute NetBSD/x68k kernel from Human68k.
 1.1.184.1 05-Mar-2011  bouyer Sync with HEAD
 1.1.182.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.176.1 05-Mar-2011  rmind sync with head
 1.20 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.19 10-Aug-2020  rin Make x68k/stand compile with GCC8. Tested with XEiJ.
 1.18 01-Feb-2020  isaki Make it output 68000 binary.
CFLAGS already has -m68000 but AFLAGS didn't.

This change makes it proceed to next stage1 even if MPU is 68000.
All stage1 bootloader displays an error message if MPU is 68000.
 1.17 08-Aug-2014  isaki branches: 1.17.28; 1.17.34;
Remove STRIP?=strip.
Falling back to the hosttool is not a good way now.
 1.16 05-Apr-2012  isaki branches: 1.16.2; 1.16.12;
Use common library libiocs.a. suggested by tsutsui@.
o Originally, mboot had an IOCS_S_READEXT() inline function but
its expansion corrupted (from somewhere after branching netbsd-5).
This solves PR#46293 by using the common library.
This problem was reported by Y.Sugahara at NetBSD booth at
Open Source Conference (OSC) 2012 Ehime in March.
o As a side effect, it also correct the different problem that
IOCS_S_READ() calls _S_READEXT not _S_READ.
Should be pulled up to netbsd-6.
 1.15 12-Jan-2009  tsutsui branches: 1.15.14; 1.15.18; 1.15.20;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.14 29-Jun-2006  lukem branches: 1.14.58; 1.14.62; 1.14.70;
Support MAKEVERBOSE
 1.13 29-Jun-2006  lukem Rename LDFLAGS to LINKFLAGS, as the former is for CC not LD.
 1.12 11-Dec-2005  christos branches: 1.12.4; 1.12.8; 1.12.16;
merge ktrace-lwp.
 1.11 08-Oct-2003  simonb branches: 1.11.16;
Add -D_STANDALONE to CPPFLAGS.
 1.10 05-May-2002  isaki branches: 1.10.10;
libsa/Makefile: Fix rules to create symlinks on read-only source tree.
{boot,libsa,mboot}/Makefile, Makefile.booters:
move that common rule to Makefile.booters
 1.9 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.8 22-Sep-2001  tv branches: 1.8.4;
objcopy -> ${OBJCOPY}; remove redundant definitions of OBJCOPY?= (it is
now in bsd.own.mk).
 1.7 12-Jun-2001  minoura branches: 1.7.2; 1.7.4;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.6 26-Jan-2001  minoura branches: 1.6.2;
Use IOCS_S_READEXT only when reading the partition boot from
higher part of the disk than 0x200000.
 1.5 01-Feb-2000  tsutsui Revert STRIPPROG -> STRIP
 1.4 23-Jan-2000  mycroft Clean up the machine symlink stuff ever so slightly. Needs to be
standardized between files.
 1.3 19-Jan-2000  tsutsui STRIP -> STRIPPROG
 1.2 24-Dec-1999  minoura Replace shell script version of newdisk utility with C version.
Add the man page newdisk(8).
 1.1 04-Jul-1999  minoura branches: 1.1.2;
SCSI primary boot program and its installer.
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.7.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.8.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.8.4.1 22-Sep-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:28:49 +0000
 1.10.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.10.1 03-Aug-2004  skrll Sync with HEAD
 1.11.16.1 30-Dec-2006  yamt sync with head.
 1.12.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.12.8.1 11-Aug-2006  yamt sync with head
 1.12.4.1 09-Sep-2006  rpaulo sync with head
 1.14.70.1 19-Jan-2009  skrll Sync with HEAD.
 1.14.62.1 04-May-2009  yamt sync with head.
 1.14.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.15.20.1 09-Apr-2012  riz Pull up following revision(s) (requested by isaki in ticket #171):
sys/arch/x68k/stand/mboot/mboot.c: revision 1.10
sys/arch/x68k/stand/mboot/Makefile: revision 1.16
sys/arch/x68k/stand/Makefile: revision 1.9
Use common library libiocs.a. suggested by tsutsui@.
o Originally, mboot had an IOCS_S_READEXT() inline function but
its expansion corrupted (from somewhere after branching netbsd-5).
This solves PR#46293 by using the common library.
This problem was reported by Y.Sugahara at NetBSD booth at
Open Source Conference (OSC) 2012 Ehime in March.
o As a side effect, it also correct the different problem that
IOCS_S_READ() calls _S_READEXT not _S_READ.
Should be pulled up to netbsd-6.
mboot now depends on libiocs. noticed by tsutsui@.
 1.15.18.1 05-Apr-2012  mrg sync to latest -current.
 1.15.14.1 17-Apr-2012  yamt sync with head
 1.16.12.1 10-Aug-2014  tls Rebase.
 1.16.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.17.34.1 29-Feb-2020  ad Sync with head.
 1.17.28.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.12 06-Apr-2012  isaki Oops, One more message.
 1.11 06-Apr-2012  isaki Print my progname in error messages.
It makes easy to find who displayed it.
 1.10 05-Apr-2012  isaki Use common library libiocs.a. suggested by tsutsui@.
o Originally, mboot had an IOCS_S_READEXT() inline function but
its expansion corrupted (from somewhere after branching netbsd-5).
This solves PR#46293 by using the common library.
This problem was reported by Y.Sugahara at NetBSD booth at
Open Source Conference (OSC) 2012 Ehime in March.
o As a side effect, it also correct the different problem that
IOCS_S_READ() calls _S_READEXT not _S_READ.
Should be pulled up to netbsd-6.
 1.9 01-Oct-2011  chs branches: 1.9.2; 1.9.6; 1.9.8;
fix build errors with gcc 4.5.
 1.8 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.7 12-Jan-2009  tsutsui branches: 1.7.2;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.6 28-Apr-2008  martin branches: 1.6.8;
Remove clause 3 and 4 from TNF licenses
 1.5 24-Dec-2005  perry branches: 1.5.74; 1.5.76; 1.5.78;
bare asm -> __asm
 1.4 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.3 12-Jun-2001  minoura branches: 1.3.8; 1.3.40;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.2 26-Jan-2001  minoura branches: 1.2.2;
Use IOCS_S_READEXT only when reading the partition boot from
higher part of the disk than 0x200000.
 1.1 04-Jul-1999  minoura branches: 1.1.2;
SCSI primary boot program and its installer.
 1.1.2.1 11-Feb-2001  bouyer Sync with HEAD.
 1.2.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.40.1 21-Jun-2006  yamt sync with head.
 1.3.8.2 12-Jun-2001  minoura Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.3.8.1 12-Jun-2001  minoura file mboot.c was added on branch nathanw_sa on 2001-06-12 16:57:29 +0000
 1.5.78.2 04-May-2009  yamt sync with head.
 1.5.78.1 16-May-2008  yamt sync with head.
 1.5.76.1 18-May-2008  yamt sync with head.
 1.5.74.2 17-Jan-2009  mjf Sync with HEAD.
 1.5.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.8.2 28-Apr-2009  skrll Sync with HEAD.
 1.6.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.7.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.8.2 09-Apr-2012  riz Pull up following revision(s) (requested by isaki in ticket #172):
sys/arch/x68k/stand/mboot/mboot.c: revision 1.11
sys/arch/x68k/stand/mboot/mboot.c: revision 1.12
Print my progname in error messages.
It makes easy to find who displayed it.
Oops, One more message.
 1.9.8.1 09-Apr-2012  riz Pull up following revision(s) (requested by isaki in ticket #171):
sys/arch/x68k/stand/mboot/mboot.c: revision 1.10
sys/arch/x68k/stand/mboot/Makefile: revision 1.16
sys/arch/x68k/stand/Makefile: revision 1.9
Use common library libiocs.a. suggested by tsutsui@.
o Originally, mboot had an IOCS_S_READEXT() inline function but
its expansion corrupted (from somewhere after branching netbsd-5).
This solves PR#46293 by using the common library.
This problem was reported by Y.Sugahara at NetBSD booth at
Open Source Conference (OSC) 2012 Ehime in March.
o As a side effect, it also correct the different problem that
IOCS_S_READ() calls _S_READEXT not _S_READ.
Should be pulled up to netbsd-6.
mboot now depends on libiocs. noticed by tsutsui@.
 1.9.6.2 29-Apr-2012  mrg sync to latest -current.
 1.9.6.1 05-Apr-2012  mrg sync to latest -current.
 1.9.2.1 17-Apr-2012  yamt sync with head
 1.2 24-Dec-1999  minoura Replace shell script version of newdisk utility with C version.
Add the man page newdisk(8).
 1.1 04-Jul-1999  minoura branches: 1.1.2;
SCSI primary boot program and its installer.
 1.1.2.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.4 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 12-Jun-2001  minoura branches: 1.2.8; 1.2.126; 1.2.128; 1.2.130;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.1 04-Jul-1999  minoura branches: 1.1.14;
SCSI primary boot program and its installer.
 1.1.14.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.130.1 16-May-2008  yamt sync with head.
 1.2.128.1 18-May-2008  yamt sync with head.
 1.2.126.1 02-Jun-2008  mjf Sync with HEAD.
 1.2.8.2 12-Jun-2001  minoura Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.2.8.1 12-Jun-2001  minoura file srt0.S was added on branch nathanw_sa on 2001-06-12 16:57:29 +0000
 1.7 25-Jun-2016  isaki branches: 1.7.16;
Unify netboot and boot (into boot).
Now boot becomes to be able to load the NFS kernel and
netboot also becomes to be able to load the local kernel.
The only difference is the default kernel which loads.
I.e., netboot's default is nfs.

Bump boot_ustar's BOOT_MAXSIZE.
 1.6 08-Aug-2014  isaki branches: 1.6.4;
Remove STRIP?=strip.
Falling back to the hosttool is not a good way now.
 1.5 06-Aug-2014  isaki Remove unused variable.
 1.4 05-Aug-2014  isaki Support a 'switch' command.
It displays/modifies some SRAM parameters on X680x0, like as
memswitch(1) or Human68k's SWITCH.X .
It makes easy to change the boot devices or correct the inconsistency
of SRAM/real memory size.

sample usage:
> switch show .. show all supported parameters
> switch boot=std .. set boot order to 'STD'
> switch memory=12 .. set memory size to 12MB
 1.3 06-Jul-2014  tsutsui Merge and share boot.c between normal boot and netboot by dumb #ifdefs.

Tested on XM6i.
 1.2 01-Nov-2012  isaki branches: 1.2.2; 1.2.12;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file Makefile was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.12.1 10-Aug-2014  tls Rebase.
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file Makefile was added on branch netbsd-6 on 2012-11-18 19:05:21 +0000
 1.6.4.1 09-Jul-2016  skrll Sync with HEAD
 1.7.16.2 03-Dec-2017  jdolecek update from HEAD
 1.7.16.1 25-Jun-2016  jdolecek file Makefile was added on branch tls-maxphys on 2017-12-03 11:36:49 +0000
 1.4 06-Jul-2014  tsutsui Merge and share boot.c between normal boot and netboot by dumb #ifdefs.

Tested on XM6i.
 1.3 06-Jul-2014  tsutsui Reduce diffs to prepare to merge these files.
 1.2 01-Nov-2012  isaki branches: 1.2.2; 1.2.12;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file boot.c was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.12.1 10-Aug-2014  tls Rebase.
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file boot.c was added on branch netbsd-6 on 2012-11-18 19:05:21 +0000
 1.4 25-Jun-2016  isaki Unify netboot and boot (into boot).
Now boot becomes to be able to load the NFS kernel and
netboot also becomes to be able to load the local kernel.
The only difference is the default kernel which loads.
I.e., netboot's default is nfs.

Bump boot_ustar's BOOT_MAXSIZE.
 1.3 13-Jan-2013  tsutsui branches: 1.3.14;
Remove unnecessary struct open_file files[] leftover.
It's in libsa/files.c.
 1.2 01-Nov-2012  isaki branches: 1.2.2;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.4 23-Jan-2013  yamt sync with head
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file conf.c was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file conf.c was added on branch netbsd-6 on 2012-11-18 19:05:21 +0000
 1.3.14.1 09-Jul-2016  skrll Sync with HEAD
 1.3 25-Jun-2016  isaki Unify netboot and boot (into boot).
Now boot becomes to be able to load the NFS kernel and
netboot also becomes to be able to load the local kernel.
The only difference is the default kernel which loads.
I.e., netboot's default is nfs.

Bump boot_ustar's BOOT_MAXSIZE.
 1.2 17-Jan-2016  tsutsui Enable LIBSA_CREAD_NOCRC. PR/50638

Bump version to denote user visible change.
XXX: recent visible changes (memsize probe, SRAM switch command)
were not denoted in versions
Tested on (real) X68030.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2; 1.1.4; 1.1.18;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.18.2 09-Jul-2016  skrll Sync with HEAD
 1.1.18.1 19-Mar-2016  skrll Sync with HEAD
 1.1.4.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.1.4.1 12-Oct-2012  riz file version was added on branch netbsd-6 on 2012-11-18 19:05:21 +0000
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file version was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.3 04-May-2011  tsutsui WARNSfy to avoid further botch.
 1.2 12-Dec-2001  tv branches: 1.2.144; 1.2.150;
MKfoo=no -> NOfoo
 1.1 24-Dec-1999  minoura branches: 1.1.6; 1.1.10; 1.1.14;
Replace shell script version of newdisk utility with C version.
Add the man page newdisk(8).
 1.1.14.1 08-Jan-2002  nathanw Catch up to -current.
 1.1.10.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 24-Dec-1999  bouyer file Makefile was added on branch thorpej_scsipi on 2000-11-20 20:30:18 +0000
 1.2.150.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.144.1 31-May-2011  rmind sync with head
 1.11 26-Mar-2014  christos kill sprintf, fix unused.
 1.10 23-Jun-2012  minoura branches: 1.10.2; 1.10.4;
Change to the 2-clauses license.
 1.9 04-May-2011  tsutsui branches: 1.9.4; 1.9.10;
WARNSfy to avoid further botch.
 1.8 29-Apr-2011  isaki Add a missing printf argument..
 1.7 29-Apr-2011  isaki - use getprogname() instead of argv[0]
- remove an extra decl. of optind
 1.6 29-Apr-2011  isaki Fix indent and style.
 1.5 14-Mar-2009  dsl branches: 1.5.4; 1.5.6;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.4 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.3 04-Aug-2006  mhitch branches: 1.3.62; 1.3.70; 1.3.76;
gcc4 fix: change prototype and definition of volatile void usage().
 1.2 08-Dec-2001  minoura branches: 1.2.32; 1.2.46; 1.2.50;
Add -p option to suppress creating the partition table.
 1.1 24-Dec-1999  minoura branches: 1.1.6; 1.1.10; 1.1.14;
Replace shell script version of newdisk utility with C version.
Add the man page newdisk(8).
 1.1.14.1 08-Jan-2002  nathanw Catch up to -current.
 1.1.10.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 24-Dec-1999  bouyer file newdisk.c was added on branch thorpej_scsipi on 2000-11-20 20:30:19 +0000
 1.2.50.1 11-Aug-2006  yamt sync with head
 1.2.46.1 09-Sep-2006  rpaulo sync with head
 1.2.32.1 30-Dec-2006  yamt sync with head.
 1.3.76.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.70.1 28-Apr-2009  skrll Sync with HEAD.
 1.3.62.1 04-May-2009  yamt sync with head.
 1.5.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.4.1 31-May-2011  rmind sync with head
 1.9.10.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.9.4.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.9.4.1 30-Oct-2012  yamt sync with head
 1.10.4.1 18-May-2014  rmind sync with head
 1.10.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.17 16-Aug-2020  isaki Replace boot_ustar with xxboot_ustarfs.
The old boot_ustar had many hard coding and was small(<1KB).
The new xxboot_ustarfs is a part of integrated larger(<8KB) xxboot.
We had to maintain three similar but not the same bootloaders, but
now we have two!
 1.16 14-Aug-2020  isaki Style fixes. One entry per line for some parts.
 1.15 20-Mar-2012  minoura branches: 1.15.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.14 27-Jan-2002  minoura branches: 1.14.100;
Remove obsolete xxboot.
 1.13 07-Jan-2002  minoura New toolchain.
XXX: New toolchain generates 100byte bigger object than the 8KB limit.
XXX: Therefore, compilation always fails!
 1.12 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.11 02-Dec-2001  minoura .include <bsd.own.mk> for OBJECT_FMT.
 1.10 29-Sep-2001  minoura branches: 1.10.4;
Make this compile with the new toolchain.
 1.9 22-Sep-2001  tv objcopy -> ${OBJCOPY}; remove redundant definitions of OBJCOPY?= (it is
now in bsd.own.mk).
 1.8 12-Jun-2001  minoura branches: 1.8.2; 1.8.4;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.7 01-Feb-2000  tsutsui branches: 1.7.6;
Revert STRIPPROG -> STRIP
 1.6 19-Jan-2000  tsutsui STRIP -> STRIPPROG
 1.5 28-Mar-1999  minoura branches: 1.5.8;
Fixed the bug described in the previous commit log.
Re-enabled the title image.
 1.4 27-Mar-1999  minoura Work around for broken unzip routine.
Transition to egcs seems to have broken the trickily hacked inflate routine.
Disable the hack and size-consuming title image for a while.
 1.3 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.2 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.1 01-Sep-1998  itohy branches: 1.1.6;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.6.1 14-Mar-1999  minoura Sync.
 1.5.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.8.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.8.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.8.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.4.4 28-Feb-2002  nathanw Catch up to -current.
 1.10.4.3 11-Jan-2002  nathanw More catchup.
 1.10.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.10.4.1 29-Sep-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:28:50 +0000
 1.14.100.1 17-Apr-2012  yamt sync with head
 1.15.4.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.15.4.1 20-Mar-2012  riz file Makefile was added on branch netbsd-6 on 2012-11-18 19:05:18 +0000
 1.21 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.20 25-Apr-2022  mlelstv libsa now needs ioctl to support media with large sectors. Provide
missing functions.

libsa defines files[] array itself, just reference it.
This also adds another global variable that tracks the root
filesystem module.
 1.19 04-Feb-2022  isaki Add missing -m68020-60 option. This makes xxboot_ustarfs work even on 68060.
Problem reported by Makoto Kamada. Confirmed on XEiJ (68060 mode).
 1.18 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.17 14-Aug-2020  isaki Reduce binary size as possible. These reduce filesize about 20 words.
- Use word alignment (rather than longword alignment) for text/data section.
- Use short reference. In the bootloader, all symbols can be expressed in
short.
 1.16 14-Aug-2020  isaki Use fixed 'xx' instead of DEV and DEVDRV for simplicity.
There is no choice other than xx for now.
 1.15 14-Aug-2020  isaki Style fixes. One entry per line for some parts.
 1.14 14-Aug-2020  isaki - Restore display of first_kbyte. This is helpful for development.
- Check the filesize of resulting file instead of section sizes.
If there is a gap between sections, the filesize may be exceeded even
though the section total is not exceeded. Of course that doesn't
usually happen but I've experienced this during development.
 1.13 10-Aug-2020  rin Make x68k/stand compile with GCC8. Tested with XEiJ.
 1.12 28-Jan-2020  isaki Set heap area explicitly.
Until the load address was moved, the heap was placed at _end (it's default)
and it was large space. After moving, this default space was too small.
 1.11 18-Jan-2020  isaki Check whether the text+data+bss doesn't reach 0x6000 where secondary
bootloader should be.
 1.10 18-Jan-2020  isaki Use ASSERT() in ldscript to check first_kbyte (etc) restrictions,
rather than complicated shell expressions in Makefile.
 1.9 18-Jan-2020  isaki Change primary bootloader's load address from 0x0f0000 to 0x003000.
- Moving addresses closer eliminates bunch of this linker errors:
in function `entry0':
relocation truncated to fit: R_68K_16 against `edata'+ffffffffffff8000
:
- By this change, harmful -noinhibit-exec option can also be removed.
Finally, we can break the builds when assemble error occurs!
- Load address of secondary is 0x6000, so that this change limits
text+data+bss 12KB or less. Current actual size is 5~7KB.
I think it should be fine.
- cd9660 can have up to 30KB text+data in its bootarea. Even in this
case, this change limits text+data+bss 12KB or less (currently, it's
about 6KB). However, I take breaking the builds on errors rather than
future size limitation.
There is no user visible changes or interface changes.
 1.8 18-Jan-2020  isaki Add 0x prefix when defining variables, not when using it.
This was necessary for bc(1) but it's no longer necessary.
 1.7 18-Jan-2020  isaki Pass address constants from Makefile to ldscript.
 1.6 16-Jan-2020  isaki Rewrite limit check using cross-build tools.
This eliminates use of hosts tr(1) and bc(1).
(But I'm going to remove this again soon due to other reason)
 1.5 16-Jan-2020  isaki Remove .else part of .if OBJECT_FMT == ELF.
All similar parts in other Makefiles are removed in 2010.
 1.4 08-Apr-2017  christos branches: 1.4.14; 1.4.20;
centralize vers.c building for standalone programs.
 1.3 08-Aug-2014  isaki branches: 1.3.4; 1.3.8; 1.3.12;
Remove OBJCOPY?=objcopy.
Falling back to the hosttool is not a good way now.
 1.2 12-Aug-2013  joerg branches: 1.2.2;
Build boot loaders without unwind tables.
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.8.1 28-Aug-2013  rmind sync with head
 1.1.6.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.1.6.1 20-Mar-2012  riz file Makefile.xxboot was added on branch netbsd-6 on 2012-11-18 19:05:17 +0000
 1.1.4.2 03-Dec-2017  jdolecek update from HEAD
 1.1.4.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.2.3 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file Makefile.xxboot was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.12.1 21-Apr-2017  bouyer Sync with HEAD
 1.3.8.1 26-Apr-2017  pgoyette Sync with HEAD
 1.3.4.1 28-Aug-2017  skrll Sync with HEAD
 1.4.20.3 29-Feb-2020  ad Sync with head.
 1.4.20.2 25-Jan-2020  ad Sync with head.
 1.4.20.1 17-Jan-2020  ad Sync with head.
 1.4.14.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2 27-Jan-2002  minoura Remove obsolete xxboot.
 1.1 01-Sep-1998  itohy branches: 1.1.28; 1.1.32;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.2 27-Jan-2002  minoura Remove obsolete xxboot.
 1.1 01-Sep-1998  itohy branches: 1.1.28; 1.1.32;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.2 27-Jan-2002  minoura Remove obsolete xxboot.
 1.1 01-Sep-1998  itohy branches: 1.1.28; 1.1.32;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.3 22-Aug-2020  isaki Minor improvement.
add/addx is faster and the size remains the same.
 1.2 22-Aug-2020  isaki typo in comment.
 1.1 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.1 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.13 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.12 28-Jan-2020  isaki Set heap area explicitly.
Until the load address was moved, the heap was placed at _end (it's default)
and it was large space. After moving, this default space was too small.
 1.11 28-Jan-2020  isaki Revert placing .bss right after .data, and make .bss fixed at 0x5000.
.bss placed right after .data was overwritten when first 1KB loads full
.text+.data.
 1.10 28-Jan-2020  isaki Use __bss_start rather than edata to point the beginning of .bss.
Currently the .bss is placed right after .data. In that case, edata
points to the beginning of .bss so that there is no visible changes at
least currently.
 1.9 18-Jan-2020  isaki Change primary bootloader's load address from 0x0f0000 to 0x003000.
- Moving addresses closer eliminates bunch of this linker errors:
in function `entry0':
relocation truncated to fit: R_68K_16 against `edata'+ffffffffffff8000
:
- By this change, harmful -noinhibit-exec option can also be removed.
Finally, we can break the builds when assemble error occurs!
- Load address of secondary is 0x6000, so that this change limits
text+data+bss 12KB or less. Current actual size is 5~7KB.
I think it should be fine.
- cd9660 can have up to 30KB text+data in its bootarea. Even in this
case, this change limits text+data+bss 12KB or less (currently, it's
about 6KB). However, I take breaking the builds on errors rather than
future size limitation.
There is no user visible changes or interface changes.
 1.8 18-Jan-2020  isaki Typo in comment. s/availble/available/
 1.7 18-Jan-2020  isaki Add comment and figure of address map.
 1.6 18-Jan-2020  isaki Initialize the screen in all primary bootloaders.
- Some IPL (or boot selector) don't do it, but current secondary bootloader
expects the screen to be initialized to display logo.
To keep messages (like version signature) displayed by primary bootloader,
this initialization should be done early in all primary bootloaders.
- For boot_ustar.S, relocates some registers to save bootinfo (%d0).
- Bumps version.

Confirmed on X68030+060turbo and my X68030. This problem was found on
X68030+060turbo at NetBSD booth in OSC 2011 Hiroshima (8+ years ago).
 1.5 16-Jan-2020  isaki Use .org directive to fix disklabel location instead of hand calculation.
If the code size before disklabel is less, zero is filled automatically.
If the code size before disklabel is exceeded, assembler stops with error.
Note that this changes a padding word in the current output binary from
a NOP instruction to zero but there are no functional changes.
 1.4 13-Jan-2020  isaki Typo in comment. s/LABELLOFFSET/LABELOFFSET/
 1.3 17-Nov-2012  tsutsui branches: 1.3.2; 1.3.40; 1.3.46;
Use a correct function name in .globl decl.
 1.2 17-Nov-2012  tsutsui Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file boot.S was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.3.46.3 29-Feb-2020  ad Sync with head.
 1.3.46.2 25-Jan-2020  ad Sync with head.
 1.3.46.1 17-Jan-2020  ad Sync with head.
 1.3.40.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.3.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.3.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.3.2.1 17-Nov-2012  riz file boot.S was added on branch netbsd-6 on 2012-11-18 19:05:17 +0000
 1.9 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.8 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.7 14-Aug-2020  isaki Use DEV_OPEN() macro.
 1.6 14-Aug-2020  isaki Add xxboot.h common header to share prototype definitions.
 1.5 14-Aug-2020  isaki Make compilable even with XXBOOT_DEBUG.
 1.4 17-Nov-2012  tsutsui branches: 1.4.2;
Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.
 1.3 17-Nov-2012  tsutsui Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.
 1.2 17-Nov-2012  tsutsui - fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file bootmain.c was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.4.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.4.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.4.2.1 17-Nov-2012  riz file bootmain.c was added on branch netbsd-6 on 2012-11-18 19:05:17 +0000
 1.4 27-Jan-2002  minoura Remove obsolete xxboot.
 1.3 07-Jan-2002  minoura Copy alloca() and memcpy() definitions from libkern.h.
 1.2 12-Jun-2001  minoura branches: 1.2.2; 1.2.8;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.1 01-Sep-1998  itohy branches: 1.1.26;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.2.8.2 11-Jan-2002  nathanw More catchup.
 1.2.8.1 12-Jun-2001  nathanw file bootufs.c was added on branch nathanw_sa on 2002-01-11 23:38:48 +0000
 1.2.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.2.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3 27-Jan-2002  minoura Remove obsolete xxboot.
 1.2 12-Jun-2001  minoura branches: 1.2.2; 1.2.8;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.1 01-Sep-1998  itohy branches: 1.1.26;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.8.1 12-Jun-2001  nathanw file chkfmt.s was added on branch nathanw_sa on 2002-02-28 04:12:39 +0000
 1.2.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.6;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.6.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.1.6.1 20-Mar-2012  riz file conf.c was added on branch netbsd-6 on 2012-11-18 19:05:17 +0000
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file conf.c was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.2 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.6;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.6.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.1.6.1 20-Mar-2012  riz file consio1.c was added on branch netbsd-6 on 2012-11-18 19:05:17 +0000
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file consio1.c was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.2 27-Jan-2002  minoura Remove obsolete xxboot.
 1.1 01-Sep-1998  itohy branches: 1.1.28; 1.1.32;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.2 27-Jan-2002  minoura Remove obsolete xxboot.
 1.1 01-Sep-1998  itohy branches: 1.1.28; 1.1.32;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.3 27-Jan-2002  minoura Remove obsolete xxboot.
 1.2 12-Jun-2001  minoura branches: 1.2.2; 1.2.8;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.1 01-Sep-1998  itohy branches: 1.1.26;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.8.1 12-Jun-2001  nathanw file iocscall.h was added on branch nathanw_sa on 2002-02-28 04:12:39 +0000
 1.2.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.2 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.1 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.1 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.1 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.4 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.3 18-Jan-2020  isaki Initialize the screen in all primary bootloaders.
- Some IPL (or boot selector) don't do it, but current secondary bootloader
expects the screen to be initialized to display logo.
To keep messages (like version signature) displayed by primary bootloader,
this initialization should be done early in all primary bootloaders.
- For boot_ustar.S, relocates some registers to save bootinfo (%d0).
- Bumps version.

Confirmed on X68030+060turbo and my X68030. This problem was found on
X68030+060turbo at NetBSD booth in OSC 2011 Hiroshima (8+ years ago).
 1.2 17-Nov-2012  tsutsui branches: 1.2.2; 1.2.40; 1.2.46;
Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file version was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.2.46.1 25-Jan-2020  ad Sync with head.
 1.2.40.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 17-Nov-2012  riz file version was added on branch netbsd-6 on 2012-11-18 19:05:18 +0000
 1.5 25-Apr-2022  mlelstv libsa now needs ioctl to support media with large sectors. Provide
missing functions.

libsa defines files[] array itself, just reference it.
This also adds another global variable that tracks the root
filesystem module.
 1.4 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.3 14-Aug-2020  isaki Add xxboot.h common header to share prototype definitions.
 1.2 17-Nov-2012  tsutsui branches: 1.2.2;
- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file xx.c was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 17-Nov-2012  riz file xx.c was added on branch netbsd-6 on 2012-11-18 19:05:16 +0000
 1.3 27-Jan-2002  minoura Remove obsolete xxboot.
 1.2 12-Jun-2001  minoura branches: 1.2.2; 1.2.8;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.1 01-Sep-1998  itohy branches: 1.1.26;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.8.1 12-Jun-2001  nathanw file xxboot.S was added on branch nathanw_sa on 2002-02-28 04:12:39 +0000
 1.2.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.4 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.3 14-Aug-2020  isaki Add xxboot.h common header to share prototype definitions.
 1.2 27-Jan-2002  minoura Remove obsolete xxboot.
 1.1 01-Sep-1998  itohy branches: 1.1.28; 1.1.32;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.10 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.9 14-Aug-2020  isaki Reduce binary size as possible. These reduce filesize about 20 words.
- Use word alignment (rather than longword alignment) for text/data section.
- Use short reference. In the bootloader, all symbols can be expressed in
short.
 1.8 14-Aug-2020  isaki - Restore display of first_kbyte. This is helpful for development.
- Check the filesize of resulting file instead of section sizes.
If there is a gap between sections, the filesize may be exceeded even
though the section total is not exceeded. Of course that doesn't
usually happen but I've experienced this during development.
 1.7 28-Jan-2020  isaki Revert placing .bss right after .data, and make .bss fixed at 0x5000.
.bss placed right after .data was overwritten when first 1KB loads full
.text+.data.
 1.6 18-Jan-2020  isaki Check whether the text+data+bss doesn't reach 0x6000 where secondary
bootloader should be.
 1.5 18-Jan-2020  isaki Make .bss follows .data to detect size restriction easier.
Previously, if text+data exceeds the restricted size, it will conflict
with manually fixed .bss area and ldscript makes it an error.
By this change, ASSERT() can detect it.
 1.4 18-Jan-2020  isaki Use ASSERT() in ldscript to check first_kbyte (etc) restrictions,
rather than complicated shell expressions in Makefile.
 1.3 18-Jan-2020  isaki Remove commented out ALIGN() operation.
It looks unnecessary and has never been used.
 1.2 18-Jan-2020  isaki Pass address constants from Makefile to ldscript.
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.6; 1.1.44; 1.1.50;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.50.2 29-Feb-2020  ad Sync with head.
 1.1.50.1 25-Jan-2020  ad Sync with head.
 1.1.44.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1.6.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.1.6.1 20-Mar-2012  riz file xxboot.ldscript was added on branch netbsd-6 on 2012-11-18 19:05:17 +0000
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file xxboot.ldscript was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.3 14-Aug-2020  isaki Use fixed 'xx' instead of DEV and DEVDRV for simplicity.
There is no choice other than xx for now.
 1.2 17-Nov-2012  tsutsui branches: 1.2.2;
Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file Makefile was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 17-Nov-2012  riz file Makefile was added on branch netbsd-6 on 2012-11-18 19:05:23 +0000
 1.1 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.6 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.5 14-Aug-2020  isaki Use fixed 'xx' instead of DEV and DEVDRV for simplicity.
There is no choice other than xx for now.
 1.4 17-Nov-2012  tsutsui branches: 1.4.2;
Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.
 1.3 17-Nov-2012  tsutsui Fix previous; no need to echo dummy command.
 1.2 17-Nov-2012  tsutsui Appease warning "nbmake: ${TOUCHPROG} expands to empty string".
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file Makefile was added on branch yamt-pagecache on 2012-04-17 00:07:04 +0000
 1.4.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.4.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.4.2.1 17-Nov-2012  riz file Makefile was added on branch netbsd-6 on 2012-11-18 19:05:16 +0000
 1.6 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.5 14-Aug-2020  isaki Use fixed 'xx' instead of DEV and DEVDRV for simplicity.
There is no choice other than xx for now.
 1.4 17-Nov-2012  tsutsui branches: 1.4.2;
Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.
 1.3 17-Nov-2012  tsutsui Fix previous; no need to echo dummy command.
 1.2 17-Nov-2012  tsutsui Appease warning "nbmake: ${TOUCHPROG} expands to empty string".
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file Makefile was added on branch yamt-pagecache on 2012-04-17 00:07:04 +0000
 1.4.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.4.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.4.2.1 17-Nov-2012  riz file Makefile was added on branch netbsd-6 on 2012-11-18 19:05:23 +0000
 1.6 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.5 14-Aug-2020  isaki Use fixed 'xx' instead of DEV and DEVDRV for simplicity.
There is no choice other than xx for now.
 1.4 17-Nov-2012  tsutsui branches: 1.4.2;
Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.
 1.3 17-Nov-2012  tsutsui Fix previous; no need to echo dummy command.
 1.2 17-Nov-2012  tsutsui Appease warning "nbmake: ${TOUCHPROG} expands to empty string".
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file Makefile was added on branch yamt-pagecache on 2012-04-17 00:07:04 +0000
 1.4.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.4.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.4.2.1 17-Nov-2012  riz file Makefile was added on branch netbsd-6 on 2012-11-18 19:05:22 +0000
 1.6 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.5 14-Aug-2020  isaki Use fixed 'xx' instead of DEV and DEVDRV for simplicity.
There is no choice other than xx for now.
 1.4 17-Nov-2012  tsutsui branches: 1.4.2;
Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.
 1.3 17-Nov-2012  tsutsui Fix previous; no need to echo dummy command.
 1.2 17-Nov-2012  tsutsui Appease warning "nbmake: ${TOUCHPROG} expands to empty string".
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file Makefile was added on branch yamt-pagecache on 2012-04-17 00:07:04 +0000
 1.4.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.4.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.4.2.1 17-Nov-2012  riz file Makefile was added on branch netbsd-6 on 2012-11-18 19:05:22 +0000

RSS XML Feed