From 6e42cb95bd7100f6d8b0351b24d6a7887390261e Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 14 May 2006 14:13:55 +0000 Subject: [PATCH] Also capture INT 19 as a failure path, to allow for boot sectors that don't conform to BBS (e.g. the one created by mkdosfs). --- src/arch/i386/interface/pcbios/int13.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/arch/i386/interface/pcbios/int13.c b/src/arch/i386/interface/pcbios/int13.c index 229bb3ba..1adbef1b 100644 --- a/src/arch/i386/interface/pcbios/int13.c +++ b/src/arch/i386/interface/pcbios/int13.c @@ -51,7 +51,14 @@ extern void int13_wrapper ( void ); */ static struct segoff int18_vector; -/** Restart point for INT 18 */ +/** Vector for storing original INT 19 handler + * + * We do not chain to this vector, so there is no need to place it in + * .text16. + */ +static struct segoff int19_vector; + +/** Restart point for INT 18 or 19 */ extern void int13_exec_fail ( void ); /** List of registered emulated drives */ @@ -531,9 +538,11 @@ int int13_boot ( unsigned int drive ) { return -ENOEXEC; } - /* Hook INT 18 to capture failure path */ + /* Hook INTs 18 and 19 to capture failure paths */ hook_bios_interrupt ( 0x18, ( unsigned int ) int13_exec_fail, &int18_vector ); + hook_bios_interrupt ( 0x19, ( unsigned int ) int13_exec_fail, + &int19_vector ); /* Boot the loaded sector */ REAL_EXEC ( rm_int13_exec, @@ -555,9 +564,11 @@ int int13_boot ( unsigned int drive ) { DBG ( "Booted disk returned via INT 18\n" ); - /* Unhook INT 18 */ + /* Unhook INTs 18 and 19 */ unhook_bios_interrupt ( 0x18, ( unsigned int ) int13_exec_fail, &int18_vector ); + unhook_bios_interrupt ( 0x19, ( unsigned int ) int13_exec_fail, + &int19_vector ); return -ECANCELED; }