Re: I documented 10.1 installation onto a blue and white G3:

Chris Tucker <[email protected]> Sat, 22 Mar 2025 18:20:28 -0700
Newsgroups gmane.os.netbsd.ports.macppc
Message-ID <CAPsZW0gXnAWvGx6NrDaFC-zJdTJpOA-OLHqNRkDTE9sJ9Ns2Kg@mail.gmail.com>
ah, found this in UTM: "export QEMU command" ...

qemu-system-ppc -L
/Users/chris/Library/Containers/com.utmapp.UTM/Data/Library/Caches/qemu
-S -spice unix=3Don,addr=3D4D6EFE89-3FF4-4110-8E05-7FE7A930FE6D.spice,disab=
le-ticketing=3Don,image-compression=3Doff,playback-compression=3Doff,stream=
ing-video=3Doff,gl=3Doff
-chardev spiceport,name=3Dorg.qemu.monitor.qmp.0,id=3Dorg.qemu.monitor.qmp
-mon chardev=3Dorg.qemu.monitor.qmp,mode=3Dcontrol -nodefaults -vga none
-device tulip,mac=3DC6:F8:CC:03:A4:E2,netdev=3Dnet0 -netdev user,id=3Dnet0
-device VGA -smp cpus=3D1,sockets=3D1,cores=3D1,threads=3D1 -machine
mac99,via=3Dcuda -accel tcg,tb-size=3D64 -m 256 -audio coreaudio -audiodev
spice,id=3Daudio0 -device ide-cd,bus=3Dide.0,drive=3Ddrive2,bootindex=3D0
-drive "if=3Dnone,media=3Dcdrom,id=3Ddrive2,file.filename=3D/Volumes/G-DRIV=
E/691-2684-A
Mac OS 9.0.4.iso,file.locking=3Doff,readonly=3Don" -device
ide-hd,bus=3Dide.1,drive=3Ddrive0,bootindex=3D1 -drive
"if=3Dnone,media=3Ddisk,id=3Ddrive0,file.filename=3D/Users/chris/.Trash/Mac=
 OS
9.1 (config only).utm/Data/Mac OS
9.1.qcow2,discard=3Dunmap,detect-zeroes=3Dunmap" -device virtio-serial
-device virtserialport,chardev=3Dorg.qemu.guest_agent,name=3Dorg.qemu.guest=
_agent.0
-chardev spiceport,name=3Dorg.qemu.guest_agent.0,id=3Dorg.qemu.guest_agent
-name "Mac OS 91 config only" -uuid
4D6EFE89-3FF4-4110-8E05-7FE7A930FE6D -rtc base=3Dlocaltime -g
1280x720x32 -cpu G3 -usbdevice keyboard

(i earlier tossed one of the files in the trash)

On Sat, Mar 22, 2025 at 6:16=E2=80=AFPM Chris Tucker <[email protected]> wr=
ote:
>
> Here's the contents of "config.plist" for the UTM settings that run
> MacOS 9. Might offer some clues:
>
> <?xml version=3D"1.0" encoding=3D"UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
> "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
> <plist version=3D"1.0">
> <dict>
> <key>Backend</key>
> <string>QEMU</string>
> <key>ConfigurationVersion</key>
> <integer>4</integer>
> <key>Display</key>
> <array>
> <dict>
> <key>DownscalingFilter</key>
> <string>Linear</string>
> <key>DynamicResolution</key>
> <false/>
> <key>Hardware</key>
> <string>VGA</string>
> <key>NativeResolution</key>
> <false/>
> <key>UpscalingFilter</key>
> <string>Linear</string>
> </dict>
> </array>
> <key>Drive</key>
> <array>
> <dict>
> <key>Identifier</key>
> <string>2</string>
> <key>ImageType</key>
> <string>CD</string>
> <key>Interface</key>
> <string>IDE</string>
> <key>InterfaceVersion</key>
> <integer>0</integer>
> <key>ReadOnly</key>
> <true/>
> </dict>
> <dict>
> <key>Identifier</key>
> <string>0</string>
> <key>ImageName</key>
> <string>Mac OS 9.1.qcow2</string>
> <key>ImageType</key>
> <string>Disk</string>
> <key>Interface</key>
> <string>IDE</string>
> <key>InterfaceVersion</key>
> <integer>0</integer>
> <key>ReadOnly</key>
> <false/>
> </dict>
> </array>
> <key>Information</key>
> <dict>
> <key>Icon</key>
> <string>MacOS9.1.icns</string>
> <key>IconCustom</key>
> <true/>
> <key>Name</key>
> <string>Mac OS 9.1 (config only)</string>
> <key>Notes</key>
> <string>Mac OS 9.1
>
> To configure, use the CD/DVD drop-down to select a retail Mac OS 9.1
> CD image.  ISO, CDR and uncompressed DMG are accepted formats.
>
> Then boot from the image, install onto the existing virtual HD, and
> shut down the guest VM.  Edit this configuration, select the top IDE
> drive, and click Move Down.  Save and boot into your new OS.
>
> Some extensions may not be compatible with the emulator.  You can
> disable them by holding space during boot and using Extension Manager
> to turn them off.
>
> If the VM won=E2=80=99t start, your device may not support the audio samp=
ling
> rate used by the emulator. You can disable sound and try
> again.</string>
> <key>UUID</key>
> <string>4D6EFE89-3FF4-4110-8E05-7FE7A930FE6D</string>
> </dict>
> <key>Input</key>
> <dict>
> <key>MaximumUsbShare</key>
> <integer>3</integer>
> <key>UsbBusSupport</key>
> <string>Disabled</string>
> <key>UsbSharing</key>
> <true/>
> </dict>
> <key>Network</key>
> <array>
> <dict>
> <key>Hardware</key>
> <string>tulip</string>
> <key>IsolateFromHost</key>
> <false/>
> <key>MacAddress</key>
> <string>C6:F8:CC:03:A4:E2</string>
> <key>Mode</key>
> <string>Emulated</string>
> <key>PortForward</key>
> <array/>
> </dict>
> </array>
> <key>QEMU</key>
> <dict>
> <key>AdditionalArguments</key>
> <array>
> <string>-g 1280x720x32</string>
> <string>-cpu G3</string>
> <string>-usbdevice keyboard</string>
> </array>
> <key>BalloonDevice</key>
> <false/>
> <key>DebugLog</key>
> <false/>
> <key>Hypervisor</key>
> <false/>
> <key>MachinePropertyOverride</key>
> <string>via=3Dcuda</string>
> <key>PS2Controller</key>
> <false/>
> <key>RNGDevice</key>
> <false/>
> <key>RTCLocalTime</key>
> <true/>
> <key>TPMDevice</key>
> <false/>
> <key>TSO</key>
> <false/>
> <key>UEFIBoot</key>
> <false/>
> </dict>
> <key>Serial</key>
> <array/>
> <key>Sharing</key>
> <dict>
> <key>ClipboardSharing</key>
> <false/>
> <key>DirectoryShareMode</key>
> <string>None</string>
> <key>DirectoryShareReadOnly</key>
> <false/>
> </dict>
> <key>Sound</key>
> <array>
> <dict>
> <key>Hardware</key>
> <string>screamer</string>
> </dict>
> </array>
> <key>System</key>
> <dict>
> <key>Architecture</key>
> <string>ppc</string>
> <key>CPU</key>
> <string>default</string>
> <key>CPUCount</key>
> <integer>1</integer>
> <key>CPUFlagsAdd</key>
> <array/>
> <key>CPUFlagsRemove</key>
> <array/>
> <key>ForceMulticore</key>
> <false/>
> <key>JITCacheSize</key>
> <integer>0</integer>
> <key>MemorySize</key>
> <integer>256</integer>
> <key>Target</key>
> <string>mac99</string>
> </dict>
> </dict>
> </plist>
>
> On Sat, Mar 22, 2025 at 5:52=E2=80=AFPM Chris Tucker <[email protected]> =
wrote:
> >
> > I just picked 256M coz that's what I have on my real machine :)
> > haven't tried other settings. I'm not sure what the RAM max is on this
> > sort of older Mac hardware is ... I suspect Qemu may fail if you set
> > the RAM higher than what these old Macs actually support ... not sure.
> >
> > Yes Mac99 machine in the drop-down menu is what I have.
> >
> > I just tested the mouse on MacOS 9 and with USB set to "disabled" it
> > captured the mouse OK after I pressed the "capture input devices" icon
> > in UTM. (icon depicts a mouse cursor with rays emanating from it in a
> > circle.)
> >
> > I've not tried mouse use on NetBSD/X11 in Qemu on PowerPC emulation. I
> > imagine it works since it works on MacOS 9.1.
> >
> > Yes sungem iirc didn't work for me, which is why I tried tulip which di=
d work.
> >
> > Speed of the system seems to be quite reasonable, considering it's
> > emulating PPC on an M1 with a "single core." With this sort of
> > emulation, I'm more impressed it works at all, much less that it runs
> > speedily or not. haha.
> >
> > On Sat, Mar 22, 2025 at 5:35=E2=80=AFPM Andrew Randrianasulu
> > <[email protected]> wrote:
> > >
> > >
> > >
> > > =D0=B2=D1=81, 23 =D0=BC=D0=B0=D1=80. 2025 =D0=B3., 03:24 Chris Tucker=
 <[email protected]>:
