Linux Module Stacking Example
What is module stacking?
New modules using the symbols exported by old modules.
Examples of modules stacking in Linux Kernel?
- Msdos filesystem relies on symbols exported by fat module
- Parallel port printer driver (lp) relies on symbols exported by generic parallel port driver (parport)
Let's write a sample device driver code which exports a function myadd performing addition of two numbers:
Code:
Now, we will write another module which uses the exported function:
Code:
Makefile to Compile two modules:
Comments
Post a Comment