<div dir="ltr">hi all:<div> the codes is:</div><div>#########################################</div><div><div>#include <linux/module.h> // for printk()</div><div>#include <linux/mm.h> // for struct page</div>
<div>#include <asm/page.h> // for struct page</div><div>#include <asm/pgtable.h> // for ZERO_PAGE</div><div><br></div><div>static int __init init_hello( void )</div><div>{</div><div>
int i;</div><div> struct page * zero_page;</div><div> printk( "\n Kello, the first! \n\n" );</div><div> i = 0x100;</div><div> zero_page = ZERO_PAGE(&i);</div><div> printk(" the ZERO address is %p", zero_page);</div>
<div> return 0;</div><div>}</div><div><br></div><div>static void __exit exit_hello( void )</div><div>{</div><div> printk( "\n Goodbye now... \n\n" );</div><div>}</div><div><br></div><div>MODULE_LICENSE("GPL");</div>
<div>module_init(init_hello);</div><div>module_exit(exit_hello);</div></div><div>#########################################</div><div><br></div><div>I complier it. by:</div><div>#########################################</div>
<div>make -C /lib/modules/`uname -r`/build M=`pwd`<br></div><div>#########################################</div><div><br></div><div>the results is:</div><div>#########################################</div><div><div>[root@localhost kernel_test]# make -C /lib/modules/`uname -r`/build M=`pwd`</div>
<div>make: Entering directory `/usr/src/kernels/2.6.18-308.el5-x86_64'</div><div> CC [M] /opt/lx/kernel/kernel_test/zero.o</div><div> Building modules, stage 2.</div><div> MODPOST</div><div><span style="background-color:rgb(255,255,255)"><b><font color="#ff0000">WARNING: "phys_base" [/opt/lx/kernel/kernel_test/zero.ko] undefined!</font></b></span></div>
<div> LD [M] /opt/lx/kernel/kernel_test/zero.ko</div><div>make: Leaving directory `/usr/src/kernels/2.6.18-308.el5-x86_64'</div></div><div>#########################################</div><div><br></div><div>I try to find the file which defined the "phys_base", for examples;</div>
<div><h1 style="font-family:'Trebuchet MS','Lucida Grande',Verdana,Arial,sans-serif;color:black;font-size:1.3em">phys_base</h1><span style="color:rgb(120,120,120);font-family:'Lucida Grande',Verdana,Arial,sans-serif;font-size:14px;background-color:rgb(51,51,51)">Defined as a variable in:</span><ul style="margin-top:0.5em;color:rgb(120,120,120);font-family:'Lucida Grande',Verdana,Arial,sans-serif;font-size:14px">
<li style="margin-top:0.35em"><a href="http://lxr.oss.org.cn/source/arch/sparc/mm/init.c?v=2.6.8#L40" style="text-decoration:none;border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(153,153,153);color:white;background-image:none;background-color:rgb(51,51,51)">arch/sparc/mm/init.c, line 40</a></li>
<li style="margin-top:0.35em"><a href="http://lxr.oss.org.cn/source/arch/sparc64/kernel/sparc64_ksyms.c?v=2.6.8#L110" style="text-decoration:none;border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(153,153,153);color:white;background-color:rgb(51,51,51)">arch/sparc64/kernel/sparc64_ksyms.c, line 110</a></li>
<li style="margin-top:0.35em"><a href="http://lxr.oss.org.cn/source/arch/sparc64/mm/init.c?v=2.6.8#L47" style="text-decoration:none;border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(153,153,153);color:white;background-color:rgb(51,51,51)">arch/sparc64/mm/init.c, line 47</a></li>
<li style="margin-top:0.35em"><a href="http://lxr.oss.org.cn/source/include/asm-sparc/page.h?v=2.6.8#L160" style="text-decoration:none;border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(153,153,153);color:white;background-color:rgb(51,51,51)">include/asm-sparc/page.h, line 160</a></li>
<li style="margin-top:0.35em"><a href="http://lxr.oss.org.cn/source/include/asm-sparc/pgtable.h?v=2.6.8#L122" style="text-decoration:none;border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(153,153,153);color:white;background-color:rgb(51,51,51)">include/asm-sparc/pgtable.h, line 122</a></li>
<li style="margin-top:0.35em"><a href="http://lxr.oss.org.cn/source/include/asm-sparc64/pgtable.h?v=2.6.8#L227" style="text-decoration:none;border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(153,153,153);color:white;background-color:rgb(51,51,51)">include/asm-sparc64/pgtable.h, line 227</a></li>
</ul></div><div><br></div><div>But I can't find the file of init.c in my computer. Please tell me some ways to solve it, thank you.</div><div><br></div></div>