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

Loading…
Cancel
Save