# How to compile driver in FreeBSD



## ChrisDB (Jul 2, 2017)

In Ubuntu 16.04 I can do this like this:

```
apt-get install build-essential git
git clone https://github.com/CristianVladescu/rtl8814AU.git
cd rtl8814AU && make && make install
```
In FreeBSD, I tried this:

Install FreeBSD 10.3 with source files - OK
`pkg install git` - OK
`git clone https://github.com/CristianVladescu/rtl8814AU.git` - OK

`cd rtl8814AU` - OK

`make` - FAIL


```
make: "/root/rtl8814AU/Makefile" line 137: Missing dependency operator
make: "/root/rtl8814AU/Makefile" line 139: Need an operator
make: "/root/rtl8814AU/Makefile" line 141: Missing dependency operator
...
make: "/root/rtl8814AU/Makefile" line 1688: Need an operator
make: "/root/rtl8814AU/Makefile" line 1692: Need an operator
make: "/root/rtl8814AU/Makefile" line 1734: Need an operator
make: Fatal errors encountered -- cannot continue
make: stopped in /root/rtl8814AU
```


pkg install gmake - OK
gmake - FAIL


```
gmake ARCH=amd64 CROSS_COMPILE= -C /lib/modules/10.3-RELEASE/build M=/root/rtl8814AU  modules
gmake[1]: *** /lib/modules/10.3-RELEASE/build: No such file or directory.  Stop.
gmake: *** [Makefile:1699: modules] Error 2
```


Now I reached a dead end. I have no clue what to google.


----------



## ShelLuser (Jul 2, 2017)

A driver is usually build for a specific operating system. When looking at the original repository I noticed that were developed for Linux, which could definitely explain your issues.

I'm not familiar with this chipset from mind myself but have you tested already to check that it's not natively supported by FreeBSD?


----------



## ChrisDB (Jul 2, 2017)

Yeah, I was hopping that a driver which compiles on Debian flavored Linux, will also compile on BSD flavored Unix, to a certain degree.  I asked the same thing on on stackexchange and got the same answer.
I also checked if it is supported natively, and neither AR9271 or MT7610 are supported.


----------



## SirDice (Jul 3, 2017)

ChrisDB said:


> I was hopping that a driver which compiles on Debian flavored Linux, will also compile on BSD flavored Unix, to a certain degree.


That's not going to work. Even if you can get it to compile the way drivers interact with the kernel is entirely different.


----------



## BSDAppentic3 (Apr 25, 2018)

ShelLuser Hi again.
I'm in the same.
How can I compile the drivers for a TP-LINK WN722N? In the list of supported devices, this specific model, doesn't appear. Some people told me that I must look for the chipset, not for the model of the device...
So, I must look for the chipset, right. What else?


----------



## ralphbsz (Apr 25, 2018)

Please explain a lot more.

What is a TP-LINK WN722N?  Let's assume it is a USB-connected purple elephant.  One of the problems with PCI cards and USB devices is that vendors often don't tell you what the chip in the device is, and sometimes even change chips without changing the model number of the device.  So the Foo brand purple elephant of model FOO-1234 might contain an Arago 987 chip, or a Broadcom 456, or a Cirrus 321, or something like that.  So you need to translate from WN722N to what the actual chip in there is.  We can't do this for you in all cases.

