kernel module
am 12.11.2007 14:59:17 von Rajeh kuri
Hi,
Is there any ways to invoke/call the function (kernel module
functions) from compiled base kernel. Well that statement sounds
strange.
I will try to simplify that statement, with problem I faced.
I have written a kernel module but it is of no use till I call one of
its function from kernel, and hence i modified the kernel source to
call this function and then compiled the kernel. Now the problem is
obliviously 'linker cannot resolve the symbol. Because I'm trying to
call the function which is available only after I insert the kernel
module.
Is this a right approach? I'm using the kernel module concept in opposite way.
Any pointers or suggestions will be greatly appreciated.
TIA...
--Regards,
rajesh
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" 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.linux-learn.org/faqs
Re: kernel module
am 13.11.2007 10:40:52 von Kristof Provost
--R3G7APHDIzY6R/pk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Hi,
On 2007-11-12 19:29:17 (+0530), Rajeh kuri wrote:
> Hi,
>=20
> Is there any ways to invoke/call the function (kernel module
> functions) from compiled base kernel. Well that statement sounds
> strange.
>=20
> I will try to simplify that statement, with problem I faced.
> I have written a kernel module but it is of no use till I call one of
> its function from kernel, and hence i modified the kernel source to
> call this function and then compiled the kernel. Now the problem is
> obliviously 'linker cannot resolve the symbol. Because I'm trying to
> call the function which is available only after I insert the kernel
> module.
The problem is that you're calling code compiled as a module from code
compiled into the kernel. That means you either compile both parts as a=20
module, or compile both of them into the kernel.
Kbuild/Kconfig has supports this type of dependency because it's quite
common.
Kristof
--R3G7APHDIzY6R/pk
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQFHOXEkUEZ9DhGwDugRAuRwAJ0TjAm+RMggTz8s79LNIsPTBXtlqQCf bkEp
hqfo+ieU2axIBIldFL7YdUA=
=yQLI
-----END PGP SIGNATURE-----
--R3G7APHDIzY6R/pk--
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" 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.linux-learn.org/faqs
Re: kernel module
am 13.11.2007 11:33:18 von Rodrigo
Export the symbol in the kernel and then hook it in your module ;)
cya,
Rodrigo (BSDaemon).
--
http://www.kernelhacking.com/rodrigo
Kernel Hacking: If i really know, i can hack
GPG KeyID: 1FCEDEA1
--------- Mensagem Original --------
De: Rajeh kuri
Para: Kristof Provost
C=F3pia: linux-newbie@vger.kernel.org
Assunto: Re: kernel module
Data: 13/11/07 09:13
>
> Well it means there is no way to achieve compiled kernel calling
> compiled kernel module. OR The direction of communication from kernel
> to kernel module can not be possible?
>
> I believe there must be a way around to get this work.
> If i find it will update here.
>
> --Regards,
> rajesh
> On Nov 13, 2007 3:10 PM, Kristof Provost
<Kristof@provost-engineering.be> wrote:
> > Hi,
> >
> > On 2007-11-12 19:29:17 (+0530), Rajeh kuri
<rajeshkuri@gmail.com> wrote:
> > > Hi,
> > >
> > > Is there any ways to invoke/call the function (kernel modul=
e
> > > functions) from compiled base kernel. Well that statement s=
ounds
> > > strange.
> > >
> > > I will try to simplify that statement, with problem I faced=
> > > I have written a kernel module but it is of no use till I c=
all
one of
> > > its function from kernel, and hence i modified the kernel s=
ource
to
> > > call this function and then compiled the kernel. Now the pr=
oblem
is
> > > obliviously 'linker cannot resolve the symbol. Because I'm
trying to
> > > call the function which is available only after I insert th=
e
kernel
> > > module.
> > The problem is that you're calling code compiled as a module fro=
m
code
> > compiled into the kernel. That means you either compile both par=
ts as
a
> > module, or compile both of them into the kernel.
> > Kbuild/Kconfig has supports this type of dependency because it's
quite
> > common.
> >
> > Kristof
> >
> -
> To unsubscribe from this list: send the line "unsubscribe
linux-newbie" 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.linux-learn.org/faqs
>
>
>
>
________________________________________________
Message sent using UebiMiau 2.7.2
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie"=
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.linux-learn.org/faqs
Re: kernel module
am 13.11.2007 13:23:11 von Rajeh kuri
Well it means there is no way to achieve compiled kernel calling
compiled kernel module. OR The direction of communication from kernel
to kernel module can not be possible?
I believe there must be a way around to get this work.
If i find it will update here.
--Regards,
rajesh
On Nov 13, 2007 3:10 PM, Kristof Provost wrote:
> Hi,
>
> On 2007-11-12 19:29:17 (+0530), Rajeh kuri wrote:
> > Hi,
> >
> > Is there any ways to invoke/call the function (kernel module
> > functions) from compiled base kernel. Well that statement sounds
> > strange.
> >
> > I will try to simplify that statement, with problem I faced.
> > I have written a kernel module but it is of no use till I call one of
> > its function from kernel, and hence i modified the kernel source to
> > call this function and then compiled the kernel. Now the problem is
> > obliviously 'linker cannot resolve the symbol. Because I'm trying to
> > call the function which is available only after I insert the kernel
> > module.
> The problem is that you're calling code compiled as a module from code
> compiled into the kernel. That means you either compile both parts as a
> module, or compile both of them into the kernel.
> Kbuild/Kconfig has supports this type of dependency because it's quite
> common.
>
> Kristof
>
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" 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.linux-learn.org/faqs
Re: kernel module
am 13.11.2007 15:06:29 von Kristof Provost
--JWEK1jqKZ6MHAcjA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On 2007-11-13 17:53:11 (+0530), Rajeh kuri wrote:
> Well it means there is no way to achieve compiled kernel calling
> compiled kernel module. OR The direction of communication from kernel
> to kernel module can not be possible?
It is possible and it's done quite often. You just need to handle things
slightly differently.
Take a filesystem for example. They can be built as a module, and still
be used by the kernel. In this case that's basically done by function
pointers.
When the fs module is loaded it registers itself to the kernel and
passes pointers to the basic operations to the kernel.
The kernel itself doesn't contain any calls to (for example)
fat_statfs. That's only used in the fat module. The kernel calls
the statfs function pointer in the super_operations struct the fat
module registered when it was loaded.
Kristof
--JWEK1jqKZ6MHAcjA
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQFHOa9kUEZ9DhGwDugRAlTGAJ95+U71UEetLtThBDrGVb0S0Nej1QCf Y7/z
UGUou8sgaHzy+xCgmcSlNKg=
=zbTW
-----END PGP SIGNATURE-----
--JWEK1jqKZ6MHAcjA--
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" 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.linux-learn.org/faqs