How to control booting via BIOS vs booting via EFI?

Johan Stenstam <[email protected]> Sun, 12 Oct 2025 16:21:51 +0200
Newsgroups gmane.os.netbsd.ports.x86-64
Message-ID <[email protected]>
Hi,

I have an Minisforum MS-01 which I like a lot. In fact I like it so much =
that I bought a second one. The first one runs NetBSD 10.1/Xen and the =
second one should do that too, but doesn=E2=80=99t.=20

The problem seems to be that when I load the Xen hypervisor (i.e. from =
boot.cfg, multiboot=E2=80=A6) on the second system it crashes. Same =
version of Xen on both systems. After some hunting around I=E2=80=99ve =
become aware that apparently NetBSD/Xen must boot via BIOS, EFI =
doesn=E2=80=99t work at the moment. So I checked =E2=80=9Csysctl =
machdep.bootmethod=E2=80=9D and as the first box says =E2=80=9CBIOS=E2=80=9D=
 and the second says =E2=80=9CEFI=E2=80=9D I believe that I have found =
the problem.

So I tried to switch the second system to do BIOS-booting instead (I =
don=E2=80=99t know why it chosed EFI, I do not remember being given a =
choice). No luck, no matter how much I play with installboot and copying =
/usr/mdec/boot to /boot and similar stuff from the BIOS era, system =
always boots via EFI. Sigh.

Here it is worth pointing out that neither system announces any =
BIOS/Legacy-booting ability. Also they have slightly different versions =
of the Minisforum firmware (1.26 vs 1.27). So perhaps 1.26 didn=E2=80=99t =
announce the BIOS-booting ability but did support it, while 1.27 =
actually removed BIOS-booting? That would suck as I really need to be =
able to run Xen.

To test this I switched the disks between the two systems. And then, =
suddenly, the older MS-01 only does EFI-booting while the newer only =
does BIOS-booting. That=E2=80=99s actually great, because it means that =
both systems are *able* to boot via BIOS, which I need for Xen.

Which brings me to my current conundrum: as the BIOS vs EFI-booting =
apparently follows the disk used it must be something on the disk that =
determines the boot method. But what? And how do I change it? Both disks =
use GPT, have identical GPT tables from start until the NetBSD =
partitions (although the new disk is larger). Output from =E2=80=9Cfdisk =
/dev/rld0=E2=80=9D is identical. Contents of the =E2=80=9CPBR=E2=80=9D =
is the same, /boot is the same, etc, etc.

I simply do not understand where on the disk the magic lies that =
determine boot method.

Any help would be much appreciated.=