Add support for building Linux-only network drivers

Niclas Zeising zeising+freebsd at daemonic.se
Sat Aug 15 22:05:48 UTC 2020


On 2020-08-15 23:59, zerous wrote:
> On Fri, Jul 24, 2020 at 07:42:32PM +0200, Niclas Zeising wrote:
>>
>> Hi!
>> The Linux compatibility layer, aka Linuxolator, is for running userland
>> Linux binaries on FreeBSD.  I think what you're looking for is the Linux
>> KPI, or lkpi.  I believe Mellanox network card drivers are using this, and I
>> know the drm-kmod graphics drivers are.  This might be a starting point for
>> you.
> 
> Hi,
> 
> I was just wondering if I could find more documentation about
> linuxolator. I have been reading up "FreeBSD Device Drivers" and I
> think it will help me in understanding network drivers, but I couldn't
> find much information on the linux kernel api other than a blog on
> drm-kmod (setup).
> 
> 	Naveen
> 

THe linuxolator, as I told you, is for running userland Linux binaries 
on FreeBSD, and has nothing to do with wanting to build Linux-only 
network drivers.
I suggest you look at the code for the lkpi, you can find it here: 
https://github.com/freebsd/freebsd/tree/master/sys/compat/linuxkpi/common
There are also drivers in the tree using it, such as mellanox network 
drivers, I think.
The lkpi is meant to work like on Linux, but you probably need some glue 
to set up modules and so on.
I suggest you start with looking at the relevant code.
Regards
-- 
Niclas


More information about the freebsd-net mailing list