# hardware support and Linux



## fort77 (Aug 1, 2017)

I have a two questions about the status and future of hardware support (most commonly video cards and wireless) on FreeBSD. These are general questions and I felt they probably belonged here not in a sub-category.

1- Does Linux have better access/availability of drivers compared to FreeBSD? I did install Linux+xfce on an old 2009 Dell laptop earlier, which now runs FreeBSD + xfce. I feel, and I could be mistaken here, that the overall machine performance was "better" under Linux. Almost all hardware buttons (volume, wireless switch etc) worked flawlessly and sleep/wake functions were excellent. On FreeBSD the same hardware buttons work only partially. I can suspend the machine, but not recover from sleep. So if Linux does have better hardware support and drivers, can anyone explain the reason for that?

2- Is FreeBSD more likely to support hardware on a newer generation laptop than an older laptop (5+ years)? and why?

Thanks.


----------



## tingo (Aug 1, 2017)

2. No. It is the opposite - FreeBSD is more likely to support an older laptop. Newer hardware is (in general) less documented, less figured out (reverse engineered) and so on.
FreeBSD has (compared to Linux) fewer resources (developers, testers, etc) that is why it is a bit behind Linux on hardware support. This also goes for almost any open source project when you compare it to Linux.


----------



## SirDice (Aug 1, 2017)

Also note that hardware support on Linux is a giant mess. On FreeBSD drivers tend to use better solutions by putting common components in a framework. It takes longer to develop this initial framework but in the long run it's better because things are more structured. This is typically why hardware support on FreeBSD seems to move slower than Linux.

Over the years I learned to buy hardware I know is supported (or will be soon), instead of the other way around. If you're a bit careful about the hardware you buy FreeBSD will run just wonderful.


----------



## drhowarddrfine (Aug 1, 2017)

Linux has a wider range of hardware support but FreeBSD has most of the same hardware support. In other words, while Linux may have support for 10,000 hardware components, FreeBSD supports 9,379 of them. The important thing to remember is, if FreeBSD is given or wrote drivers for your hardware, it doesn't matter what Linux supports. 

So, FreeBSD worked on my bleeding edge hardware that I used to build my workstation (two years ago). The i7-3770 was a new product as was my Gigabyte motherboard, SSD drive, nVidia card and so on. Everything worked out of the box.

While most of us will choose wisely to make sure the drivers are supplied to FreeBSD for the hardware we use, it's not difficult to do, and chances are it will be supported.

Now, you are talking about laptops which are a different beast. They are designed to work on Windows and Linux wants to be just like Windows. Laptops are a black box where you have little to no ability to choose the hardware it runs. If a laptop manufacturer wants their device to run on something other than Windows, it's easier to stick a guy in a closet to work with device manufacturers and port drivers to one other OS instead of two. 

FreeBSD has no control over manufacturers to supply drivers. It's why there is a universal hatred toward Broadcom which steadfastly refused to provide help while supplying drivers to Linux. Fortunately, Broadcom was sold to someone who appears to be moving toward cooperation along those lines.


----------



## alx82 (Aug 1, 2017)

SirDice said:


> Also note that hardware support on Linux is a giant mess. On FreeBSD drivers tend to use better solutions by putting common components in a framework.



