# I tried OpenBSD on bare metal

  Yes, since I started using FreeBSD last year on my old laptop, I am
growing to love BSD more and more. So during this vacation time I
thought about giving OpenBSD a try on my desktop computer as well. 
  
  Long story short, the USB sticks with OpenBSD image freeze my PC at
BIOS flash screen, which is probably a bug in my BIOS firmware.

  I had a USB thumb drive with Ventoy(1) in it at hand already so I just
went on and downloaded install73.iso amd64 version and put it in the
thumb drive.  My desktop runs on a Gigabyte board, model num
H61M-D2P-B3. I have owned it since 2010-ish and I always used legacy
BIOS and MBR disk scheme with secure boot off. There are two hard disks,
one with several NTFS partitions and a Windows 10 I seldom use nowadays,
the other is empty and I intended to install OpenBSD in it. Pressing F12
at BIOS splash screen brings up the boot device menu to choose which
device to boot from on the fly.  Ventoy booted smoothly and I chose
install73.iso and it then booted without any error. Fast forward to the
last step where installer had to extract file sets, then it asked to
specify where the file sets were.  I realized that the Ventoy formated
the thumb drive in exFat format and it occurred to me that it was not
possible to mount it at this point.  OpenBSD does not support exFat out
of box, and Internet connection is not up as my WiFi card need firmware
to work (which I'd need working network to download).

  I then switched to another drive and used install73.img as per FAQ,
this is a very old 2GB one which only supported USB 2.0 speed. I used
Rufus(2) in Windows 10 to dd the img in MBR mode. All done, I rebooted
my computer, well it did tried to boot after poweroff, only got stuck at
BIOS splash screen (where some texts indicating hardware info appeared
in the middle of the screen, right after texts at bottom about which
keys to use for entering BIOS settings or quick boot device menu). It
just got stuck there no matter how long I waited. Hard reboot by reset
button or power off and on again by power button worked but only
resulted in another hang. Keyboard and mouse wouldn't respond either.  

  I switched to another thumb drive, a USB 3.0 capable one. same problem
persisted. 

  I set up a Ubuntu VM, passed my USB stick to the VM from the host and
dd the img using
 
dd if=install73.img of=/dev/sdb bm=1m

and tried again, no luck. I also noticed if I inserted the thumb drive
when I was in BIOS setting, or at the quick boot device menu, keyboard
instantly stopped working too, so I could continue booting. Basiclly,
USB drives just caused my BIOS hang.

  I finally pined down two option in BIOS setting that might be the
culprit causing the problem to boot OpenBSD install img stick: USB
Legacy Funtion and USB Storage Function. If I disable both, the computer
won't got stuck at boot but boot from USB (USB-HDD, USB-FDD, USB-ZIP)
wouldn't work and machine just ignore my USB stick and go ahead and boot
from hard disk even when USB was set as first boot priority divice. But
if I enable one of them or both, computer got stuck and keyboard stops
working, if I was in BIOS setting, or early during boot. 

  However, knowing that Ventoy was able to boot OpenBSD iso, the only
issue was file sets, I came up with an idea to just insert another USB
stick formated as FAT32 with file sets in it. When I was prompted by the
installer for the path to file sets, I just mount the drive manually and
pointed the installed there. Wala, all went well. I was able to install
OpenBSD this way got basic X running up out of box. Later I downloaded
the firmware for my wireless card and got network to work too. It was
all easy and straightforward.


# However, I went back to FreeBSD after a few hours

  After setting up basic X and network, I started to find get my Nvidia
card to work. Unfortunately, it occurred to me that my card was not
supported by the nv driver that came with basic install. VESA worked but
I was unable to get native resolution for my monitor, everything was a
bit distorted in a lower resolution and laggy. Apart from that, I was
also aware that although the earlier issue with BIOS hang was not the
problem of OpenBSD, I also found out that FreeBSD img USB stick would
not cause that. So there was something with OpenBSD maybe, but that's
beyond my capability to investigate. Also, OpenBSD has the great
documents and tutorials on their websites, but it was a little too much
for me. There was so much that I don't understand even I tried reading
manual pages. I spent a lot of time trying to understand how disks and
partitions are named and how to mount them. I decided that it might not
for me, at least now. So I went straight back to FreeBSD. 

  Still the same process, dd FreeBSD install img into the same USB
stick, no hang this time. Install was smooth and quick, WiFi card was
recognized during install and network was up so I didn't have to do
anything after install it just worked out of box. ZFS is great and a
really killing feature, although there is still so much for me to learn.
Setting up X was pretty simple, Nvidia propietary driver worked as
expected. I was surprized that suspend and wake-up also worked
flawlessly. So this was the second computer I have that's running
FreeBSD and everything is working perfectly. 

  I've posted most of this and my thoughts on OpenBSD and FreeBSD on
Mastodon so here is just a memo of some kind for me.

(I have to learn how to properly format texts in vim for better reading
at sometime.)

[1] Ventoy: https://www.ventoy.net
[2] Rufus: https://rufus.ie