Home | History | Annotate | only in /src/sys/arch/amiga/stand/bootblock/boot
History log of /src/sys/arch/amiga/stand/bootblock/boot
RevisionDateAuthorComments
 1.63 08-Jun-2024  mlelstv Enable and use debug printfs to get some output into the build log.
 1.62 29-Apr-2022  rin Enable SA_HARDCODED_SECSIZE to shrink loaders slightly.
 1.61 29-Apr-2022  rin Now, cread.c can be built with -Os.

It was not a compiler bug actually; object code generated with
"-Os -Wa,-l" contains R_68K_16, which is not supported by elf2bb(1).

We should have fixed elf2bb(1), but the problem is gone at the moment.
 1.60 29-Apr-2022  rin Compile boot.amiga without -l option for gas(1).

Fix build failure due to relocation overflows for R_68K_PC16.
 1.59 27-Apr-2022  rin Revert previous.

On 2022/04/27 21:10, Rin Okuyama wrote:
> Module Name: src
> Committed By: rin
> Date: Wed Apr 27 12:10:47 UTC 2022
>
> Modified Files:
> src/sys/arch/amiga/stand/bootblock/boot: Makefile
>
> Log Message:
> Sprinkle SA_HARDCODED_SECSIZE; now everything fits into
> +/-32KB range visible for PC relative addressing mode.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.57 -r1.58 src/sys/arch/amiga/stand/bootblock/boot/Makefile
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
 1.58 27-Apr-2022  rin Sprinkle SA_HARDCODED_SECSIZE; now everything fits into
+/-32KB range visible for PC relative addressing mode.
 1.57 25-Feb-2021  rin Add FFSv2 support for primary- and second-stage boot loaders.

Rename primary-stage boot for FFSv1 (and ustarfs) to bootxx_ffsv1 for clarity.

Bump version to 3.1.
 1.56 09-Apr-2017  christos branches: 1.56.26;
make this work again.
 1.55 08-Apr-2017  christos centralize vers.c building for standalone programs.
 1.54 17-Sep-2016  christos branches: 1.54.2;
NOPIE
 1.53 15-Jan-2016  mlelstv branches: 1.53.2;
Add 'C' option to bootblock to enable serial console.
 1.52 19-Apr-2014  tsutsui branches: 1.52.4;
No need to use annoying HAVE_GCC to handle gcc48 m68k behavior chnages.
 1.51 19-Apr-2014  christos unbreak gcc4.5
 1.50 29-Mar-2014  mlelstv branches: 1.50.2;
Use different option (-mcpu=68030) to select target cpu for the assembler.
The old option (-m68030) causes it to complain about features used that
are not provided by the target cpu.
 1.49 21-Aug-2013  matt Use <bsd.klinks.mk>
Use ${_MKTARGET_*}
Use correct arguments to ${AR}
Fix entry symbol.
 1.48 18-Jul-2013  joerg Explicitly disable unwind tables for the boot loader.
 1.47 04-Oct-2011  chs branches: 1.47.2; 1.47.12; 1.47.16; 1.47.24;
build cread.c with -O1 to work around a gcc 4.5 bug.
 1.46 12-Jul-2011  mrg fix previous and only force the failure if reloc2bb already failed.
 1.45 11-Jul-2011  mrg improve the error message if elf2bb finds we are too large. if elf2bb
fails, make sure that the following nm -u's success doesn't cause make
to believe the target was built. now amiga builds with HAVE_GCC=45
actually fail here, rather than fail at sets time due to missing files.
 1.44 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.43 06-Jul-2010  mrg branches: 1.43.2; 1.43.4;
use elf2bb / elf2bb.h instead of the old, now gone aout2bb version.
 1.42 14-Mar-2010  mrg branches: 1.42.2;
update all of these makefiles for the .so -> .pico change.

most of them are most harmless, but the libgcc parts are quite essential.
before this change, all the special rules for .pico files were not applied,
and exception handling wasn't enabled. this caused c++ exceptions not to
work on sparc64.


this fixes the build of boost-headers (it was correctly calling exception
support broken!), which in turn makes all the things that depend upon it
to actually work again on sparc64.
 1.41 29-Dec-2009  elad branches: 1.41.2;
Don't abuse INSECURE for allowing exec() to load files not owned by uid 0.

Adjust references where this has been used.
 1.40 17-Oct-2009  mlelstv Add a serial console mode for the bootblock. In this mode all console
output will be echoed to the serial port and input will be accepted
from either keyboard or serial port. The bootblock serial console is
limited to 9600bps 8N1 as it uses the AmigaOS kernel debug routines.

To enable this you have to uncomment the SERCONSOLE define in
boot/Makefile.

Also note that the handling of a serial console in the kernel is
independent of this, you need to a build a kernel with 'options
SERCONSOLE'.
 1.39 12-Jan-2009  tsutsui - WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- add src/common/dist/zlib to INCPATH and remove unnecessary options
- remove -I${DESTDIR}/usr/include from INCPATH
 1.38 25-Jan-2006  is branches: 1.38.72; 1.38.76; 1.38.84;
Compile new zlib; compile it in a way that it doesn't inflate the bootblock
by 50% with tables. While we're here: use our own memmove().
 1.37 24-Jan-2006  is Use our own s(n)printf.
 1.36 02-Jan-2006  is Make the bootblocks compile again using the shared libc functions.
 1.35 11-Dec-2005  christos branches: 1.35.2;
merge ktrace-lwp.
 1.34 26-Oct-2003  lukem branches: 1.34.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.33 25-Oct-2003  mhitch Use -Os to shrink bootblock code a little more. Now bootxx_fd builds with
gcc 3.3.2.
 1.32 24-Aug-2003  he Adapt to new ufs.c needing memcmp and memmove.
 1.31 01-Apr-2003  he branches: 1.31.2;
The adler32.c file previously from libz is no longer needed.
 1.30 03-Feb-2003  mhitch Add 64 bit div/mod for 64 bit daddr_t changes and snprintf.
 1.29 31-May-2002  thorpej Add -ffreestanding.
 1.28 15-Apr-2002  mhitch branches: 1.28.2;
Don't copy boot.amiga to ${DESTDIR}/ - it is now done by the install/update
script, sysinst, or manually when the bootblock is installed.
 1.27 26-Mar-2002  mhitch Need to include files.o for the file descriptor table used by open().

The -S flag to indicate secondary boot no longer takes a size - size is
computed from input image.
 1.26 26-Jan-2002  aymeric include ${.CURDIR}/../Makefile.booters
 1.25 26-Jan-2002  aymeric s/BOOT_ELF/BOOT_ELF32/ inside a comment
 1.24 17-Dec-2001  mhitch Update amiga booter to two-stage booter.

