<div dir="ltr">Hi All,<br><span style="color:rgb(32,56,100);font-family:'Times New Roman',serif;font-size:12pt"><br>I am using coreboot with seabios payload to boot to Win7.</span><p class="MsoNormal"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(32,56,100)">But sometimes Seabios is not able to find its own CBFS partition
in the coreboot image and causes the exception and does not boot OS.</span></p>

<p class="MsoNormal"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(32,56,100)"> </span></p>

<p class="MsoNormal"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(32,56,100)">Below is source code which throws exception:</span></p>

<p class="MsoNormal"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(32,56,100)">In SeaBIOS config value, the default value of
CONFIG_CBFS_LOCATION  is set to Zero.</span></p>

<p class="MsoNormal"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(32,56,100)"> </span></p>

<p class="MsoNormal" style="margin-left:37.5pt;text-align:justify;line-height:150%;background-image:initial;background-repeat:initial"><span style="font-size:12pt;line-height:150%;font-family:'Times New Roman',serif;color:black;background:yellow">struct cbfs_header *hdr = *(void <b>**</b>)(CONFIG_CBFS_LOCATION - 4);</span><span style="font-size:12pt;line-height:150%;font-family:'Times New Roman',serif;color:black"></span></p>

<p class="MsoNormal" style="margin-left:37.5pt;text-align:justify;line-height:150%;background-image:initial;background-repeat:initial"><span style="font-size:12pt;line-height:150%;font-family:'Times New Roman',serif;color:black">   if ((u32)hdr
& 0x03) {</span></p>

<p class="MsoNormal" style="margin-left:37.5pt;text-align:justify;line-height:150%;background-image:initial;background-repeat:initial"><span style="font-size:12pt;line-height:150%;font-family:'Times New Roman',serif;color:black">       
dprintf(1, "Invalid CBFS pointer %p\n", hdr);</span></p>

<p class="MsoNormal" style="margin-left:37.5pt;text-align:justify;line-height:150%;background-image:initial;background-repeat:initial"><span style="font-size:12pt;line-height:150%;font-family:'Times New Roman',serif;color:black">       
return;</span></p>

<p class="MsoNormal" style="margin-left:37.5pt;text-align:justify;line-height:150%;background-image:initial;background-repeat:initial"><span style="font-size:12pt;line-height:150%;font-family:'Times New Roman',serif;color:black">    }</span></p>

<p class="MsoNormal"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(32,56,100)">Here CBFS header pointer *hdr points to valid address 0xfffffc10
( that is being calculated from (CONFIG_CBFS_LOCATION – 4)) </span></p>

<p class="MsoNormal"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(32,56,100)">but sometimes CBFS header pointer *hdr is invalid and points to
0xffffffff, thus SeaBIOS  does not execute further ROM code e.g. VGA
option ROM.</span></p>

<p class="MsoNormal"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(32,56,100)"> </span></p>

<p class="MsoNormal"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(32,56,100)">As we know the address of  seabios CBFS hdr pointer so
either we can hard code the config Variable CONFIG_CBFS_LOCATION  to value
0xfffffc14</span></p>

<p class="MsoNormal"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(32,56,100)">OR we can assign *hdr to address 0xfffffc10 in source code.</span></p>

<p class="MsoNormal"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(32,56,100)"> </span></p>

<p class="MsoNormal" style="margin-left:37.5pt;text-align:justify;line-height:150%;background-image:initial;background-repeat:initial"><span style="font-size:12pt;line-height:150%;font-family:'Times New Roman',serif;color:black">struct cbfs_header *hdr =
*(void <b>**</b>)(CONFIG_CBFS_LOCATION - 4);</span></p>

<p class="MsoNormal" style="margin-left:37.5pt;text-align:justify;line-height:150%;background-image:initial;background-repeat:initial"><span style="font-size:12pt;line-height:150%;font-family:'Times New Roman',serif;color:black">   if ((u32)hdr
& 0x03) {</span></p>

<p class="MsoNormal" style="margin-left:37.5pt;text-align:justify;line-height:150%;background-image:initial;background-repeat:initial"><span style="font-size:12pt;line-height:150%;font-family:'Times New Roman',serif;color:black">       
dprintf(1, "Invalid CBFS pointer %p\n", hdr);</span></p>

<p class="MsoNormal" style="margin-left:37.5pt;text-align:justify;line-height:150%;background-image:initial;background-repeat:initial"><span style="font-size:12pt;line-height:150%;font-family:'Times New Roman',serif;color:black">       
<span style="background:yellow">hdr=0xfffffc10;</span></span></p>

<p class="MsoNormal" style="margin-left:37.5pt;text-align:justify;line-height:150%;background-image:initial;background-repeat:initial"><span style="font-size:12pt;line-height:150%;font-family:'Times New Roman',serif;color:black">    }</span></p><div><br>Please let me know if any information.</div>-- <br><div class="gmail_signature">Thanks,<div>Rajashaker Goud Ranga</div></div>
</div>