From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 717F6CA9EA0 for ; Mon, 28 Oct 2019 09:46:27 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0D9562184C for ; Mon, 28 Oct 2019 09:46:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=dke-khu-ac-kr.20150623.gappssmtp.com header.i=@dke-khu-ac-kr.20150623.gappssmtp.com header.b="CMkwaAfE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D9562184C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=dke.khu.ac.kr Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces+kernelnewbies=archiver.kernel.org@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1iP1bT-0002kz-NS for kernelnewbies@archiver.kernel.org; Mon, 28 Oct 2019 05:46:23 -0400 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1iP1ZV-0000ZK-7t for kernelnewbies@kernelnewbies.org; Mon, 28 Oct 2019 05:44:21 -0400 Received: by mail-lj1-x241.google.com with SMTP id c4so10519704lja.11 for ; Mon, 28 Oct 2019 02:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dke-khu-ac-kr.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=p7gVkUgfRtrR2kCT5fsJRghJr+YOQ0dDgcjj+Asq4Rs=; b=CMkwaAfEd9p6wnoBY5NpjAn5lICgYNGjzqX3yK30No2HP0H1VfkJfhh6KKH28woUCS zVGAxYjSxrP2v2bRRwYWVDYVqdKsmggdeN7BMRw/fYXtDUn2/qyDjTHiOnMeDoTlAWDI edTiPBt/UUi4sK0iivwaR8TkQXCEMn0XYk2ycFTRBL25oZV7lu6hTU68RMm5pvpLePEq s53ZnPqktbBc8B0kFUgZHginGi53QRKtLuf30ztN0zT6J8FnqYDmzFTC3gHUz1XN1F3F aVwTHViorj+875pnPS94Gogq/QLcgap6j/0H7NSpNeZ2UTCkLU0J00pTNE7Z72en35n0 urCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=p7gVkUgfRtrR2kCT5fsJRghJr+YOQ0dDgcjj+Asq4Rs=; b=qTZEXOkdy0OgCgBVbEP6Ac7sw+HSLkdL0ZwJn5mx6UFZlOoTvJ5e7MgeffGYUSlJwA vLIWXg3bxvqgDPzcrANNWJCw2RhYb7Q4gKYnlFYHX2DdiIu5B7ov8WkkQUpDsYZRX0+U awT2cDQCHHau/jmsa7KQshZvOEEjGXP5k1zIFEBoq/l3bMdYorlTn0gc9vRVaXPmhWwk qDUiesbgbYdQBqdgOK0RWv/MDG1ftcpALJEUgmsMrJKh9JtomkIUY3JfJxzypvC3Kp+L nRRZqJk6NdxoGjvQSMISyja4jyxtVNISFlDYvTolZzuj93UiNGDDQEA3hp/IPqjWr4BX z9Xg== X-Gm-Message-State: APjAAAVB0dG7iQOsjbK66FqW3DGQ7twlPWJ9Ia4tUSB3nFgKQB5JgMjc fNcjLIycwNYSH1uEaA5CkN5I3IX1SXNEbiUQddaGrg== X-Google-Smtp-Source: APXvYqxPHXRGP9TpPtCyBUYeRP2mx7U/+WWKk+x6Af/9R2h69jyD6OgY0lMi8Yiu37De9RCIFvy+r+dfBxxEwqTbvnk= X-Received: by 2002:a2e:575c:: with SMTP id r28mr11058823ljd.245.1572255794280; Mon, 28 Oct 2019 02:43:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?B?SXJmYW4gVWxsYWggKOyauOudvCDsnbTrpbTtjJAp?= Date: Mon, 28 Oct 2019 18:43:01 +0900 Message-ID: Subject: Re: Kernel Module with multiple source files not initializing To: Bernd Petrovitsch Cc: Linux Kernel List X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============4435518999638087802==" Errors-To: kernelnewbies-bounces+kernelnewbies=archiver.kernel.org@kernelnewbies.org --===============4435518999638087802== Content-Type: multipart/alternative; boundary="0000000000001d50e10595f554c9" --0000000000001d50e10595f554c9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the help. I have removed the "static" from the hello_init, hello_exti but nothing worked. I am not sure, but I think the problem is with the make file. On Sun, Oct 27, 2019 at 5:44 PM Bernd Petrovitsch wrote: > Hi all! > > On 25/10/2019 11:14, Irfan Ullah (=EC=9A=B8=EB=9D=BC =EC=9D=B4=EB=A5=B4= =ED=8C=90) wrote: > > Dear All, > > I have developed a kernel module consists of one source file that sends > > and receives message to the user space. I have spitted the source cod= e > > in two files, and now I am trying to develop kernel module from these > > source files. After compiling and linking without any problems, I insmo= d > > the module but I didn=E2=80=99t see any of the printk() I wrote, in fac= t, the > > module can be inserted and removed, but it does nothing. Code is in the > > attached file zipped file. > > I tried many things , e.g., link 1, link2 > > < > https://www.linuxquestions.org/questions/linux-kernel-70/kernel-module-wi= th-multiple-source-files-not-initializing-886190/ > >;, > > and link3 > > < > https://android.googlesource.com/kernel/msm/+/android-msm-dory-3.10-kitka= t-wear/Documentation/kbuild/modules.txt> etc. > > > but nothings worked out. > > I also used /nm/ to inspect the module, but, as expected, there was no> > signs of "__init and __exit" functions can in the output. > > To be exact, you are looking for the hello_init function. > Since "nm" doesn't show it, it's either not there or > "static". > > [ for the nm-output see in the OPs mail ] > > Can you please help me: what's the problem/mistake I am doing? > > Thank you very much. > > Get rid of the "static" for the hello_init and hello_exit function. > > MfG, > Bernd > -- > Bernd Petrovitsch Email : bernd@petrovitsch.priv.at > LUGA : http://www.luga.at > > --=20 *Best Regards,* *Mr. Irfan Ullah* PhD Candidate Data and Knowledge Engineering(DKE) Lab Department of Computer Science and Engineering Kyung Hee University, South Korea. +82-010-591-51651 <+82%2010-3877-8867> sahibzada.iu@gmail.com sahibzada_irfanullah --0000000000001d50e10595f554c9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for the help. I have removed the "static"= from the hello_init, hello_exti but nothing worked. I am not sure, but I t= hink the problem=C2=A0is with the make file.


