Another round,another interesting question
I've installed netBSD emulated with Bhyve on FreeBSD. I'm trying to configure a serial console inside the bhyve parameters and also inside the boot.cfg config file of netBSD because I need to read the early boot messages printed by NetBSD. I am not sure how bhyve keeps logs. Xorg logs are fine but at the point that the OS have already booted and it can save to files. Before the system comes up, while it is booting, the system prints logs to the console. At that point it has no filesystem access. If the kernel crashes (and this is what I suspect,that the NetBSD kernel crashes on that point) while booting I typically get the debugger prompt on the console, or it reboots again. Unfortunately when the graphics driver kicks in, the screen blanks. So if the kernel crashes then, I don't see what happened. If I will be able to tell the kernel to boot from the serial console, then all the output will be directed there (and the debugger prompt). What I would like to do is to get the kernel use the serial console for input and output while booting so that I can see what happens when the screen blanks. Below you can see how I have configured bhyve to boot NetBSD from its phisycal installation :
as u can see,on the bhyve side I've added the parameter : "-l com1,nmdm0A" and on NetBSD side,I've added the same parameter on the file boot.cfg :
consdev com1 ;
when I run the VM with the command below :
I get the following error mesage :
Unable to initialize backend 'nmdm0A' for LPC device COM1
device emulation initialization error: No such file or directory
I've installed netBSD emulated with Bhyve on FreeBSD. I'm trying to configure a serial console inside the bhyve parameters and also inside the boot.cfg config file of netBSD because I need to read the early boot messages printed by NetBSD. I am not sure how bhyve keeps logs. Xorg logs are fine but at the point that the OS have already booted and it can save to files. Before the system comes up, while it is booting, the system prints logs to the console. At that point it has no filesystem access. If the kernel crashes (and this is what I suspect,that the NetBSD kernel crashes on that point) while booting I typically get the debugger prompt on the console, or it reboots again. Unfortunately when the graphics driver kicks in, the screen blanks. So if the kernel crashes then, I don't see what happened. If I will be able to tell the kernel to boot from the serial console, then all the output will be directed there (and the debugger prompt). What I would like to do is to get the kernel use the serial console for input and output while booting so that I can see what happens when the screen blanks. Below you can see how I have configured bhyve to boot NetBSD from its phisycal installation :
Code:
bhyve -S -c 8 -m 8G -w -H \
-s 0,hostbridge \
-s 1,virtio-blk,/dev/ada1 \
-s 6,virtio-net,tap0 \
-s 29,fbuf,tcp=`[`0.0.0.0:5900`](https://0.0.0.0:5900)`,w=800,h=600 \
-s 30,xhci,tablet \
-s 31,lpc \
-l com1,nmdm0A \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
vm0
as u can see,on the bhyve side I've added the parameter : "-l com1,nmdm0A" and on NetBSD side,I've added the same parameter on the file boot.cfg :
consdev com1 ;
when I run the VM with the command below :
Code:
root@marietto:/home/marietto/Desktop/Files/bhyve # kldstat
Id Refs Address Size Name
1 108 0xffffffff80200000 1f11f28 kernel
----> 2 1 0xffffffff82112000 4110 nmdm.ko
bhyve -S -c 8 -m 8G -w -H \
-s 0,hostbridge \
-s 1,virtio-blk,/dev/ada1 \
-s 6,virtio-net,tap0 \
-s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600 \
-s 30,xhci,tablet \
-s 31,lpc \
-----> -l com1,nmdmA \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
vm0
I get the following error mesage :
Unable to initialize backend 'nmdm0A' for LPC device COM1
device emulation initialization error: No such file or directory