mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Module link
@ 2006-07-07  3:55 yh
  2006-07-07  4:08 ` Randy.Dunlap
  0 siblings, 1 reply; 6+ messages in thread
From: yh @ 2006-07-07  3:55 UTC (permalink / raw)
  To: linux-kernel

Thanks for all helps. The module can now be loaded. There are some other
issues as descripbled as follows:

1. The module I used links to i2c drivers. It works fine in kernel 2.4
after "insmod NewModule.o", but now it has a NULL point in kernel 2.6 when
to init it. It seems that the i2c driver is not linked in the module. How
can I link an i2c to my driver module?

2. In kernel 2.4, when I call "insmod NewModule.o", the insmod can find
the path of the NewModule.o and to init the module. In 2.6 kernel, the
"insmod NewModule.ko" does not know the path, so I have to specify the
path explicitly as "insmod
/lib/modules/2.6.8.1/kernel/drivers/char/NewModule.ko" to make it work. I
guess the above problem in question 1 may also related to this issue. What
did I wrong here?

Thank you.

Jim




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Module link
  2006-07-07  3:55 Module link yh
@ 2006-07-07  4:08 ` Randy.Dunlap
  2006-07-07  5:33   ` yh
  0 siblings, 1 reply; 6+ messages in thread
From: Randy.Dunlap @ 2006-07-07  4:08 UTC (permalink / raw)
  To: yh; +Cc: linux-kernel

On Fri, 7 Jul 2006 13:55:39 +1000 (EST) yh@bizmail.com.au wrote:

> Thanks for all helps. The module can now be loaded. There are some other
> issues as descripbled as follows:
> 
> 1. The module I used links to i2c drivers. It works fine in kernel 2.4
> after "insmod NewModule.o", but now it has a NULL point in kernel 2.6 when
> to init it. It seems that the i2c driver is not linked in the module. How
> can I link an i2c to my driver module?

Sorry, I don't understand the question.
Where is the driver source code?

> 2. In kernel 2.4, when I call "insmod NewModule.o", the insmod can find
> the path of the NewModule.o and to init the module. In 2.6 kernel, the
> "insmod NewModule.ko" does not know the path, so I have to specify the
> path explicitly as "insmod
> /lib/modules/2.6.8.1/kernel/drivers/char/NewModule.ko" to make it work. I
> guess the above problem in question 1 may also related to this issue. What
> did I wrong here?

In module-init-tools, insmod requires full path and modprobe
does not (it searches for the file).

---
~Randy

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Module link
  2006-07-07  4:08 ` Randy.Dunlap
@ 2006-07-07  5:33   ` yh
  2006-07-07  5:49     ` Arjan van de Ven
  2006-07-07  5:50     ` Dave C Boutcher
  0 siblings, 2 replies; 6+ messages in thread
From: yh @ 2006-07-07  5:33 UTC (permalink / raw)
  To: linux-kernel

Thanks Randy. Let me clarify it.

I have a driver module (NewSerialModule.ko) and I build it for module
load. This driver module uses i2c functions. It was fine to init this
module in kernel 2.4 as the i2c functions are exported in i2c Makefile.

In kernel 2.6, I loaded this module and got NULL point exception. I
checked the module map, all i2c functions are not linked. I also checked
i2c, there is no export for i2c in kernel 2.6. So, my question is how can
I link the dirvers/i2c to my driver module in drivers/char directory? How
to export a directory to be a library such as i2c? In general, how to link
another directory functions by a module in kernel 2.6?

Thank you.

Jim




> On Fri, 7 Jul 2006 13:55:39 +1000 (EST) yh@bizmail.com.au wrote:
>
>> Thanks for all helps. The module can now be loaded. There are some other
>> issues as descripbled as follows:
>>
>> 1. The module I used links to i2c drivers. It works fine in kernel 2.4
>> after "insmod NewModule.o", but now it has a NULL point in kernel 2.6
>> when
>> to init it. It seems that the i2c driver is not linked in the module.
>> How
>> can I link an i2c to my driver module?
>
> Sorry, I don't understand the question.
> Where is the driver source code?
>
>> 2. In kernel 2.4, when I call "insmod NewModule.o", the insmod can find
>> the path of the NewModule.o and to init the module. In 2.6 kernel, the
>> "insmod NewModule.ko" does not know the path, so I have to specify the
>> path explicitly as "insmod
>> /lib/modules/2.6.8.1/kernel/drivers/char/NewModule.ko" to make it work.
>> I
>> guess the above problem in question 1 may also related to this issue.
>> What
>> did I wrong here?
>
> In module-init-tools, insmod requires full path and modprobe
> does not (it searches for the file).
>
> ---
> ~Randy
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Module link
  2006-07-07  5:33   ` yh
