[kernel]which the file define the variable of "phys_base"?
lx
lxlenovostar at gmail.com
Mon Feb 24 09:04:30 EST 2014
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_baseDefined as a variable in:
- arch/sparc/mm/init.c, line
40<http://lxr.oss.org.cn/source/arch/sparc/mm/init.c?v=2.6.8#L40>
- arch/sparc64/kernel/sparc64_ksyms.c, line
110<http://lxr.oss.org.cn/source/arch/sparc64/kernel/sparc64_ksyms.c?v=2.6.8#L110>
- arch/sparc64/mm/init.c, line
47<http://lxr.oss.org.cn/source/arch/sparc64/mm/init.c?v=2.6.8#L47>
- include/asm-sparc/page.h, line
160<http://lxr.oss.org.cn/source/include/asm-sparc/page.h?v=2.6.8#L160>
- include/asm-sparc/pgtable.h, line
122<http://lxr.oss.org.cn/source/include/asm-sparc/pgtable.h?v=2.6.8#L122>
- include/asm-sparc64/pgtable.h, line
227<http://lxr.oss.org.cn/source/include/asm-sparc64/pgtable.h?v=2.6.8#L227>
But I can't find the file of init.c in my computer. Please tell me some
ways to solve it, thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140224/be096350/attachment.html
More information about the Kernelnewbies
mailing list