This is a updated patch from this old patch according to the modification from markj on uart part of bhyve.
This patch add raw tcp connection ability on bhyve and has been tested on my own machine.
An example about this is as following:
bhyve -c 2 -m 4G -w -H \ -s 0,hostbridge \ -s 1,virtio-blk,./FreeBSD-14.0-STABLE-amd64-20240118-cef433d3fb38-266364.raw \ -s 30,xhci,tablet \ -s 31,lpc -l com1,tcp=127.0.0.1:8085 \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \ uefivm
Then we can use nc by:
netcat 127.0.0.1 8085