MediaTek MT7921 Wireless LAN driver

New to BSD, coming from Linux. My laptop (Asus FX706LI) uses the MediaTek MT7921. Although I've never installed linux on this laptop, I know the driver is in Linux 5.12 and subsequent kernels. I am to the point that I'd like to try modifying the driver to work with BSD. I currently have NetBSD running on a QEMU virtual machine, and I'd like to find a service that will allow me to add kernel modules so I don't need to rebuild the kernel for every attempt.

Once getting the WiFi, audio, bluetooth and graphics drivers working, my plan is to create a Wayland shell using wlroots that uses the least amount of RAM possible while remaining aesthetically pleasing. I may end up rewriting portions of WayFire to use Vulkan, and include this in the compositor/shell. Of course, I will give the resulting drivers to NetBSD and FreeBSD, and release the code for the compositor using the BSD license.

At some point, I'd like to take NetBSD, FreeBSD and BSD 4.4Lite-2 and modify and rewrite them using rust, which if successful, I will release the binaries but not the source. You may analyze the binaries for yourself, however I despise corporate interests and will only allow a trusted circle to work with this code. Any documentation and whatever you may consider useful is welcomed.
 
First of all, welcome to the world of FreeBSD.

You're setting yourself quite the goalpost there. I won't judge on whether this is all feasible on your own because there's merit in having a larger vision. It makes it difficult to recommend particular resources though, because the technological spectrum is quite broad.

There's the old adage "the code is the documentation"... if you haven't looked at FreeBSD's source yet, it's probably a very good starting point; I can recommend "The Design and Implementation of the FreeBSD Operating System" to go along.


While it's a couple years back when it was originally published, it still rings true in the most important areas. There's also "FreeBSD Device Drivers", which might help understanding kernel and module development.


Marshall Kirk McKusick has held a bunch of talks that might also be interesting. Hell, you could probably could go back all the way to AT&T UNIX if you want to learn more about the reasoning behind the system architecture we see today.

You probably want to dig into linuxkpi if you want to make use of linux module code, though you may need to be careful about license issues, if your particular chipset driver is GPL.

That's what jumped to mind for the moment.

Good luck and feel free to ask around for additional pointers. After all, FreeBSD isn't just about the tech but also about the community around it.
 
Thanks for the very useful books. I found the PDFs for both and will begin reading them. Do you know if there is a microkernel implementation of BSD? I just created a FreeBSD vm and already I prefer the lexicography of its system applications to that of NetBSD’s, but I prefer the rump kernel to the monolithic and further still, I prefer the microkernel philosophy, while still having layer of abstraction between applications and hardware, unlike an exokernel.
 
Don't know of any BSD based micro kernel. FreeBSD's architecture kind of goes against that concept in general. You could strip things out of the kernel, but you'd likely cross a point where you need to ask yourself whether you're still working on FreeBSD and not something else entirely.

The good news: the licensing allows you to do with FreeBSD's code as you like. Whether it's better to start your endeavor from NetBSD or from FreeBSD is hard to say. I feel more at ease at FreeBSD, but that's very much subjective and comes with years of using it for almost everything.
 
Might try to take the FreeBSD SysApps paired with NetBSD’s kernel. Maybe when I feel confident enough to write my own kernel and SysApps in rust, I can release it as Lou’s Software Distribution, or “LSD”. Disk Management Tool, “DMT”.
 
Hi.
For MT7921 Wi-Fi module not have solution for up now?
I'm sorry, gentlemen, but is there a solution for 13.2 with wi-fi for mt7921? Unfortunately, everything that is in the search engines does not allow you to configure the device.
 
is there a solution for 13.2 with wi-fi for mt7921?
Most likely the mt76 driver (which includes the mt7921) wont be available on the 13.x branch, I suspect because of LinuxKPI.

It's present in the source tree beginning with the 14 branch, but disconnected from build: https://cgit.freebsd.org/src/tree/sys/contrib/dev/mediatek/mt76?h=releng/14.0

There is some work done but there are no recent reports on the progress:

- Bug 264300 Missing MEDIATEK MT7921 802.11ax PCI Express Wireless driver
- https://wiki.freebsd.org/WiFi/Mt76

You could drop a mail on freebsd-wireless@freebsd.org mailing list to ask about the progress. The developer of the driver, Bjoern A. Zeeb, is subscribed on that list.
 
There's a good push on OpenBSD to make a driver (see mwx). I think this might be a good starting point for adding support for this wifi card, without using the LinuxKPI. At last I checked, scanning was working.

This is something I wanted to try tinkering with, but ultimately I have no experience writing drivers.

I only say this might be a better starting point because of the issues I've heard with the LinuxKPI with this particular driver. Again, I have no experience here.

If I get around to it in the next couple weeks, I might take a look at trying my hand at this. Otherwise I'm sure someone will beat me to it very quickly and/or the LinuxKPI driver will suffice and be released.
 
Back
Top