From c691269f0bc370016362d50c5e25e4fd7b4eecdd Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 19 Sep 2007 23:13:13 -0700 Subject: [PATCH] ISOLINUX: save segment registers around INT 13h There is at least one set of CD-ROM BIOSes out there which corrupt FS on INT 13h, so save and restore all segment registers around INT 13h. --- NEWS | 2 ++ isolinux.asm | 25 +++++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index e9a741c..9d8b738 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,8 @@ Changes in 3.52: * pcitest.c32: now functions as a full "lspci". Thanks to Erwan Velu for this work. * MEMDISK: Make EDD actually work. + * ISOLINUX: Fix for certain broken CD-ROM BIOSes which + randomly corrupted register FS. Changes in 3.51: * EXTLINUX: Fix failure to find the configuration file. diff --git a/isolinux.asm b/isolinux.asm index c8cc647..8f0a28a 100644 --- a/isolinux.asm +++ b/isolinux.asm @@ -297,7 +297,7 @@ initial_csum: xor edi,edi mov ax,4B01h ; Get disk emulation status mov dl,[DriveNo] mov si,spec_packet - int 13h + call int13 jc award_hack ; changed for BrokenAwardHack mov dl,[DriveNo] cmp [sp_drive],dl ; Should contain the drive number @@ -570,7 +570,7 @@ spec_query_failed: mov ax,4B01h mov si,spec_packet mov byte [si],13 ; Size of buffer - int 13h + call int13 popa jc .still_broken @@ -657,6 +657,23 @@ writechr_simple: ret ; +; int13: save all the segment registers and call INT 13h +; Some CD-ROM BIOSes have been found to corrupt segment registers. +; +int13: + + push ds + push es + push fs + push gs + int 13h + pop gs + pop fs + pop es + pop ds + ret + +; ; Get one sector. Convenience entry point. ; getonesec: @@ -707,7 +724,7 @@ getlinsec: ; INT 13h with retry xint13: mov byte [RetryCount],retry_count .try: pushad - int 13h + call int13 jc .error add sp,byte 8*4 ; Clean up stack ret @@ -1051,7 +1068,7 @@ is_disk_image: lss sp,[InitStack] TRACER 'X' - int 13h + call int13 ; If this returns, we have problems .bad_image: -- 2.7.4