So tell us what chipset or chip is in there; that information might be found in the output of dmesg, or of usbconfig, or pciconf, or something like that (depending on how it is connected to the system).  Then use man to find a list of related chips.  For example the driver for USB-connected colored pachyderms of brand foo can be found by typing "man ufoop" (obviously that's a joke, but for example the USB-connected RAL wireless chips can be found under "man ural").  That will get you much closer, and you can ask a sensible question for example: "I bought a USB connected purple elephant that contains the Foo 123b chip.  The man page for driver ufoop says that it supports the Foo 123 pink hippopotamus.  Anyone have experience with using it with the purple elephant?  Do I have to download and install a special driver?"

In order to ask a sensible question, you first have to do your homework.


----------



## BSDAppentic3 (Apr 26, 2018)

ralphbsz 
Ok, all right. I asked because the handbook didn't was too much help.
But your response makes me to see that here I neither found any kind of help.
So thanks for nothing. I'll try to understand it by myself and try to be the less bother that I can here.
Thanks for speaking about pachyderms and hippopotammus, but my message was about a USB card or whatever that gives me the conection to wireless connections.
But it doesn't matter: thanks for the advice. I only was asking how to fuck do something but with your reply, at least now I know that here I can't ask anything of that kind. So what the fuck it's the purppose of this forums?
Anyway, thanks for nothing.
And I'll be sure that this will the last time that I will ask something here, at least where you reply.


----------



## rsronin (Apr 26, 2018)

BSDAppentic3 said:


> ShelLuser Hi again.
> I'm in the same.
> How can I compile the drivers for a TP-LINK WN722N? In the list of supported devices, this specific model, doesn't appear. Some people told me that I must look for the chipset, not for the model of the device...
> So, I must look for the chipset, right. What else?



Professional help, not to be found within this forum I am afraid.


----------



## ShelLuser (Apr 26, 2018)

You guys may not like what ralphbsz had to say but he most definitely has a point. I also have no idea what a WN722N is supposed to be, which is quite essential in order to address this. When I looked it up on Google then all I found was a wireless dongle. But apparently it's an USB card of some sort? (PCI or... ?).

But most definitely: `usbconfig`, `pciconf -l` and `dmesg` (optionally: `less /var/run/dmesg.boot`) are all very solid suggestions on how to find the relevant chipset. The only thing I would like to add is mention of the apropos(1) command which can also be invaluable to find existing information based on keywords.

You may not like the direct wording being used, fair enough, but don't forget that in the end this is a technical forum we're attending. Being direct means leaving as little as possible to the assumption (or imagination) of others, which is very important to get to the solution of a problem as best as possible.

Yet this also means that you should not take stuff too personal in here. Ralph wasn't trying to ridicule or offend, he merely explained - in detail - why the question couldn't be answered. Sure, also poked a little bit of fun but at the same time provided some very serious and useful examples as well.

The alternative would simply have been to fully ignore the question because there's not enough information to address it.

No professional help here? Correct. You usually have to pay for that and some people seem to forget that most of us here are doing what we do in our spare time. If you want professional then this link could provide some alternative options.

But I most certainly disagree that the quality of the provided help on this forum can't reach that same professional level. You'd be surprised. Quite a few regulars on this forum have been working within the field of IT for _years_. Sometimes even within support 

The main difference though is the way the information is being presented, which can indeed be a bit direct sometimes. If you can't handle that then, well, sorry to say but then this forum might not be for you. Nor any other technical forum I might add. I've been active on quite a bit, including Microsoft based fora, and you mostly get the same kind of direct responses there.


----------



## ralphbsz (Apr 26, 2018)

I'm sorry if I have offended you.  That was not my intent.  I apologize.

So what was the intent?  I think there are three parts to it.

First, I simply am not capable of helping, nor is anyone else.  If you tell me that you have a WN722N, that doesn't tell us what chip is really in there.  As explained above, there is no 1-to-1 translation from devices to chips.  You need to find that out and post it.  Some of the commands to find that out were posted above.  And thanks to ShelLuser for making the list of commands even more complete.  Once we have the exact ID of the chip, we might be able to find out which driver to use.

Second, I'm not really interested in solving your problem.  Instead, I prefer to teach you how to solve your problem yourself.  That's why there are the references to using "man" above, and ShelLuser's reference to Apropos.  Why do I want to teach you?  Because (a) it is less work for me to help you do the first steps, and then you do the rest yourself, (b) I'm hoping that in a few weeks or a year, you'll be able to help others, and (c) as a parent of a grown child, I can't help it but I have to educate people and make the world a better place.

Third, I'm not the FreeBSD support system.  I have many hobbies and tasks in life (including being a parent, a spouse, an employee, an amateur musician, the section leader of percussion in a band, and so on), and performing support for an operating system I happen to like is pretty low on the list.  I invest a few minutes here and there into it, but I can't be bothered to do it full-time.  Yes, I work in the computer industry, and yes, I have helped paying customers and supported them. Those are customers that typically spend M$ on their systems, and dozens or hundreds of K$ per year on their support contract.  If you insist on getting technical support from me, you have to be aware that the going rate is many hundreds of $ per hour, and billing would be through my employer.  So consider yourself happy that I gave you a little bit of help for free.

Now, I'll go and find some other thread on this forum, to see whether anyone else needs help.  And if you post the USB manufacturer and model ID of your chip, I'll probably spend half an hour checking whether I can find out which driver you should use and how to get it installed/compiled/configured/whatever.  But you need to make that first step.  There is a German saying: "Hilft Dir selbst, so hilft Gott": If you help yourself, god will help too.


----------



## Sensucht94 (Apr 26, 2018)

BSDAppentic3 said:


> ShelLuser Hi again.
> I'm in the same.
> How can I compile the drivers for a TP-LINK WN722N? In the list of supported devices, this specific model, doesn't appear. Some people told me that I must look for the chipset, not for the model of the device...
> So, I must look for the chipset, right. What else?



So, TP-LINK WNT22N strikes again? That beautiful dongle often betrays new FreeBSD users expectations (you're not the first one I see struggling with it). The problem is that there are 2 versions of this usb card:

- TL-WNT22N v1 which uses AR9271 chipset, * still unsupported* in FreeBSD by ath(4), and with only a partial/buggy support in Linux through ath9k_htc. Practically speaking, this thing works well on Windows only (macOS doesn't support it either)

- TL-WNT22N v2, which uses the RTL8188EUS, *well supported in FreeBSD, * through urtwn(4)

Now, check the box which  your dongle came inside to find out which of the 2 you have.

If it's the second, then:

- instructions about how to setup wireless are available on Handbook, man pages and many forums threads. Refer to the handbook 30.3 Wireless Networking, as well as  to wpa_supplicant(8), wpa_supplican.conf(5) and ifconfig(8) man pages

- Like in all other Unix-like libre OSs with a modular kernel, drivers in FreeBSD are not downloaded somewhere (with the notable exception of Nvidia, hardly anybody, any company will ever be interested in investing money into developing drivers for FreeBSD), rather they come  all bounded with the OS itself, having been developed/ported by the same people who maintain FreeBSD itself. The exception is the 3rd-party hardcoded/built-in firmware which those NICs come preinstalled with: it is distributed as closed-source binaries and needs to be loaded along with the driver. Sone firmware (e.g. Realtek) is already found in the FreeBSD base system, some other (e.g. Broadcom) can be installed from ports: net/bwn-firmware-kmod

Many common drivers are built in the default GENERIC kernel,meaning you don't have to load them: if a supported NIC is discovered, a device node (ex. run0) is created. If the module is not built in kernel (like urtwn(4)), then it can be loaded with kldload(8): `kldload if_urtwn`,or loaded automatically at boot by editing /boot/loader.conf  and adding:

```
if_urtwn_load="YES"
```

The module itself if_urtwn.ko, physically resides under /boot/kernel folder.

If you use urtwn driver, you must agree with the Realtek License on order for firmware to be loaded (otherwise misbehaviour may occurr). Inside /boot/loader.conf place:


```
legal.realtek.license_ack=1
```


----------



## BSDAppentic3 (Apr 28, 2018)

ShelLuser You right. My bad.
I must explain in detail which chipset I'm using. Gimme a few time and I can found even the grade of purity in the conductors of which is make, and perhaps the diagram of the connections and how they are disposed in the "core" (sorry, I'm studying electomechanic, not informatic-electronics, hence the term that I've used denotes my level of understanding about this area).
Of course that I know that he was kidding. Why not. If I'm trowing a model instead of the chipset, why somebody wouldn't take it like a joke?


----------



## BSDAppentic3 (Apr 28, 2018)

ralphbsz said:


> I'm sorry if I have offended you.  That was not my intent.  I apologize.



For sure. I just was asking for help. Don't lie to me: your apologies aren't because you recognize what you have said. For YOUR information: I think that I told that to ShelLuser a time ago, that I was trying to run a program which is for simulate electro-pneumatics circuits. I have no studies in this WHOLE world of the informatics, hence everyone can see the cause of my non-knowing: you know about a PC, I know what the fuck it's a PLC and why the A.C. it's better outside, leaving apart the area of electronic, why the heck it's better because of its high U.



> Second, I'm not really interested in solving your problem.  Instead, I prefer to teach you how to solve your problem yourself.  That's why there are the references to using "man" above, and ShelLuser's reference to Apropos.  Why do I want to teach you?  Because (a) it is less work for me to help you do the first steps, and then you do the rest yourself, (b) I'm hoping that in a few weeks or a year, you'll be able to help others, and (c) as a parent of a grown child, I can't help it but I have to educate people and make the world a better place.



You pretend to tech me something? I will try to make to you the same: tell me how the shitty fuck, you could be capable to understand how the hell fix something that you have no knowing of it, that you aren't studying right now, with a mediocre section of the "sacro-sanctum" handbook that throws a few words, yet you haven't be kidded by who have a BIG and SOLID idea of which you're speaking of?



> So what was the intent?  I think there are three parts to it.
> 
> First, I simply am not capable of helping, nor is anyone else.  If you tell me that you have a WN722N, that doesn't tell us what chip is really in there.  As explained above, there is no 1-to-1 translation from devices to chips.  You need to find that out and post it.  Some of the commands to find that out were posted above.  And thanks to ShelLuser for making the list of commands even more complete.  Once we have the exact ID of the chip, we might be able to find out which driver to use.


And this it's so simple that you only have to do a poor search in the all-mighty google. Here you have one, in case that you hadn't done yet: https://www.lelong.com.my/tp-link-t...r-bhlonlinesales-191944173-2018-05-Sale-P.htm
But as you want the components of such device, I'll give you 'em: https://wikidevi.com/wiki/File:TL-WN722N-front_b.jpg
Do you see that? I'm not some guy expert on electronics components, despite of it, I'm capable of distinguish in the image: a processor (the thing in the center, or perhaps it could be the holly chipset, as I said, I'm not a electronic), and a couple of resistences integrated.
In case that you want the source, here's: https://wikidevi.com/wiki/TP-LINK_TL-WN722N



> Third, I'm not the FreeBSD support system.  I have many hobbies and tasks in life (including being a parent, a spouse, an employee, an amateur musician, the section leader of percussion in a band, and so on), and performing support for an operating system I happen to like is pretty low on the list.  I invest a few minutes here and there into it, but I can't be bothered to do it full-time.  Yes, I work in the computer industry, and yes, I have helped paying customers and supported them. Those are customers that typically spend M$ on their systems, and dozens or hundreds of K$ per year on their support contract.  If you insist on getting technical support from me, you have to be aware that the going rate is many hundreds of $ per hour, and billing would be through my employer.  So consider yourself happy that I gave you a little bit of help for free.



Of course, we can use the classic: call to the routine. I have to study to get a title of electro-mechanic (which it's much more than the 50% of the time of my week) and tomorrow I must go to a course of auxiliar of pharmacy. Despite of it, Sensucht94 knows that I want to know not only about technology, but also about biology. Besides I'm doing my firsts steps on Arduino. Sorry, I'm not a musician: give me a beer (and I'm not kidding) and I'll sing. Also I want to play the guitar and piano by own count. Not enough, because I'm wanting to understand a system which is almost unknown by the standard user. Still, I want to study chemistry, but not for now. Now I'm learning about nanotechnology to be capable of doing a project which parts are made in 3D-impresors, its system based on Arduino, and using a micro servomotor. And here you have the half of the history: don't you dare to see how I have the splice of my cable that gives me the service, and the damage on my keyboard because of, both because of a change of house of go and back because a familiar trouble that I won't type here. Still you don't know all the whole history.



> Now, I'll go and find some other thread on this forum, to see whether anyone else needs help.  And if you post the USB manufacturer and model ID of your chip, I'll probably spend half an hour checking whether I can find out which driver you should use and how to get it installed/compiled/configured/whatever.  But you need to make that first step.  There is a German saying: "Hilft Dir selbst, so hilft Gott": If you help yourself, god will help too.



Thanks but you don't need to. A guy says me that he was capable to understand Arduino by himself when I asked him for help. Since that I trying to understanding it by my own. Conslussion: I don't need that you say that you gonna waste your precious time looking for a solution and kidding me because I wasn't so specific. I can do it by my own, thanks.


----------



## BSDAppentic3 (Apr 28, 2018)

Sensucht94 said:


> So, TP-LINK WNT22N strikes again? That beautiful dongle often betrays new FreeBSD users expectations (you're not the first one I see struggling with it). The problem is that there are 2 versions of this usb card:
> 
> - TL-WNT22N v1 which uses AR9271 chipset, * still unsupported* in FreeBSD by ath(4), and with only a partial/buggy support in Linux through ath9k_htc. Practically speaking, this thing works well on Windows only (macOS doesn't support it either)
> 
> ...



Thanks for throw a rope instead of mount a circus only just because I wasn't so specific.


----------



## ralphbsz (Apr 28, 2018)

OK, I just looked at the high-resolution picture from the wiki page you pointed to.  It describes the *OLDER* version of this device.  To find out the chip model, I had to to zoom into the chip in the middle (click on the high-resolution version first): and it is an Atheros AR9271L.  Not good: That chip is known to not be supported, as Sensucht already wrote above.  Matter-of-fact, if you read about that in the FreeBSD developer wiki at 
https://wiki.freebsd.org/dev/ath(4) 
it is clear it won't be supported for a while, as there is no work in progress to support it.

So the question is: Does the PC board of your device really look like the picture of the wiki?  Does the USB chip ID say that it is a Atheros 9271?  If yes, return it to the vendor, and try to get your money back.  

Or you MIGHT be lucky, and you have the newer model, which both Sensucht and the Wiki page talk about.  In that case, it should just work, as Sensucht said in this instructions.

Unfortunately, the web page of the vendor (in Malaysia) you pointed to doesn't have any information about the exact identity of the device.  It doesn't have a full EAN on the web page.  The outside picture (white plastic USB dongle, not PC board) on the vendor page looks exactly like the picture in the Wiki you pointed to ... and unfortunately the two versions (older=bad and newer=good) look exactly the same.

Let us know what happens next; now I'm curious.


----------



## Crivens (Apr 28, 2018)

Oh, and while we are at it: usage of 4-letter words starting with 'f' *hint hint* is a way to increase the likelihood of ending up in the pre-moderate queue or winning a short holiday from the forum. I presume we are all grow up here, so lets act as we are and use some finesse when trying to mock or insult each other. Okay?


----------



## Sensucht94 (Apr 28, 2018)

BSDAppentic3 said:


> Thanks for throw a rope instead of mount a circus only just because I wasn't so specific.



Whatever other say BSDAppentic3 you can't afford to talk like that. Let's keep the debate civil. This is a serious and high-level  tech/support forum not a tavern. We may still have fun talking about ScreenShots, Music and video games, but this doesn't keep this forum from being mainly a professional support platform for power users and people using FreeBSD at workplaces, on enterprise envs and public servers. Which means, people often are *working here *not having casual chat about their home-server or their FreeBSD desktop.
For such a reason,and not only, no personal attack is allowed; you can criticize statements regarding FreeBSD or IT world in general, but if you feel offended,than there are PMs (talk with the person directly explaining what you didn't like) and there is the report flag: mods will take care.

I've been mod in other forums in the past (one dedicated to Latin2Italian translation and one to Medicine-related Q&A), and I'll be honest: I wouldn't have hesitated giving you a temporary ban you for what you wrote

But this didn't happen and this forum confirms once again being the most friendly tech forum you can find online. Rather, you've been warned in the kindest of the ways.

Trust me (or better go find out yourself), you believe that this forum is not friendly and you're not being treated well? Go on Slackware/Alpine Linux mailing-lists, or even better, go on some Arch/Gentoo Linux forum, full of fanatics, know-it-all boys and proud distro users: your 'beginner-level' question would have never been answered, you would have been heavily criticized and pointed out some wiki page, but framed as noob either way. And if you had spoken the way you spoke above,  a *permaban  *is what you would have surely got in return.


So whether you like it or not, 'this is the best of all possible Worlds' (to quote Leibniz),maining the best you can get right now.

Wanna know the main reason which brought me to stay with FreeBSD? Community

I'll leave you with a nice page I strongly suggest you to read, when you find the time: Thread FreeBSD Forums Rules.38922

Yours faithfully


----------



## BSDAppentic3 (Apr 28, 2018)

Sensucht94 
Thanks, but you don't need to remind me that I was aggressive and offensive. You know how old I am, I know perfectly what I had done well either what I done bad.
Crivens Of course I can be much more offensive without using "bad words". And for your information, in that case, no one can ban me. I really don't know to offend, I don't need to write like a marine speaks in a tavern who have drink some beers. No.


----------



## BSDAppentic3 (Apr 28, 2018)

I don't want that this thread changes its course to a discussion of bar. I think that all of you want the same.
So, we must return to the cordiality, to the "good words", to don't try to be offensive and don't write like we're discussing.
I don't want this because suddenly I get fear of be banned. I really don't care about it. -Snake- knows that I can get off easily, nobody will miss me. Except for a few users.
So, let's me explain: if I wrote asking for help, that wasn't to be kidded like if I was an idiot. That was because the handbook only says a few words about how to compile drivers: https://www.freebsd.org/doc/en/books/arch-handbook/driverbasics.html
That's why, when I read the response of ralphbsz I get sick.
I really don't need to invent apologizes. I was bad, I was tired, I was in troubles not only with this.


----------



## BSDAppentic3 (Apr 28, 2018)

So, I appreciate if we could return like ralphbsz has done: back to the topic. Don't you gonna think that I will edit my angry and obfuscated messages: I won't retract. What I said, I said it: end of history.


----------



## BSDAppentic3 (Apr 29, 2018)

Thanks ralphbsz !
Here's the output of 
	
	



```
root@hostfbsd:~ # usbconfig -u 4 -a 3 dump_device_desc
```
: 
	
	



```
ugen4.3: <ATHEROS USB2.0 WLAN> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)

  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0200 
  bDeviceClass = 0x00ff  <Vendor specific>
  bDeviceSubClass = 0x00ff 
  bDeviceProtocol = 0x00ff 
  bMaxPacketSize0 = 0x0040 
  idVendor = 0x0cf3 
  idProduct = 0x9271 
  bcdDevice = 0x0108 
  iManufacturer = 0x0010  <ATHEROS>
  iProduct = 0x0020  <USB2.0 WLAN>
  iSerialNumber = 0x0030  <12345>
  bNumConfigurations = 0x0001
```


----------



## BSDAppentic3 (Apr 29, 2018)

Searching I found something alike this topic: https://forums.freebsd.org/threads/how-to-install-and-configure-atheros-usb-wifi-card.56080/


----------



## ralphbsz (Apr 29, 2018)

It's an Atheros 9271 chip, the output above is super clear.  Unfortunately that seems to imply that there is no driver for it in FreeBSD.  Ok, you're done with this device, unless you are willing to switch OSes.

You could theoretically find the maintainer of the Atheros code on the kernel mailing list, and send him an e-mail, and beg and plead.  I don't think that makes much sense; they probably get dozens of requests, and if they haven't done it yet, there must be good reasons.

Another option would be to create a small VM on your FreeBSD machine, run Windows or Linux or OpenBSD inside it, and use it only to run a network bridge from this device to a local network.  This would be insanely much work.


----------



## BSDAppentic3 (Apr 29, 2018)

ralphbsz said:


> There is no driver for this for FreeBSD: It's an Atheros 9271 chip, the output above is super clear.  Unfortunately.  Ok, you're done with this device.  Hopefully you get your money back.
> 
> You could theoretically find the maintained of the Atheros code on the kernel mailing list, and send him an e-mail, and beg and plead.  I don't think that makes much sense; they probably get dozens of requests, and if they haven't done it yet, there must be good reasons.


Why? There's no possibilities of use this device here?


----------



## ralphbsz (Apr 29, 2018)

BSDAppentic3 said:


> Why? There's no possibilities of use this device here?


The 9271 is just not supported with the existing drivers on FreeBSD.

EDITed to add: Which is really strange.  Because the 9270 (different last digit) is supported by the otus driver.  And the maintainer of that stack has talked about the 9271 chip in his blog postings.  That makes very little sense.


----------



## BSDAppentic3 (Apr 29, 2018)

ralphbsz Man, you know from where I am! Do you think that they will give me my money? Besides, it works on Kali. Yes, I have been using Kali Linux, and I can say that it's one of the better distros EVER.
Now you probably gonna think: "this assh0le is using a device which isn't supported here". Calm: I explain it...
I don't know which is your level of knowing in Linux. I started on FBSD a few months ago. I've been using Linux since I throw Winsh1t through the window (never better said). That was, aproximately, form 3 to 5 years ago. I have very, but very clear from which could be used Kali. In fact, I used its tools more than one time, but because I'm not a hacker, I used it mostly for its estability and because, god don't leave it, but some cr4p that is rounding from the Web gets the brilliant idea of try to f*ck me (or use your imagination), I will prepared for that.
That's why I installed RHEL. That's why I use FBSD. The first was because of the two s**** defects on the processors: "spectre" and "meltdown". I read that RHEL has one (if not the most) of the higher level of security in its system. That they were patched those cr4p. And FBSD was for the same reason, but with a little exception: it is free. I can't pay for software which I didn't used. So, despite of my low level of knowing informatic, I can sort both sh1t here and there: something that I can't in Winsh1t because...well...if you wait for REAL help from those who make the code of one of the most unsafe and unstable systems...you're bad bro...you could be watched with no problems there. Here can occur that? Yes. But despite it, at least you *have the facility to defend yourself and don't wait that a dark company helps you god knows when*.


----------



## BSDAppentic3 (Apr 29, 2018)

ralphbsz This would be probably touching the illegal...but I could "copy" the drivers from Kali or another OS and adapt 'em for use here?
Edit: if you couldn't give me that answer don't worry: I understand perfectly why.


----------



## ralphbsz (Apr 29, 2018)

You could *port* the driver.  That's nothing like copying.  Fundamentally, you would be writing a new FreeBSD driver, but following the logic from the OpenBSD or Linux drivers.  If you read the blog posts by Adrian Chadd (the maintainer of many of the wireless drivers in FreeBSD), that's actually how he works: He uses knowledge gleaned from reading other drivers to write the FreeBSD drivers.  I don't know what the copyright situation would be with the Linux driver (it is probably GPL, so you can't copy code from it, but you can read it and learn from it).  As the OpenBSD driver is under BSD copyright, it would be perfectly legal to just copy it, but it wouldn't work at all, without a complete rewrite.

This is something that would be "easy" for an experienced driver developer, who understands USB and wireless (easy doesn't mean an hour or two, but the concepts would be understandable).  It would be hard for a generic kernel developer.  It would be virtually impossible for a generic user-space programmer.  I won't even attempt to guess how long it would take; don't have enough kernel experience to make sensible estimates.

(You asked about my level of knowing Linux: I've been using Linux since about 1994 or 1995 (I can date it from which job I was working at), with  kernel version 0.99.13.  There is a little bit of code I have contributed to the Linux kernel, about that time; a few lines to fix an obscure SCSI card.)


----------



## BSDAppentic3 (Apr 29, 2018)

What if I try to learn how to do it? You will help me?
If not, it doesn't matter: I can by myself.
Besides, I really want to make a program/diver/etc, something that could be used for me or I and others.


----------



## hotaronohanako (Apr 29, 2018)

BSDAppentic3 said:


> Sensucht94
> Thanks, but you don't need to remind me that I was aggressive and offensive. You know how old I am, I know perfectly what I had done well either what I done bad.
> Crivens Of course I can be much more offensive without using "bad words". And for your information, in that case, no one can ban me. I really don't know to offend, I don't need to write like a marine speaks in a tavern who have drink some beers. No.



StarBucks and your mac thats all what you need


----------



## sidetone (Apr 29, 2018)

There's ndis(4), a wrapper for windows network drivers to work on FreeBSD, but it is only for x86 architectures. I never tried it, but it does not seem eloquent.


----------



## ralphbsz (Apr 30, 2018)

BSDAppentic3 said:


> What if I try to learn how to do it?


Start as follows:
Find an OS that has good support for this card (OpenBSD, Linux, whatever) and is open source.  Install it and verify that it works.  Download the source code.  Read the driver for the card.  This will require learning about the ToO (theory of operation) of USB and of 802.11.  It also requires excellent C skills, and kernel programming skills.

Download the source code for FreeBSD.  Find the driver that is closest to matching this card.  I would start by looking at Adrian Chadd's blog, then send him an e-mail.  Completely understand the driver, so perfectly that you are willing to modify it. Get a card that is supported by that driver without modifications, to use as a gold standard.  Now for a practice exercise, without having to write a new driver, simply modify the driver for the existing card, like adding debug statements, or adding some new functionality (like support for 802.11n).  Spend some time making sure you are comfortable doing kernel programming.

Once you are there, take all the ideas and algorithms from the other OS, and put them into a new FreeBSD driver for this card.  I have no idea how long this step will take, but it depends massively on how experienced the person is.  (Side remark: If you look at the software engineering literature, it is generally accepted that the productivity of software engineers varies by a factor of 10 from person to person and project to project.  That's why schedule estimates for software are so difficult.)

Unfortunately, I can't help with this: I have never done any serious driver development, and never any FreeBSD kernel development (never even compiled a FreeBSD kernel).  My only serious kernel work has been file systems, and then only Linux and closed-source operating systems.


----------



## BSDAppentic3 (Apr 30, 2018)

ralphbsz


> This will require learning about the ToO (theory of operation) of USB and of 802.11.  It also requires excellent C skills, and kernel programming skills.


 Exactly what I want. Can you tell me, if I study C++, it would be the same, or not?


----------



## BSDAppentic3 (Apr 30, 2018)

Guys, I came to FreeBSD knowing what I should treat 
I didn't came to here looking for a "ubuntu" nor "winsh1t". I know EXACTLY what I'm dealing. This separates incompetents from experts 
You have only 1 option to survive and get success in *BSD: fight and win. If you can't fight or you give up, it's better that you get off


----------



## sidetone (Apr 30, 2018)

Says someone who gets offended when someone tells him do his homework.


----------



## sidetone (Apr 30, 2018)

On a NetBSD mailing list, there is interest in porting a Broadcom bcm43142 driver. http://mail-index.netbsd.org/netbsd-users/2018/04/29/msg020666.html

I realize it's a different OS and different hardware, but the goal is very much similar.


----------



## BSDAppentic3 (Apr 30, 2018)

sidetone said:


> Says someone who gets offended when someone tells him do his homework.


You had said it: do your homework. You know why I choose "apprentice" by my user name? Because I always been studying this system. And you: you know about it? Better: how much do you know about it?


----------



## BSDAppentic3 (Apr 30, 2018)

sidetone said:


> On a NetBSD mailing list, there is interest in porting a Broadcom bcm43142 driver. http://mail-index.netbsd.org/netbsd-users/2018/04/29/msg020666.html
> 
> I realize it's a different OS and different hardware, but the goal is very much similar.



It doesn't matter: I'll give you a program, and you must follow a procedure to initialize it in a specific OS. Until here, everything's ok. Now, what you will do, if you haven't that system, but you have the program? You MUST know the procedure. Once you get the idea, adapt and modify it according to the system that you're using. A user, I think that he was ShelLuser , told me that it's a nice effort of memory memorize a few commands, but they will function for a few time. Then, you must go to the root: know where and how you can learn how to do the same.
That applies to what you give me: I don't have the OS neither the hardware. So, I must get what it's the procedure, commands, etc, and replicate 'em here with what I have. Do you get what I mean?


----------



## ralphbsz (Apr 30, 2018)

BSDAppentic3 said:


> ralphbsz
> Exactly what I want. Can you tell me, if I study C++, it would be the same, or not?


No.
When C++ is taught, the focus is typically on object-oriented analysis and design (also known as OOA&D).  That is actually very important for engineering large projects, and the best way to create complex software that's known today.  The important thing to learn there is how to express the class hierarchy and object relationships in the C++ language.  While clearly the procedural basis of the language need to be part of knowing C++, that's typically not the emphasis in learning C++.  Typically, that is taught in a C class.

For a typical software engineer, learning OOA&D is vitally important, as is learning engineering practices (such as source control, software process, testing, ...).  Personally, I think that C++ is not the best language to learn these things (and not even the best language to implement most systems).  But kernel device drivers are not a typical software engineering process; only a tiny fraction of all software engineering effort goes into kernels, and much of that isn't even device drivers.

A kernel device driver is not a large software project, and it is  constrained by the interfaces that the kernel proscribes for device drivers, which are not really object oriented.  Furthermore, the FreeBSD (and Linux and OpenBSD ...) kernels are written in straight non-object-oriented C, not in C++.  So learning C++ misses the goal.

In reality, the problem of writing a device drivers is really elsewhere.  The first single largest task is to learn about the problem domain: How does USB work?  How are USB messages passed around, what is their content and semantics?  How is error handling done?  The second task is to learn about 802.11: how are packets send and received, what are all the complex settings and parameters of a device, how are wireless connections established and managed?  I would think that about 70% of the knowledge required to write a driver for this chip is to learn the basics of USB and wireless, and the exact interfaces of this chip.  The next 20% of the task is learning how to function in the somewhat unusual software development environment of the kernel, which has unusual memory management, debugging facilities, and interesting restrictions.  Only the last 10% are learning mastery of C.


----------



## stariq (Jun 17, 2018)

In FreeBSD things get slow but very slow, be patient, after another 10 years will write a driver for this chip.


----------



## ShelLuser (Jun 17, 2018)

stariq said:


> In FreeBSD things get slow but very slow, be patient, after another 10 years will write a driver for this chip.


That's not really a fair comment to make in my opinion. You're talking here as if we're dealing with this big bad organization which can't be bothered to do this but that is a completely false depiction of this situation.

Fact of the matter is that _anyone_ can pick up this problem, start coding and then present their solution as a PR with a request to have it included with the official source tree. And trust me: if it's a good solution you can bet that it'll be included.

Heck, if you feel so strong about this then have a go at it yourself. The FreeBSD developers handbook gives you a full overview on how the development process works, how the source tree is connected together and gives a good explanation on the OS basics such as socket handling, kernel architecture and it even gives a rough impression on how you'd set up a driver.

The full source code (not just the kernel, but the whole OS) is also merely one checkout away so.... 

All the tools you might need are already in place.

Well, we both know that this isn't going to happen and there also lies the problem. FreeBSD, as an organization, is depending on programmers who are familiar enough with the hardware and motivated enough to actually code a driver for it. But it is depending on good will, it does not have enough resources to task or hire people to develop support for specific hardware "just because".

Which indeed means that sometimes a driver is never going to get developed and you'll never be able to use certain hardware on FreeBSD. Sucks, for sure, but that's the way it is.

Yet it has nothing to do with people being unwilling to help yet more so with being unable to.

Never forget that no one gets paid for doing what they do, in the end this is one huge voluntary effort. And I get the impression that some people sometimes totally ignore that.


----------