On Sun, Oct 27, = 2019 at 5:44 PM Bernd Petrovitsch <bernd@petrovitsch.priv.at> wrote:
Hi all!

On 25/10/2019 11:14, Irfan Ullah (=EC=9A=B8=EB=9D=BC =EC=9D=B4=EB=A5=B4=ED= =8C=90) wrote:
> Dear All,
> I have developed a kernel module consists of one source file that send= s
> and receives=C2=A0 message to the user space.=C2=A0 I have spitted the= source code
> in two files, and now I=C2=A0 am trying to develop kernel module from = these
> source files. After compiling and linking without any problems, I insm= od
> the module but I didn=E2=80=99t see any of the printk() I wrote, in fa= ct, the
> module can be inserted and removed, but it does nothing. Code is in th= e
> attached file zipped file.
> I tried many things , e.g.,=C2=A0 link <https://paguilar.org/?p= =3D7>1, link2
> <https://www.linuxquestions.org/questions/lin= ux-kernel-70/kernel-module-with-multiple-source-files-not-initializing-8861= 90/>;,
> and link3
> <https://android.googlesource.com/kernel/msm/+/android-= msm-dory-3.10-kitkat-wear/Documentation/kbuild/modules.txt>=C2=A0etc= .
> but nothings worked out.
> I also used /nm/ to inspect the module, but, as expected, there was no= > signs of "__init and __exit" functions can in the output.
To be exact, you are looking for the hello_init function.
Since "nm" doesn't show it, it's either not there or
"static".

[ for the nm-output see in the OPs mail ]
> Can you please help me: what's the problem/mistake I am doing?
> Thank you very much.

Get rid of the "static" for the hello_init and hello_exit functio= n.

MfG,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Bernd
--
Bernd Petrovitsch=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 Email : bernd@petrovitsch.priv.at
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0LUGA : http://www.luga.at



--
Best Regards,


Mr. Irfan Ullah
PhD Candidate
Data and Knowledge Engineering(DKE) Lab
Department of Computer Science and Engineering
Kyung Hee University, South Korea.
=C2=A0+82-010-591-51651
=C2=A0sahibzada_irfanulla= h
--0000000000001d50e10595f554c9-- --===============4435518999638087802== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============4435518999638087802==--