Date:        Tue, 8 Jul 2025 21:03:45 -0000 (UTC)
    From:        mlel...@serpens.de (Michael van Elst)
    Message-ID:  <104k13h$k7p$1...@serpens.de>

  | % strings /usr/mdec/bootxx_ffsv2 |grep -i slice
  | no slice

Hmm .. I did a recursive grep on src/sys and didn't find that, but
I was probably looking for SLICE (upper case) which is what the
reported message was.   That's bizarre, why would be use "slice" there?

  | bootxx_ffsv2 looks for a MBR with a NetBSD partition (type 169),
  | it will only look for a GPT if it gets started with $GPT_MAGIC
  | in %eax (from a hybrid MBR).

That's horrid, and needs fixing, it should be possible to boot from
GPT if the MBR is a PMBR as well.   I don't know x86 assembler well
enough to fix that, but it looks as if checking for the PMBR magic
in the same sequence that the checks for various FAT types (if that
is being compiled in), and the NetBSD MBR type, should allow it to
work, if there's enough space to shovel in whatever else is needed.

Or, as this is something of a special case, make two new bootxx_ffsvN
variants, which can only boot from GPT, never from an MBR partition,
for installing in GPT partitions PBR ... lots of the existing code can
go then (no need for space for a disklabel, never to be installed in
an MBR as the primary boot, no need to look for MBR anything, ...)

The actual boot code is all there, and clearly can work with GPT, so
all that should be needed is sane startup code to not reject GPTs, and
to locate the NetBSD GPT partition (which is needed for the hybrid MBR
case as well).   It is still "bios" booting in all respects, except for
the label layout on the drive.

kre


Reply via email to