Home | History | Annotate | Download | only in ofwboot
History log of /src/sys/arch/macppc/stand/ofwboot/boot.c
RevisionDateAuthorComments
 1.32  13-Jan-2025  tsutsui Tweak bootpath strings in ofwboot for OpenBIOS used on qemu-system-ppc.

Bump version to denote the visible change.

This makes qemu-system-ppc -M mac99 booting from a harddisk image
using ofwboot installed by installboot(8) with /usr/mdec/bootxx:
---
% qemu-system-ppc --version
QEMU emulator version 9.1.2
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers
% qemu-system-ppc -M mac99 -drive file=NetBSD-10.1-macppc.img,media=disk,format=raw -nographic

>> =============================================================
>> OpenBIOS 1.1 [Mar 7 2023 22:21]
>> Configuration device id QEMU version 1 machine id 1
>> CPUs: 1
>> Memory: 128M
>> UUID: 00000000-0000-0000-0000-000000000000
>> CPU type PowerPC,G4
milliseconds isn't unique.
Welcome to OpenBIOS v1.1 built on Mar 7 2023 22:21
Trying hd:,\\:tbxi...
Trying hd:,\ppc\bootinfo.txt...
Trying hd:,%BOOT...
>> Not a bootable ELF image
>> switching to new context:

OF_open bootpath=/pci@f2000000/mac-io@c/ata-3@20000/disk@0
read stage 2 blocks: 01234. done!
starting stage 2...

