diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2012-10-28 15:24:42 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2012-10-28 15:24:42 +0000 |
commit | c77c384636e17e99c414fa2afdee2af456450624 (patch) | |
tree | 5234f5e646561052a2706ae1baad21fe818e616c /sys/arch/amd64/stand | |
parent | 7e96585807cb7b376818a918f15810d2e420d372 (diff) |
Save and restore %ebx across the call to read. Otherwise we load the first
64KB segment at 0x7c00 and any additional 64KB segments over top of each
other at 0x10000.
Diffstat (limited to 'sys/arch/amd64/stand')
-rw-r--r-- | sys/arch/amd64/stand/cdbr/cdbr.S | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/amd64/stand/cdbr/cdbr.S b/sys/arch/amd64/stand/cdbr/cdbr.S index de2c4a03ac8..ae29d0e14ab 100644 --- a/sys/arch/amd64/stand/cdbr/cdbr.S +++ b/sys/arch/amd64/stand/cdbr/cdbr.S @@ -1,4 +1,4 @@ -/* $OpenBSD: cdbr.S,v 1.2 2004/08/24 15:33:25 tom Exp $ */ +/* $OpenBSD: cdbr.S,v 1.3 2012/10/28 15:24:41 jsing Exp $ */ /* * Copyright (c) 2004 Tom Cosgrove <tom.cosgrove@arches-consulting.com> @@ -204,9 +204,11 @@ load_loop: load_notrunc: subb %dh, %cl /* Update count */ pushl %eax /* Save */ - movw %bx, %es /* %bx had the segment (para) number */ - xorw %bx, %bx /* %es:0000 for destination */ + pushl %ebx /* Save */ + movw %bx, %es /* %bx has the segment (para) number */ + xorw %bx, %bx /* %es:0000 for destination */ call read /* Read it in */ + popl %ebx /* Restore */ popl %eax /* Restore */ addl $MAX_READ_SEC, %eax /* Update LBA */ addw $MAX_READ_PARAS, %bx /* Update dest addr */ |