# Install Linux driver



## fernandobsd (Mar 22, 2015)

Hello

I am new in FreeBSD, my problem is that my laptop has an unsupported wireless card, there is a driver for it but in Windows and Linux, and I was wondering if I could install the one for Linux or other solution. My wireless card is a *realtek RTL8188CE*.

Thank you for your attention


----------



## Oko (Mar 22, 2015)

I have a flat tire on my Boeing 777. Do you think I can use a spare tire from your car so that I can take off and fly this plane? That being said FreeBSD developers actually think that that is a good idea and provide a tool ndisgen(8).

P.S. Realtek people are such bastards when it comes to open source that you can't be even sure that the actual chip model is matching what is written on it.


----------



## fernandobsd (Mar 22, 2015)

This looks like the solution I want, I am going to test it, thank you

P.S. How do I use that tool?


----------



## fernandobsd (Mar 22, 2015)

fernandobsd said:


> This looks like the solution I want, I am going to test it, thank you
> 
> P.S. How do I use that tool?



I found how to use it in the handbook


----------



## sidetone (Mar 22, 2015)

There is a book called "FreeBSD Device Drivers: A Guide for the Intrepid" by Joseph Kong. I only know of the book, and do not know enough about it, how much it can do. I'm still skeptical that the book alone can help someone without a program writing background, including me, write their own drivers. I'd bet the book still has something that FreeBSD users could use though. If anyone knows about the book, can they say what they like about it, or what stands out to them.


----------



## Oko (Mar 22, 2015)

sidetone said:


> the book alone can help someone without a program writing background, including me, write their own drivers.


Before anybody can write a driver hardware manufacturer needs to provide hardware specification for the device. Broadcom makes products of such shady quality that they have to hide hardware specifications from developers in hope that they can keep their "trade secrets". When manufacturer like Intel makes a good quality network controller they have nothing to hide from and they are making documentation available to any interested developer or group. They often donate hardware to large groups like BSDs or even pay their own employees  to write open source drivers. IIRC FreeBSD drivers for Intel hardware are written by Intel employees.

Btw, there is nothing that can bring faster to its knees an OS using monolithic design than the buggy driver. FreeBSD uses monolithic kernel. The last thing I would like to see is students learning how to program in C by writing device drivers for FreeBSD.


----------



## sidetone (Mar 23, 2015)

That's a misquote, that's not what I said.


----------



## protocelt (Mar 23, 2015)

sidetone said:


> That's a misquote, that's not what I said.


I'm sure it was just an accident while truncating the original quote. 

I don't own and haven't read the book however I would almost guarantee it assumes the reader has or will have general knowledge/experience in C programming. Writing hardware drivers is generally not an entry level task.


----------



## Terry_Kennedy (Mar 23, 2015)

Oko said:


> Before anybody can write a driver hardware manufacturer needs to provide hardware specification for the device. Broadcom makes products of such shady quality that they have to hide hardware specifications from developers in hope that they can keep their "trade secrets".


I have used dozens of systems with various Broadcom Ethernet chips in production servers and have never had a problem. My only complaint is that they don't (didn't?) support jumbo frames across the product family, so sometimes I needed an add-in card (also Broadcom).

As far as documentation, the NetXtreme II Programmer's Reference Guide is 920 pages. That is the product family supported by bce(4).  The very last line of that manpage says _"The bce driver was     written by David Christensen <davidch@broadcom.com>."_

Now, if you want to talk about System-on-Chip (SoC) and graphics then yes, they do keep that info confidential.


----------



## diizzy (Mar 23, 2015)

@ Oko
I guess there are two sides of this, to protect their *IP* and if management want to spend money on something that unfortunately will give little to none revenue. If they get the snowball effect like Atheros (QCA) have got regarding their wireless chipset support and SoCs it might affect business in the end but it will take several hardware generations (time) to get there...
//Danne


----------



## fernandobsd (Mar 23, 2015)

Ok, how do I use `ndisgen`?
I tried to create the module but I don't know, can someone tell me step by step?
Thank you.


----------



## wblock@ (Mar 23, 2015)

Start with ndisgen(8).


----------



## aht0 (Mar 27, 2015)

I would buy one well supported WLAN card off eBay. Why? 

Less hassle after each fresh OS install, card itself might very well be more stable, such cards are dirt cheap and in most laptops - easily replaceable. Just screw off the appropriate lid underneath, pull out mini-PCIe card and push new card in.

Avoid Chinese sellers and get one from seller located on your own continent. Going to get to you faster (Chinese postal service is slow) and you would have less likely issues with a wrong regdomain burned on the card's EEPROM (Atheros cards have regdomain with few exceptions written into EEPROM). On AR928x series card's, it's fixable issue. On newer cards, there could be OTP (stands for One-Time-Programmable) EEPROM you can not alter.

European eBay sites generally allow for seller location filtering ("EU only", "Worldwide" etc), on generic ebay.com such possibilities do not exist and it would need manual filtering by Mark I eyeball.


----------

