summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-06-04 17:24:58 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-06-04 17:24:58 -0700
commit9147554cd1ab47d51fd4f50a001f05fa665ecfd0 (patch)
treec7ecf4a6437f234617bc5dbde6f78fc111c5013f
parented6f352b62233c155abf446f57d2b9dc7a6b1e87 (diff)
downloadsyslinux-9147554cd1ab47d51fd4f50a001f05fa665ecfd0.tar.gz
core: prevent buggy INT 13h from leaving IF=0syslinux-3.82-pre4
If it can happen for CD-ROM BIOSes, it can probably happen elsewhere, too; make sure we don't leave interrupts disabled after broken INT 13h calls. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--core/diskstart.inc8
-rw-r--r--core/extlinux.asm4
2 files changed, 9 insertions, 3 deletions
diff --git a/core/diskstart.inc b/core/diskstart.inc
index c3881eab..53229223 100644
--- a/core/diskstart.inc
+++ b/core/diskstart.inc
@@ -503,6 +503,7 @@ ldlinux_ent:
;
jmp 0:.next
.next:
+ sti ; In case of broken INT 13h BIOSes
;
; Tell the user we got this far
@@ -609,11 +610,16 @@ writestr_early:
ret
+;
; getlinsecsr: save registers, call getlinsec, restore registers
+; Save/restore the flags, too, especially IF.
;
-getlinsecsr: pushad
+getlinsecsr:
+ pushfd
+ pushad
call getlinsec
popad
+ popfd
ret
;
diff --git a/core/extlinux.asm b/core/extlinux.asm
index 46faac55..ac5fb6f0 100644
--- a/core/extlinux.asm
+++ b/core/extlinux.asm
@@ -116,7 +116,7 @@ Files resb MAX_OPEN*open_file_t_size
mov bx,SuperBlock
mov eax,1024 >> SECTOR_SHIFT
mov bp,ax
- call getlinsec
+ call getlinsecsr
;
; Compute some values...
@@ -208,7 +208,7 @@ getonesec_ext:
getlinsec_ext:
cmp eax,[SecPerClust]
- jae getlinsec ; Nothing fancy
+ jae getlinsecsr ; Nothing fancy
; If we get here, at least part of what we want is in the
; zero block. Zero one sector at a time and loop.