First stage is bootxx_ffs (for ffs boot partitions) or bootxx_fd (for bootable
floppy disk). These locate, load, and execute the second stage loader boot.amiga.
The console screen is created and passed to the second stage loader.

The second stage loader uses loadfile() to load the kernel image, which can
be either a.out or ELF format, and can also be compressed. It will load a
kernel file from ffs file systems or the ustarfs used on floppy disks.
 1.23 10-Dec-2001  mhitch Add a left shift routine needed by changes in lib/libsa/ufs.c.
 1.22 02-Mar-2001  mhitch branches: 1.22.4; 1.22.8;
Use ${NM} and ${SIZE} so cross-compiling works. The machine and m68k include
directories still need to be fixed.
 1.21 17-Sep-2000  is Make this build again. Fixes by Michael Hitch.
 1.20 15-Apr-2000  is branches: 1.20.4;
Don't use runtime systems' includes.
 1.19 03-Apr-1999  is branches: 1.19.2;
make the Amiga bootblocks link again.
 1.18 03-Mar-1999  tron branches: 1.18.2;
Include "bsd.prog.mk" earlier so that "CFLAGS" doesn't get clobbered.
 1.17 06-Feb-1999  is Define _STANDALONE instead of STANDALONE.
 1.16 03-Jan-1999  veego Enable fdboot again.
 1.15 13-Nov-1998  is Simplify program structure to save a few bytes.
 1.14 08-May-1998  chopps remove -Z (load from chipmem) flag
fix copier code (startit) to work bi-directionally.
change compiler optimization options to save some bytes
 1.13 14-Jul-1997  veego s/BOOTBLOCKS/FILES/, remove the no longer needed install: rule and set the
BINDIR to /usr/mdec.
 1.12 23-Jun-1997  is fdboot is too big again. leave it out.
 1.11 19-May-1997  veego Make the install rule nicer.
 1.10 19-May-1997  is Yet another try to sanitize the bootblock build. Each major target has now
its own subdirectory.
Smaller changes involved:
- installboot installs to /usr/mdec
- installboot.8 installs to /usr/share/man/cat8/amiga/
 1.9 14-May-1997  veego Remove a : which is too much. fix pr#3621
 1.8 07-May-1997  mycroft Clean up weirdness.
 1.7 24-Apr-1997  veego remove a duplicated : for the install rule.
 1.6 24-Apr-1997  is - Minor brushup of man page.
- Try to fix manual installation.
 1.5 24-Mar-1997  mycroft Build fdboot.
 1.4 05-Feb-1997  is The last few libsa/open.c changes gradually increased code size, until fdboot
became too big. Disable its building, til we can squeeze a couple of bytes
out of the code again.
XXX Yes, this is a disgusting hack.
 1.3 23-Jan-1997  is Added libboot.a to the CLEANFILES.
 1.2 21-Jan-1997  is * make object dirs work:
- move the helper programs txlt and aout2bb to the topmost directory
- build the few files from libsa in the topmost directory

* while doing this, hunted down mysterious code expansion: It seems
that ld aligns code segments differently when linking .o's directly
than when using an archive consisting of the same files. Abuse this
effect to make the bootblock even smaller. The floppy boot block
"fdboot" is now small enough to build; add it back to the Makefile.

* while being here, remove a file which was committed by mistake.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.18.2.1 03-Apr-1999  is branches: 1.18.2.1.2;
From -current: add errno.c (to define the errno variable). This makes
the bootblocks link again.
 1.18.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.19.2.2 12-Mar-2001  bouyer Sync with HEAD.
 1.19.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.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.20.4.2 09-Feb-2002  he Pull up revision 1.23 (requested by mhitch):
Add a left-shift routine needed by lib/libsa/ufs.c due to changes
in fs.h.
 1.20.4.1 19-Sep-2000  is Pullup from -current, requested by is, granted by thorpej:
Changes by mhitch, needed for those directories to compile.
 1.22.8.5 20-Jun-2002  nathanw Catch up to -current.
 1.22.8.4 17-Apr-2002  nathanw Catch up to -current.
 1.22.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.22.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.22.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.22.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.22.4.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.22.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.28.2.1 09-Jul-2002  gehenna catch up with -current.
 1.31.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.31.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.31.2.1 03-Aug-2004  skrll Sync with HEAD
 1.34.16.1 21-Jun-2006  yamt sync with head.
 1.35.2.2 01-Feb-2006  yamt sync with head.
 1.35.2.1 15-Jan-2006  yamt sync with head.
 1.38.84.1 19-Jan-2009  skrll Sync with HEAD.
 1.38.76.3 11-Aug-2010  yamt sync with head.
 1.38.76.2 11-Mar-2010  yamt sync with head
 1.38.76.1 04-May-2009  yamt sync with head.
 1.38.72.1 17-Jan-2009  mjf Sync with HEAD.
 1.41.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.41.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.42.2.1 05-Mar-2011  rmind sync with head
 1.43.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.43.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.47.24.1 23-Jul-2013  riastradh sync with HEAD
 1.47.16.2 18-May-2014  rmind sync with head
 1.47.16.1 28-Aug-2013  rmind sync with head
 1.47.12.2 03-Dec-2017  jdolecek update from HEAD
 1.47.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.47.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.50.2.1 10-Aug-2014  tls Rebase.
 1.52.4.3 28-Aug-2017  skrll Sync with HEAD
 1.52.4.2 05-Oct-2016  skrll Sync with HEAD
 1.52.4.1 19-Mar-2016  skrll Sync with HEAD
 1.53.2.2 26-Apr-2017  pgoyette Sync with HEAD
 1.53.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.54.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.56.26.1 03-Apr-2021  thorpej Sync with HEAD.
 1.10 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.9 31-Jan-2006  is branches: 1.9.72; 1.9.74; 1.9.76;
Implement dealloc() - and implement alloc() in a way that it matches it.
 1.8 11-Mar-2001  mhitch branches: 1.8.8; 1.8.40; 1.8.52;
ELF ABI requires address to be returned in A0.
 1.7 02-Mar-2001  mhitch branches: 1.7.2;
More missing register prefixes and _C_LABEL()s for ELF. Should now compile
with ELF, but still needs an "elf2bb" program.
 1.6 01-Mar-2001  is Add register prefixes.
 1.5 26-Feb-2001  is use ENTRY_NOPROFILE and _C_LABEL, where appropriate.
 1.4 16-Feb-1999  is branches: 1.4.8;
Fix Copyright dates
 1.3 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.2 11-Nov-1998  is Correct the calls (use AllocVec() and FreeVec()),
