LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-11-2006, 09:31 PM   #1
Oky
LQ Newbie
 
Registered: May 2006
Posts: 3

Rep: Reputation: 0
A couple of really simple Linux compatibility questions


Hi, It'd be really appreciated if you could answer a couple of really simple compatibility questions regarding Linux..

1) Is it possible to write a Linux driver that will work on all Linux distributions without having to give away any source code?

2) Same as above but for a commercial software package (e.g. Photoshop)?

Thank you
 
Old 05-11-2006, 09:56 PM   #2
centauricw
Member
 
Registered: Dec 2005
Location: Lawrenceville GA
Distribution: Slackware, CentOS. Red Hat Enterprise Linux
Posts: 216

Rep: Reputation: 31
Quote:
Is it possible to write a Linux driver that will work on all Linux distributions without having to give away any source code?
Yes. Graphics card manufacturers like NVidia release binary-only drivers with no source code access. Such drivers are always installable kernel modules. However, you will need to release a new binary-only driver with (possibly) each new kernel release since only you will be able to compile the driver for new kernels. You will also need to ready to support the driver and take responsibiliy for it braking things. Since it's a binary-only driver, it will (generally) not be included in any of the Linux distributions, meaning that the end-user, should they want to use it, will have to obtain and install it for themselves. How useful your driver turns out to be will depend on how desparate users are for it (does it operate hardware for which no open source driver exists), how up-to-date your releases are (do you keep up with the 2.6 kernel releases in a timely fashion and is a backport available for the 2.4 kernel), how active your support is (can someone connect you and expect a timely, helpful reply) and if you plan to charge for it.

If this a driver for a piece of hardware that you manufacture or that you have exclusive, non-disclosure knowledge of, and it's not easy for someone in the open source community to develop one (and someone will try, if for nothing else than to prove it can be done), then it might be worth it to you to develop a binary-only driver. Keep in mind the points above or it won't see much use in the Linux community. No one likes being locked in to a particular kernel version because of a binary-only driver.

Quote:
Same as above but for a commercial software package (e.g. Photoshop)?
Much easier because as long as you adhere to the standard APIs, your program should work under any version of Linux. Generally your issues are going to be the libraries installed on the system rather than the Linux kernel, and with good coding practices, this should not be a difficulty. There are more examples for closed source applications than there are kernel drivers.
 
Old 05-11-2006, 10:39 PM   #3
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
Simple question, complicated answer. A kernel module compiled on one system will not work on all. For a kernel module to work it needs to have been compiled against the source for the running kernel and with the same version of gcc. With the number of combinations of kernel versions plus patchsets plus gcc versions, you can't provide a binary module.

The way Nvidia handle it is their driver ships with the kernel module source as it obviously needs to be built and binary versions of libGL and a binary X11 driver. The LICENSE file that comes with the driver distrobution is pretty explicit in it's terms and obviously judging by their track record they have everything under control. Now the binary libGL and X11 driver will work on all systems (this gets tricky with 64 bit distrobutions though), it's only kernel stuff that is all fiddly.

In regards to a software package, that should be simple enough and to make things even easier you can compile against your own static versions of libraries that it links against and ship those with it so it's 100% self-contained.
 
Old 05-12-2006, 08:43 AM   #4
Oky
LQ Newbie
 
Registered: May 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Ok thanks, that’s cleared things up a lot.

Just out of interest, why does a driver have to be recompiled for every new version of the Kernel? Surely if the driver API stays the same a driver should continue to work.

It is my understanding that Windows uses the Portable Executable File format for its drivers along with a standard interface which allow for a driver to be compatible will all versions of the OS built on the same tech (ie 9x or NT). Is this assumption correct? If so couldn't Linux adopt this kind of strategy?

I apologise if these are dumb questions, I should say that I have never touched driver development myself.

The reason I ask is because the compilation of software and drivers seams to be quite a stumbling point for newbie’s and I was wondering if there was another way.

Thanks again
 
Old 05-12-2006, 09:20 AM   #5
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Quote:
Originally Posted by Oky
It is my understanding that Windows uses the Portable Executable File format for its drivers along with a standard interface which allow for a driver to be compatible will all versions of the OS built on the same tech (ie 9x or NT). Is this assumption correct?
Unfortunately, no.

Just try and find/install a driver for any recent piece of hardware on a Windows 95, Win98 (pre-SE), or WinNT machine. Go ahead and try it. Grrrr....

Conversely, try installing WinXP on an old WinNT machine with older hardware. Grrrrr again....
 
Old 05-12-2006, 09:45 AM   #6
Oky
LQ Newbie
 
Registered: May 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Oh sorry I didn't explain my self very well. I meant that there is a generic driver for all 2000/XP systems and another generic driver for all 9x systems no matter which kernel version is being used or which updates are installed etc. At least I think its a generic driver, It could be lots of drivers bundled into single self-installing .exe but jugging by the fact that my old WinTV 2000 driver works in XP I think they are generic.

From cs-cam's post I assume this is not possible for Linux but am unsure of the pacific reason.

My question put very simply is: Why would I have to rebuild a driver for every new version of the kernel?

Thank you
 
Old 05-12-2006, 09:51 AM   #7
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Oh, I got exactly what you meant. And unfortunately, it simply doesn't work out that way in Windows. If you're lucky, the same driver will work on different versions of Windows which are similar enough. If you're lucky. But between Win95 and WinMe? Between WinNT and WinXP? Just ask anyone who has the misfortune of having to do IT support for a wide mix of computer systems.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Couple of simple usability questions... dangerousdave Linux - Newbie 2 08-21-2005 06:56 PM
Apache, MySQL, PHP, a couple simple questions. The_Messiah Linux - Software 3 04-09-2005 05:17 PM
Some questions on integrating a couple simple python programs. RHLinuxGUY Programming 1 12-17-2004 12:32 PM
A couple of simple questions Redeye2 Mandriva 3 02-10-2004 11:50 PM
How to download Linux? and a couple other questions... RHLinuxGUY Linux - Newbie 3 12-01-2003 05:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration