Discussion:
diskless
Hugo Villeneuve
2010-02-19 15:06:14 UTC
Permalink
I know that mac68k is mostly abandonware here and that's why I
deleted the au/x parition on my quadra.

But I was curious about running diskless.

It works. Kind of.

A kernel with "config bsd root on nfs" crash into ddb with an MMU
fault. But if I tell the booter to ask for root and write my network
interface name at the prompt, it boots diskless properly.

This differ from GENERIC by (and was compiled disklessly):

option BUFCACHEPERCENT=15
config bsd root on nfs


OpenBSD 4.6-stable (ROOTNFS) #0: Wed Feb 17 19:05:13 EST 2010
***@mac.EINTR.net:/usr/src/sys/arch/mac68k/compile/ROOTNFS
Apple Macintosh Quadra 650, 68040 CPU+MMU+FPU, 4k on-chip physical I/D caches
real mem = 142606336 (136MB)
avail mem = 132976640 (126MB)
mainbus0 at root
obio0 at mainbus0
adb0 at obio0: II series
asc0 at obio0: Apple Sound Chip
macfb0 at obio0: DAFB, monitor sense 0
macfb0: 800x600, monochrome display
wsdisplay0 at macfb0 mux 1: console (std, vt100 emulation)
sn0 at obio0: integrated ethernet adapter, address 08:00:07:9c:f8:76
esp0 at obio0 (pseudo-DMA): NCR53C96, 16MHz
scsibus0 at esp0: 8 targets, initiator 7
sd0 at scsibus0 targ 2 lun 0: <IBM, DPES-31080 !t, S31R> SCSI2 0/direct fixed
sd0: 1034MB, 512 bytes/sec, 2118144 sec total
cd0 at scsibus0 targ 3 lun 0: <SONY, CD-ROM CDU-8003A, 1.9a> SCSI2 5/cdrom removable
zsc0 at obio0
zstty0 at zsc0 channel 0
zstty1 at zsc0 channel 1
nubus0 at mainbus0
adb0: 2 targets
akbd0 at adb0 addr 2: extended keyboard (ISO layout)
wskbd0 at akbd0: console keyboard, using wsdisplay0
ams0 at adb0 addr 3: 1-button, 100 dpi mouse
wsmouse0 at ams0 mux 0
softraid0 at root
root device: sn0
nfs_boot: using interface sn0, with revarp & bootparams
nfs_boot: client_addr=192.168.12.50
nfs_boot: server_addr=192.168.12.220 hostname=mac
root on jwales:/exports/mac/root
swap on jwales:/exports/mac/swap


I can't tell if the swap works as it isn't using any of it with
136MB of memory. I was surprised I had to re-mount it in fstab, I
tought it was automated.

/etc/fstab:
jwales:/exports/mac/root / nfs rw 0 0
jwales:/exports/mac/swap none swap sw,nfsmntpt=/swap 0 0
swap /tmp mfs rw,nodev,nosuid,-s=40960 0 0
jwales:/exports/mac/src /usr/src nfs rw 0 0
jwales:/exports/mac/XF4 /usr/obj nfs rw 0 0


It's fun.
--
Hugo Villeneuve <***@EINTR.net>
http://EINTR.net/
Miod Vallat
2010-02-19 15:38:10 UTC
Permalink
Post by Hugo Villeneuve
I know that mac68k is mostly abandonware here and that's why I
deleted the au/x parition on my quadra.
But I was curious about running diskless.
It works. Kind of.
A kernel with "config bsd root on nfs" crash into ddb with an MMU
fault. But if I tell the booter to ask for root and write my network
interface name at the prompt, it boots diskless properly.
Sounds like a NULL pointer dereference in setroot().

Does the following diff help? You should get greeted by a panic instead,
as there is no way for the kernel to guess which network interface to
use as its diskless interface, since it has not been booted from it.

If your machine only has one network interface it could be possible to
default to it, though.

Miod

