On 01/09/2013 02:05 PM, H. Peter Anvin wrote: > On 01/09/2013 02:02 PM, Jordan Justen wrote: >> On Wed, Jan 9, 2013 at 11:12 AM, David Woodhouse <dw...@infradead.org> wrote: >>> We're supposed to zero everything in the kernel bootparams that we don't >>> explicitly initialise, other than the setup_header from 0x1f1 onwards >>> for a precisely defined length, which is copied from the bzImage. >>> >>> We're *not* supposed to just pass the garbage that we happened to find >>> in the bzImage file surrounding the setup_header. >> >> In which case might this be garbage? A PE/COFF based image? >> > > For all kernels. For non-EFI-stub kernels there will be a dummy boot > sector there; there is also garbage *after* the initialized header. > >> For non-PE/COFF kernels, will be potentially be zero'ing out valuable >> config information built into the image? >> > > No. >
As a clarification: what the spec specifies -- and the 16-bit BIOS stub built into the kernel implements nowadays -- is to take a 4K long page of bss memory and zero it, then copy the specific initialized structure starting at 0x1f1 and with the length given by the byte at 0x201. This is of course equivalent to copying the first 4K of the file and zeroing out the head and tail, but it might be more intuitive to think about. -hpa ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412 _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel