Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Question of kernel module dependency

9 views
Skip to first unread message

Jeongki Min

unread,
Nov 22, 2006, 12:13:52 PM11/22/06
to
Hi,


I'm making two modules.

Those modules are dependent on each other.

I mean, for example, module A uses module B's function, and module B also uses modules A's function.

Because of that, using "insmod" I cannot load one of them at all.

Every time when I try to load one of them, there is error message to load the other one first.

Is there any method I can load both together?

Because this is first time on kernel module programming, I have no idea how to do it.

I'd really appreciate it if you share any idea for me.


Thanks,
JK

Avishay Traeger

unread,
Nov 22, 2006, 12:28:10 PM11/22/06
to

I'm not sure how to do it, but this seems like a very strange
programming model. Why would you make two separate modules if they are
dependent on each other? Why not just make one module?

Avishay Traeger
http://www.fsl.cs.sunysb.edu/~avishay/


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/


Jeongki Min

unread,
Nov 22, 2006, 1:06:47 PM11/22/06
to
Hi,

yeah..it seems strange.
I modified a mac driver and on top of that driver I made a new module.
The new module manages some information from the mac driver, so, they need to communicate each other.
I don't want to put the new module inside the mac driver.
So, I got this starage situation:)
Usually is there not any case that two module have dependency to each other?

Thanks,
JK

Shakthi Kannan

unread,
Nov 22, 2006, 10:58:01 PM11/22/06
to
Hi,

On 11/22/06, Jeongki Min <jeong...@gmail.com> wrote:
> The new module manages some information from the mac driver,
> so, they need
> to communicate each other.

Why? Isn't the MAC driver dealing mainly with its lower-level
drivers/layers rather than its upper layer drivers/subsystems. That is
the idea behind a layered design where data flows from the application
down to hardware.

If you have dependancies between the two, then you need to build the
object files together as a single module.

SK

--
Shakthi Kannan
http://www.shakthimaan.com

Ranjan Sinha

unread,
Nov 23, 2006, 3:16:44 AM11/23/06
to
Hi,

>
> I modified a mac driver and on top of that driver I made a new module.
> The new module manages some information from the mac driver, so, they need
> to communicate each other.
> I don't want to put the new module inside the mac driver.
> So, I got this starage situation:)
> Usually is there not any case that two module have dependency to each other?
>

Umm well it does happen that Module A has dependencies on Module B,
but having interdependencies is well a bit unfortunate on the design
part.

But you can always have a model where module A directly depend on
module B and having module B calling functions of A through
callbacks. This way B can be loaded without requiring module A.
Of course best design would be to avoid this interdependency.

Hope this helps.

--
Ranjan

Arjan van de Ven

unread,
Nov 23, 2006, 3:19:46 AM11/23/06
to
On Wed, 2006-11-22 at 12:13 -0500, Jeongki Min wrote:
> Hi,
>
>
> I'm making two modules.
>
> Those modules are dependent on each other.
>
> I mean, for example, module A uses module B's function, and module B
> also uses modules A's function.

this is a good sign that they shouldn't be separate modules at all...
after all you gain nothing in this scenario anyway.

Can you give a pointer to the full source code so that we can help you
better?

--
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org

Jeong Ki Min

unread,
Nov 23, 2006, 11:50:27 AM11/23/06
to
Thank you guys so much.
As you said, I think my design is wrong.
Because this is first time to work on kernel, I've never expected this
kind of problem at all.
So, I'll start changing the whole scheme.

Thank you so much for taking your time, and I really appreciate it.

Jeong Ki Min

0 new messages