入口
    OF 1/2 の場合
    OF 3 の場合
      設置後すぐ
      CDROM 無で
    Mac OS の場合
    その他
  NetBSD
  Booting Media
Primary
  bootxx
Secondary
  xcf/elf
    release(7)
    /usr/mdec
ofwboot
  Locore.c
  boot.c
    main()
    boot-file
    chain()
    OF_chain()
kernel(1)
  locore.S
  machdep.c
    initppc()
kernel(2)
  init_main.c
    main()
その他
  installboot
    旧版
    新版
    実例
  DEFAULT CATCH
GENERIC_MD
  mdsetimage

NetBSD/macppc booting

ofwboot

前に説明した方法で、 Primary Loader または直接 Open Firmware によって ofwboot.xcf 等が読まれ、制御が渡される。 例えば次のような表示が出る
0 > boot load-size=d7a0 adler32=36ee944c 

loading XCOFF

tsize=c1c0 dsize=1500 bsize=1608 entry=600000 
SECTIONS:
.text    00600000 00600000 0000c1c0 000000e0
.data    0060d000 0060d000 00001500 0000c2a0
.bss     0060e500 0060e500 00001608 00000000
loading .text, done..
loading .data, done..
clearing .bss, done..

>> NetBSD/macppc OpenFirmware Boot, Revision 1.2
>> (matt@duel.local, Sat Aug 18 13:46:09 PDT 2001)
3855660+219148 [95+188576....
(上記例は ofwboot.xcf が 0x60000 に置かれた場合) また ofwboot.elf (や ofwboot の時は)次のような表示が出る
>> NetBSD/macppc OpenFirmware Boot, Revision 1.6
>> (makoto@ibook, Mon May 27 12:55:46 JST 2002)
3752908+218516 [188032+156838]=0x41deec
 start=0x100000
[ using 345484 bytes of netbsd ELF symbol table ]
(その時に ofwboot.xcf がどこに置いてあって、 読まれるかは、いろいろな場合があるが、これも前に説明した)

src: src/sys/arch/macppc/stand/ofwboot/

の Makefile を見ると

RELOC=          640000
ENTRY=          _start
というような字があるので、6MBytes + 256k の位置に置かれ、 Locore.c の中の _start に行く。 この RELOC の値は、2002/02 までは 600000 だった。 また 2005/08 頃には次のようになっている。
RELOC=		E00000
ENTRY=		_start
また ts 版では次のようになっている。
RELOC=          c0000
ENTRY=          _start
Makefile の 1.26 の変更の部分(の commit の記録) に少し解説がある。
Check in machinery to make ofwboot load at 600000, while ofwboot.elf and ofwboot.xcf will load at 640000. The idea is that we can now leave load-base at 600000, and it will work right for all three methods.

The problem is that the file loader and the net loader use load-base as a scratch area, so if the executable really wants to load there, the load fails.

その後 _start -> startup -> main -> と進む。
Last Update: Sat, 04 May 2019 00:45:20 GMT 1.66 2008/03/08