Clear bss earlier

Craig Dooley cd5697 at albany.edu
Wed Jul 30 07:01:37 PDT 2003


Follow the comment in locore.s and the recent patch to FreeBSD5 and clear the 
bss earlier in the boot sequence.
-- 
Craig Dooley						 cd5697 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00001.pgp
Type: application/octet-stream
Size: 187 bytes
Desc: "Description: signature"
URL: <http://lists.dragonflybsd.org/pipermail/submit/attachments/20030730/575ec587/attachment-0013.obj>


More information about the Submit mailing list