[HN Gopher] FreeBSD on the Framework Laptop
       ___________________________________________________________________
        
       FreeBSD on the Framework Laptop
        
       Author : throw0101a
       Score  : 114 points
       Date   : 2022-08-23 18:56 UTC (4 hours ago)
        
 (HTM) web link (xyinn.org)
 (TXT) w3m dump (xyinn.org)
        
       | ruslan wrote:
       | This is nice. Couple of days ago I published 80 pages work
       | describing my experience installing FreeBSD on Lenovo Ideapad 3
       | Gaming laptop and making it to work. The article is in Russian,
       | but I think it can be easily read through Google Translate,
       | here's the link: https://habr-
       | com.translate.goog/en/post/683702/?_x_tr_sl=ru&...
       | 
       | My experience was pretty similar to that of the owner of
       | Framework laptop, except some extra topics: headless NVIDIA GPU,
       | Touchpad issues, bootloader hangs.
        
         | phist_mcgee wrote:
         | Did you really write all of those pages by hand?? It appears
         | incredibly comprehensive. Did you write it just for fun?
        
           | ruslan wrote:
           | Yes, I wrote it just for fun. It was a kind of challenge for
           | me, both resolving issues and describing them in detail to
           | let new people in town learn _how_ issues can be resolved.
           | Last time I wrote anything that long was my diploma thesis
           | 20+ years go. :-) This work took me nearly four months to
           | accomplish.
        
             | jayp1418 wrote:
             | Cool. Let us know if you write one about NetBSD :)
        
               | ruslan wrote:
               | Sure. ;)
        
       | MontyCarloHall wrote:
       | Serious question: what is so compelling about the FreeBSD desktop
       | experience compared to Linux that makes it worth jumping through
       | all these hoops?
        
         | kloch wrote:
         | Some folks just prefer BSD over other variants. I learned on
         | old school SunOS so that might be why I prefer it.
         | 
         | SysV based Solaris left a bad taste and Linux just seemed
         | unnecessarily weird. 386/Net/FreeBSD was fast, a stable, simple
         | to configure and most importantly familiar.
        
         | IgorPartola wrote:
         | For me personally it would be the ability to run jails and ZFS
         | on a desktop. That would in turn enable me to run the same in
         | production because local/dev/prod parity would be a good thing.
        
           | ladyanita22 wrote:
           | I mean, Ubuntu does support ZFS, and there's LXC...
        
           | MontyCarloHall wrote:
           | Don't Linux and FreeBSD both use OpenZFS these days?
           | 
           | Jails are a fair point, but if they're essential to your
           | production environment, why not just run your FreeBSD dev
           | environment in a VM on your Linux laptop, or SSH into a
           | dedicated FreeBSD dev box?
           | 
           | After all, OP is already running Linux in a VM in order to
           | run working WiFi drivers.
        
       | AdmiralAsshat wrote:
       | The music player at the bottom right is...Audacious with Winamp
       | skin, I presume?
        
         | qbrass wrote:
         | It's XMMS.
         | 
         | Audacious is a fork of a fork of it.
        
       | martin1975 wrote:
       | Is it possible to port Linux driver code to FreeBSD, given
       | licensing issues and all that? Seems like an 'easy' fix, given
       | that Linux has most of the non-working FreeBSD issues solved..if
       | not all. I'm all for code re-use.
        
         | bpye wrote:
         | Some Linux code is dual licensed, a lot of the DRM subsystem
         | for example, I'm pretty sure GPU support on the BSDs are based
         | on ports of it.
        
       | nortonham wrote:
       | Nice update. Hopefully the work being done to update wifi support
       | on FreeBSD will come to something and something like wifibox
       | won't be necessary.
        
       | imwillofficial wrote:
       | If this is something they get dialed in, I'll buy several for
       | sure. Love the framework idea and want to support, but have very
       | little use case right now.
        
       | throw7 wrote:
       | FreeBSD on laptops sounds like Linux on smartphones. ;)
        
         | ruslan wrote:
         | Me and many others would be happy to have it. :)
        
         | alberth wrote:
         | So you mean like Android then.
        
       | auraham wrote:
       | I suggest to share your experience in [1], so others can benefit
       | of your testing.
       | 
       | [1] http://linux-hardware.org/
        
       | xupybd wrote:
       | I want to try BSD one day but these sorts of articles put me off.
       | I used to enjoy trying to get things working but I just don't
       | have that sort of time anymore.
       | 
       | I understand that the community only has so many resources to
       | support the various hardware around. I suspect one BSDs strengths
       | is that the smaller community is able to follow a more cohesive
       | vision. But for me this means I'm probably not going learn it
       | until I can just run it out of the box.
        
         | ndiddy wrote:
         | In every image I've seen of a FreeBSD developer conference, the
         | vast majority of the developers are running FreeBSD in a
         | virtual machine on a Macbook. I guess they aren't considering
         | real hardware support as a priority.
        
       | dark-star wrote:
       | Man, FreeBSD really needs some driver love...
       | 
       | * No Suspend/Resume? Linux has solved this for years, I have not
       | come across a laptop in the last 10 years that had trouble with
       | s2r or s2d (but I guess that there might be a few that don't
       | fully support it, I mainly tested Dell laptops)
       | 
       | * WiFi driver and Ethernet over USB-C both highly unstable?
       | That's an Intel chipset, those are usually the more stable ones
       | (at least on Linux/Windows), and the wire ethernet is not a
       | cheapo chipset either (Realtek)
       | 
       | * Bluetooth not supported???
       | 
       | * microSD slot on USB-C docking station doesn't work? This is
       | just SPI, how hard can that be...
       | 
       | I wonder if there is any laptop from the last 5 years where
       | FreeBSD fully works. I keep trying FreeBSD on and off on my two
       | Laptops but I had similar experiences (plus I'm not used to the
       | FreeBSD way of doing things). I'm ready to jump through _some_
       | hoops but in my case, FreeBSD was always removed after a weekend
       | or so, and replaced with Linux where everything just works.
       | 
       | I used to tinker a lot to get Linux and BSD running on hardware,
       | but these days I kinda expect _most_ things to just work out of
       | the box ...
       | 
       | I really wish FreeBSD would get some more developer backing
        
         | [deleted]
        
         | kevin_thibedeau wrote:
         | > This is just SPI
         | 
         | It isn't "just SPI". That is a fallback protocol for the full
         | SD interface.
        
         | vbernat wrote:
         | Ethernet is likely a Realtek chipset (on the docking station).
         | Intel does not do Ethernet over USB chipsets.
        
           | rjsw wrote:
           | The Ethernet expansion card uses a Realtek 2.5Gb/s controller
           | with a USB-C connection to the laptop.
           | 
           | This is a fairly new controller that may not have a FreeBSD
           | driver yet.
        
         | cowtools wrote:
         | if FreeBSD had a copyleft license, maybe companies would have a
         | reason to publish their drivers, or you could port drivers from
         | Linux.
        
           | systemvoltage wrote:
           | I am glad FreeBSD exists. Not every commercial venture has
           | the luxury to release their source code, even if they wanted
           | to. If you're writing software for banks or defense, the
           | source needs to be closed.
           | 
           | FreeBSD enables these companies to exist and while _consumer_
           | grade drivers are not available, many things in FreeBSD are
           | rock solid. Thanks to commercial contributions.
        
             | doublerabbit wrote:
             | For my hobby server of 1000+ days [1] uptime with ram
             | failing. A raid controller on the brink. I've amazed at the
             | solidarity of FreeBSD.
             | 
             | [1] https://i.redd.it/2omcrsz8ut691.png
             | 
             | * i am aware how in todays time you shouldn't, updates, and
             | blah blah. But not required.
        
           | inopinatus wrote:
           | If FreeBSD was encumbered with copyleft then half the
           | contributors would leave, and the sectors in which it is
           | widely used would seek an alternative.
           | 
           | Pretty sure any "port" of Linux drivers would be in effect a
           | substantial rewrite, for the dissimilar kernel structures and
           | coding standards.
        
           | yjftsjthsd-h wrote:
           | What company do you think is writing FreeBSD drivers for the
           | framework - or any laptop - and not sharing them?
        
           | filmgirlcw wrote:
           | That's probably true but it cuts both ways too.
           | 
           | I don't know if the lack of copy left license is the problem
           | as much as the momentum.
           | 
           | The various Unix and BSD wars (that were predicated on a much
           | different licensing challenge) and splintering of the
           | communities has meant there was never a big way for developer
           | or even manufacturer interest to really focus.
           | 
           | OpenBSD has a very different philosophy related to drivers
           | than FreeBSD and for very understandable reasons, most of the
           | BSDs don't want to use or touch GPL code.
           | 
           | The copyleft nature of the GPL definitely helped Linux, but I
           | don't think it's the only reason Linux was successful.
           | 
           | But Linux got its shit together first and was able to benefit
           | from that. Apple and to a lesser-extent, Solaris, show that
           | you can still have broader hardware support and drivers
           | without a copyleft license.
           | 
           | I do think that if companies could easily port their Linux
           | drivers, you'd see that happen. That's absolutely a
           | consequence of the license choice (and it's a consequence
           | from either license decision). But if there is a market for
           | the BSDs in a particular area, I do think you see companies
           | making drivers.
           | 
           | The reality is, the market for people running FreeBSD on
           | laptops is pretty small and probably not worth it for a lot
           | of WiFi chipset makers. But if you had a specific industry
           | where FreeBSD was widely deployed, I do think you'd have
           | broader hardware support for things important to that
           | industry, if nothing else.
        
             | dark-star wrote:
             | From what I heard, at least some companies that use FreeBSD
             | in their products do give back and upstream at least bits
             | of their code (like Sony, NetApp, ...). Probably mostly
             | improvements to existing kernel subsystems, maybe not
             | drivers, if the hardware isn't freely available... but they
             | still participate in development. At the end of the day, it
             | _is_ in their interest as it lessens the maintenance burden
             | of forward-porting everything to every new kernel version.
        
               | filmgirlcw wrote:
               | Correct! And that's sort of my point. But I don't think a
               | lot of those companies care about wifi drivers working on
               | laptops, as an example.
               | 
               | It is absolutely in their interest to help. But if people
               | expect companies to just write a driver for X operating
               | system, that's not realistic. And if you could just port
               | the Linux drivers, sure, that would be easier, but it
               | wouldn't change the fact that device makers still have
               | the be able to prioritize where to put their resources.
               | And laptop FreeBSD users is probably really low on most
               | lists.
        
             | behnamoh wrote:
             | > But Linux got its shit together first and was able to
             | benefit from that.
             | 
             | Linux is not a company or person. It's the people behind
             | Linux who got it together, but sadly BSD folks have left
             | behind.
             | 
             | > Apple and to a lesser-extent, Solaris, show that you can
             | still have broader hardware support and drivers without a
             | copyleft license.
             | 
             | You're comparing Apple (a company, and a FAANG of them no
             | less) with community-driven projects. Apples and oranges,
             | almost literally.
        
             | 0x457 wrote:
             | Well, it's not that simple.
             | 
             | FreeBSD has some contribution from businesses like Netflix
             | and Nginx and those are very welcome, but they have nothing
             | to do with desktop usage. Those have deadlines and budgets,
             | features get implemented and tested. That's why FreeBSD has
             | superb network stack, good NUMA support, files from disk to
             | nic go brrr. That's why the move to OpenZFS was so fast.
             | 
             | Then, they're contributions without company backing it.
             | This is where desktop feature live. That's why FreeBSD's
             | Wi-Fi stack is stuck on 802.11g - no company depends on
             | this. GPU drivers stuck at Linux 5.4 level - no company
             | cares about it[1]. Those get discussed to death - there is
             | no deadline, no money.
             | 
             | Note, that solution to graphics card driver is to use
             | Linux's drivers, so they don't shy about GPL. However,
             | FreeBSD folks LOVE to bikeshed and polish things. This is
             | why PR to port linux 5.11 drm was open when 5.11 was
             | already EoL for an entire year. Instead of "just" porting
             | 5.11, they decided to refactor how things are done. There
             | are like 3 people working on that PR. It still not merged
             | and not even in review yet.
             | 
             | [1]: Bless Nvidia for having FreeBSD driver available.
             | Would be nice to have CUDA too...
        
               | Melatonic wrote:
               | Seriously - more than anything I feel like FreeBSD is a
               | server OS first and foremost. Or more realistically
               | something with lower flexibility that makes it ideal for
               | more niche use cases as a pseudo "lower level" OS. The
               | way I see it the two things you want MOST reliable are
               | storages and network - and all the other features of most
               | operating systems are just unnecessary fluff for those.
               | 
               | What I would like to see however is maybe some specific
               | wifi chip or USB/thunderbolt Ethernet adapter that is
               | certified to work well with FreeBSD - for testing
               | purposes and as a mobile network tool it would be useful
               | to have a laptop running FreeBSD in a VM that could
               | communicate over that dedicated piece of hardware. This
               | would make it super convenient to test a bunch of
               | physical hardware or do all kinds of other infrastructure
               | work while remote.
        
           | keewee7 wrote:
           | Aren't most Linux drivers closed source binary blobs?
        
             | cowtools wrote:
             | The nvidia drivers sure are. I don't know about _most_
             | drivers though. As for wifi, I own this ath9k card which I
             | 'm told is completely free, but I also own this intel 3160
             | chip that apparently requires some firmware to be loaded.
             | 
             | See https://en.wikipedia.org/wiki/Comparison_of_open-
             | source_wire...
        
             | colechristensen wrote:
             | "most" and "drivers" are things that need specific usages
             | to be true, but if you drop them and restate, you're
             | absolutely right.
             | 
             | It is _really hard_ to have a complete personal computer on
             | Linux or any other OS that doesn 't require closed source /
             | proprietary binary blobs.
        
             | minimaul wrote:
             | No? The vast majority of hardware has OSS drivers (and
             | they're usually even the better choice!) - the big
             | exception here for average machines is NVIDIA.
        
             | salawat wrote:
             | No. You're thinking firmware.
             | 
             | The driver layer (code around firmware that initializes the
             | hardware and marshals/unmarshals comms to/from the
             | device).tends to be GPL lest it taint the kernel. The
             | firmware on the other hand, is the last unconquered vestige
             | of the Open Source landscape. Logic locking, and the
             | prevalence/nature of fabless semiconductor IP tends to make
             | that endeavor incredibly difficult.
        
         | [deleted]
        
         | 0x457 wrote:
         | > * No Suspend/Resume? Linux has solved this for years, I have
         | not come across a laptop in the last 10 years that had trouble
         | with s2r or s2d (but I guess that there might be a few that
         | don't fully support it, I mainly tested Dell laptops)
         | 
         | I wouldn't be so sure. My Dell XPS 13 and ThinkPad X1 Carbon
         | both had issues with suspend/resume. Close the lid @ get
         | surprised with a completely dead battery.
         | 
         | Ironically, when I used FreeBSD on X1 - S3 state worked
         | perfectly fine. The issue in post is how bhyve handles wake up
         | from S3 state, with devices being pass-through to the VM.
         | 
         | Not once had a laptop that isn't a MacBook with macOS with
         | properly working hibernation.
         | 
         | > * Bluetooth not supported???
         | 
         | Yeah, BT stack is completely broken for years. No one has
         | desire to fix it.
         | 
         | > Ethernet over USB-C both highly unstable?
         | 
         | - I had no issues with my no-name dongle.
         | 
         | > I wonder if there is any laptop from the last 5 years where
         | FreeBSD fully works.
         | 
         | Define fully works? Graphics - you're limited to Nvidia and
         | whatever Linux 5.4 supported. Wi-Fi - 802.11g is as fast as you
         | can go without wifibox.
         | 
         | > but these days I kinda expect most things to just work out of
         | the box ...
         | 
         | Even on Linux, you either have to deal with hardware that been
         | out for some time or know how to install the latest kernel and
         | maybe apply some patches. When I got my XPS, it was the first
         | one with Intel Xe - had to use "unstable" kernel in NixOS with
         | every other distro not having graphics output.
         | 
         | This is still an issue in 2022:
         | https://01.org/blogs/qwang59/2018/how-achieve-s0ix-states-li...
        
           | Melatonic wrote:
           | On Windows the first thing I always do is turn off
           | hibernation. It made a bigger difference back in the day
           | since the swap was on a spinning disk but it still has a
           | little performance improvement and nets you a bit more ram.
           | With machines booting up so fast these days I personally
           | avoid anything related to hibernate / sleep.
        
             | 0x457 wrote:
             | True, but I never turn off my Mac unless I'm installing
             | updates. A few times a year, I have an issue from resume
             | (from Suspend to RAM) on a desktop - GPU won't wake up.
             | 
             | When I had an Nvidia card, this issue would happen every
             | other day, so I had to disable sleep and hibernate. Because
             | it was a very shitty way to start your day.
        
           | Melatonic wrote:
           | Was actually also debating recently between the thinkpad and
           | the dell - ended up based on cost with the XPS 15 - any other
           | general tips or big gotchas running linux on it?
        
       | sdfjkl wrote:
       | > wifibox essentially spins up an Alpine Linux VM using FreeBSD's
       | bhyve virtualization technology, and allows you to passthrough
       | your machine's wireless card
       | 
       | Jesus christ.
        
         | [deleted]
        
         | NegativeLatency wrote:
         | Sounds sub-optimal, I'm thinkng back to linux wifi support on
         | random laptops 10+ years ago and it was also quite bad.
        
           | felixg3 wrote:
           | I think it mostly depended on the vendor, like today, where
           | Broadcom and Realtek suck a lot, Mediatek and Qualcomm a
           | little and Intel/Atheros work just fine. I remember using
           | Ubuntu 6.10 or so with an Intel card out of the box.
        
             | filmgirlcw wrote:
             | I'm sure it is but the status I see shows that there isn't
             | much support for anything newer than 802.11n cards period,
             | so if you're using anything from the last 5 or 6 years, you
             | may have a problem.
             | 
             | That's a it different from the various Broadcom or whatever
             | issues the Linux kernel was dealing with in the early
             | Ubuntu eras (where Ubuntu also I think accepted some
             | blobs/drivers that weren't in the kernel at the time).
             | 
             | The problem here seems to be no support for certain stuff,
             | regardless of chipset maker, rather than having to pick a
             | certain one, unless you're able to go really far back
             | (which may have issues on some networks at this point).
             | 
             | As always, the best option for less-mainstream operating
             | systems is to use Ethernet when possible.
        
         | easton wrote:
         | It's easier than writing a driver for FreeBSD yourself, I
         | suppose, although I'd probably just get a USB Wi-Fi dongle
         | instead of worry about walking into a meeting and my Wi-Fi
         | driver VM crashing :)
         | 
         | (or, just run Linux and run FreeBSD in a VM, but that's no way
         | to support a niche operating system...)
        
           | filmgirlcw wrote:
           | I think the problem is that there aren't many modern wireless
           | cards with official FreeBSD support, so you're stuck using a
           | specialized dongle or Ethernet if you want to use FreeBSD on
           | a laptop.
        
           | craftkiller wrote:
           | You don't need a dongle, just purchase a supported wifi card.
           | I put a supported atheros card in my framework laptop and the
           | wifi works flawlessly, natively. The framework laptop is
           | designed to be opened and have the parts replaced, so its the
           | perfect laptop for doing hardware changes like this.
        
             | Klonoar wrote:
             | Does this _actually_ support operating on 5GHz, or is it
             | still stuck in the 2.4GHz era? I 'm not aware of any
             | FreeBSD-compatible wifi cards that actually do this.
             | 
             | (I would _love_ to be proven wrong, but I 'm super tired of
             | people saying "wifi cards work fine on FreeBSD" when the
             | reality is that the speeds are sub-optimal without a way to
             | improve it currently)
        
               | prmoustache wrote:
               | On the other hands 2.4GHz is perfectly fine for a lot of
               | people. Actually I often select 2.4GHz on purpose at home
               | because 5GHz works really bad with thick walls and I
               | barely get any network in my kitchen and rooftop.
               | 
               | People will say it is easy, setup a mesh network or some
               | powerline adapters but: 1. It is much more expensive 2.
               | It is not practical in an old flat with very few power
               | outlets, especially when you are not the owner.
               | 
               | And I don't really run into use case where running 2.4GHz
               | limits me.
        
               | craftkiller wrote:
               | Yep! Its both 2.4ghz and 5ghz, but only 802.11n which is
               | fine. Certainly not the newest wifi standard, but 802.11n
               | is plenty fast.
               | 
               | dmesg | grep ath:                   [ath_dfs] loaded
               | [ath_rate] loaded         [ath] loaded         ath0:
               | <Atheros AR946x/AR948x> mem 0x7a200000-0x7a27ffff at
               | device 0.0 on pci2         ath0: [HT] enabling HT modes
               | ath0: [HT] enabling short-GI in 20MHz mode         ath0:
               | [HT] 1 stream STBC receive enabled         ath0: [HT] 1
               | stream STBC transmit enabled         ath0: [HT] LDPC
               | transmit/receive enabled         ath0: [HT] 2 RX streams;
               | 2 TX streams         ath0: AR9460 mac 640.3 RF5110 phy
               | 0.0         ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0000
               | ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping
               | ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping
               | 
               | I confirmed by checking wpa_cli scan_results and I saw my
               | 5ghz-only ssid (not listing the output here for privacy)
               | 
               | Its an AR9462 which I purchased off thinkpenguin
        
         | cesarb wrote:
         | Not that different from a Linux user using NDISwrapper to run a
         | Windows wireless driver on Linux.
        
           | sheenobu wrote:
           | NDISwrapper was more like wine, it implements APIs but
           | doesn't run any sort of virtual CPU.
        
         | ploxiln wrote:
         | That is my initial reaction, but ... a minimal linux VM in a
         | minimal hypervisor, might not be that bad, for a network
         | adapter. Perhaps -40MB- 128MB of memory? Double the context
         | switching? Sounds kinda like a micro-kernel driver.
         | 
         | Have you ever tried to install a minimal driver for a printer
         | in windows, and then watched in horror as it automatically
         | started downloading 600MB of HP junk?
        
           | yjftsjthsd-h wrote:
           | Yeah, obviously it's not _ideal_ but I don 't really see any
           | problem with passing the card to what is, indeed, effectively
           | a userspace driver (that happens to internally contain a
           | virtual machine and Linux). Some upfront setup effort and
           | lower performance beats not having a way to use the card at
           | all!
        
           | tailspin2019 wrote:
           | > Have you ever tried to install a minimal driver for a
           | printer in windows, and then watched in horror as it
           | automatically started downloading 600MB of HP junk?
           | 
           | Never have I changed my opinion on something (a VM for a
           | fricking driver) so quickly. Good job.
        
           | doubled112 wrote:
           | I just stay away from HP junk. Life is too short.
        
         | znpy wrote:
         | > Jesus christ.
         | 
         | exactly.
         | 
         | this is the kind of bs i like to call out when i see the usual
         | freebsd desktop thread.
         | 
         | it's going to work mostly okay-ish, as long as you don't mine
         | some abominations like that running on your systems in the
         | background.
         | 
         | this really reminds me my linux experiences circa 2005-2006
         | (ndiswrapper for wifi cards, do people remember that?).
        
           | flatiron wrote:
           | Totally agree. Wonder the use case why they don't run Linux
           | and put FreeBSD in a VM where everything would work
           | perfectly.
        
       ___________________________________________________________________
       (page generated 2022-08-23 23:00 UTC)