@ 2006-07-07  5:49     ` Arjan van de Ven
  2006-07-07  5:50     ` Dave C Boutcher
  1 sibling, 0 replies; 6+ messages in thread
From: Arjan van de Ven @ 2006-07-07  5:49 UTC (permalink / raw)
  To: yh; +Cc: linux-kernel

On Fri, 2006-07-07 at 15:33 +1000, yh@bizmail.com.au wrote:
> Thanks Randy. Let me clarify it.
> 
> I have a driver module (NewSerialModule.ko) and I build it for module
> load. This driver module uses i2c functions. It was fine to init this
> module in kernel 2.4 as the i2c functions are exported in i2c Makefile.
> 
> In kernel 2.6, I loaded this module and got NULL point exception. 

you very likely have a bug in your code or in your Makefile. Since you
haven't posted either.. how are we supposed to help you? Please provide
a URL to both the source and the Makefile.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Module link
  2006-07-07  5:33   ` yh
  2006-07-07  5:49     ` Arjan van de Ven
@ 2006-07-07  5:50     ` Dave C Boutcher
  2006-07-07 23:34       ` YH
  1 sibling, 1 reply; 6+ messages in thread
From: Dave C Boutcher @ 2006-07-07  5:50 UTC (permalink / raw)
  To: yh; +Cc: linux-kernel

On Fri, 7 Jul 2006 15:33:43 +1000 (EST), yh@bizmail.com.au said:
> 
> Thanks Randy. Let me clarify it.
> I have a driver module (NewSerialModule.ko) and I build it for module
> load. This driver module uses i2c functions. It was fine to init this
> module in kernel 2.4 as the i2c functions are exported in i2c Makefile.
> 
> In kernel 2.6, I loaded this module and got NULL point exception. I
> checked the module map, all i2c functions are not linked. I also checked
> i2c, there is no export for i2c in kernel 2.6. So, my question is how can
> I link the dirvers/i2c to my driver module in drivers/char directory? How
> to export a directory to be a library such as i2c? In general, how to link
> another directory functions by a module in kernel 2.6?

It is difficult for any of us to offer assistance unless you provide a
pointer to your source code.

However, I will point out that the i2c functions are exported from
drivers/i2c/i2c-core.c, so you should make sure you have that module
either built into your kernel or loaded.

Dave B

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Module link
  2006-07-07  5:50     ` Dave C Boutcher
@ 2006-07-07 23:34       ` YH
  0 siblings, 0 replies; 6+ messages in thread
From: YH @ 2006-07-07 23:34 UTC (permalink / raw)
  To: linux-kernel

Thanks for all responses. The file was modified from 
drivers/macintosh/therm_adt746x.c, the function call i2c_add_driver() in 
static int __init thermostat_init(void) caused a null point. In fact, 
all i2c related functions were not linked. The i2c-core.c has been built 
in kernel. How does the module therm_adt746x.ko link to i2c? I did not 
see that the module therm_adt746x.ko resolved symbol i2c_add_driver. Or, 
the symbols are resolved during insmod? I guess I try to figure out 
whether this problem is caused by building process in kernel or by 
module loading process in insmod (using BusyBox)?

Thank you.

Jim

Dave C Boutcher wrote:
> On Fri, 7 Jul 2006 15:33:43 +1000 (EST), yh@bizmail.com.au said:
> 
>>Thanks Randy. Let me clarify it.
>>I have a driver module (NewSerialModule.ko) and I build it for module
>>load. This driver module uses i2c functions. It was fine to init this
>>module in kernel 2.4 as the i2c functions are exported in i2c Makefile.
>>
>>In kernel 2.6, I loaded this module and got NULL point exception. I
>>checked the module map, all i2c functions are not linked. I also checked
>>i2c, there is no export for i2c in kernel 2.6. So, my question is how can
>>I link the dirvers/i2c to my driver module in drivers/char directory? How
>>to export a directory to be a library such as i2c? In general, how to link
>>another directory functions by a module in kernel 2.6?
> 
> 
> It is difficult for any of us to offer assistance unless you provide a
> pointer to your source code.
> 
> However, I will point out that the i2c functions are exported from
> drivers/i2c/i2c-core.c, so you should make sure you have that module
> either built into your kernel or loaded.
> 
> Dave B
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-07-07 23:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-07  3:55 Module link yh
2006-07-07  4:08 ` Randy.Dunlap
2006-07-07  5:33   ` yh
2006-07-07  5:49     ` Arjan van de Ven
2006-07-07  5:50     ` Dave C Boutcher
2006-07-07 23:34       ` YH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®