in case somebody ever needs free().
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.4.8.1 12-Mar-2001  bouyer Sync with HEAD.
 1.7.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.8.52.1 01-Feb-2006  yamt sync with head.
 1.8.40.1 21-Jun-2006  yamt sync with head.
 1.8.8.2 11-Mar-2001  mhitch ELF ABI requires address to be returned in A0.
 1.8.8.1 11-Mar-2001  mhitch file alloc.s was added on branch nathanw_sa on 2001-03-11 20:10:05 +0000
 1.9.76.1 16-May-2008  yamt sync with head.
 1.9.74.1 18-May-2008  yamt sync with head.
 1.9.72.1 02-Jun-2008  mjf Sync with HEAD.
 1.5 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.4 31-Aug-2001  simonb branches: 1.4.6; 1.4.124; 1.4.126; 1.4.128;
Use comments around the token after a #endif.
 1.3 16-Feb-1999  is branches: 1.3.22;
Fix Copyright dates
 1.2 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.3.22.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.4.128.1 16-May-2008  yamt sync with head.
 1.4.126.1 18-May-2008  yamt sync with head.
 1.4.124.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.6.2 31-Aug-2001  simonb Use comments around the token after a #endif.
 1.4.6.1 31-Aug-2001  simonb file amigagraph.h was added on branch nathanw_sa on 2001-08-31 04:44:59 +0000
 1.4 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3 16-Feb-1999  is branches: 1.3.144; 1.3.146; 1.3.148;
Fix Copyright dates
 1.2 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.3.148.1 16-May-2008  yamt sync with head.
 1.3.146.1 18-May-2008  yamt sync with head.
 1.3.144.1 02-Jun-2008  mjf Sync with HEAD.
 1.8 04-Jan-2016  phx Make the -p option work, like with loadbsd.
Otherwise the kernel could load into a low-priority 512MB Z3 RAM segment.
 1.7 28-Apr-2008  martin branches: 1.7.44; 1.7.64;
Remove clause 3 and 4 from TNF licenses
 1.6 04-Mar-2007  christos branches: 1.6.40; 1.6.42; 1.6.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.5 26-Jan-2002  aymeric branches: 1.5.32; 1.5.70;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.4 11-Mar-2001  mhitch branches: 1.4.2; 1.4.8;
Pack the ExecBase structure to avoid aligning contraint problems with ELF
compiler
 1.3 16-Feb-1999  is branches: 1.3.8; 1.3.20;
Fix Copyright dates
 1.2 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.3.20.1 09-Apr-2001  nathanw Catch up with -current.
 1.3.8.1 12-Mar-2001  bouyer Sync with HEAD.
 1.4.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.4.8.1 11-Mar-2001  nathanw file amigatypes.h was added on branch nathanw_sa on 2002-02-28 04:07:07 +0000
 1.4.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.5.70.1 12-Mar-2007  rmind Sync with HEAD.
 1.5.32.1 03-Sep-2007  yamt sync with head.
 1.6.44.1 16-May-2008  yamt sync with head.
 1.6.42.1 18-May-2008  yamt sync with head.
 1.6.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.64.1 19-Mar-2016  skrll Sync with HEAD
 1.7.44.1 03-Dec-2017  jdolecek update from HEAD
 1.3 22-Aug-2020  isaki Fix register order. %d0 is higher and %d1 is lower.
This would have rarely affected.
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 10-Dec-2001  mhitch branches: 1.1.2; 1.1.4; 1.1.6; 1.1.124; 1.1.126; 1.1.128;
Add a left shift routine needed by changes in lib/libsa/ufs.c.
 1.1.128.1 16-May-2008  yamt sync with head.
 1.1.126.1 18-May-2008  yamt sync with head.
 1.1.124.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.6.2 09-Feb-2002  he Pull up revision 1.1 (new, requested by mhitch):
Add a left-shift routine needed by lib/libsa/ufs.c due to changes
in fs.h.
 1.1.6.1 10-Dec-2001  he file ashldi3.s was added on branch netbsd-1-5 on 2002-02-09 17:35:07 +0000
 1.1.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 10-Dec-2001  thorpej file ashldi3.s was added on branch kqueue on 2002-01-10 19:37:23 +0000
 1.1.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.1 10-Dec-2001  nathanw file ashldi3.s was added on branch nathanw_sa on 2002-01-08 00:23:00 +0000
 1.7 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6 02-Mar-2001  mhitch branches: 1.6.126; 1.6.128; 1.6.130;
More missing register prefixes and _C_LABEL()s for ELF. Should now compile
with ELF, but still needs an "elf2bb" program.
 1.5 01-Mar-2001  is Add register prefixes.
 1.4 26-Feb-2001  is use ENTRY_NOPROFILE and _C_LABEL, where appropriate.
 1.3 16-Feb-1999  is branches: 1.3.8;
Fix Copyright dates
 1.2 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.3.8.1 12-Mar-2001  bouyer Sync with HEAD.
 1.6.130.1 16-May-2008  yamt sync with head.
 1.6.128.1 18-May-2008  yamt sync with head.
 1.6.126.1 02-Jun-2008  mjf Sync with HEAD.
 1.15 29-Apr-2022  rin Simplify relocation rules.

Now, both single- and triple-byte encodings in relocation table
represent addrdiff (instead of absolute file offset for the latter).

Shave off one insn for boot.amiga. Also, for elf2bb(1), relocation
overflow is mitigated and detectable at least even if inevitable
(it seems unlikely to happen although).
 1.14 29-Apr-2022  rin Fix boot.amiga when relocation table is located beyond 0x8000.

In this case, we cannot load reltab directly into %a2 by movw:

For m68k, movw is actually synonym for different instructions when
its destination is data or address register, respectively.

(1) For data register, it is for move.w, which loads source into lower
half word with upper wharf word being kept untouched.

(2) For address register, it is movea.w, which loads source with
*sign extension*.

XXX
We should really stop using movw, and use move.w or movea.w explicitly.
However, this will end up with BIG diff...

Thanks ryo@ and isaki@ for comments offlist.
 1.13 06-Jul-2010  mrg remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

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

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


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
 1.12 28-Apr-2008  martin branches: 1.12.20; 1.12.22;
Remove clause 3 and 4 from TNF licenses
 1.11 26-Jan-2002  aymeric branches: 1.11.118; 1.11.120; 1.11.122;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.10 17-Dec-2001  mhitch Update amiga booter to two-stage booter.

First stage is bootxx_ffs (for ffs boot partitions) or bootxx_fd (for bootable
floppy disk). These locate, load, and execute the second stage loader boot.amiga.
The console screen is created and passed to the second stage loader.

The second stage loader uses loadfile() to load the kernel image, which can
be either a.out or ELF format, and can also be compressed. It will load a
kernel file from ffs file systems or the ustarfs used on floppy disks.
 1.9 24-Sep-2001  is branches: 1.9.4;
