<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body>
<div id="contentDescription" style="line-height:1.5;text-align:justify;text-justify:inter-ideograph">
<div><br></div><div>Thank you mike!</div><div>so ,after the first instruction ,rbp contains the offset of actually loaded address, which equals the physical address. </div><div><br></div><div style="text-align: start;">$_text - <span style="text-align: justify; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.301961); -webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><font color="#000000" face="-webkit-standard" size="3">__START_KERNEL_map contains the expected physical address .</font></span></div><div style="text-align: justify;"><font color="#000000" face="-webkit-standard" size="3"><span style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.301961); -webkit-text-size-adjust: auto;">Right ?</span></font></div>
<div class="borderFixWidth iMailDoNotReScale" style="background-color:#f2f2f2;color:black;padding-top:6px;padding-bottom:6px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;margin-top:45px;margin-bottom:20px;"><div style="font-size:14px;line-height:1.5;word-break:break-all;margin-left:10px;margin-right:10px">在2015年12月30日 19:35,<a style="text-decoration:none;color:#2a97ff;" href="mailto:krinkin.m.u@gmail.com">Mike Krinkin</a> 写道:</div></div><blockquote id="ntes-iosmail-quote" style="margin:0">On Wed, Dec 30, 2015 at 06:45:40PM +0800, xiaoqiang zhao wrote:
<br>> Hello:
<br>>
<br>> After kernel is decompressed, the kernel will execute startup_64 and
<br>> the first two instructions are:
<br>>
<br>> leaq _text(%rip), %rbp
<br>
<br>this gets an actual address of kernel code in rbp register (which might
<br>differ from an address where kernel is compiled to run)
<br>
<br>> subq $_text - __START_KERNEL_map, %rbp
<br>
<br>__START_KERNEL_map is an expected addres of kernel code, i. e. where
<br>kernel is compiled to run.
<br>
<br>So rbp contains difference between address where kernel is loaded and
<br>address where it is expected to be loaded.
<br>
<br>>
<br>> I tried to understand them but can not figure out what rbp contains
<br>> after this two instructions. Anybody give me a clear explanation?
<br>>
<br>> Thanks a lot!
<br>>
<br>> _______________________________________________
<br>> Kernelnewbies mailing list
<br>> Kernelnewbies@kernelnewbies.org
<br>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
<br></blockquote>
</div>
</body></html>