From a598db0083212e273ae26daa59426c4ba169554a Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Wed, 31 Oct 2012 14:29:59 +0000 Subject: 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. --- sys/arch/i386/stand/cdbr/cdbr.S | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys') diff --git a/sys/arch/i386/stand/cdbr/cdbr.S b/sys/arch/i386/stand/cdbr/cdbr.S index e9947c2cbe2..2089c8b49d8 100644 --- a/sys/arch/i386/stand/cdbr/cdbr.S +++ b/sys/arch/i386/stand/cdbr/cdbr.S @@ -1,4 +1,4 @@ -/* $OpenBSD: cdbr.S,v 1.2 2004/08/24 15:24:05 tom Exp $ */ +/* $OpenBSD: cdbr.S,v 1.3 2012/10/31 14:29:58 jsing Exp $ */ /* * Copyright (c) 2004 Tom Cosgrove @@ -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 */ -- cgit v1.2.3