[uClinux-dev] How to load kernel modules in C

Kendrick Hamilton hamilton at sedsystems.ca
Fri Mar 14 09:25:12 EST 2003

	all you need to do is use the system function call.

	system("/sbin/insmod mymodule");
This will vfork and exec a shell which then executes the insmod. If you
want to eliminate the shell startup from the code, do the vfork and exec
in your program.

On Thu, 13 Mar 2003, Fabrice Gautier wrote:

> Hi,
> Is there somewhere some non-GPL C code to load a kernel module ?
> Right now I'm calling an external insmod program (busybox) to load a kernel
> module but i would like to include the C functions that does that directly
> in my program. But since busybox is GPL i cannot just take the busybox
> insmod code and include it in this non-GPL program.
> So i'm looking for either:
> a) Some code with a friendly license (like a BSD or similar).
> b) Some documentation that explains the kernel API used to load a module. (I
> could look at the busybox code, to understand the kernel APIs, but i feel
> the result would probably be too much like the GPL code, and be considered a
> derviative work...)
> Thanks
> --
> Fabrice Gautier,
> Fabrice_Gautier at sdesigns.com
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev at uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev at uclinux.org

More information about the uClinux-dev mailing list