On Mon, 10 Nov 2025 19:56:15 +0100,
Miod Vallat <[email protected]> wrote:
>
> > Without attached screen it has bios_efiinfo->fb_addr == 0 that leads to skip
> > efifb by efifb_match.
>
> Well, I still have this diff lying around, in need of testers...
>
Machine doesn't boot without KVM.
When KVM was attached it was a black screen with no reaction on keyboard.
Restart boots it.
> Index: sys/arch/amd64/amd64/efifb.c
> ===================================================================
> RCS file: /OpenBSD/src/sys/arch/amd64/amd64/efifb.c,v
> diff -u -p -u -p -r1.34 efifb.c
> --- sys/arch/amd64/amd64/efifb.c 15 Jul 2022 17:57:25 -0000 1.34
> +++ sys/arch/amd64/amd64/efifb.c 10 Nov 2025 18:52:35 -0000
> @@ -349,6 +349,15 @@ efifb_alloc_screen(void *v, const struct
> }
>
> int
> +efifb_cnprobe(void)
> +{
> + if (bios_efiinfo == NULL || bios_efiinfo->fb_addr == 0)
> + return (-1);
> +
> + return (0);
> +}
> +
> +int
> efifb_cnattach(void)
> {
> if (bios_efiinfo == NULL || bios_efiinfo->fb_addr == 0)
> Index: sys/arch/amd64/amd64/wscons_machdep.c
> ===================================================================
> RCS file: /OpenBSD/src/sys/arch/amd64/amd64/wscons_machdep.c,v
> diff -u -p -u -p -r1.14 wscons_machdep.c
> --- sys/arch/amd64/amd64/wscons_machdep.c 14 Oct 2017 04:44:43 -0000
> 1.14
> +++ sys/arch/amd64/amd64/wscons_machdep.c 10 Nov 2025 18:52:35 -0000
> @@ -82,6 +82,25 @@ void
> wscnprobe(struct consdev *cp)
> {
> int maj;
> + int display = 0;
> +
> +#if (NEFIFB > 0)
> + if (efifb_cnprobe() == 0)
> + display = 1;
> +#endif
> +#if (NVGA > 0)
> + if (!display && vga_cnprobe(X86_BUS_SPACE_IO, X86_BUS_SPACE_MEM) == 0)
> + display = 1;
> +#endif
> +#if (NPCDISPLAY > 0)
> + if (!display &&
> + pcdisplay_cnprobe(X86_BUS_SPACE_IO, X86_BUS_SPACE_MEM) == 0)
> + display = 1;
> +#endif
> + if (!display) {
> + cp->cn_pri = CN_DEAD;
> + return;
> + }
>
> /* locate the major number */
> for (maj = 0; maj < nchrdev; maj++) {
> Index: sys/arch/amd64/include/efifbvar.h
> ===================================================================
> RCS file: /OpenBSD/src/sys/arch/amd64/include/efifbvar.h,v
> diff -u -p -u -p -r1.10 efifbvar.h
> --- sys/arch/amd64/include/efifbvar.h 4 May 2019 11:34:47 -0000 1.10
> +++ sys/arch/amd64/include/efifbvar.h 10 Nov 2025 18:52:35 -0000
> @@ -25,6 +25,7 @@ struct efifb_attach_args {
>
> struct pci_attach_args;
>
> +int efifb_cnprobe(void);
> int efifb_cnattach(void);
> void efifb_cnremap(void);
> int efifb_is_console(struct pci_attach_args *);
> Index: sys/dev/ic/vga.c
> ===================================================================
> RCS file: /OpenBSD/src/sys/dev/ic/vga.c,v
> diff -u -p -u -p -r1.74 vga.c
> --- sys/dev/ic/vga.c 27 May 2021 23:24:40 -0000 1.74
> +++ sys/dev/ic/vga.c 10 Nov 2025 18:52:35 -0000
> @@ -571,6 +571,15 @@ vga_extended_attach(struct device *self,
> }
>
> int
> +vga_cnprobe(bus_space_tag_t iot, bus_space_tag_t memt)
> +{
> + if (!vga_common_probe(iot, memt))
> + return (ENXIO);
> +
> + return (0);
> +}
> +
> +int
> vga_cnattach(bus_space_tag_t iot, bus_space_tag_t memt, int type, int check)
> {
> uint32_t defattr;
> Index: sys/dev/ic/vgavar.h
> ===================================================================
> RCS file: /OpenBSD/src/sys/dev/ic/vgavar.h,v
> diff -u -p -u -p -r1.13 vgavar.h
> --- sys/dev/ic/vgavar.h 26 Jul 2015 03:17:07 -0000 1.13
> +++ sys/dev/ic/vgavar.h 10 Nov 2025 18:52:35 -0000
> @@ -187,6 +187,7 @@ struct vga_config *
> vga_extended_attach(struct device *, bus_space_tag_t, bus_space_tag_t,
> int, paddr_t (*)(void *, off_t, int));
> int vga_is_console(bus_space_tag_t, int);
> +int vga_cnprobe(bus_space_tag_t, bus_space_tag_t);
> int vga_cnattach(bus_space_tag_t, bus_space_tag_t, int, int);
>
> struct wsscreen_descr;
> Index: sys/dev/isa/pcdisplay.c
> ===================================================================
> RCS file: /OpenBSD/src/sys/dev/isa/pcdisplay.c,v
> diff -u -p -u -p -r1.15 pcdisplay.c
> --- sys/dev/isa/pcdisplay.c 6 Apr 2022 18:59:28 -0000 1.15
> +++ sys/dev/isa/pcdisplay.c 10 Nov 2025 18:52:35 -0000
> @@ -286,6 +286,16 @@ pcdisplay_attach(struct device *parent,
>
>
> int
> +pcdisplay_cnprobe(bus_space_tag_t iot, bus_space_tag_t memt)
> +{
> + if (pcdisplay_probe_col(iot, memt))
> + return (0);
> + if (pcdisplay_probe_mono(iot, memt))
> + return (0);
> + return (ENXIO);
> +}
> +
> +int
> pcdisplay_cnattach(bus_space_tag_t iot, bus_space_tag_t memt)
> {
> int mono;
> Index: sys/dev/isa/pcdisplayvar.h
> ===================================================================
> RCS file: /OpenBSD/src/sys/dev/isa/pcdisplayvar.h,v
> diff -u -p -u -p -r1.4 pcdisplayvar.h
> --- sys/dev/isa/pcdisplayvar.h 2 Apr 2004 04:39:51 -0000 1.4
> +++ sys/dev/isa/pcdisplayvar.h 10 Nov 2025 18:52:35 -0000
> @@ -27,4 +27,5 @@
> *
> */
>
> +int pcdisplay_cnprobe(bus_space_tag_t, bus_space_tag_t);
> int pcdisplay_cnattach(bus_space_tag_t, bus_space_tag_t);
--
wbr, Kirill