Skip to content

Commit

Permalink
[liba20] Preserve all non-segment registers when calling INT 15,2401
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mcb30 committed Oct 25, 2011
1 parent 4d8a009 commit c77aece
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/arch/i386/transitions/liba20.S
Expand Up @@ -96,8 +96,11 @@ test_a20_long:
.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
Expand All @@ -108,7 +111,7 @@ enable_a20_bios:
call test_a20_short

99: /* Restore registers and return */
popw %ax
popal
ret
.size enable_a20_bios, . - enable_a20_bios

Expand Down

0 comments on commit c77aece

Please sign in to comment.