[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Determining kernel version (2.2 or 2.4) from within module?
On Fri, Apr 27, 2001 at 11:44:59AM -0500, Timur Tabi wrote:
> I have a module which compiles for both 2.2 and 2.4, using a couple #ifdef's
> for the differences. I want to be able to create a binary driver that loads on
> both 2.2 or 2.4, detecting at run-time which version it is. Two questions:
>
> 1. Can I use "insmod -f" to load a driver compiled for 2.2 under 2.4?
No.
> 2. Is there a way to check the kernel version number from within a module?
Yes, but only after the module has been loaded, i.e.: too late.
> Please do not tell me that I should just distribute the source code and let the
> user compile, or anything along those lines. That option is not available, and
> I don't want to discuss it. Please just answer my question without criticism.
Well, I'm afraid there's no other choice left. Or use the vmware trick
and supply some glue source code that interfaces between the kernel and
the binary module.
Erik
--
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands
Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.kernelnewbies.org/