From 9147554cd1ab47d51fd4f50a001f05fa665ecfd0 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 4 Jun 2009 17:24:58 -0700 Subject: core: prevent buggy INT 13h from leaving IF=0 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 --- core/diskstart.inc | 8 +++++++- core/extlinux.asm | 4 ++-- 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. -- cgit v1.2.1