==== //depot/yahoo/ybsd_4/src/sys/i386/i386/machdep.c#8 - /home/peter/ybsd_4/src/sys/i386/i386/machdep.c ==== @@ -1804,6 +1804,35 @@ phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); avail_end = phys_avail[pa_indx]; + + if ((cp = getenv("hw.noclearmem")) != NULL) + return; + /* + * Clear all memory outside the message buffer. + * Certain versions of the Tyan 2510 bios do not + * clear extended memory to initialize the ECC system. + */ + pte = (pt_entry_t)CMAP1; + for (i = 0; i <= pa_indx; i += 2) { + vm_offset_t end; + int *ptr = (int *)CADDR1; + + end = phys_avail[i + 1]; + for (pa = phys_avail[i]; pa < end; pa += PAGE_SIZE) { + /* Do not bzero the kernel... */ + if (pa >= 0x100000 && pa < first) + continue; + + /* Map page into kernel: valid, read/write */ + *pte = pa | PG_V | PG_RW; + invltlb(); + + /* Clear the page */ + bzero(ptr, PAGE_SIZE); + } + } + *pte = 0; + invltlb(); } void