[syslinux] [PATCH 9/9] Workaround for a buggy get info BIOS

Frediano Ziglio frediano.ziglio at citrix.com
Wed Oct 3 09:06:55 PDT 2012


It's an Amd machine with another experimental BIOS (too experiment here,
I know).

Before the patch I just called EDD get parameters type before reading
every sector of ADV. This seems to create some problems. I tried to
reset some register in order to check if code for some reason use 32bit
registers (like esi instead of si), clearing direction flag and other.
This workaround (calling just after EDD detection) works correctly and
code is also a bit smaller so I decided to include it in the patch set.

Frediano

On Wed, 2012-10-03 at 08:54 -0700, H. Peter Anvin wrote:
> Details on the affected machine?
> 
> Frediano Ziglio <frediano.ziglio at citrix.com> wrote:
> 
> >This issue drive parameters only one time to avoid to have disk read
> >failure.
> >This happened just on a specific machine, probably the BIOS is buggy
> >but
> >the fix didn't have any regression.
> >
> >Signed-off-by: Frediano Ziglio <frediano.ziglio at citrix.com>
> >---
> > core/adv.inc |   35 ++++++++++++++++++-----------------
> > 1 files changed, 18 insertions(+), 17 deletions(-)
> >
> >diff --git a/core/adv.inc b/core/adv.inc
> >index a714800..ab29fde 100644
> >--- a/core/adv.inc
> >+++ b/core/adv.inc
> >@@ -351,6 +351,23 @@ adv_read_write:
> > 		jne .noedd
> > 		test cl,1
> > 		jz .noedd
> >+
> >+		push 512
> >+		sub sp, 14h
> >+		push 0
> >+		push 1ah
> >+		mov si,sp
> >+		mov ah,48h			; EDD get drive parameters
> >+		mov dl,[ADVDrive]
> >+		push ds
> >+		push ss
> >+		pop ds
> >+		int 13h
> >+		pop ds
> >+		add sp,18h
> >+		pop ax
> >+		mov [ADVSsz], ax
> >+
> > 		mov si,.ebios
> > .noedd:
> > 
> >@@ -375,23 +392,6 @@ adv_read_write:
> > 
> > 		extern xfer_buf_seg
> > .ebios:
> >-		pusha
> >-		sub sp,1ch
> >-		push 1eh
> >-		mov si,sp
> >-		mov ah,48h			; EDD get drive parameters
> >-		mov dl,[ADVDrive]
> >-		push ds
> >-		push ss
> >-		pop ds
> >-		mov word [si+18h], 512
> >-		int 13h
> >-		mov ax, [si+18h]
> >-		pop ds
> >-		mov [ADVSsz], ax
> >-		add sp,1eh
> >-		popa
> >-
> > 		mov cx,adv_retries
> > .eb_retry:
> > 		; Form DAPA on stack
> >@@ -450,6 +450,7 @@ adv_read_write:
> > 		; copy it back
> > 		pusha
> > 		push ds
> >+		cld
> > 		mov si, di
> > 		mov di, bx
> > 		push xfer_buf_seg
> 





More information about the Syslinux mailing list