All of lore.kernel.org
 help / color / mirror / Atom feed
From: sundarcs@gwu.edu (Sunny)
To: kernelnewbies@lists.kernelnewbies.org
Subject: [kernel]which the file define the variable of "phys_base"?
Date: Mon, 24 Feb 2014 13:33:48 -0500	[thread overview]
Message-ID: <279E4871-8503-46A7-93EF-A7ED65CBDF50@gwu.edu> (raw)
In-Reply-To: <CA+5jrfnaVzJgoWjb2TE=qNSFWB9uJQBs5HyLtkeSzOcprynv6Q@mail.gmail.com>

Hi,

I?m not sure about the ?pays_base? warning, but your code runs fine in my machine. What happens if you ignore the warning and load the module anyway?

- Sunny

On Feb 24, 2014, at 9:04 AM, lx <lxlenovostar@gmail.com> wrote:

> hi all:
>       the codes is:
> #########################################
> #include <linux/module.h>               // for printk()
> #include <linux/mm.h>             // for struct page
> #include <asm/page.h>             // for struct page
> #include <asm/pgtable.h>                // for ZERO_PAGE
> 
> static int __init init_hello( void )
> {
>         int i;
>         struct page * zero_page;
>         printk( "\n   Kello, the first! \n\n" );
>         i = 0x100;
>         zero_page = ZERO_PAGE(&i);
>         printk(" the ZERO address is %p", zero_page);
>         return  0;
> }
> 
> static void __exit exit_hello( void )
> {
>         printk( "\n   Goodbye now... \n\n" );
> }
> 
> MODULE_LICENSE("GPL");
> module_init(init_hello);
> module_exit(exit_hello);
> #########################################
> 
> I complier it. by:
> #########################################
> make -C /lib/modules/`uname -r`/build M=`pwd`
> #########################################
> 
> the results is:
> #########################################
> [root at localhost kernel_test]# make -C /lib/modules/`uname -r`/build M=`pwd`
> make: Entering directory `/usr/src/kernels/2.6.18-308.el5-x86_64'
>   CC [M]  /opt/lx/kernel/kernel_test/zero.o
>   Building modules, stage 2.
>   MODPOST
> WARNING: "phys_base" [/opt/lx/kernel/kernel_test/zero.ko] undefined!
>   LD [M]  /opt/lx/kernel/kernel_test/zero.ko
> make: Leaving directory `/usr/src/kernels/2.6.18-308.el5-x86_64'
> #########################################
> 
> I try to find the file which defined the "phys_base", for examples;
> phys_base
> 
> Defined as a variable in:
> arch/sparc/mm/init.c, line 40
> arch/sparc64/kernel/sparc64_ksyms.c, line 110
> arch/sparc64/mm/init.c, line 47
> include/asm-sparc/page.h, line 160
> include/asm-sparc/pgtable.h, line 122
> include/asm-sparc64/pgtable.h, line 227
> 
> But I can't find the file of init.c in my computer. Please tell me some ways to solve it, thank you.
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140224/94dc9261/attachment.html 

  reply	other threads:[~2014-02-24 18:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-24 14:04 [kernel]which the file define the variable of "phys_base"? lx
2014-02-24 18:33 ` Sunny [this message]
     [not found]   ` <CA+5jrfmAX7GR=TLD3GHqSnyek56mgZQ9uyw2WirJhEr9om7q_Q@mail.gmail.com>
2014-02-25 12:54     ` Sunny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=279E4871-8503-46A7-93EF-A7ED65CBDF50@gwu.edu \
    --to=sundarcs@gwu.edu \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.