Index: subr_disk.c
===================================================================
RCS file: /cvs/src/sys/kern/subr_disk.c,v
retrieving revision 1.99
diff -u -p -r1.99 subr_disk.c
--- subr_disk.c 14 Jan 2010 23:12:11 -0000 1.99
+++ subr_disk.c 19 Feb 2010 15:36:18 -0000
@@ -1193,7 +1193,7 @@ gotswap:
if (ifp)
if_addgroup(ifp, "netboot");

- switch (rootdv->dv_class) {
+ switch (rootdv ? rootdv->dv_class : DV_DULL) {
#if defined(NFSCLIENT)
case DV_IFNET:
mountroot = nfs_mountroot;
Hugo Villeneuve
2010-02-20 04:56:12 UTC
Permalink
Post by Miod Vallat
Post by Hugo Villeneuve
I know that mac68k is mostly abandonware here and that's why I
deleted the au/x parition on my quadra.
But I was curious about running diskless.
It works. Kind of.
A kernel with "config bsd root on nfs" crash into ddb with an MMU
fault. But if I tell the booter to ask for root and write my network
interface name at the prompt, it boots diskless properly.
Sounds like a NULL pointer dereference in setroot().
You were right on this.
Post by Miod Vallat
Does the following diff help? You should get greeted by a panic instead,
as there is no way for the kernel to guess which network interface to
use as its diskless interface, since it has not been booted from it.
If your machine only has one network interface it could be possible to
default to it, though.
The patch works great. 4.6-stable is a few version back from your
(mvme68k?) tree but it applied cleanly.

But you were wrong. On my "config bsd root on nfs" kernel, it did
not panic. It just went directly to nfs booting of sn0.

For fairness, I'll try to get the result with a generic kernel
(config bsd swap generic). It might panic on that. But that will
be tomorrow. It takes 3+ hours to make a kernel.

Still I'm happy, I get un-attented reboot in diskless mode. Thanks
a lot Miod.


My ROOTNFS kernel differ from GENERIC by:

option BUFCACHEPERCENT=23
config bsd root on nfs


Here's the dmesg. I like the "can't figure root, hope your kernel
is right".


OpenBSD 4.6-stable (ROOTNFS) #2: Fri Feb 19 18:33:03 EST 2010
***@mac.EINTR.net:/usr/src/sys/arch/mac68k/compile/ROOTNFS
Apple Macintosh Quadra 650, 68040 CPU+MMU+FPU, 4k on-chip physical I/D caches
real mem = 142606336 (136MB)
avail mem = 132976640 (126MB)
mainbus0 at root
obio0 at mainbus0
adb0 at obio0: II series
asc0 at obio0: Apple Sound Chip
macfb0 at obio0: DAFB, monitor sense 0
macfb0: 800x600, monochrome display
wsdisplay0 at macfb0 mux 1: console (std, vt100 emulation)
sn0 at obio0: integrated ethernet adapter, address 08:00:07:9c:f8:76
esp0 at obio0 (pseudo-DMA): NCR53C96, 16MHz
scsibus0 at esp0: 8 targets, initiator 7
sd0 at scsibus0 targ 2 lun 0: <IBM, DPES-31080 !t, S31R> SCSI2 0/direct fixed
sd0: 1034MB, 512 bytes/sec, 2118144 sec total
cd0 at scsibus0 targ 3 lun 0: <SONY, CD-ROM CDU-8003A, 1.9a> SCSI2 5/cdrom removable
zsc0 at obio0
zstty0 at zsc0 channel 0
zstty1 at zsc0 channel 1
nubus0 at mainbus0
adb0: 2 targets
akbd0 at adb0 addr 2: extended keyboard (ISO layout)
wskbd0 at akbd0: console keyboard, using wsdisplay0
ams0 at adb0 addr 3: 1-button, 100 dpi mouse
wsmouse0 at ams0 mux 0
softraid0 at root
can't figure root, hope your kernel is right
nfs_boot: using interface sn0, with revarp & bootparams
nfs_boot: client_addr=192.168.12.50
nfs_boot: server_addr=192.168.12.220 hostname=mac
root on jwales:/exports/mac/root
swap on jwales:/exports/mac/swap
--
Hugo Villeneuve <***@EINTR.net>
http://EINTR.net/
Hugo Villeneuve
2010-03-10 17:31:26 UTC
Permalink
Post by Hugo Villeneuve
Post by Miod Vallat
Post by Hugo Villeneuve
A kernel with "config bsd root on nfs" crash into ddb with an MMU
fault. But if I tell the booter to ask for root and write my network
interface name at the prompt, it boots diskless properly.
Sounds like a NULL pointer dereference in setroot().
Does the following diff help? You should get greeted by a panic instead,
as there is no way for the kernel to guess which network interface to
use as its diskless interface, since it has not been booted from it.
If your machine only has one network interface it could be possible to
default to it, though.
The patch works great. 4.6-stable is a few version back from your
(mvme68k?) tree but it applied cleanly.
For fairness, I'll try to get the result with a generic kernel
(config bsd swap generic). It might panic on that. But that will
be tomorrow. It takes 3+ hours to make a kernel.
Obviously, there's no issue with GENERIC, the first thing setroot
does is add the RB_ASKNAME flag when there's no "root on" and no
boot device known.

Since then, I compiled 2 snapshots in a row. Seems to work all
right. I'm running March 3 and now making build xenocara. It's fun.

I tought a big issue was responsible for no new mac68k snapshots
since 4.6. But it seems it could run on auto-pilot for a few more
release. It was really easy for me to go to current.

<rant>
I guess "progress" means xterm terminfo entry is getting colors on
OpenBSD too. I just hate terminal colors. I had before a "screen-m"
entry that remove ansi colors from "screen" in my ~/.terminfo.db,
but now I have to also move all my xterm/Terminal.app to use "vt102"
instead of "xterm" for TERM.
</rant>


Thanks again



Diff from GENERIC:

maxusers 64
option BUFCACHEPERCENT=23
config bsd root on nfs swap on nfs


OpenBSD 4.7-beta (ROOTNFS) #4: Thu Mar 4 07:02:12 EST 2010
***@mac.EINTR.net:/usr/src/sys/arch/mac68k/compile/ROOTNFS
Apple Macintosh Quadra 650, 68040 CPU+MMU+FPU, 4k on-chip physical I/D caches
real mem = 142606336 (136MB)
avail mem = 133488640 (127MB)
mainbus0 at root
obio0 at mainbus0
adb0 at obio0: II series
asc0 at obio0: Apple Sound Chip
macfb0 at obio0: DAFB, monitor sense 0
macfb0: 800x600, monochrome display
wsdisplay0 at macfb0 mux 1: console (std, vt100 emulation)
sn0 at obio0: integrated ethernet adapter, address 08:00:07:9c:f8:76
esp0 at obio0 (pseudo-DMA): NCR53C96, 16MHz
scsibus0 at esp0: 8 targets, initiator 7
sd0 at scsibus0 targ 2 lun 0: <IBM, DPES-31080 !t, S31R> SCSI2 0/direct fixed
sd0: 1034MB, 512 bytes/sec, 2118144 sec total
cd0 at scsibus0 targ 3 lun 0: <SONY, CD-ROM CDU-8003A, 1.9a> SCSI2 5/cdrom removable
zsc0 at obio0
zstty0 at zsc0 channel 0
zstty1 at zsc0 channel 1
nubus0 at mainbus0
adb0: 2 targets
akbd0 at adb0 addr 2: extended keyboard (ISO layout)
wskbd0 at akbd0: console keyboard, using wsdisplay0
ams0 at adb0 addr 3: 1-button, 100 dpi mouse
wsmouse0 at ams0 mux 0
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
can't figure root, hope your kernel is right
nfs_boot: using interface sn0, with revarp & bootparams
nfs_boot: client_addr=192.168.12.50
nfs_boot: server_addr=192.168.12.220 hostname=mac
root on jwales:/exports/mac/root
swap on jwales:/exports/mac/swap

Loading...