Linux compatibility layer for porting proprietary drivers?

Programming, for all ages and all languages.
Post Reply
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Linux compatibility layer for porting proprietary drivers?

Post by AndrewAPrice »

I was thinking, if the proprietary NVidia drivers link with the Linux kernel symbols on your system, then would it be possible, to say, imitate the functionality of these symbols and link with them instead? Then doing the same with libGLcore.so, so it just has enough functionality to communicate back and forth with /dev/nvidiactl and /dev/nvidia0.

As my OS is a microkernel, so the driver will be running in userland, it should be possible for me to set up a fake Linux-like compatibility layer. The overhead of the compatibility layer ("efficiently done" that is) should outweigh the benefits of having 3D accelleration.

Any thoughts?
My OS is Perception.
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

Re: Linux compatibility layer for porting proprietary drivers?

Post by gravaera »

Seeing as I'm actually interested directly in porting things like drivers, I'd simply suggest that for drivers that imply the user would want full, absolute performance, you should probably put some work into it and actually port it fully to your OS.
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Linux compatibility layer for porting proprietary drivers?

Post by Brynet-Inc »

gravaera wrote:Seeing as I'm actually interested directly in porting things like drivers, I'd simply suggest that for drivers that imply the user would want full, absolute performance, you should probably put some work into it and actually port it fully to your OS.
Didn't notice he said "proprietary" eh? Nvidia's Linux driver is not open source.. thus you cannot "fully port" it.

I do not believe a Linux compatibility layer for kernel modules is realistic either, even if you manage to satisfy the requirements of the Nvidia blob.. the higher level API that is exposed to the X server is also likely undocumented.

A lot of effort has gone into the Nouveau project.. you may be able to gleam enough information from that, or the accelerated 2D drivers from Xorg or Haiku (..as done by JamesM).
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

Re: Linux compatibility layer for porting proprietary drivers?

Post by gravaera »

Oh right. I did kind of gloss over that part. :? Come to think of it, the Linux source, (I finally started going through it yesterday. Started from <root>/arch/x86/boot) is extraordinarily helpful! I mean...I just started going through yesterday and already I've had like... tons of questions answered.

It might even be a good idea to advise newcomers to RTFSource. =P~ Honestly, it was like...amazingly helpful.
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
Kitsune
Posts: 20
Joined: Wed Aug 05, 2009 7:13 pm

Re: Linux compatibility layer for porting proprietary drivers?

Post by Kitsune »

Can't comment on difficulty, really (I'd guess somewhere in the range of 'extremely hard' to 'blood shooting out of your eyes'), but it should be possible. Some developers have done a similar thing to add support to the Linux kernel (via a third party module, mind you) for Windows NDIS binary drivers, and at least for some drivers it works rather well (I know I had to use it in the past) so the concept isn't really all that crazy.

Although, even if you get it working, you shouldn't expect all that great stability or performance (compared to running natively, of course). It sounds like it'd be a fun-yet-challenging project... I'd say give it a shot, it's not like you can't dump it later if it turns out to not be practical (and maybe you'll learn something!).


As an alternative, you could try porting Gallium3D, which'll eventually get you support for Intel/Cell for mostly free (IIRC,both are currently supported), and eventually Radeon and (if Nouveau pulls it off) nVidia. Gallium3D was actually designed to be a framework to ease the development of graphics drivers that should run on multiple platforms.
Post Reply