> > >>
> > >> Hello, I am not familiar with netbsd-current and I've never installe=
d it.
> > >
> > >
> > >
> > > I suspect there might be regression, but not sure if it surfaces alwa=
ys, or only on my machine. I see qemu was used for development recently, bu=
t all my (netbsd/macppc cdrom/iso) builds fail in same way very early.
> > >
> > >
> > >>
> > >> I was able to install 10.1 on Qemu (UTM) using one of the config fil=
es here:
> > >> https://github.com/adespoton/utmconfigs
> > >>
> > >> If I recall correctly, I used one of the Classic MacOS 9.1 UTM confi=
g
> > >> files there. This link:
> > >> https://github.com/adespoton/utmconfigs/blob/main/Mac%20OS%209.1%20(=
config%20only).utm.zip
> > >>
> > >> But I had to play around to actually get that to work: Try opening
> > >> that config file, then additionally make the following changes to it=
.
> > >> I got the following to work on my Macbook Air M1 running UTM:
> > >>
> > >> (Make sure have the netbsd 10.1 (or your netbsd-current) ISO "loaded=
"
> > >> in the UTM drive)
> > >>
> > >> System menu in UTM prefs for the macos 9.1 config file:
> > >> cpu: default
> > >> cpu cores: 1
> > >> RAM: 256megs
> > >
> > >
> > > It dails for me at 270 mb of ram and up on any supported qemu machine=
 .... :( 256, 257, 258 and below works ...not sure why.
> > >
> > >
> > >>
> > >> Qemu menu:
> > >> QEMU Machine Properties: via=3Dcuda
> > >
> > >
> > >
> > > I guess this mean -M mac99 machine ....
> > >
> > > Does mouse cursor works ok for you in this (no usb) configuration? In=
 NetBSD or MacOS? It does not for me until I add -icount shift=3D1 but then=
 everything becomes perceptibly slower ....
> > >>
> > >>
> > >> Input menu:
> > >> USB support: Disabled
> > >>
> > >> Network menu: Emulated Network Card: tulip
> > >
> > >
> > >
> > > sungem (default) does not work for you too?
> > >
> > >
> > >>
> > >> Then try booting it with something like boot cd:,\ofwboot.xcf netbsd
> > >>
> > >> On Fri, Mar 14, 2025 at 9:18=E2=80=AFPM Andrew Randrianasulu
> > >> <[email protected]> wrote:
> > >> >
> > >> >
> > >> >
> > >> > =D1=81=D0=B1, 1 =D0=BC=D0=B0=D1=80. 2025 =D0=B3., 05:31 Chris Tuck=
er <[email protected]>:
> > >> >>
> > >> >> Hope you don't mind that I post it here, in case someone else fin=
ds it
> > >> >> to be helpful.
> > >> >>
> > >> >> https://github.com/capagh/NetBSD10.1-B-W-Mac
> > >> >>
> > >> >> How to install NetBSD 10.1 on a Blue-and-White Macintosh PowerPC =
G3
> > >> >
> > >> >
> > >> > Thanks for this writeup, I tried to build iso-image out of NetBSD =
-Current for mappc using slightly modified instructions, but sadly it does =
not boot on qemu? Dies early .....
> > >> >
> > >> > If you have time can you check if -current kernel bootable on real=
 G3?
> > >> >
> > >> >
> > >> >>
> > >> >> Direct questions or comments to capa150 at gmail.com
> > >> >>
> > >> >> Contents:
> > >> >>
> > >> >> Background story
> > >> >> Performing a dual-boot MacOS/NetBSD install:
> > >> >> How to build an install kernel and a regular kernel for NetBSD 10=
.1/macppc.
> > >> >> Preventing caps-lock from freezing a blue-and-white G3
> > >> >> X11 with the blue-and-white
> > >> >>
> > >> >> There are several ways to install NetBSD 10.1 on a Mac. This text
> > >> >> describes two of the ways -- one is a dual-boot Classic MacOS/Net=
BSD
> > >> >> 10.1 system, and the second is a NetBSD 10.1-only system. There a=
re
> > >> >> other methods described in the NetBSD install document.
> > >> >>
> > >> >> What I used for this install:
> > >> >> A Blue-and-White Macintosh G3 with a CD/DVD drive.
> > >> >> An IDE hard disk attached to a PCI IDE card such as a Sonnet Temp=
o or
> > >> >> Acard/Ahard M6280, M6880, M6860 or M6260 (the =E2=80=98M=E2=80=99=
 means it is bootable
> > >> >> by a Mac. Otherwise it=E2=80=99s for PCs.) I=E2=80=99ve found the=
 motherboard IDE to
> > >> >> be buggy.
> > >> >> A copy of MacOS 9 on CD/DVD (to partition the drive using MacOS 9=
=E2=80=99s
> > >> >> Drive Setup utility.)
> > >> >> A copy of MacOS 8.6 (I like 8.6 more than 9. I used Drive Setup o=
n 9
> > >> >> to partition the disk. Then I installed 8.6.)
> > >> >> A copy of NetBSD 10.1 on CD/DVD.
> > >> >> (https://cdn.netbsd.org/pub/NetBSD/images/10.1/ titled
> > >> >> =E2=80=9CNetBSD-10.1-macppc.iso.=E2=80=9D) (Alternately, skip the=
 ISO and just install
> > >> >> via FTP.)
> > >> >> The macOS X application =E2=80=9CQuickFTP,=E2=80=9D available fre=
e from the macOS app store.
> > >> >>
> > >> >> Note: I=E2=80=99ve not tried a SCSI disk on my Blue-and White. I =
suspect SCSI
> > >> >> would wholly avoid the problems I encountered. Consider using blu=
eSCSI
> > >> >> or ZuluSCSI as finding a good SCSI drive is difficult these days.
> > >> >>
> > >> >> This install assumes the Mac has one hard disk. Be sure to back-u=
p any
> > >> >> important data before proceeding.
> > >> >>
> > >> >> It=E2=80=99s important to note the Blue-and-White G3 Macs use Ope=
n Firmware version 3.x.
> > >> >> The install process for Macs that use Open Firmware 1.x or 2.x is
> > >> >> different and not covered in this document. Refer to the official
> > >> >> NetBSD install notes for more.
> > >> >>
> > >> >> The backstory:
> > >> >>
> > >> >> Problem No. 1:
> > >> >> My Blue-and-White G3 came with an IDE hard drive attached to the
> > >> >> motherboard=E2=80=99s IDE slot. I installed NetBSD 10.1 and it se=
emed to work.
> > >> >> But eventually I noticed a quirk: When issued a "shutdown -r now"
> > >> >> command, the system will often state:
> > >> >>
> > >> >> "...
> > >> >> About to run shutdown hooks ...
> > >> >> Stopping cron.
> > >> >> Stopping inetd."
> > >> >>
> > >> >>
> > >> >> And then it hangs. This is an incomplete shut-down, as there are
> > >> >> supposed to be more lines after =E2=80=9CStopping inetd.=E2=80=9D=
 But at other times
> > >> >> it would complete the shutdown process. I eventually found the pr=
ocess
> > >> >> rndctl -- which is called during shutdown -- would cause the comp=
uter
> > >> >> to sometimes hang. Rndctl is used for entropy-related work.
> > >> >>
> > >> >> (See NetBSD Problem Report #59014
> > >> >> https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=3D5901=
4 for
> > >> >> more on this problem.)
> > >> >>
> > >> >> I determined the problem is caused by the CMD IDE controller chip=
 the
> > >> >> blue-and-white uses. This controller is known to be buggy, accord=
ing
> > >> >> to the Wikipedia entry on it. https://en.wikipedia.org/wiki/CMD64=
0
> > >> >>
> > >> >> I resolved the rndctl problem by using a Sonnet Tempo IDE PCI
> > >> >> controller card instead of the motherboard controller. Which led =
to
> > >> >> ...
> > >> >>
> > >> >> Problem No. 2:
> > >> >>
> > >> >> Although I resolved the rndctrl problem, I gained a new problem.
> > >> >>
> > >> >> When booting off the Tempo, the Mac would report hundreds of erro=
rs
> > >> >> when running NetBSD, such as: "wd0: aborted command, interface CR=
C
> > >> >> error" and =E2=80=9Cwd0c: error reading fsbn.=E2=80=9D
> > >> >>
> > >> >> I believe the problem is due to the netbsd kernel accessing my UD=
MA
> > >> >> IDE hard disk in UDMA mode 6 (ATA/133), but the Blue and White G3
> > >> >> specifications indicate the Mac is designed for UDMA mode 2 (ATA/=
33).
> > >> >>
> > >> >> The Mac can't handle the higher speed and thus complains profusel=
y.
> > >> >>
> > >> >> I resolved this problem by compiling two custom kernels -- one fo=
r
> > >> >> installation, and one for regular use. Both are the same as the
> > >> >> default kernels except they limit the IDE drive mode to UDMA mode=
 2.
> > >> >> (I also changed the console text color to green text on a black
> > >> >> background, with white text for kernel messages -- default is bla=
ck
> > >> >> text on white background. Nothing else has been changed.)
> > >> >>
> > >> >> (See NetBSD Problem Report #59078
> > >> >> https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=3D5907=
8 for
> > >> >> more.)
> > >> >>
> > >> >> Performing a dual-boot MacOS/NetBSD install:
> > >> >>
> > >> >> 1. Insert the OS 9 install disc into the Mac. Hold down the =E2=
=80=98C=E2=80=99 key to
> > >> >> boot from the CD.
> > >> >>
> > >> >> 2. Open the =E2=80=9CUtilities=E2=80=9D folder on the disc. Launc=
h =E2=80=9CDrive Setup.=E2=80=9D (The
> > >> >> version of Drive Setup that comes with OS 9 is required. Older
> > >> >> versions will not work, according to the NetBSD install document.=
)
> > >> >>
> > >> >> 3. For this example install, three partitions will be used. One f=
or
> > >> >> MacOS, one for NetBSD root and usr, and one for NetBSD swap. Sele=
ct
> > >> >> the drive to be initialized then click =E2=80=9CCustom Setup.=E2=
=80=9D  Set
> > >> >> =E2=80=9CPartitioning Scheme=E2=80=9D to three partitions. The to=
p partition will be
> > >> >> for MacOS. It should be at least 400 megabytes in size but you ca=
n
> > >> >> make it larger if you like. Set the =E2=80=9CType=E2=80=9D to eit=
her =E2=80=9CMacOS Standard=E2=80=9D
> > >> >> (HFS) or =E2=80=9CMacOS Extended=E2=80=9D (HFS+).
> > >> >>
> > >> >> 4. Select the second-from-top partition. This will be your NetBSD=
 root
> > >> >> and usr partition. Make this partition as large as possible, whil=
e
> > >> >> keeping some space free for swap. Set the =E2=80=9CType=E2=80=9D =
to =E2=80=9CA/UX Root.=E2=80=9D
> > >> >>
> > >> >> 5. Select the third-from-top partition. This will be your swap dr=
ive.
> > >> >> It should be the same size as the amount of RAM available. =E2=80=
=9CType=E2=80=9D
> > >> >> should be set to =E2=80=9CA/UX Swap.=E2=80=9D
> > >> >>
> > >> >> 6. There may be a small amount of space at the bottom of the part=
ition
> > >> >> map labeled =E2=80=9CExtra.=E2=80=9D This is OK.
> > >> >>
> > >> >> 7. Click =E2=80=9COK=E2=80=9D followed by =E2=80=9CInitialize.=E2=
=80=9D Quit Drive Setup.
> > >> >>
> > >> >> 8. Rename your new Mac drive if you like. Run the MacOS installer=
 (I
> > >> >> have also installed MacOS 8.5/8.6 for a dual-boot system. However=
 you
> > >> >> must use the newer MacOS 9 Drive Setup application to initially
> > >> >> partition the drive, not the version of Drive Setup that comes wi=
th
> > >> >> 8.5/8.6.)
> > >> >>
> > >> >> 9. Reboot into the new MacOS. Quit the MacOS Setup Assistant. Ins=
ert
> > >> >> the NetBSD 10.1 disc. Drag =E2=80=9Cofwboot.xcf=E2=80=9D to the M=
ac=E2=80=99s hard drive.
> > >> >>
> > >> >> Here are the two kernels limited to UDMA mode 2:
> > >> >>
> > >> >> netbsd-INSTALL
> > >> >> netbsd
> > >> >>
> > >> >> Download netbsd-INSTALL and move it to the MacOS drive.
> > >> >>
> > >> >> QuickFTP Server, running on my MacBook Air, was a helpful tool fo=
r
> > >> >> this installation. I connected my blue-and-white G3 to the local =
area
> > >> >> network and set the TCP/IP control panel to DHCP. I then used Int=
ernet
> > >> >> Explorer on the G3 to access the files from QuickFTP, using the I=
P
> > >> >> address displayed on QuickFTP. (example =E2=80=9Cftp://10.0.0.55=
=E2=80=9D into the
> > >> >> Internet Explorer address bar.) I right-clicked (or control-click=
)
> > >> >> each file and saved it to the base level of the Mac=E2=80=99s dri=
ve.
> > >> >>
> > >> >> QuickFTP uses this default path to host files, but it can be chan=
ged:
> > >> >> /Users/chris/Library/Containers/QuickFTP/Data/
> > >> >> For this document, I changed this to /Users/chris instead, as it=
=E2=80=99s
> > >> >> easier to access.
> > >> >> Set a username, password, and read and write access on QuickFTP.
> > >> >>
> > >> >> Both ofwboot.xcf and the modified installer netbsd-INSTALL files =
must
> > >> >> be in the base level of the Mac=E2=80=99s drive, not in any subfo=
lder.
> > >> >>
> > >> >> 10. Reboot the Mac and hold down command-option-O-F to boot into =
Open
> > >> >> Firmware. The NetBSD install  document describes how the Open Fir=
mware
> > >> >> bootloader works. It can be tricky to figure out, and the exact
> > >> >> command varies depending on the hardware available. Experimentati=
on is
> > >> >> pretty much mandatory. Here=E2=80=99s the command my G3 uses:
> > >> >>
> > >> >> 0 > boot /pci@80000000/pci-bridge@d/Ultra-Tek100P@3/sd:,\ofwboot.=
xcf
> > >> >> netbsd-INSTALL
> > >> >>
> > >> >> The boot process should begin. You should see a line about the ha=
rd
> > >> >> disk on the screen, so make note of the drive name. In my case th=
e
> > >> >> drive is =E2=80=9Cwd0.=E2=80=9D
> > >> >>
> > >> >> When asked, accept =E2=80=9Cvt100=E2=80=9D as terminal type.
> > >> >>
> > >> >> 12. Select =E2=80=9C(S)hell=E2=80=9D when asked.
> > >> >>
> > >> >> 11. Optional: type:
> > >> >>
> > >> >> # disklabel /dev/wd0
> > >> >>
> > >> >> to see some cool partition information. Make note of the letter
> > >> >> assigned the partitions. On my install, =E2=80=9Ca=E2=80=9D is as=
signed to 4.2BSD
> > >> >> (root/usr) and =E2=80=9Cb=E2=80=9D is assigned to swap. (Do not u=
se disklabel for any
> > >> >> other purpose as it will wreck your partitions.)
> > >> >>
> > >> >> 12. Type:
> > >> >>
> > >> >> Create a NetBSD filesystem on partition =E2=80=9Ca,=E2=80=9D moun=
t it, and create an etc folder:
> > >> >> # newfs /dev/wd0a
> > >> >> # mount /dev/wd0a /targetroot
> > >> >> # mkdir /targetroot/etc
> > >> >>
> > >> >> (The official NetBSD install notes say to mount this partition as=
 /mnt
> > >> >> but this will cause an error later during the install, so use
> > >> >> /targetroot.)
> > >> >>
> > >> >>
> > >> >> 13. Create an fstab file: Type the following (I used tabs to keep
> > >> >> everything tidy, but you can also use spaces.):
> > >> >>
> > >> >> # cat > /targetroot/etc/fstab
> > >> >> /dev/wd0a / ffs rw 1 1
> > >> >> /dev/wd0b none swap sw 0 0
> > >> >> ptyfs /dev/pts ptyfs rw
> > >> >>
> > >> >> Press the return key at the end of the ptyfs line, followed by ct=
rl-d
> > >> >> to save the file.
> > >> >>
> > >> >> Unmount the filesystem:
> > >> >>
> > >> >> # umount /targetroot
> > >> >>
> > >> >> 14.(optional) Type =E2=80=9Cpdisk /dev/wd0c=E2=80=9D (=E2=80=9Cc=
=E2=80=9D here represents the entire
> > >> >> drive) to learn more about partitions.
> > >> >> Type =E2=80=9Cp=E2=80=9D to print the partition table. Do not run=
 any other command.
> > >> >> Make note of the leftmost numbers associated with the partitions =
as
> > >> >> you=E2=80=99ll need this to boot from Open Firmware later on. In =
particular,
> > >> >> note the number associated with the HFS/HFS+ partition and also w=
ith
> > >> >> the AU/X Root partition. Type =E2=80=9Cq=E2=80=9D to quit.
> > >> >>
> > >> >> 15. Actually install NetBSD! Type =E2=80=9Csysinst=E2=80=9D to ru=
n the installer. Do
> > >> >> NOT select option =E2=80=9Ca=E2=80=9D as this will demolish the p=
artitions. Instead
> > >> >> select option =E2=80=9Cc: Re-install sets or install additional s=
et.=E2=80=9D then
> > >> >> =E2=80=9Cyes=E2=80=9D then =E2=80=9Cb: wd0 ...=E2=80=9D then =E2=
=80=9Ca: Full installation=E2=80=9D (or as desired)
> > >> >> then =E2=80=9Ca: CD-ROM / DVD=E2=80=9D (or as desired.)
> > >> >>
> > >> >> Note: If you use networking, be sure to specify =E2=80=9C100baseT=
X=E2=80=9D instead of
> > >> >> the default =E2=80=9Cautoselect=E2=80=9D so ethernet functions co=
rrectly.
> > >> >>
> > >> >> 16. You=E2=80=99ll  now be asked to set up entropy. The way I did=
 it is with
> > >> >> option =E2=80=9Cc: Load raw binary random data.=E2=80=9D
> > >> >>
> > >> >> In Terminal.app on my M1:
> > >> >> % dd if=3D/dev/random bs=3D32 count=3D1 of=3D/Users/chris/random.=
tmp
> > >> >>
> > >> >> Select =E2=80=9Cb: Download via ftp=E2=80=9D
> > >> >> Select =E2=80=9Ca: bm0=E2=80=9D (onboard ethernet)
> > >> >>
> > >> >> When you see Sysinst show this message:
> > >> >> =E2=80=9CNetwork media type (empty to autoconfigure) [autoselect]=
:=E2=80=9D
> > >> >> Do not hit return to accept =E2=80=9Cautoselect=E2=80=9D, as this=
 does not work.
> > >> >> Instead type in:
> > >> >> 100baseTX
> > >> >>
> > >> >> Then =E2=80=9CYes=E2=80=9D to perform autoconfiguration.
> > >> >> Type in a hostname as desired.
> > >> >> Feel free to leave domain blank.
> > >> >>
> > >> >> To configure FTP, enter fields for Host, User and Password (same =
as
> > >> >> what QuickFTP uses) as necessary and start download.
> > >> >>
> > >> >> Now you=E2=80=99ll be back at the sysinst main menu.
> > >> >>
> > >> >> Do not reboot yet. Sysinst installed the regular default kernel a=
nd
> > >> >> that needs to be replaced with the kernel modified for UDMA mode =
2.
> > >> >>
> > >> >> Select =E2=80=9CExit Install System=E2=80=9D
> > >> >>
> > >> >> Mount our new system and rename the default kernel:
> > >> >> # mount /dev/wd0a /mnt
> > >> >> # cd /mnt
> > >> >> # mv netbsd netbsd.original
> > >> >>
> > >> >> Download the modified kernel:
> > >> >> # ftp 10.0.0.220
> > >> >> ftp> get netbsd
> > >> >> ftp> quit
> > >> >>
> > >> >> Modify permissions to match original:
> > >> >> # chmod 755 netbsd
> > >> >> # cd /
> > >> >> # umount /mnt
> > >> >> # reboot
> > >> >>
> > >> >> When you hear the chime, hold down command-option-O-F again to ge=
t
> > >> >> into Open Firmware. Boot off the modified regular kernel:
> > >> >>
> > >> >> 0 > boot /pci@80000000/pci-bridge@d/Ultra-Tek100P@3/sd:,\ofwboot.=
xcf netbsd
> > >> >>
> > >> >> 16. NetBSD will state /etc/rc.conf isn=E2=80=99t configured. Hit =
return to
> > >> >> accept /bin/sh. Type:
> > >> >>
> > >> >> # export TERM=3Dvt100
> > >> >> # mount -uw /
> > >> >>
> > >> >> Now edit the rc.conf file:
> > >> >>
> > >> >> # vi /etc/rc.conf
> > >> >>
> > >> >> A short lesson in how to use the vi text editor:
> > >> >> Vi has two modes: command mode and edit mode.
> > >> >> In command mode, use the arrow keys (or the HJKL keys) to move th=
e
> > >> >> cursor around.
> > >> >> In command mode, use =E2=80=9Cx=E2=80=9D key to delete text.
> > >> >> Press =E2=80=9Ci=E2=80=9D key to enter insert mode. Now you can e=
dit text.
> > >> >> Press =E2=80=9CESC=E2=80=9D to exit insert mode and return to com=
mand mode.
> > >> >> Press =E2=80=9CESC=E2=80=9D followed by =E2=80=9C:wq=E2=80=9D to =
write the file to disk and quit.
> > >> >>
> > >> >> Edit rc.conf to make these changes and additions:
> > >> >>
> > >> >> rc_configured=3DYES
> > >> >> dhcpcd=3DYES
> > >> >> wscons=3DYES
> > >> >> hostname=3Dnetbsd (or whatever name you prefer)
> > >> >> ifconfig_bm0=3D=E2=80=9Cmedia 100baseTX mediaopt full-duplex=E2=
=80=9D
> > >> >>
> > >> >> Esc :wq to write the file to disk and quit vi.
> > >> >>
> > >> >> Set filesystem to read-only (so fsck doesn=E2=80=99t complain), a=
nd exit to
> > >> >> resume booting:
> > >> >>
> > >> >> # mount -ur /
> > >> >> # exit
> > >> >>
> > >> >> The boot process will continue.
> > >> >>
> > >> >> Login as root (no password yet.)
> > >> >>
> > >> >> Add a password for root:
> > >> >> # passwd root
> > >> >>
> > >> >> 19. Create a normal user (e.g. johndoe) and a home directory for =
that
> > >> >> user, and add that user to the superuser group:
> > >> >> # useradd -m -G wheel johndoe
> > >> >>
> > >> >> Give the user a password:
> > >> >> # passwd johndoe
> > >> >>
> > >> >> All done.
> > >> >>
> > >> >> To reboot:
> > >> >> # shutdown -r now
> > >> >> To shut-down and power-off:
> > >> >> # shutdown -p now
> > >> >>
> > >> >> If you wish to boot into MacOS, boot without holding command-opti=
on-O-F.
> > >> >>
> > >> >> ------
> > >> >>
> > >> >> How to build an install kernel and a regular kernel for NetBSD 10=
.1/macppc.
> > >> >>
> > >> >> This section is optional, as I=E2=80=99ve already made the two ke=
rnels
> > >> >> available for download. However, if you=E2=80=99d like to build t=
hose kernels
> > >> >> yourself, the steps are listed here:
> > >> >>
> > >> >> For this example, two computers are used: a blue-and-white G3, an=
d a
> > >> >> Macbook Air M1.
> > >> >>
> > >> >> Install UTM (Qemu) on the M1. Create an emulated amd64 machine an=
d
> > >> >> install NetBSD 10.1. (Running NetBSD for Arm would be more sensib=
le
> > >> >> for M1, but I couldn=E2=80=99t get it to install, hence the choic=
e to emulate
> > >> >> amd64 instead.)
> > >> >>
> > >> >> In UTM preferences, set the number of cores to 8 (for M1).
> > >> >> Create a regular user in group wheel.
> > >> >> Enable dhcpcd with (as root):
> > >> >>
> > >> >> # /etc/rc.d/dhcpcd onestart
> > >> >>
> > >> >> OBTAINING SOURCES
> > >> >>
> > >> >> Build sources as described here:
> > >> >> https://www.netbsd.org/docs/guide/en/chap-fetch.html
> > >> >>
> > >> >> (as root):
> > >> >> # mkdir /usr/src
> > >> >> # chown chris /usr/src
> > >> >>
> > >> >> exit to return to regular user.
> > >> >>
> > >> >> Grab the source files (no need for xsrc.tgz, as I=E2=80=99ll be u=
sing this
> > >> >> emulated machine for compiling only.):
> > >> >>
> > >> >> $ ftp -i ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-10.1/source/sets/
> > >> >> ftp> get gnusrc.tgz
> > >> >> ftp> get sharesrc.tgz
> > >> >> ftp> get src.tgz
> > >> >> ftp> get syssrc.tgz
> > >> >> ftp> quit
> > >> >>
> > >> >> You should now have four *.tgz files in your home directory.
> > >> >>
> > >> >> Extract all them all:
> > >> >>
> > >> >> $ for file in *.tgz
> > >> >> > do
> > >> >> > tar -xzf $file -C /
> > >> >> > done
> > >> >>
> > >> >> This will take a while.
> > >> >>
> > >> >> CROSS-COMPILING
> > >> >>
> > >> >> Since I=E2=80=99m using amd64 to create macppc/powerpc kernels,
> > >> >> cross-compilation is required.
> > >> >>
> > >> >> https://www.netbsd.org/docs/guide/en/chap-build.html#chap-boot-cr=
oss-build-kernel
> > >> >>
> > >> >> Although the instructions call for placing sources in ~/cvs/src, =
I
> > >> >> chose to keep them in /usr/src instead.
> > >> >>
> > >> >> $ mkdir ~/obj
> > >> >> $ cd /usr/src
> > >> >>
> > >> >> Build the tools:
> > >> >>
> > >> >> $ ./build.sh -U -O ~/obj -j8 -m macppc -a powerpc tools
> > >> >>
> > >> >> where  the 8 in -j8 is the number of cores on your system.
> > >> >>
> > >> >> After a while, this process will print a summary of results.
> > >> >>
> > >> >> Configure the kernel:
> > >> >>
> > >> >> $ cd /usr/src/sys/arch/macppc/conf
> > >> >>
> > >> >> The configuration file titled INSTALL is the one with the RAM dis=
k for
> > >> >> installation. Copy the original and work on the copy:
> > >> >>
> > >> >> cp INSTALL INSTALL2
> > >> >>
> > >> >> Use your preferred editor with INSTALL2.
> > >> >> Change the line:
> > >> >> wd*  at atabus? drive ? flags 0x0000
> > >> >> to
> > >> >> wd* at atabus? drive? flags 0x0aac
> > >> >> and save the change.
> > >> >>
> > >> >> This will limit the drive to UDMA mode 2 (ATA/33) which is the dr=
ive
> > >> >> specification for the blue-and-white G3. See the man page for wd =
for
> > >> >> more information.
> > >> >>
> > >> >> Build the install kernel as a =E2=80=9Crelease.=E2=80=9D This, ap=
parently, also builds
> > >> >> the Unix utilities required on the installer.
> > >> >>
> > >> >> $ cd /usr/src
> > >> >> $ ./build.sh -U -j8 -O ~/obj -m macppc -a powerpc kernel=3DINSTAL=
L2 release
> > >> >>
> > >> >> (Running on an Apple M1 cpu, this task will take around 12 hours =
to complete.)
> > >> >>
> > >> >> https://www.netbsd.org/docs/guide/en/chap-inst-media.html
> > >> >>
> > >> >> There will be a newly-created install kernel with the changes for=
 UDMA
> > >> >> mode 2 in the directory ~/obj/distrib/macppc/floppies/md-kernel/.
> > >> >>
> > >> >> However, this new file isn=E2=80=99t titled =E2=80=9CINSTALL2,=E2=
=80=9D but simply =E2=80=9Cnetbsd-INSTALL.=E2=80=9D
> > >> >>
> > >> >> Transfer this file to the base level of the hard drive of the Cla=
ssic
> > >> >> MacOS machine.
> > >> >>
> > >> >> In my case, how I did this was to sftp the file from my UTM machi=
ne to
> > >> >> the M1 host OS. From the ~/obj/distrib/macppc/floppies/md-kernel/
> > >> >> directory:
> > >> >>
> > >> >> Transfer files from the emulated amd64 machine to my M1 Mac=E2=80=
=99s OS:
> > >> >> $ sftp [email protected]  (change the address as necessary)
> > >> >> sftp> put netbsd-INSTALL
> > >> >> sftp> quit
> > >> >>
> > >> >> netbsd-INSTALL is now in the M1=E2=80=99s home directory (which i=
s,
> > >> >> co-incidentally, also QuickFTP=E2=80=99s working directory.)
> > >> >>
> > >> >> On the blue-and-white, running Classic MacOS, point Internet Expl=
orer
> > >> >> or Netscape to ftp://10.0.0.220 and right-click netbsd-INSTALL to=
 save
> > >> >> the file to the base level of the hard disk.
> > >> >>
> > >> >> COMPILE THE REGULAR KERNEL
> > >> >>
> > >> >> The installation kernel is ready, but we need a regular kernel as=
 well.
> > >> >>
> > >> >> https://www.netbsd.org/docs/guide/en/chap-kernel.html
> > >> >>
> > >> >> On the emulated amd64:
> > >> >>
> > >> >> $ cd /usr/src/sys/arch/macppc/conf
> > >> >>
> > >> >> $ cp GENERIC GENERIC2
> > >> >>
> > >> >> Use your preferred editor with GENERIC2.
> > >> >> Change the line:
> > >> >> wd*  at atabus? drive ? flags 0x0000
> > >> >> to
> > >> >> wd* at atabus? drive? flags 0x0aac
> > >> >> and save the change.
> > >> >>
> > >> >> $ cd /usr/src
> > >> >> $ ./build.sh -U -j8 -O ~/obj -m macppc -a powerpc kernel=3DGENERI=
C2
> > >> >>
> > >> >> A summery will tell you where the new kernel (called =E2=80=9Cnet=
bsd=E2=80=9D) is located.
> > >> >>
> > >> >> Copy this from the UTM machine to the home directory on my M1:
> > >> >>
> > >> >> $ cd /home/chris/obj/sys/arch/macppc/compile/GENERIC2/
> > >> >> $ sftp [email protected]
> > >> >> sftp> put netbsd
> > >> >> sftp> quit
> > >> >>
> > >> >> It=E2=80=99s now ready to be copied to the blue-and-white G3 (see=
 elsewhere).
> > >> >>
> > >> >> ----
> > >> >>
> > >> >> Preventing caps-lock from freezing a blue-and-white G3
> > >> >>
> > >> >> On my B&W G3 I noticed the caps-lock key would sometimes -- but n=
ot
> > >> >> always -- cause the computer to freeze. Unplugging the USB cable =
would
> > >> >> un-freeze the machine, but also cause strange behavior on the con=
sole.
> > >> >> As such, I found it useful to simultaneously ssh into the B&W fro=
m my
> > >> >> M1 Air while messing around with caps-lock so I could more easily
> > >> >> reboot the machine.
> > >> >>
> > >> >> The keyboard in question is a late-1990s Apple M2452.
> > >> >>
> > >> >> My =E2=80=9Csolution=E2=80=9D was to map the caps-lock key to the=
 left shift key.
> > >> >> Therefore I have two left shift keys, and no caps-lock. But at le=
ast I
> > >> >> don=E2=80=99t accidentally freeze my Mac any more.
> > >> >>
> > >> >> Edit /etc/wscons.conf.
> > >> >> Underneath the line that begins: =E2=80=9C#mapfile
> > >> >> /usr/share/wscons/keymaps/pckbd.sv.svascii=E2=80=9D
> > >> >> add a new, uncommented line:
> > >> >> mapfile /usr/share/wscons/keymaps/pckbd.caps.shift
> > >> >> and save the change.
> > >> >>
> > >> >> Then:
> > >> >> # cd /usr/share/wscons/keymaps/
> > >> >> # vi pckbd.caps.shift
> > >> >>
> > >> >> and add one line to this file:
> > >> >> keysym Caps_Lock =3D Shift_L
> > >> >>
> > >> >> Save and reboot. Caps will now map to shift.
> > >> >>
> > >> >> X11 with the blue-and-white
> > >> >>
> > >> >> Here=E2=80=99s a functional xorg.conf file for the Mac with a ATI=
 Rage 128 PCI card.
> > >> >> It=E2=80=99s probably nowhere near optimal. 3D acceleration is no=
t enabled.
> > >> >> Let me know if you know how to enable acceleration.
> > >> >>
> > >> >> Place this text as /etc/X11/xorg.conf
> > >> >>
> > >> >> Section "ServerLayout"
> > >> >> Identifier     "X.org Configured"
> > >> >> Screen      0  "Screen0" 0 0
> > >> >> InputDevice    "Mouse0" "CorePointer"
> > >> >> InputDevice    "Keyboard0" "CoreKeyboard"
> > >> >> EndSection
> > >> >>
> > >> >> Section "Files"
> > >> >> ModulePath   "/usr/X11R7/lib/modules"
> > >> >> FontPath     "/usr/X11R7/lib/X11/fonts/misc/"
> > >> >> FontPath     "/usr/X11R7/lib/X11/fonts/TTF/"
> > >> >> FontPath     "/usr/X11R7/lib/X11/fonts/Type1/"
> > >> >> FontPath     "/usr/X11R7/lib/X11/fonts/75dpi/"
> > >> >> FontPath     "/usr/X11R7/lib/X11/fonts/100dpi/"
> > >> >> EndSection
> > >> >>
> > >> >> Section "Module"
> > >> >> #Load  "dbe"  #action
> > >> >> #Load  "extmod"  #action
> > >> >> Load  "dri"
> > >> >> Load  "dri2"
> > >> >> Load  "glx"
> > >> >> Load  "shadow"
> > >> >> EndSection
> > >> >>
> > >> >> Section "InputDevice"
> > >> >> Identifier  "Keyboard0"
> > >> >> Driver      "kbd"
> > >> >> Option    "Protocol" "wskbd"
> > >> >> Option    "Device" "/dev/wskbd"
> > >> >> EndSection
> > >> >>
> > >> >> Section "InputDevice"
> > >> >> Identifier  "Mouse0"
> > >> >> Driver      "mouse"
> > >> >> Option    "Protocol" "wsmouse"
> > >> >> Option    "Device" "/dev/wsmouse"
> > >> >> Option    "ZAxisMapping" "4 5 6 7"
> > >> >> EndSection
> > >> >>
> > >> >> Section "Monitor"
> > >> >> Identifier   "Monitor0"
> > >> >> VendorName   "Monitor Vendor"
> > >> >> ModelName    "Monitor Model"
> > >> >> #HorizSync     58-62 #action
> > >> >> #VertRefresh   75-117 #action
> > >> >> #Option "VGA-0" "VGA monitor"  #action
> > >> >> Modeline "1024x768" 78.75  1024 1040 1136 1312  768 769 772 800 -=
hsync -vsync
> > >> >> Modeline "1024x768" 78.75  1024 1040 1136 1312  768 769 772 800 +=
hsync +vsync
> > >> >> EndSection
> > >> >>
> > >> >> Section "Monitor"
> > >> >>     Identifier    "LVDS monitor"
> > >> >>     Option "LVDS" "LVDS note"
> > >> >> EndSection
> > >> >>
> > >> >> Section "Device"
> > >> >>         ### Available Driver options are:-
> > >> >>         ### Values: <i>: integer, <f>: float, <bool>: "True"/"Fal=
se",
> > >> >>         ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
> > >> >>         ### <percent>: "<f>%"
> > >> >>         ### [arg]: arg optional
> > >> >>         #Option     "NoAccel"             # [<bool>]
> > >> >>         #Option     "Dac6Bit"             # [<bool>]
> > >> >>         #Option     "VGAAccess"           # [<bool>]
> > >> >>         #Option     "ShowCache"           # [<bool>]
> > >> >>         #Option     "SWcursor"           # [<bool>]
> > >> >>         #Option     "VideoKey"           # <i>
> > >> >>         #Option     "PanelWidth"         # <i>
> > >> >>         #Option     "PanelHeight"         # <i>
> > >> >>         #Option     "ProgramFPRegs"       # [<bool>]
> > >> >>         #Option     "DMAForXv"           # [<bool>]
> > >> >>         #Option     "ForcePCIMode"       # [<bool>]
> > >> >>         #Option     "CCEPIOMode"         # [<bool>]
> > >> >>         #Option     "CCENoSecurity"       # [<bool>]
> > >> >>         #Option     "CCEusecTimeout"     # <i>
> > >> >>         #Option     "AGPMode"             # <i>
> > >> >>         #Option     "AGPSize"             # <i>
> > >> >>         #Option     "RingSize"           # <i>
> > >> >>         #Option     "BufferSize"         # <i>
> > >> >>         #Option     "EnablePageFlip"     # [<bool>]
> > >> >>         #Option     "AccelMethod"         # <str>
> > >> >>         #Option     "RenderAccel"         # [<bool>]
> > >> >> #Option "NoAccel" "off"  #action
> > >> >> #Option "UseFBDev" "on"  #action
> > >> >> #Screen 0 #action
> > >> >> #Option "ForcePCIMode"    "True"  #not used re manpage but in aut=
ogen
> > >> >> #Option "Display" "CRT"  #not used re r128 manpage but x.org disa=
gree
> > >> >> Identifier  "Card0"
> > >> >> Driver      "r128"
> > >> >> BusID       "PCI:0:16:0"
> > >> >> EndSection
> > >> >>
> > >> >>
> > >> >> Section "Screen"
> > >> >> Identifier "Screen0"
> > >> >> Device     "Card0"
> > >> >> Monitor    "Monitor0"
> > >> >> Option  "DPMS"
> > >> >>
> > >> >> DefaultDepth  24
> > >> >>
> > >> >> SubSection "Display"
> > >> >> Viewport   0 0
> > >> >> Depth     1
> > >> >> EndSubSection
> > >> >> SubSection "Display"
> > >> >> Viewport   0 0
> > >> >> Depth     4
> > >> >> EndSubSection
> > >> >> SubSection "Display"
> > >> >> Viewport   0 0
> > >> >> Depth     8
> > >> >> EndSubSection
> > >> >> SubSection "Display"
> > >> >> Viewport   0 0
> > >> >> Depth     15
> > >> >> EndSubSection
> > >> >> SubSection "Display"
> > >> >> Viewport   0 0
> > >> >> Depth     16
> > >> >> EndSubSection
> > >> >> SubSection "Display"
> > >> >> Viewport   0 0
> > >> >> Depth     24
> > >> >> EndSubSection
> > >> >> EndSection
> > >> >>
> > >> >> Section "DRI"
> > >> >>     Mode 0666
> > >> >> EndSection