diff options
authorH. Peter Anvin <hpa@zytor.com>2008-10-15 08:52:54 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-10-15 08:52:54 -0700
commit5ae9675217168272e645bca55ddc7b7ba1400dbd (patch)
parent57538d7f56b33d2b9a93b7c71f28af4c28f8ac0e (diff)
MEMDISK: in safeint mode, don't bother testing for unchanged INT 15hsyslinux-3.73-pre4
In safeint mode, don't bother testing for unchanged INT 15h. It points back at ourselves, anyway, and we end up doing, in the end, the same thing as the safeint stub would do. Furthermore, the test was broken for years, and so this is actually closer to what we originally tested. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
1 files changed, 14 insertions, 26 deletions
diff --git a/memdisk/memdisk.asm b/memdisk/memdisk.asm
index 1fd3329f..0d489614 100644
--- a/memdisk/memdisk.asm
+++ b/memdisk/memdisk.asm
@@ -630,38 +630,17 @@ bcopy:
mov bx, real_int15_stub
test byte [ConfigFlags], CONFIG_RAW|CONFIG_SAFEINT
- jz .anymode
+ jz .anymode ; Always do the real INT 15h
smsw ax ; Unprivileged!
test al,01h
- jnz .protmode
+ jnz .protmode ; Protmode -> do real INT 15h
- test byte [ConfigFlags], CONFIG_RAW
- jnz .raw
+ ; Raw or Safeint mode, and we're in real mode...
- ; We're in real mode with CONFIG_SAFEINT, invoke INT 15h
- ; directly if the vector is unchanged, otherwise invoke
- ; the *old* INT 15h vector.
- push ds
- xor ax, ax
- mov ds,ax
- cmp word [4*0x15], Int15Start
- jne .changed
- mov ax, cs
- cmp word [4*0x15+2], ax
- jne .changed
- pop ds
- jmp .anymode ; INT 15h unchanged, safe to execute
-.changed: ; INT 15h modified, execute *old* INT 15h
- pop ds
- mov bx, fake_int15_stub
- jmp .anymode
+ test byte [ConfigFlags], CONFIG_SAFEINT
+ jnz .fakeint15
@@ -741,6 +720,15 @@ bcopy:
popfd ; <A>
jmp .done
+ ; We're in real mode with CONFIG_SAFEINT, invoke the
+ ; original INT 15h vector. We used to test for the
+ ; INT 15h vector being unchanged here, but that is
+ ; *us*; however, the test was wrong for years (always
+ ; negative) so instead of fixing the test do what we
+ ; tested and don't bother probing.
+ mov bx, fake_int15_stub