Browse Source

Move stack to below 0x7c00; leaving it at the default location

(0x7ef4) tends to really screw up anything that loads at 0x7c00...
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
03ca71c38d
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      src/arch/i386/prefix/dskprefix.S

+ 5
- 3
src/arch/i386/prefix/dskprefix.S View File

@@ -31,6 +31,10 @@
31 31
 
32 32
 	jmp	$BOOTSEG, $go		/* reload cs:ip to match relocation addr */
33 33
 go: 
34
+	xorw	%ax,%ax			/* put stack at 0000:7c00 */
35
+	movw	%ax,%ss
36
+	movw	$0x7c00,%sp
37
+
34 38
 	movw	$0x2000-12, %di		/* 0x2000 is arbitrary value >= length */
35 39
 					/* of bootsect + room for stack + 12 for */
36 40
 					/* saved disk parm block */
@@ -38,8 +42,6 @@ go:
38 42
 	movw	$BOOTSEG, %ax
39 43
 	movw	%ax,%ds
40 44
 	movw	%ax,%es
41
-	movw	%ax,%ss			/* put stack at BOOTSEG:0x4000-12. */
42
-	movw	%di,%sp
43 45
 
44 46
 /* Many BIOS's default disk parameter tables will not recognize multi-sector
45 47
  * reads beyond the maximum sector number specified in the default diskette
@@ -50,7 +52,7 @@ go:
50 52
  * will set the maximum sector count to 36 - the most we will encounter on an
51 53
  * ED 2.88.  High doesn't hurt.	Low does.
52 54
  *
53
- * Segments are as follows: ds=es=ss=cs - BOOTSEG
55
+ * Segments are as follows: ds=es=cs - BOOTSEG
54 56
  */
55 57
 
56 58
 	xorw	%cx,%cx

Loading…
Cancel
Save