Re: cpu_rootconf() vs booted_device issues

2022-03-14 Thread Izumi Tsutsui
mrg@ wrote:

> cpu_rootconf problems.most of these only need to have eg
> "if (booted_device) return;" added to a function usually
> called findroot() or set_root_device():
 :
> atari
> - also checks RB_ASKNAME, which means no default will be set
>   (consider removing this check here)

As commented in the its cpu_rootconf(), it's inside of
"#if defined(MEMORY_DISK_HOOKS)" and necessary for the atari specific
"auto load mdroot image from floppy on the first open" for installation,
after md(4) has been changed to be dynamically configured:
 https://mail-index.netbsd.org/source-changes/2010/11/11/msg014346.html
 https://nxr.netbsd.org/xref/src/sys/arch/atari/atari/autoconf.c?r=1.71#91

"ustarfs based multiple install floppies for atari" is in my todo list,
but it requires more detailed info about TOS (an atari's native OS)
internal BIOS functions for raw I/O accesses..

---
Izumi Tsutsui


cpu_rootconf() vs booted_device issues

2022-03-13 Thread matthew green
hi folks.


i recently changed the evbmarm/fdt code to avoid forcing the
'booted_device' to be set to something if it was already set
(in that case, by the raidframe "soft root" code).

i surveyed all the cpu_rootconf() implementations.  there are
a lot, some are fixed but many are not.

i'm not planning on fixing any of these right now, though many
will use an idential patch (eg, all hpc{arm,mips.sh}, many of
the m68k/ppc/mips ports, use similar or identical code here
already), and some require thinking a little more about it
(eg, the sparc* ports set "booted_device" during autoconf when
the boot device is found in the tree.)  however, here's the
list of them all and my vague notes.


.mrg.


cpu_rootconf problems.most of these only need to have eg
"if (booted_device) return;" added to a function usually
called findroot() or set_root_device():
amiga
amigappc
atari
- also checks RB_ASKNAME, which means no default will be set
  (consider removing this check here)
cats
- might need to avoid setting boot_args?few others too.
evbppc/ev64260
evbppc/pmppc
ews4800mips
hp300
hpcarm
hpcmips
hpcsh
hppa
ibmnws
mac68k
mipsco
mvmeppc
news68k
newsmips
next68k
prep
shark
sparc
sparc64
- both sparc/sparc64 set booted_device during autoconfig
  when the device is found, matched with the ofw provided
  boot path info.
sun3
sun68k
usermode

these ones have an always-true test could be fixed:
evbmips/cavium
evbmips/gdium
evbmips/loongson
evbmips/malta
evbmips/rmixl
if (booted_device)
return;
if ((booted_device == NULL) && netboot == 0) {