<div>Hi,</div><div> The following is extracted from Documentation/x86/boot.txt,</div><div> which show's memory map when booting a kernel.</div><div><br></div><div><pre style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 0.95em; padding: 1em; color: rgb(120, 120, 120); overflow: auto; font-weight: bold; line-height: normal;"><a name="L117" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L117" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">117</a> ~ ~
<a name="L118" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L118" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">118</a> | Protected-mode kernel |
<a name="L119" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L119" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">119</a> 100000 +------------------------+
<a name="L120" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L120" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">120</a> | I/O memory hole |
<a name="L121" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L121" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">121</a> 0A0000 +------------------------+
<a name="L122" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L122" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">122</a> | Reserved for BIOS | Leave as much as possible unused
<a name="L123" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L123" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">123</a> ~ ~
<a name="L124" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L124" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">124</a> | Command line | (Can also be below the X+10000 mark)
<a name="L125" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L125" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">125</a> X+10000 +------------------------+
<a name="L126" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L126" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">126</a> | Stack/heap | For use by the kernel real-mode code.
<a name="L127" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L127" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">127</a> X+08000 +------------------------+
<a name="L128" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L128" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">128</a> | Kernel setup | The kernel real-mode code.
<a name="L129" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L129" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">129</a> | Kernel boot sector | The kernel legacy boot sector.
<a name="L130" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L130" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">130</a> X +------------------------+
<a name="L131" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L131" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">131</a> | Boot loader | <- Boot sector entry point 0000:7C00
<a name="L132" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L132" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">132</a> 001000 +------------------------+
<a name="L133" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L133" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">133</a> | Reserved for MBR/BIOS |
<a name="L134" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L134" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">134</a> 000800 +------------------------+
<a name="L135" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L135" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">135</a> | Typically used by MBR |
<a name="L136" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L136" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">136</a> 000600 +------------------------+
<a name="L137" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L137" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">137</a> | BIOS use only |
<a name="L138" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L138" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">138</a> 000000 +------------------------+</pre><pre style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 0.95em; padding: 1em; color: rgb(120, 120, 120); overflow: auto; font-weight: bold; line-height: normal;"><pre style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 0.95em; padding: 1em; overflow: auto;">where the address X is as low as the design of the boot loader
<a name="L141" href="http://lxr.free-electrons.com/source/Documentation/x86/boot.txt#L141" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153); color: black;">141</a> permits.</pre></pre></div><div>The address X is not determined by kernel, so the kernel real-mode code's VMA may not equal to LMA, how kernel solved it??</div><div><br></div><div>One more question, in ld script, does the location counter ".", represent VMA?? </div><div><br></div><div>Thanks.</div>