Debug output from Bootloader

Hey, just a quick question,

Am I right in thinking that to get (verbose) debugging output form the bootloader itself, I need to recompile and ensure the relevant TRACE macro is defined? I can boot the Anyboot as a CD and go through the full installation, but then on reboot the loader can’t see any partitions with an installation on them. I may have messed up but thought it would be good to see hat’s happening via the serial console in case this is specific to the bhyve setup as it is now.

Thanks :slight_smile:

Hey,
Can you run Haiku in bhyve with smp?
I openend a bug report about that on freebsds side but never got a response, would be interesting if my issue was hw specific.
(https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241338 )

As far as i know you would indeed need to recompile the bootloader with debug set.
Since it works from the cd though it would be interesting how you installed the system. did you use the bhyve efi firmware? If not and with bios booting did you mark the partition to use as active when creating it? (as in bootable flag)

if efi did you copy the loader into the fallback path for a new esp?

image

Appears to be!(?)

From the bug report, this is just any time you start in bhyve with anything but a single virtual core? I’m running from OmniOS so I haven’t had to fiddle manually with any of bhyve’s settings, in fact, I’m pretty new to it - I’d been trying to play with illumos for a long time but often when I started spinning up zones (guests) they didn’t work, and I ended up in this cycle where I couldn’t get a feel for the system setup cause my zones weren’t booting, yet I didn’t know how to diagnose or fix them because I hadn’t got any experience with what is actually happening. Turns out it’s a two-step process, bhyve kinda does its own thing inside the zone, and the kernel is segregating that on another level. So I’ve seen scripts like vmrun.sh before but I’d need to peek under the bonnet and see what the zone is actually firing up bhyve with to see - not too difficult to get the logs with this new utility they’ve introduced and I’ve split onto lines for you:

usr/sbin/bhyve  \
  -U 48fb72a1-4754-4f0b-82d4-9fa0c124361c \
  -A -H 
  -B 1,manufacturer=OmniOS,product=OmniOS HVM,version=1.0,serial=48fb72a1-4754-4f0b-82d4-9fa0c124361c,sku=001,family=Virtual Machine
 -c 4 -m 2G  \
 -l bootrom,/usr/share/bhyve/firmware/BHYVE.fd \
 -s 0,hostbridge,model=i440fx \
 -s 1,lpc \
  -l com1,/dev/zconsole \
 -s 7:0,ahci-cd,/zones/BootDisks/Haiku.iso \
 -s 4:0,virtio-blk,/dev/zvol/rdsk/rpool/haiku_cd_/root \
 -s 6:0,virtio-net-viona,haiku_1_0 \
 -s 30:0,fbuf,vga=off,unix=/tmp/vm.vnc
  -s 30:1,xhci,tablet haiku_cd_ 

I see your host is AMD, I’m on a (now) old intel i5. I modified a little script in python to test the required processor flags - I meant to polish this ifnally some point and submit so I can send your way if you want to see. I ran into a problem on another machine where my processor was just slightly too old and so it seemed all the flgs were supported but in fact an additional test showed one was missing, or something like it.

But yes, I used EFI - at least think I did, should have booted EFI automatically. On Omni at least, and I believe upstream, the VNC doesn’t work on BIOS booting. So I just made a FAT32 on my installation candidate and copied Haiku’s bootloader across, which I presume must be working as I get that far. I was suspecting perhaps the disk isn’t fully howing up to the bootloader form within bhyve with the added complication of EFI - those block devices do not show up with nice names in the boot menu anyway, so wondered if that was related.

I’ll get to building Haiku when I’m back on my old native Ubuntu to make things easier and see where we get; I don’t fancy doing it all from the live machine unless I can put plenty of it onto non-volatile storage XD
But thnaks for confirming :smiley:

Don’t suppose this is any way related(?):


Just came up in google and wondered if of any interest, as seems recent. Joyent do I think submit back up to BSD’s bhyve quite often.

I no longer have the Install, and the machine is standing still (Have a newer board and processor to run haiku natively on)
Didn’t know you were on illumos.

for the efi install variant, can you boot the installation with the efi loader of the cd?
and are you using the nightly or beta?
the nightlies have a known bug for efi booting where you have to manually select the state to boot every boot before it will work (doesn’t find the partition)

That’s a good point, I think I meant to try that, but it comes up so fast I must have been distracted and forgot. I’ll see if I can hit spacebar via the serial before it dives straight in. And yeah, I’m trying to transition to have everything fully virtual as a zone. Just been a very long and slow project I’ve had to keep on the back burner.

The vmrun.sh script has an option to make bhvye wait for the vnc connection to be established if you use that, perhaps your frontend has a similar option somewhere? (It’s all passed to bhyve at some point anyway)

Am looking now and don’t see anything, but think it could probably be added at some point without too much difficulty. I don’t really know how the zone branding sets up and tears down the utilities inside the zone, but that’s something I could learn about for later.

Also tried booting from the CD, there are three entries all labelled ‘Haiku’, and they all seem to go back to the Anyboot so think it’s probably the same. I’ll get to building it with the debug flags shortly.

the nightlies have a known bug for efi booting where you have to manually select the state to boot every boot before it will work (doesn’t find the partition)

I’ve just run into this, now I’ve updated to a more recent build. Beta2 could not find the partition at all, 55001 does, but as you say, needs to rescan. Otherwise seems to be spinning up fine now.