2

Is it possible for a function in a linux kernel module calling a function in another module ?

3

2 Answers 2

2

Yes. Of course, the other kernel module must be loaded.

For an example, look at the USB code, which is implemented as a mullti-layer driver, with each layer in its own module.Reference link here.

Sign up to request clarification or add additional context in comments.

Comments

1

It is possible by using EXPORT_SYMBOL in Linux.

If one module has one function called etx_shared_func and one global variable called etx_count. This function and variable can be shared among with all the loadable modules using EXPORT_SYMBOL.

EXPORT_SYMBOL(etx_shared_func);
EXPORT_SYMBOL(etx_count);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.