At 7:17 PM -0800 2/28/04, Matthew Bogosian wrote:
Howdy all,

Sorry for the cross post, but in retrospect, I thought [EMAIL PROTECTED]
was a better place to ask this question than [EMAIL PROTECTED]

It is, so I'll stick with devel.


>As a user, I'm not really concerned whether or not [nVidia PPC Linux]
drivers are Open Source or not (although I would certainly commend
nVidia for such a bold step). I just want them to be available.

I'd like to ask a question, though: is it even conceivably possible to
use the binary code distributed with OS X 10.x in Linux? What I mean
is, is it possible that one could (in theory) write a wrapper for the
Mach-0 based code for the video drivers? Kind of like what these guys
>have done to allow x86 Linux to use Windows wireless drivers:

On the face of it, this is an interesting idea. I had toyed with the idea of going the other way at one time: writing an IOKit wrapper for Mac OS X that would allow one to use XFree86 drivers. Unfortunately, there are a lot of issues you have not considered.


> http://www.linuxant.com/driverloader/?PHPSESSID=c500d3092e9954138998fb5a8bac0713
http://ndiswrapper.sourceforge.net/

I don't even know which .dylib(s) hold(s) the appropriate code, but I'm
imagining something like the following:

1. Identify the appropriate .dylib files (and their dependencies?) in
OS X (perhaps "otool -L
>/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLSystem.dylib"?)

You'll actually want to be looked at KEXT's in /System/Library/Extensions. Dylibs are dynamic shared libraries in user land. All the drivers you want to wrap run in kernel space.


 >2. Find/write a Mach-0 object loader for Linux (is this necessary?
 >Linux uses ELF, and OS X uses Mach-0, right?)

Right. Note the NetBSD guys have done this. Check out <http://hcpnet.free.fr/applebsd.html>.


>3. Identify the approprate nVidia-specific symbols in the .dylib files
(this probably requires some heavy reverse engineering/experimentation
and a lot of patience)

4. Write the wrapper/glue code to abstract the Mach-O loader/nVidia
>symbol calls as an XFree86 driver

This is not really right. In fact:


1. You'd have to provide an emulation of the environment IOKit video drivers expect to see when they are linked into the Darwin kernel. This would allow the driver to talk to the hardware. This is harder then it might first appear because the IOKit is C++ based and drivers rely on inheriting much of their functionality from other objects. (This is part of the elegance of the IOKit.) You would likely end up having to provide the functionality of a big chunk of the IOKit.

Since the Darwin kernel is open source you can see and use all the IOKit kernel code. The Apple Public Source License (2.0) is both open and free <http://www.gnu.org/philosophy/apsl.html>. Unfortunately, you may run into license compatibility issues depending on how and where you wanted to deploy this code. The APSL is not GPL compatible for example.

2. You would also need to write your XFree86 shim-driver that translated the standard calls from XFree86 ddx into calls appropriate for an IOKit driver.

Unfortunately when you were done you might not see the performance you hoped for. The 2-D graphics model on Mac OS X and X11 are very different. An IOKit video driver will provide no hooks to accelerate many X11 graphics primitives. For 3-D you are at least targeting the same API with X11 and Mac OS X (OpenGL), so performance could be closer to ideal.

>Is there anything wrong with my thinking here? If there are any nVidia
developers reading this list, is this something nVidia would be willing
to do? It seems like this might be a decent compromise (nVidia doesn't
have to release its IP, and Linux users get updates with OS X).
Alternatively, are there any bright independents out there who are
>capable/willing to tackle such a daunting task?

The biggest problem is that you are talking about a huge amount of work without a very large payoff. There are very few people who understand both the low level details of the X server and IOKit driver development well enough to attempt it.


Not to be too glib, but the obvious question would always be, "Why not just run Mac OS X, if you are willing to use binary drivers anyway?" XFree86 is included with every computer shipped by Apple these days and in every retail version of the latest version of Mac OS X. With XFree86 4.4.0 on Mac OS X, OpenGL for local X11 applications is exactly as fast as it is for applications written with native Mac OS X API's. Not only that, but XFree86 inherits for free any improvements NVidia or others put into their graphics drivers and automatically supports any new hardware that NVidia supports on the Mac.

--Torrey
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to