>> NetBSD/macppc OpenFirmware Boot, Revision 1.14 (Mon Jan 13 14:50:50 UTC 2025)
>> Open Firmware version 3.x
>> Open Firmware running in virtual-mode.
prom2boot: bootpath from OF: "/pci@f2000000/mac-io@c/ata-3@20000/disk@0:,%BOOT"
prom2boot: bootpath patched: "/pci@f2000000/mac-io@c/ata-3@20000/disk@0:"
bootline=
Trying /netbsd
11860332+167196 [463456+447084]=0xc570ec
start=0x100000
[ 1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
[ 1.0000000] 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
[ 1.0000000] 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023,
[ 1.0000000] 2024
[ 1.0000000] The NetBSD Foundation, Inc. All rights reserved.
[ 1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[ 1.0000000] The Regents of the University of California. All rights reserved.

[ 1.0000000] NetBSD 10.1 (GENERIC) #0: Mon Dec 16 13:08:11 UTC 2024
[ 1.0000000] mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/macppc/compile/GENERIC
---
 1.31  28-Feb-2021  thorpej branches: 1.31.18; 1.31.24;
- When starting the boot program, cache a bunch of OFW frequently used
ihandles / phandles, rather than fetching them all the time.
- Change the signature of OF_call_method() to take an array of cells for
the inputs and outputs, rather than using variadic arguments. This
makes it much easier to use OF_call_method() when the format of the
arguments passed to a given method are determined at run-time
(due to e.g. #address-cells).
- Properly inform OpenFirmware where the kernel is loaded by using
"claim" on /chosen/memory and, if running in virtual-mode, using
"claim" on /chosen/mmu to reserve the VA, and "map" on /chosen/mmu
to enter the translation. (The kernel is still always mapped VA==PA.)
 1.30  23-Apr-2020  joerg branches: 1.30.2;
bootfile is owned by libsa
 1.29  06-Jun-2018  uwe branches: 1.29.12;
Provide an option to use libsa allocator. Not yet enabled. Same
binary code is generated.

To enable uncomment -DHEAP_VARIABLE and comment out alloc.c in the
makefile.

PR port-macppc/44895
 1.28  11-Jun-2016  dholland branches: 1.28.16;
PR 51200 gets in libsa considered harmful: use kgets
 1.27  19-Feb-2012  tsutsui branches: 1.27.2; 1.27.16;
Fix boot failure on OF 2.0 machines.

Discussed with phx@ on port-macppc@:
http://mail-index.NetBSD.org/port-macppc/2012/02/18/msg001556.html

Should be pulled up to netbsd-6.
 1.26  22-Jan-2011  joerg branches: 1.26.4; 1.26.8; 1.26.10;
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.25  25-Aug-2010  christos branches: 1.25.2; 1.25.4;
s/LOAD_NOTE/LOAD_BACKWARDS/
 1.24  29-Mar-2010  mrg avoid some warnings on powerpc64.
 1.23  28-Jan-2009  tsutsui branches: 1.23.4; 1.23.6;
- modify a pathname parse function to explicitly return devname and filename
- check floppyboot properly per devname before loadfile(), not in devopen()
- disable LOAD_NOTE on floppyboot to avoid backward seek
- bump revision

Tested floppy boot and IDE boot on Apus2000 with OpenFirmware 2.0.

Fixes PR install/38943 on macppc.
 1.22  28-Apr-2008  martin branches: 1.22.8; 1.22.10;
Remove clause 3 and 4 from TNF licenses
 1.21  27-Jan-2006  uwe branches: 1.21.72; 1.21.74; 1.21.76;
Call freeall() from chain() to match the code for other ofw platforms.
freeall() is a no-op.
 1.20  27-Jan-2006  uwe Make WARNS=4 happy.
 1.19  11-Dec-2005  christos branches: 1.19.2;
merge ktrace-lwp.
 1.18  31-May-2004  schmonz branches: 1.18.12;
Support userconf(4) ("boot -c"). Reviewed by Bill Studenmund.
 1.17  26-Dec-2003  aymeric branches: 1.17.2;
ANSIfy and clean up prototypes.
This has been lying around in my tree for too long now.
 1.16  30-Mar-2002  tsutsui branches: 1.16.10;
Add changedisk_hook() for ustarfs. (from tsubai)
 1.15  29-Mar-2002  tsutsui Remove unused define/include/variable.
 1.14  29-Mar-2002  tsutsui Cosmetics.
 1.13  23-Aug-2001  tsubai branches: 1.13.6;
Fix a bug introduced when machine_type.h was removed.
Now the kernel can read symbol table again.
 1.12  13-Aug-2001  tsubai Search "/netbsd.gz" and "/netbsd.macppc" in addition to "/netbsd".
 1.11  22-Jul-2001  wiz bcopy -> memcpy, bzero -> memset, bcmp -> memcmp.
Reviewed by Matt Thomas, ok'd by Tsubai Masanari.
 1.10  03-May-2001  soren branches: 1.10.2;
PPC machine type tags haven't been used for a while.
 1.9  24-Sep-2000  jdolecek branches: 1.9.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.8  25-Jul-2000  tsubai Use libsa alloc().
 1.7  03-Aug-1999  tsubai branches: 1.7.2;
Make ``boot kernelname'' work on OF-3.x too.
 1.6  29-Apr-1999  tsubai Use MI loadfile().
 1.5  17-Apr-1999  ws Modify syncicache on PowerPC from an inline to a real function.
Support different cache line sizes with the same object code in userland.
While here, move the function to implementation name space.
 1.4  05-Mar-1999  tsubai branches: 1.4.4;
Modify parseargs() so that device names can contain '-'.
 1.3  24-Jul-1998  tsubai Comment out "insert root disk..." message.
Remove unnecessary video init.
 1.2  13-Jul-1998  tsubai Use "boot-device" if "bootpath" is not set.
 1.1  15-May-1998  tsubai Initial import of macppc port.
 1.4.4.1  21-Jun-1999  thorpej Sync w/ -current.
 1.7.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.9.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.10.2.3  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.10.2.2  25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.10.2.1  03-Aug-2001  lukem update to -current
 1.13.6.2  17-Apr-2002  nathanw Catch up to -current.
 1.13.6.1  23-Aug-2001  nathanw file boot.c was added on branch nathanw_sa on 2002-04-17 00:03:44 +0000
 1.16.10.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.16.10.2  18-Sep-2004  skrll Sync with HEAD.
 1.16.10.1  03-Aug-2004  skrll Sync with HEAD
 1.17.2.1  01-Jun-2004  jmc Pullup rev 1.18 (requested by schmonz in ticket #428)

Support userconf(4) ("boot -c").
 1.18.12.1  21-Jun-2006  yamt sync with head.
 1.19.2.1  01-Feb-2006  yamt sync with head.
 1.21.76.4  09-Oct-2010  yamt sync with head
 1.21.76.3  11-Aug-2010  yamt sync with head.
 1.21.76.2  04-May-2009  yamt sync with head.
 1.21.76.1  16-May-2008  yamt sync with head.
 1.21.74.1  18-May-2008  yamt sync with head.
 1.21.72.1  02-Jun-2008  mjf Sync with HEAD.
 1.22.10.1  02-Feb-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #407):
sys/arch/macppc/stand/ofwboot/boot.c: revision 1.23
sys/arch/macppc/stand/ofwboot/boot.h: revision 1.3
sys/arch/macppc/stand/ofwboot/ofdev.c: revision 1.22
sys/arch/macppc/stand/ofwboot/ofdev.h: revision 1.6
sys/arch/macppc/stand/ofwboot/version: revision 1.12
- modify a pathname parse function to explicitly return devname and filename
- check floppyboot properly per devname before loadfile(), not in devopen()
- disable LOAD_NOTE on floppyboot to avoid backward seek
- bump revision
Tested floppy boot and IDE boot on Apus2000 with OpenFirmware 2.0.
Fixes PR install/38943 on macppc.
 1.22.8.1  03-Mar-2009  skrll Sync with HEAD.
 1.23.6.2  05-Mar-2011  rmind sync with head
 1.23.6.1  30-May-2010  rmind sync with head
 1.23.4.2  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.23.4.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.25.4.1  08-Feb-2011  bouyer Sync with HEAD
 1.25.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.26.10.1  22-Feb-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #22):
sys/arch/macppc/stand/ofwboot/boot.c: revision 1.27
sys/arch/macppc/stand/ofwboot/boot.h: revision 1.4
sys/arch/macppc/stand/ofwboot/ofdev.c: revision 1.26
Fix boot failure on OF 2.0 machines.
Discussed with phx@ on port-macppc@:
http://mail-index.NetBSD.org/port-macppc/2012/02/18/msg001556.html
Should be pulled up to netbsd-6.
 1.26.8.1  24-Feb-2012  mrg sync to -current.
 1.26.4.1  17-Apr-2012  yamt sync with head
 1.27.16.1  09-Jul-2016  skrll Sync with HEAD
 1.27.2.1  03-Dec-2017  jdolecek update from HEAD
 1.28.16.1  25-Jun-2018  pgoyette Sync with HEAD
 1.29.12.1  25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.30.2.1  03-Apr-2021  thorpej Sync with HEAD.
 1.31.24.1  02-Aug-2025  perseant Sync with HEAD
 1.31.18.1  20-Feb-2025  martin Pull up following revision(s) (requested by tsutsui in ticket #1048):

sys/arch/macppc/stand/ofwboot/version: revision 1.16
sys/arch/macppc/stand/ofwboot/boot.c: revision 1.32

Tweak bootpath strings in ofwboot for OpenBIOS used on qemu-system-ppc.
Bump version to denote the visible change.

This makes qemu-system-ppc -M mac99 booting from a harddisk image
using ofwboot installed by installboot(8) with /usr/mdec/bootxx:
---
% qemu-system-ppc --version
QEMU emulator version 9.1.2
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers
% qemu-system-ppc -M mac99 -drive file=NetBSD-10.1-macppc.img,media=disk,format=raw -nographic
> =============================================================
> OpenBIOS 1.1 [Mar 7 2023 22:21]
> Configuration device id QEMU version 1 machine id 1
> CPUs: 1
> Memory: 128M
> UUID: 00000000-0000-0000-0000-000000000000
> CPU type PowerPC,G4
milliseconds isn't unique.
Welcome to OpenBIOS v1.1 built on Mar 7 2023 22:21
Trying hd:,\\:tbxi...
Trying hd:,\ppc\bootinfo.txt...
Trying hd:,%BOOT...
> Not a bootable ELF image
> switching to new context:
OF_open bootpath=/pci@f2000000/mac-io@c/ata-3@20000/disk@0
read stage 2 blocks: 01234. done!
starting stage 2...
> NetBSD/macppc OpenFirmware Boot, Revision 1.14 (Mon Jan 13 14:50:50 UTC 2025)
> Open Firmware version 3.x
> Open Firmware running in virtual-mode.
prom2boot: bootpath from OF: "/pci@f2000000/mac-io@c/ata-3@20000/disk@0:,%BOOT"
prom2boot: bootpath patched: "/pci@f2000000/mac-io@c/ata-3@20000/disk@0:"
bootline=
Trying /netbsd
11860332+167196 [463456+447084]=0xc570ec
start=0x100000
[ 1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
[ 1.0000000] 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
[ 1.0000000] 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023,
[ 1.0000000] 2024
[ 1.0000000] The NetBSD Foundation, Inc. All rights reserved.
[ 1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[ 1.0000000] The Regents of the University of California. All rights reserved.
[ 1.0000000] NetBSD 10.1 (GENERIC) #0: Mon Dec 16 13:08:11 UTC 2024
[ 1.0000000] mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/macppc/compile/GENERIC
---

RSS XML Feed