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>
.section ".text16.early", "awx", @progbits
.code16
enable_a20_bios:
- /* Preserve registers */
- pushw %ax
+
+ /* Preserve registers. Be very paranoid, since some BIOSes
+ * are reported to clobber %ebx
+ */
+ pushal
/* Attempt INT 15,2401 */
movw $0x2401, %ax
call test_a20_short
99: /* Restore registers and return */
- popw %ax
+ popal
ret
.size enable_a20_bios, . - enable_a20_bios