From: | Craig Dooley <cd5697@xxxxxxxxxx> |
Date: | Wed, 30 Jul 2003 09:59:47 -0400 |
Follow the comment in locore.s and the recent patch to FreeBSD5 and clear the bss earlier in the boot sequence. -- Craig Dooley cd5697@xxxxxxxxxx
Index: sys/i386/i386/locore.s =================================================================== RCS file: /home/dcvs/src/sys/i386/i386/locore.s,v retrieving revision 1.6 diff -u -r1.6 locore.s --- sys/i386/i386/locore.s 8 Jul 2003 06:27:26 -0000 1.6 +++ sys/i386/i386/locore.s 30 Jul 2003 13:48:49 -0000 @@ -248,6 +248,28 @@ mov %ax, %fs mov %ax, %gs +/* clear bss */ +/* + * XXX we don't check that there is memory for our bss and page tables + * before using it. + * + * XXX the boot program somewhat bogusly clears the bss. We still have + * to do it in case we were unzipped by kzipboot. Then the boot program + * only clears kzipboot's bss. + * + * XXX the gdt and idt are still somewhere in the boot program. We + * depend on the convention that the boot program is below 1MB and we + * are above 1MB to keep the gdt and idt away from the bss and page + * tables. The idt is only used if BDE_DEBUGGER is enabled. + */ + movl $R(_end),%ecx + movl $R(_edata),%edi + subl %edi,%ecx + xorl %eax,%eax + cld + rep + stosb + call recover_bootinfo /* Get onto a stack that we can trust. */ @@ -286,30 +308,6 @@ #endif call identify_cpu - -/* clear bss */ -/* - * XXX this should be done a little earlier. - * - * XXX we don't check that there is memory for our bss and page tables - * before using it. - * - * XXX the boot program somewhat bogusly clears the bss. We still have - * to do it in case we were unzipped by kzipboot. Then the boot program - * only clears kzipboot's bss. - * - * XXX the gdt and idt are still somewhere in the boot program. We - * depend on the convention that the boot program is below 1MB and we - * are above 1MB to keep the gdt and idt away from the bss and page - * tables. The idt is only used if BDE_DEBUGGER is enabled. - */ - movl $R(_end),%ecx - movl $R(_edata),%edi - subl %edi,%ecx - xorl %eax,%eax - cld - rep - stosb call create_pagetables
Attachment:
pgp00001.pgp
Description: signature