HomeFreeBSD

amd64 loader: Use efiserialio for Hyper-V booted systems

Description

amd64 loader: Use efiserialio for Hyper-V booted systems

UEFI provides ConIn/ConOut handles for consoles that it supports,
which include the text-video and serial ports. When the serial port
is available, use the UEFI driver instead of direct io-port accesses
to avoid conflicts between the firmware and direct hardware access, as
happens on Hyper-V (Azure) setups.

This change enables efiserialio to be built for efi-amd64 and has
higher order priority vs comconsole, and only uses efiserialio
if the hypervisor is Hyper-V. When efiserialio successfully
probes, it will set efi_comconsole_avail=true which will prevent
comconsole from probing in this setup.

Tested on Hyper-V, ESXi and Azure VMs.

PR: 264267
Reviewed by: kevans, whu
Tested by: whu
Obtained from: Rubicon Communications, LLC (Netgate)
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (Netgate)

Details

Provenance
whuAuthored on Mar 14 2023, 3:13 PM
Parents
rGab3ff87a333a: Belately bump __FreeBSD_version for introduction of __libc_start1()
Branches
Unknown
Tags
Unknown