<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:΢ÈíÑźÚ
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
That's a amazing work<BR>Get code ,Seems that in csm.c <BR> <BR>csm.h --> LegacyBios.h and add UINT8/UINT16/UINT32 type definations, otherwise compile error<br> <BR>Thanks!<BR><div><div id="SkyDrivePlaceholder"> </div><div> </div>From: dwmw2@infradead.org<br>To: kevin@koconnor.net<br>Date: Fri, 18 Jan 2013 01:20:05 +0000<br>CC: seabios@seabios.org<br>Subject: Re: [SeaBIOS] [WIP PATCH 3/3] Add initial CSM support<br><br><pre>On Thu, 2013-01-17 at 19:58 -0500, Kevin O'Connor wrote:<br>> Looks like you forgot to include csm.h in the patch.<br> <br>Oops, sorry. Added in the git tree at<br>   <a href="http://git.infradead.org/users/dwmw2/seabios.git" target="_blank">http://git.infradead.org/users/dwmw2/seabios.git</a><br>    git://git.infradead.org/users/dwmw2/seabios.git<br> <br>> > +#include "util.h" // checksum<br>> > +#include "bregs.h"<br>> > +<br>> > +<br>> > +#if CONFIG_CSM<br>> > +extern void entry_csm16(void);<br>> > +EFI_COMPATIBILITY16_TABLE csm_compat_table VAR16EXPORT __aligned(16) = {<br>> > +        .Signature = 0x24454649,<br>> > +   .TableChecksum = 0 /* Filled in by checkrom.py */,<br>> > + .TableLength = sizeof(csm_compat_table),<br>> > +   .Compatibility16CallSegment = SEG_BIOS,<br>> > +    .Compatibility16CallOffset = 0 /* Filled in by checkrom.py */,<br>> > +     .OemIdStringPointer = (u32)"SeaBIOS",<br>> > +};<br>> > +#endif<br>> <br>> Does this table have to be in the f-segment, or can it be anywhere in<br>> the binary?  BTW, how does OVMF know where to place the seabios blob<br>> in memory?<br> <br>It can be anywhere in memory. OVMF loads the blob so that it ends at<br>1MiB.<br> <br>> Are these values that SeaBIOS is expected to fill, or values from EFI<br>> that SeaBIOS is expected to utilize?  In either case it shouldn't be<br>> difficult to wire them into SeaBIOS' existing structures.  <br> <br>There is a mixture of both. The ACPI one we *need* to point at a buffer<br>which is big enough to hold the table. Leave it at zero, and OVMF will<br>scribble an ACPI table over the interrupt vectors and then promptly go<br>off into the weeds the next time a timer interrupt comes in (hence the<br>problem I was seeing when I posted the patches).<br> <br>Others it'll call the 'GetTableAddress' call (which is actually malloc)<br>and then fill in the address it's given.<br> <br>More details at<br><a href="http://www.intel.com/content/dam/doc/reference-guide/efi-compatibility-support-module-specification-v097.pdf" target="_blank">http://www.intel.com/content/dam/doc/reference-guide/efi-compatibility-support-module-specification-v097.pdf</a><br> <br>> I'd need to<br>> see csm.h to confirm, but it mostly looks like it requires some<br>> function calls and variable assignments.<br> <br>Yeah, I figured it shouldn't be *so* hard. We'll get handed a full E820<br>table instead of our own for example. In memory which OVMF allocated by<br>calling the GetTableAddress function.<br> <br>> [...]<br>> > +/* Legacy16GetTableAddress */<br>> > +void handle_csm_0006(struct bregs *regs)<br>> > +{<br>> > +    u16 size = regs->cx;<br>> > +    u16 align = regs->dx;<br>> > +   u16 region = regs->bx; // (1 for F000 seg, 2 for E000 seg, 0 for either)<br>> > +        void *chunk;<br>> > +<br>> > +  /* FIXME: I don't know if we can allocate in the E000 segment at all. */<br>> > +   dprintf(3, "Legacy16GetTableAddress size %x align %x region %d\n",<br>> > +               size, align, region);<br>> > +      chunk = pmm_malloc(&ZoneFSeg, PMM_DEFAULT_HANDLE, size, align);<br>> <br>> This is the same as malloc_fseg(). <br> <br>Apart from the alignment. Which is a power of two, yes. I'll fix it to<br>use ZoneLow for the e-segment too; thanks. If no preference is expressed<br>by the caller, should I try ZoneLow first? That'll be larger, right?<br> <br>> BTW, SeaBIOS uses 4 space indentation and no tabs.<br> <br>I must teach emacs that rather than attempting to fix it up manually<br>when I notice that it's not conforming... :)<br> <br>-- <br>dwmw2<br> <br></pre><br>_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
http://www.seabios.org/mailman/listinfo/seabios</div>                                       </div></body>
</html>