浏览代码

[liba20] Preserve all non-segment registers when calling INT 15,2401

Some BIOSes are reported to corrupt %ebx when using INT 15,2401 (see
http://opensolaris.org/jive/thread.jspa?messageID=377026).  Guard
against this by preserving all (non-segment) registers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 年前
父节点
当前提交
c77aece36a
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6
    3
      src/arch/i386/transitions/liba20.S

+ 6
- 3
src/arch/i386/transitions/liba20.S 查看文件

@@ -96,8 +96,11 @@ test_a20_long:
96 96
 	.section ".text16.early", "awx", @progbits
97 97
 	.code16
98 98
 enable_a20_bios:
99
-	/* Preserve registers */
100
-	pushw	%ax
99
+
100
+	/* Preserve registers.  Be very paranoid, since some BIOSes
101
+	 * are reported to clobber %ebx
102
+	 */
103
+	pushal
101 104
 
102 105
 	/* Attempt INT 15,2401 */
103 106
 	movw	$0x2401, %ax
@@ -108,7 +111,7 @@ enable_a20_bios:
108 111
 	call	test_a20_short
109 112
 
110 113
 99:	/* Restore registers and return */
111
-	popw	%ax
114
+	popal
112 115
 	ret
113 116
 	.size	enable_a20_bios, . - enable_a20_bios
114 117
 

正在加载...
取消
保存