summaryrefslogtreecommitdiffstats
path: root/sys/boot/i386
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2004-01-12 20:34:42 +0000
committerjhb <jhb@FreeBSD.org>2004-01-12 20:34:42 +0000
commitee6a0c1737a80a14501637f982468a667622dde7 (patch)
treeb9f04f79ef96b88ef65942c022a0310a6477077e /sys/boot/i386
parent17c8306530e38d2209e0f86cf2e2763dfb8b4a9f (diff)
downloadFreeBSD-src-ee6a0c1737a80a14501637f982468a667622dde7.zip
FreeBSD-src-ee6a0c1737a80a14501637f982468a667622dde7.tar.gz
- Use constant for shift when converting file length in bytes to a sector
count. - Fix the twiddle output so that it actually spins. - Save %cx around BIOS calls to read in sectors from the disc as at least one BIOS trashes %cx when called to read off of a USB CD-ROM drive. Submitted by: Martin Nilsson <martin@gneto.com> MFC after: 1 week
Diffstat (limited to 'sys/boot/i386')
-rw-r--r--sys/boot/i386/cdboot/cdboot.s7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/boot/i386/cdboot/cdboot.s b/sys/boot/i386/cdboot/cdboot.s
index dbbebdf..0b2dd99 100644
--- a/sys/boot/i386/cdboot/cdboot.s
+++ b/sys/boot/i386/cdboot/cdboot.s
@@ -165,7 +165,7 @@ lookup_found: # Found a loader file
#
mov DIR_SIZE(%bx),%eax # Read file length
add $SECTOR_SIZE-1,%eax # Convert length to sectors
- shr $11,%eax
+ shr $SECTOR_SHIFT,%eax
cmp $BUFFER_LEN,%eax
jbe load_sizeok
mov $msg_load2big,%si # Error message
@@ -400,6 +400,7 @@ ff.match: add $2,%sp # Discard saved %si
# Trashes: EAX
#
read: push %si # Save
+ push %cx # Save since some BIOSs trash
mov %eax,edd_lba # LBA to read from
mov %ebx,%eax # Convert address
shr $4,%eax # to segment
@@ -413,7 +414,8 @@ read.retry: call twiddle # Entertain the user
int $0x13 # Call BIOS
pop %dx # Restore
jc read.fail # Worked?
- pop %si # Restore
+ pop %cx # Restore
+ pop %si
ret # Return
read.fail: cmp $ERROR_TIMEOUT,%ah # Timeout?
je read.retry # Yes, Retry.
@@ -460,6 +462,7 @@ twiddle: push %ax # Save
mov twiddle_chars,%bx # Address table
inc %al # Next
and $3,%al # char
+ mov %al,twiddle_index # Save index for next call
xlat # Get char
call putc # Output it
mov $8,%al # Backspace
OpenPOWER on IntegriCloud