Module Name: src
Committed By: maxv
Date: Thu Aug 10 14:13:45 UTC 2017
Switch to the temporary stack right away when booted via multiboot. GRUB
happens to give a correct stack, but it is not guaranteed by the spec. This
temporary stack will be reset later, which is fine.
To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/i386/i386/locore.S
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diff -u src/sys/arch/i386/i386/locore.S:1.149 src/sys/arch/i386/i386/locore.S:1.150
--- src/sys/arch/i386/i386/locore.S:1.149 Sat Jul 29 12:34:34 2017
+++ src/sys/arch/i386/i386/locore.S Thu Aug 10 14:13:45 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.149 2017/07/29 12:34:34 maxv Exp $ */
+/* $NetBSD: locore.S,v 1.150 2017/08/10 14:13:45 maxv Exp $ */
@@ -128,7 +128,7 @@
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.149 2017/07/29 12:34:34 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.150 2017/08/10 14:13:45 maxv Exp $");
@@ -342,11 +342,13 @@ _C_LABEL(Multiboot_Header):
- * Indeed, a multiboot-compliant boot loader executed us. We copy
- * the received Multiboot information structure into kernel's data
- * space to process it later -- after we are relocated. It will
- * be safer to run complex C code than doing it at this point.
+ * Indeed, a multiboot-compliant boot loader executed us. We switch
+ * to the temporary stack, and copy the received Multiboot information
+ * structure into kernel's data space to process it later -- after we
+ * are relocated. It will be safer to run complex C code than doing it
+ * at this point.
+ movl $_RELOC(tmpstk),%esp
pushl %ebx /* Address of Multiboot information */