Can you elaborate this point a bit more, giving an example if possible? I'm asking because I'm studying the FreeBSD kernel code since quite some time (I'm familiar with the Linux kernel code) and honestly I'm seeing the exact opposite of your claim. Example, trackpad/trackpoint are handled in FreeBSD in atkbdc (sys/dev/atkbdc psm.c) which is built always in the kernel (no modules!, do you expect a server to have a trackpoint?), in addition the code is not well organized there. While on the Linux part, separate modules give support for those devices, which are part of the input subsystem (in linux/drivers/input/etc... ), the code is split in many *.c files for different devices and it is extremely well organized.


----------



## SirDice (Aug 1, 2017)

alx82 said:


> Can you elaborate this point a bit more, giving an example if possible?


Probably the best example is the sound subsystem, pcm(4) framework. 

https://www.freebsd.org/doc/en/books/arch-handbook/oss.html


----------



## tankist02 (Aug 1, 2017)

How about Haswell and later Intel graphics? It's been on the market for about 4 years - still no official FreeBSD support. And newest WiFi standards - still not supported?


----------



## tankist02 (Aug 1, 2017)

Sorry, meant after Haswell - Broadwell and Skylake.


----------



## drhowarddrfine (Aug 1, 2017)

Ask Intel where the FreeBSD drivers are. Of course, you could work on that if you want. After all, money is no object cause there is no money.


----------



## fort77 (Aug 2, 2017)

thanks for the responses.


----------



## SirDice (Aug 2, 2017)

The reason it's taking so long is because this is another example of getting things set up properly before adding. You could of course crowbar the new drivers into the kernel but for the next version you'd have to crowbar it in again. Instead they opted to build a proper framework around it so future updates will be a lot easier to implement.


----------



## tankist02 (Aug 2, 2017)

Are there any ETAs for latest Intel and WiFi support completed?


----------



## ekingston (Aug 2, 2017)

SirDice said:


> The reason it's taking so long is because this is another example of getting things set up properly before adding. You could of course crowbar the new drivers into the kernel but for the next version you'd have to crowbar it in again. Instead they opted to build a proper framework around it so future updates will be a lot easier to implement.



I do not consider myself a programmer (I was about 20 years ago) but I can still usually read code. I had a look at what they built to get Haswell graphics working. I really don't understand it. I'm amazed something that complicated got built as quickly as it did (4 years of reverse engineering and planning to simplify what they are doing now).



tankist02 said:


> Are there any ETAs for latest Intel and WiFi support completed?



I'm wondering that myself. I would really like to upgrade my 4 year old laptop but (for me) there isn't much point since (it's a Haswell i5). I really should put FreeBSD on it.


----------



## Atsuri (Aug 2, 2017)

For a while I ran FreeBSD on a Haswell-based ultrabook and apart from minor graphical glitches, everything was just fine. That was either 11.0 or 10.3 (both -RELEASE). Since the Haswell iGPU is somewhat supported, not sure what the incentive for a laptop upgrade would be. Drive and RAM (and sometimes even wireless) can be upgraded anytime .

As for the original question(s), FreeBSD relies heavily on community work. Some companies like Broadcom do nowadays provide wireless drivers for Linux (makes running Linux on RPi3 a lot easier that way), however not for FreeBSD. As far as I know only nVidia seems to be putting in some extra per their various graphics card driver lines .


----------



## ekingston (Aug 3, 2017)

Atsuri said:


> For a while I ran FreeBSD on a Haswell-based ultrabook and apart from minor graphical glitches, everything was just fine. That was either 11.0 or 10.3 (both -RELEASE). Since the Haswell iGPU is somewhat supported, not sure what the incentive for a laptop upgrade would be. Drive and RAM (and sometimes even wireless) can be upgraded anytime .
> ...



In my case, as my 4 year old laptop is acutally an ultrabook, drive space, RAM, and battery are all becoming issues. I've looked into it and it appears there is a way to replace the battery and possibly the drive, but I'm stuck with the RAM.

Plus, I recently upgraded my desktop monitor (which I sometimes use with my laptop when at home) to a QHD (2560 x 1440). It would be nice to be able to use it at that resolution with FreeBSD.

Also, looking at what is happening with AMD CPUs at the moment (lots more cores) and Intel's attempt to respond (the i9), I expect things are looking interesting in terms of upgrades in the near future.

I'm not interested in the i9 at this time but a 6 or 8 core running 2 to 3 GHz long battery life lightweight laptop does interest me. Alternatively a small (11 or 12 inch screen) 2-in-1 touchscreen laptop/tablet is also of interest.


----------



## fort77 (Aug 3, 2017)

Atsuri said:


> As for the original question(s), FreeBSD relies heavily on community work. Some companies like Broadcom do nowadays provide wireless drivers for Linux (makes running Linux on RPi3 a lot easier that way), however not for FreeBSD. As far as I know only nVidia seems to be putting in some extra per their various graphics card driver lines .





SirDice said:


> Also note that hardware support on Linux is a giant mess. On FreeBSD drivers tend to use better solutions by putting common components in a framework. It takes longer to develop this initial framework but in the long run it's better because things are more structured. This is typically why hardware support on FreeBSD seems to move slower than Linux.



So just to piggyback on some of the feedback here, is it the case that Intel (insert xyz OEM) does provide their proprietary code (drivers, specs and instructions) to Windows, MacOS and Linux, but refuses to provide the same to FreeBSD? Or is it that the lack of volunteers/resources/manpower at FreeBSD due to the smaller community, and the design philosophy of the Kernel and UserLand (perhaps also more thorough as mentioned above) that lead to longer implementation and testing timeframes for the same features?

Also once an OEM decides to write and test their drivers for MacOS and Linux, how much more effort do they _really_ need to invest to make a FreeBSD suitable version of the same? Given that FreeBSD shares alot of similarities with Linux and MacOS at many levels.


----------



## Terry_Kennedy (Aug 6, 2017)

fort77 said:


> So just to piggyback on some of the feedback here, is it the case that Intel (insert xyz OEM) does provide their proprietary code (drivers, specs and instructions) to Windows, MacOS and Linux, but refuses to provide the same to FreeBSD?


This is sort of an apples to oranges comparison. Apple buys Intel products for Macs, and that gives them leverage. Microsoft [generally] doesn't make hardware, but the companies that buy OEM Windows licenses (like Dell, HP, etc.) also purchase Intel products. Linux is more comparable to FreeBSD, but there you have companies selling millions (or at least hundreds of thousands) of identical Linux widgets. If one of those companies uses Intel products, that is also a financial incentive for Intel to provide support. And if they don't use Intel products, then they don't care about Intel support.

Regarding Intel drivers and FreeBSD, there seem to be (at least) 3 categories: 1) Officially supported, downloadable from the Intel web site (and usually already integrated into FreeBSD); 2) Unofficially supported, where Intel developers contribute to FreeBSD (which could be either a complete driver or a "you should do it this way, not that way" hint); and 3) No support - effectively, "radio silence". Which is kind of appropriate, as one of the key areas where FreeBSD appears to be missing Intel support is in the WiFi chipset. Although they are far from the worst - try getting even a hint about how to talk to (for example) a Qualcomm Gobi 2000.


> Also once an OEM decides to write and test their drivers for MacOS and Linux, how much more effort do they _really_ need to invest to make a FreeBSD suitable version of the same? Given that FreeBSD shares alot of similarities with Linux and MacOS at many levels.


My first-hand knowledge is rather out-of-date, but Linux and FreeBSD drivers are quite different. It is possible to share a lot of code (3Ware did this with their drivers, where most source code was common but there were Linux- and FreeBSD-specific source files). I know less about MacOS, but my understanding is that while the userland is similar (it can talk to a MacOS kernel in a way very similar to a FreeBSD kernel), the kernel itself (both the drivers and the device-independent components) is quite different inside.


----------



## drhowarddrfine (Aug 6, 2017)

Terry_Kennedy said:


> Linux and FreeBSD drivers are quite different


Yes and no. Sometimes the only difference is the interface and system calls and they only need renaming and recompiling. The majority of the code that makes up the driver will be the same otherwise. In cases where the system calls or other ABI interface is significantly different, there can be a lot of work involved in putting together and maintaining the two.


----------