Put default command line into a fixed location with a known size.
This is intended to allow patching of the command line without a
compiler.
 1.8 02-Mar-2001  mhitch branches: 1.8.2; 1.8.4;
More missing register prefixes and _C_LABEL()s for ELF. Should now compile
with ELF, but still needs an "elf2bb" program.
 1.7 01-Mar-2001  is Add register prefixes.
 1.6 26-Feb-2001  is use ENTRY_NOPROFILE and _C_LABEL, where appropriate.
 1.5 16-Feb-1999  is branches: 1.5.8;
Fix Copyright dates
 1.4 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.3 13-Nov-1998  is Simplify program structure to save a few bytes.
 1.2 21-Jan-1997  is * make object dirs work:
- move the helper programs txlt and aout2bb to the topmost directory
- build the few files from libsa in the topmost directory

* while doing this, hunted down mysterious code expansion: It seems
that ld aligns code segments differently when linking .o's directly
than when using an archive consisting of the same files. Abuse this
effect to make the bootblock even smaller. The floppy boot block
"fdboot" is now small enough to build; add it back to the Makefile.

* while being here, remove a file which was committed by mistake.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.5.8.1 12-Mar-2001  bouyer Sync with HEAD.
 1.8.4.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.8.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.9.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.9.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.9.4.1 24-Sep-2001  nathanw file bbstart.s was added on branch nathanw_sa on 2002-01-08 00:23:00 +0000
 1.11.122.2 11-Aug-2010  yamt sync with head.
 1.11.122.1 16-May-2008  yamt sync with head.
 1.11.120.1 18-May-2008  yamt sync with head.
 1.11.118.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.22.1 05-Mar-2011  rmind sync with head
 1.12.20.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.9 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8 25-Jan-2006  is branches: 1.8.72; 1.8.74; 1.8.76;
Define memmove(), too.
 1.7 02-Mar-2001  mhitch branches: 1.7.40; 1.7.52;
More missing register prefixes and _C_LABEL()s for ELF. Should now compile
with ELF, but still needs an "elf2bb" program.
 1.6 01-Mar-2001  is Add register prefixes.
 1.5 26-Feb-2001  is use ENTRY_NOPROFILE and _C_LABEL, where appropriate.
 1.4 16-Feb-1999  is branches: 1.4.8;
Fix Copyright dates
 1.3 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.4.8.1 12-Mar-2001  bouyer Sync with HEAD.
 1.7.52.1 01-Feb-2006  yamt sync with head.
 1.7.40.1 21-Jun-2006  yamt sync with head.
 1.8.76.1 16-May-2008  yamt sync with head.
 1.8.74.1 18-May-2008  yamt sync with head.
 1.8.72.1 02-Jun-2008  mjf Sync with HEAD.
 1.6 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5 01-Mar-2001  is branches: 1.5.126; 1.5.128; 1.5.130;
Add register prefixes.
 1.4 26-Feb-2001  is use ENTRY_NOPROFILE and _C_LABEL, where appropriate.
 1.3 16-Feb-1999  is branches: 1.3.8;
Fix Copyright dates
 1.2 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.1 21-Jan-1997  is * make object dirs work:
- move the helper programs txlt and aout2bb to the topmost directory
- build the few files from libsa in the topmost directory

* while doing this, hunted down mysterious code expansion: It seems
that ld aligns code segments differently when linking .o's directly
than when using an archive consisting of the same files. Abuse this
effect to make the bootblock even smaller. The floppy boot block
"fdboot" is now small enough to build; add it back to the Makefile.

* while being here, remove a file which was committed by mistake.
 1.3.8.1 12-Mar-2001  bouyer Sync with HEAD.
 1.5.130.1 16-May-2008  yamt sync with head.
 1.5.128.1 18-May-2008  yamt sync with head.
 1.5.126.1 02-Jun-2008  mjf Sync with HEAD.
 1.2 13-Nov-1998  is Simplify program structure to save a few bytes.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.16 25-Mar-2023  abs Fix NetBSD/amiga bootblocks for Kickstart 3.2 - from Karoly Balogh

Kickstart 3.2 changed to not initialize console.device before
bootstrap, so the previous NetBSD bootblocks would crash when they
tried to initialise console output.

With this change if the call to the OpenDevice() stub fails, the
code now calls FindResident() and InitResident() before retrying
the OpenDevice().

Many thanks to Karoly Balogh for tracking this down (and also for
knowing just who to poke to get insight into the 3.2 changes :)
 1.15 18-Dec-2016  mlelstv branches: 1.15.46;
check for serial console flag also when re-using console from
primary bootstrap.
 1.14 15-Jan-2016  mlelstv branches: 1.14.2;
Add 'C' option to bootblock to enable serial console.
 1.13 17-Oct-2009  mlelstv branches: 1.13.22; 1.13.40;
Add a serial console mode for the bootblock. In this mode all console
output will be echoed to the serial port and input will be accepted
from either keyboard or serial port. The bootblock serial console is
limited to 9600bps 8N1 as it uses the AmigaOS kernel debug routines.

To enable this you have to uncomment the SERCONSOLE define in
boot/Makefile.

Also note that the handling of a serial console in the kernel is
independent of this, you need to a build a kernel with 'options
SERCONSOLE'.
 1.12 11-Oct-2009  mlelstv AmigaOS console.device expects a character buffer, not a pointer to an int.
This fixes printf() output.
 1.11 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.10 17-Mar-2009  he Make putchar() obey the stand.h prototype.
 1.9 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.8 28-Apr-2008  martin branches: 1.8.8; 1.8.14;
Remove clause 3 and 4 from TNF licenses
 1.7 11-Dec-2005  christos branches: 1.7.74; 1.7.76; 1.7.78;
merge ktrace-lwp.
 1.6 28-Jun-2005  junyoung #include <lib/libsa/stand.h> rather than <stand.h> or "stand.h"
 1.5 26-Jan-2002  aymeric branches: 1.5.16;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.4 17-Dec-2001  mhitch Update amiga booter to two-stage booter.

First stage is bootxx_ffs (for ffs boot partitions) or bootxx_fd (for bootable
floppy disk). These locate, load, and execute the second stage loader boot.amiga.
The console screen is created and passed to the second stage loader.

The second stage loader uses loadfile() to load the kernel image, which can
be either a.out or ELF format, and can also be compressed. It will load a
kernel file from ffs file systems or the ustarfs used on floppy disks.
 1.3 16-Feb-1999  is branches: 1.3.22; 1.3.26;
Fix Copyright dates
 1.2 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.3.26.2 28-Feb-2002  nathanw Catch up to -current.
 1.3.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.3.22.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.3.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.16.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.7.78.3 11-Mar-2010  yamt sync with head
 1.7.78.2 04-May-2009  yamt sync with head.
 1.7.78.1 16-May-2008  yamt sync with head.
 1.7.76.1 18-May-2008  yamt sync with head.
 1.7.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.8.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.13.40.2 05-Feb-2017  skrll Sync with HEAD
 1.13.40.1 19-Mar-2016  skrll Sync with HEAD
 1.13.22.1 03-Dec-2017  jdolecek update from HEAD
 1.14.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.15.46.1 30-Mar-2023  martin Pull up following revision(s) (requested by abs in ticket #133):

sys/arch/amiga/stand/bootblock/boot/libstubs.h: revision 1.8
sys/arch/amiga/stand/bootblock/boot/version: revision 1.3
sys/arch/amiga/stand/bootblock/boot/libstubs.s: revision 1.11
sys/arch/amiga/stand/bootblock/boot/console.c: revision 1.16

Fix NetBSD/amiga bootblocks for Kickstart 3.2 - from Karoly Balogh
Kickstart 3.2 changed to not initialize console.device before
bootstrap, so the previous NetBSD bootblocks would crash when they
tried to initialise console output.

With this change if the call to the OpenDevice() stub fails, the
code now calls FindResident() and InitResident() before retrying
the OpenDevice().

Many thanks to Karoly Balogh for tracking this down (and also for
knowing just who to poke to get insight into the 3.2 changes :)
 1.8 25-Mar-2023  abs Fix NetBSD/amiga bootblocks for Kickstart 3.2 - from Karoly Balogh

Kickstart 3.2 changed to not initialize console.device before
bootstrap, so the previous NetBSD bootblocks would crash when they
tried to initialise console output.

With this change if the call to the OpenDevice() stub fails, the
code now calls FindResident() and InitResident() before retrying
the OpenDevice().

Many thanks to Karoly Balogh for tracking this down (and also for
knowing just who to poke to get insight into the 3.2 changes :)
 1.7 17-Oct-2009  mlelstv branches: 1.7.94;
Add a serial console mode for the bootblock. In this mode all console
output will be echoed to the serial port and input will be accepted
from either keyboard or serial port. The bootblock serial console is
limited to 9600bps 8N1 as it uses the AmigaOS kernel debug routines.

To enable this you have to uncomment the SERCONSOLE define in
boot/Makefile.

Also note that the handling of a serial console in the kernel is
independent of this, you need to a build a kernel with 'options
SERCONSOLE'.
 1.6 28-Apr-2008  martin 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 17-Dec-2001  mhitch branches: 1.4.32;
Update amiga booter to two-stage booter.

First stage is bootxx_ffs (for ffs boot partitions) or bootxx_fd (for bootable
floppy disk). These locate, load, and execute the second stage loader boot.amiga.
The console screen is created and passed to the second stage loader.

The second stage loader uses loadfile() to load the kernel image, which can
be either a.out or ELF format, and can also be compressed. It will load a
kernel file from ffs file systems or the ustarfs used on floppy disks.
 1.3 16-Feb-1999  is branches: 1.3.22; 1.3.26;
Fix Copyright dates
 1.2 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.3.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.3.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.32.1 21-Jun-2006  yamt sync with head.
 1.5.78.2 11-Mar-2010  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.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.94.1 30-Mar-2023  martin Pull up following revision(s) (requested by abs in ticket #133):

sys/arch/amiga/stand/bootblock/boot/libstubs.h: revision 1.8
sys/arch/amiga/stand/bootblock/boot/version: revision 1.3
sys/arch/amiga/stand/bootblock/boot/libstubs.s: revision 1.11
sys/arch/amiga/stand/bootblock/boot/console.c: revision 1.16

Fix NetBSD/amiga bootblocks for Kickstart 3.2 - from Karoly Balogh
Kickstart 3.2 changed to not initialize console.device before
bootstrap, so the previous NetBSD bootblocks would crash when they
tried to initialise console output.

With this change if the call to the OpenDevice() stub fails, the
code now calls FindResident() and InitResident() before retrying
the OpenDevice().

Many thanks to Karoly Balogh for tracking this down (and also for
knowing just who to poke to get insight into the 3.2 changes :)
 1.11 25-Mar-2023  abs Fix NetBSD/amiga bootblocks for Kickstart 3.2 - from Karoly Balogh

Kickstart 3.2 changed to not initialize console.device before
bootstrap, so the previous NetBSD bootblocks would crash when they
tried to initialise console output.

With this change if the call to the OpenDevice() stub fails, the
code now calls FindResident() and InitResident() before retrying
the OpenDevice().

Many thanks to Karoly Balogh for tracking this down (and also for
knowing just who to poke to get insight into the 3.2 changes :)
 1.10 17-Oct-2009  mlelstv branches: 1.10.94;
Add a serial console mode for the bootblock. In this mode all console
output will be echoed to the serial port and input will be accepted
from either keyboard or serial port. The bootblock serial console is
limited to 9600bps 8N1 as it uses the AmigaOS kernel debug routines.

To enable this you have to uncomment the SERCONSOLE define in
boot/Makefile.

Also note that the handling of a serial console in the kernel is
independent of this, you need to a build a kernel with 'options
SERCONSOLE'.
 1.9 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8 17-Dec-2001  mhitch branches: 1.8.118; 1.8.120; 1.8.122;
Update amiga booter to two-stage booter.

First stage is bootxx_ffs (for ffs boot partitions) or bootxx_fd (for bootable
floppy disk). These locate, load, and execute the second stage loader boot.amiga.
The console screen is created and passed to the second stage loader.

The second stage loader uses loadfile() to load the kernel image, which can
be either a.out or ELF format, and can also be compressed. It will load a
kernel file from ffs file systems or the ustarfs used on floppy disks.
 1.7 11-Mar-2001  mhitch branches: 1.7.2; 1.7.8;
ELF ABI requires address to be returned in A0.

Change an external reference from absolute address to PC-relative.
 1.6 02-Mar-2001  mhitch branches: 1.6.2;
More missing register prefixes and _C_LABEL()s for ELF. Should now compile
with ELF, but still needs an "elf2bb" program.
 1.5 01-Mar-2001  is Add register prefixes.
 1.4 26-Feb-2001  is use ENTRY_NOPROFILE and _C_LABEL, where appropriate.
 1.3 16-Feb-1999  is branches: 1.3.8;
Fix Copyright dates
 1.2 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.3.8.1 12-Mar-2001  bouyer Sync with HEAD.
 1.6.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.7.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.7.8.1 11-Mar-2001  nathanw file libstubs.s was added on branch nathanw_sa on 2002-01-08 00:23:00 +0000
 1.7.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.122.2 11-Mar-2010  yamt sync with head
 1.8.122.1 16-May-2008  yamt sync with head.
 1.8.120.1 18-May-2008  yamt sync with head.
 1.8.118.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.94.1 30-Mar-2023  martin Pull up following revision(s) (requested by abs in ticket #133):

sys/arch/amiga/stand/bootblock/boot/libstubs.h: revision 1.8
sys/arch/amiga/stand/bootblock/boot/version: revision 1.3
sys/arch/amiga/stand/bootblock/boot/libstubs.s: revision 1.11
sys/arch/amiga/stand/bootblock/boot/console.c: revision 1.16

Fix NetBSD/amiga bootblocks for Kickstart 3.2 - from Karoly Balogh
Kickstart 3.2 changed to not initialize console.device before
bootstrap, so the previous NetBSD bootblocks would crash when they
tried to initialise console output.

With this change if the call to the OpenDevice() stub fails, the
code now calls FindResident() and InitResident() before retrying
the OpenDevice().

Many thanks to Karoly Balogh for tracking this down (and also for
knowing just who to poke to get insight into the 3.2 changes :)
 1.32 05-Dec-2021  msaitoh s/supress/suppress/
 1.31 11-Jun-2016  dholland PR 51200 gets in libsa considered harmful: use kgets
 1.30 04-Jan-2016  phx Make the -p option work, like with loadbsd.
Otherwise the kernel could load into a low-priority 512MB Z3 RAM segment.
 1.29 29-Mar-2014  mlelstv branches: 1.29.6;
Test mode is not implemented. Appease compiler.
 1.28 10-Jul-2011  mhitch branches: 1.28.2; 1.28.12; 1.28.16;
Add a serial console flag passed from the boot loader to the kernel to
allow enabling the serial console with the boot command. Loadbsd has
the option added, but I am not able to buid a new loadbsd binary at this
time, so only the bootxx loader can set the option.
 1.27 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.26 13-Jan-2011  phx branches: 1.26.2; 1.26.4;
Recognize Amiga 600 model.
Patch submited by Radoslaw Kujawa.
 1.25 15-Nov-2009  snj branches: 1.25.4;
Drop 3rd and 4th clauses (except in one case, where copyright is shared
with UCB and only the 3rd clause is dropped). Approved by mhitch@ and is@
(copyright holders).
 1.24 12-Jan-2009  tsutsui - WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- add src/common/dist/zlib to INCPATH and remove unnecessary options
- remove -I${DESTDIR}/usr/include from INCPATH
 1.23 04-Mar-2007  christos branches: 1.23.40; 1.23.44; 1.23.52;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.22 27-Jun-2006  tsutsui branches: 1.22.10;
- fix signed/unsigned mismatch
- fix lvalue cast
 1.21 25-Jan-2006  christos branches: 1.21.2; 1.21.6; 1.21.14;
free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.20 11-Dec-2005  christos branches: 1.20.2;
merge ktrace-lwp.
 1.19 28-Jun-2005  junyoung branches: 1.19.2;
#include <lib/libsa/stand.h> rather than <stand.h> or "stand.h"
 1.18 28-Jun-2005  junyoung Remove trailing spaces.
 1.17 20-Jan-2003  simonb branches: 1.17.2;
The Double-Semi-Colon Police.
 1.16 10-Dec-2002  thorpej Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is.
 1.15 26-Jan-2002  aymeric - ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.14 17-Dec-2001  mhitch Update amiga booter to two-stage booter.

First stage is bootxx_ffs (for ffs boot partitions) or bootxx_fd (for bootable
floppy disk). These locate, load, and execute the second stage loader boot.amiga.
The console screen is created and passed to the second stage loader.

The second stage loader uses loadfile() to load the kernel image, which can
be either a.out or ELF format, and can also be compressed. It will load a
kernel file from ffs file systems or the ustarfs used on floppy disks.
 1.13 24-Sep-2001  is branches: 1.13.4;
Put default command line into a fixed location with a known size.
This is intended to allow patching of the command line without a
compiler.
 1.12 24-Sep-2000  jdolecek branches: 1.12.2; 1.12.4;
this file was oversight at first (pointed out by is):

Add new boot flags -v, -q, which switch on AB_VERBOSE or AB_QUIET
respectively. This follows recent bootverbose/bootquiet changes.
 1.11 28-Nov-1999  is Very initial support for booting PPC kernels on P5 boards.
 1.10 13-Nov-1998  is branches: 1.10.10; 1.10.16;
Simplify program structure to save a few bytes.
 1.9 31-Oct-1998  is Make the exec header an automatic variable, instead of malloc()ed space.
Saves 60 bytes of code.
 1.8 08-May-1998  chopps add -m and -k flags
 1.7 08-May-1998  chopps remove -Z (load from chipmem) flag
fix copier code (startit) to work bi-directionally.
change compiler optimization options to save some bytes
 1.6 24-Mar-1997  mycroft Fix calculation of fmem and fmemsz for old ROMs.
 1.5 24-Mar-1997  mycroft Make the segment rounding code consistent. (No functional change.)
If DEBUG_MEMORY_LIST, wait for a keypress before starting the kernel; never
time out.
 1.4 24-Mar-1997  mycroft Kluge to allow building on a M68K4K system.
 1.3 01-Feb-1997  mhitch Use the disk offset to the boot block (first block in the partition) to
pass the block number of the boot partition to the kernel. The kernel
will use the block number to determine which disk device the kernel was
booted from and set the boot device based on that instead of the old
"generic" method.
 1.2 21-Jan-1997  is * make object dirs work:
- move the helper programs txlt and aout2bb to the topmost directory
- build the few files from libsa in the topmost directory

* while doing this, hunted down mysterious code expansion: It seems
that ld aligns code segments differently when linking .o's directly
than when using an archive consisting of the same files. Abuse this
effect to make the bootblock even smaller. The floppy boot block
"fdboot" is now small enough to build; add it back to the Makefile.

* while being here, remove a file which was committed by mistake.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.10.16.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.10.10.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.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.12.4.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.12.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.12.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.13.4.4 11-Dec-2002  thorpej Sync with HEAD.
 1.13.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.13.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.13.4.1 24-Sep-2001  nathanw file main.c was added on branch nathanw_sa on 2002-01-08 00:23:00 +0000
 1.17.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.19.2.3 03-Sep-2007  yamt sync with head.
 1.19.2.2 30-Dec-2006  yamt sync with head.
 1.19.2.1 21-Jun-2006  yamt sync with head.
 1.20.2.1 01-Feb-2006  yamt sync with head.
 1.21.14.1 13-Jul-2006  gdamore Merge from HEAD.
 1.21.6.1 11-Aug-2006  yamt sync with head
 1.21.2.1 09-Sep-2006  rpaulo sync with head
 1.22.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.23.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.23.44.2 11-Mar-2010  yamt sync with head
 1.23.44.1 04-May-2009  yamt sync with head.
 1.23.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.25.4.1 05-Mar-2011  rmind sync with head
 1.26.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.26.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.28.16.1 18-May-2014  rmind sync with head
 1.28.12.2 03-Dec-2017  jdolecek update from HEAD
 1.28.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.28.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.29.6.2 09-Jul-2016  skrll Sync with HEAD
 1.29.6.1 19-Mar-2016  skrll Sync with HEAD
 1.7 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6 02-Mar-2001  mhitch branches: 1.6.126; 1.6.128; 1.6.130;
More missing register prefixes and _C_LABEL()s for ELF. Should now compile
with ELF, but still needs an "elf2bb" program.
 1.5 01-Mar-2001  is Add register prefixes.
 1.4 26-Feb-2001  is use ENTRY_NOPROFILE and _C_LABEL, where appropriate.
 1.3 16-Feb-1999  is branches: 1.3.8;
Fix Copyright dates
 1.2 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.3.8.1 12-Mar-2001  bouyer Sync with HEAD.
 1.6.130.1 16-May-2008  yamt sync with head.
 1.6.128.1 18-May-2008  yamt sync with head.
 1.6.126.1 02-Jun-2008  mjf Sync with HEAD.
 1.3 12-Jan-2009  tsutsui - WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- add src/common/dist/zlib to INCPATH and remove unnecessary options
- remove -I${DESTDIR}/usr/include from INCPATH
 1.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 17-Dec-2001  mhitch branches: 1.1.2; 1.1.4; 1.1.122; 1.1.124; 1.1.126;
Update amiga booter to two-stage booter.

First stage is bootxx_ffs (for ffs boot partitions) or bootxx_fd (for bootable
floppy disk). These locate, load, and execute the second stage loader boot.amiga.
The console screen is created and passed to the second stage loader.

The second stage loader uses loadfile() to load the kernel image, which can
be either a.out or ELF format, and can also be compressed. It will load a
kernel file from ffs file systems or the ustarfs used on floppy disks.
 1.1.126.2 04-May-2009  yamt sync with head.
 1.1.126.1 16-May-2008  yamt sync with head.
 1.1.124.1 18-May-2008  yamt sync with head.
 1.1.122.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.122.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 17-Dec-2001  thorpej file panic.c was added on branch kqueue on 2002-01-10 19:37:24 +0000
 1.1.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.1 17-Dec-2001  nathanw file panic.c was added on branch nathanw_sa on 2002-01-08 00:23:00 +0000
 1.2.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.10 26-Mar-2014  christos mark unused
 1.9 22-Mar-2014  christos kill sprintf
fix unused variables
 1.8 28-Apr-2008  martin branches: 1.8.34; 1.8.44; 1.8.50;
Remove clause 3 and 4 from TNF licenses
 1.7 24-Jan-2006  is branches: 1.7.72; 1.7.74; 1.7.76;
Implement sprintf and snprintf.
 1.6 02-Mar-2001  mhitch branches: 1.6.40; 1.6.52;
More missing register prefixes and _C_LABEL()s for ELF. Should now compile
with ELF, but still needs an "elf2bb" program.
 1.5 01-Mar-2001  is Add register prefixes.
 1.4 26-Feb-2001  is use ENTRY_NOPROFILE and _C_LABEL, where appropriate.
 1.3 16-Feb-1999  is branches: 1.3.8;
Fix Copyright dates
 1.2 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.3.8.1 12-Mar-2001  bouyer Sync with HEAD.
 1.6.52.1 01-Feb-2006  yamt sync with head.
 1.6.40.1 21-Jun-2006  yamt sync with head.
 1.7.76.1 16-May-2008  yamt sync with head.
 1.7.74.1 18-May-2008  yamt sync with head.
 1.7.72.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.50.1 18-May-2014  rmind sync with head
 1.8.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.34.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.6 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5 17-Dec-2001  mhitch branches: 1.5.118; 1.5.120; 1.5.122;
Update amiga booter to two-stage booter.

First stage is bootxx_ffs (for ffs boot partitions) or bootxx_fd (for bootable
floppy disk). These locate, load, and execute the second stage loader boot.amiga.
The console screen is created and passed to the second stage loader.

The second stage loader uses loadfile() to load the kernel image, which can
be either a.out or ELF format, and can also be compressed. It will load a
kernel file from ffs file systems or the ustarfs used on floppy disks.
 1.4 16-Feb-1999  is branches: 1.4.22; 1.4.26;
Fix Copyright dates
 1.3 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.2 25-Nov-1998  frueauf pain(void) -> pain(void *), pointed out by Adam Ciarcinski.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.4.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.4.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.122.1 16-May-2008  yamt sync with head.
 1.5.120.1 18-May-2008  yamt sync with head.
 1.5.118.1 02-Jun-2008  mjf Sync with HEAD.
 1.9 15-Nov-2009  snj Drop 3rd and 4th clauses (except in one case, where copyright is shared
with UCB and only the 3rd clause is dropped). Approved by mhitch@ and is@
(copyright holders).
 1.8 02-Mar-2001  mhitch branches: 1.8.130;
More missing register prefixes and _C_LABEL()s for ELF. Should now compile
with ELF, but still needs an "elf2bb" program.
 1.7 01-Mar-2001  is Add register prefixes.
 1.6 26-Feb-2001  is use ENTRY_NOPROFILE and _C_LABEL, where appropriate.
 1.5 11-Nov-1998  is branches: 1.5.10;
Switch off the cache later.
Apparently, this avoids a problem on DraCos with HyperCom boards.
 1.4 06-Nov-1998  is Add color debug code for DraCos.
 1.3 08-May-1998  chopps remove -Z (load from chipmem) flag
fix copier code (startit) to work bi-directionally.
change compiler optimization options to save some bytes
 1.2 01-Feb-1997  mhitch Use the disk offset to the boot block (first block in the partition) to
pass the block number of the boot partition to the kernel. The kernel
will use the block number to determine which disk device the kernel was
booted from and set the boot device based on that instead of the old
"generic" method.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.5.10.1 12-Mar-2001  bouyer Sync with HEAD.
 1.8.130.1 11-Mar-2010  yamt sync with head
 1.5 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.4 11-Dec-2005  christos branches: 1.4.78; 1.4.86; 1.4.92;
merge ktrace-lwp.
 1.3 28-Jun-2005  junyoung #include <lib/libsa/stand.h> rather than <stand.h> or "stand.h"
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is branches: 1.1.1.1.56;
First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.1.1.1.56.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.1.1.56.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.56.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.56.1 03-Aug-2004  skrll 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.3 25-Mar-2023  abs Fix NetBSD/amiga bootblocks for Kickstart 3.2 - from Karoly Balogh

Kickstart 3.2 changed to not initialize console.device before
bootstrap, so the previous NetBSD bootblocks would crash when they
tried to initialise console output.

With this change if the call to the OpenDevice() stub fails, the
code now calls FindResident() and InitResident() before retrying
the OpenDevice().

Many thanks to Karoly Balogh for tracking this down (and also for
knowing just who to poke to get insight into the 3.2 changes :)
 1.2 25-Feb-2021  rin branches: 1.2.18;
Add FFSv2 support for primary- and second-stage boot loaders.

Rename primary-stage boot for FFSv1 (and ustarfs) to bootxx_ffsv1 for clarity.

Bump version to 3.1.
 1.1 17-Dec-2001  mhitch branches: 1.1.2; 1.1.4; 1.1.222;
Update amiga booter to two-stage booter.

First stage is bootxx_ffs (for ffs boot partitions) or bootxx_fd (for bootable
floppy disk). These locate, load, and execute the second stage loader boot.amiga.
The console screen is created and passed to the second stage loader.

The second stage loader uses loadfile() to load the kernel image, which can
be either a.out or ELF format, and can also be compressed. It will load a
kernel file from ffs file systems or the ustarfs used on floppy disks.
 1.1.222.1 03-Apr-2021  thorpej Sync with HEAD.
 1.1.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 17-Dec-2001  thorpej file version was added on branch kqueue on 2002-01-10 19:37:24 +0000
 1.1.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.1 17-Dec-2001  nathanw file version was added on branch nathanw_sa on 2002-01-08 00:23:01 +0000
 1.2.18.1 30-Mar-2023  martin Pull up following revision(s) (requested by abs in ticket #133):

sys/arch/amiga/stand/bootblock/boot/libstubs.h: revision 1.8
sys/arch/amiga/stand/bootblock/boot/version: revision 1.3
sys/arch/amiga/stand/bootblock/boot/libstubs.s: revision 1.11
sys/arch/amiga/stand/bootblock/boot/console.c: revision 1.16

Fix NetBSD/amiga bootblocks for Kickstart 3.2 - from Karoly Balogh
Kickstart 3.2 changed to not initialize console.device before
bootstrap, so the previous NetBSD bootblocks would crash when they
tried to initialise console output.

With this change if the call to the OpenDevice() stub fails, the
code now calls FindResident() and InitResident() before retrying
the OpenDevice().

Many thanks to Karoly Balogh for tracking this down (and also for
knowing just who to poke to get insight into the 3.2 changes :)
 1.11 25-Feb-2021  rin Add FFSv2 support for primary- and second-stage boot loaders.

Rename primary-stage boot for FFSv1 (and ustarfs) to bootxx_ffsv1 for clarity.

Bump version to 3.1.
 1.10 14-Mar-2009  dsl branches: 1.10.76;
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.9 27-Jun-2006  tsutsui branches: 1.9.62; 1.9.70; 1.9.76;
Remove static from devsw[] declaration since it's declared as extern
in <lib/libsa/stand.h>.
 1.8 11-Dec-2005  christos branches: 1.8.4; 1.8.8; 1.8.16;
merge ktrace-lwp.
 1.7 28-Jun-2005  junyoung branches: 1.7.2;
#include <lib/libsa/stand.h> rather than <stand.h> or "stand.h"
 1.6 23-Jun-2005  junyoung Use FS_OPS() macro.
 1.5 26-Jan-2002  aymeric branches: 1.5.16;
- ANSIfy
- remove some trailing spaces/tabs
- minor style nits
 1.4 17-Dec-2001  mhitch Update amiga booter to two-stage booter.

First stage is bootxx_ffs (for ffs boot partitions) or bootxx_fd (for bootable
floppy disk). These locate, load, and execute the second stage loader boot.amiga.
The console screen is created and passed to the second stage loader.

The second stage loader uses loadfile() to load the kernel image, which can
be either a.out or ELF format, and can also be compressed. It will load a
kernel file from ffs file systems or the ustarfs used on floppy disks.
 1.3 01-Feb-1997  mhitch branches: 1.3.36; 1.3.40;
Use the disk offset to the boot block (first block in the partition) to
pass the block number of the boot partition to the kernel. The kernel
will use the block number to determine which disk device the kernel was
booted from and set the boot device based on that instead of the old
"generic" method.
 1.2 21-Jan-1997  is * make object dirs work:
- move the helper programs txlt and aout2bb to the topmost directory
- build the few files from libsa in the topmost directory

* while doing this, hunted down mysterious code expansion: It seems
that ld aligns code segments differently when linking .o's directly
than when using an archive consisting of the same files. Abuse this
effect to make the bootblock even smaller. The floppy boot block
"fdboot" is now small enough to build; add it back to the Makefile.

* while being here, remove a file which was committed by mistake.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.3.40.2 28-Feb-2002  nathanw Catch up to -current.
 1.3.40.1 08-Jan-2002  nathanw Catch up to -current.
 1.3.36.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.3.36.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.16.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.7.2.1 30-Dec-2006  yamt sync with head.
 1.8.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.8.8.1 11-Aug-2006  yamt sync with head
 1.8.4.1 09-Sep-2006  rpaulo sync with head
 1.9.76.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.70.1 28-Apr-2009  skrll Sync with HEAD.
 1.9.62.1 04-May-2009  yamt sync with head.
 1.10.76.1 03-Apr-2021  thorpej Sync with HEAD.
 1.4 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3 16-Feb-1999  is branches: 1.3.144; 1.3.146; 1.3.148;
Fix Copyright dates
 1.2 16-Feb-1999  is Assign my files to The NetBSD Foundation, Inc.
 1.1 29-Nov-1996  is branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1996  is First version of a NetBSD-Amiga bootblock compilable from within NetBSD,
along with toolchain enhancements.

aout2bb transforms a.out files with reloc information into bootblock format
files with a compressed relocation info.

bbstart.s relocates the bootblock using this compressed info, before jumping
to C code.

txlt changes some more of the absolute references to pc-relative ones (we know
we have a single code + data address space).

If you ever try to change this: don't even dare to change the compiler options;
they were found in weeks of trial and error as the ones producing the smallest
(not necessarily fastests) code.

installboot is just a script around dd, for now.

Some ideas by Michael Hitch, Leo Weppelman and Jason Thorpe; bugs added
by myself.
 1.3.148.1 16-May-2008  yamt sync with head.
 1.3.146.1 18-May-2008  yamt sync with head.
 1.3.144.1 02-Jun-2008  mjf Sync with HEAD.

RSS XML Feed