From 74167734ff8ee1e97106c756ca8a81547c055439 Mon Sep 17 00:00:00 2001 From: Eric Auer Date: Sat, 12 Apr 2008 15:54:29 +0000 Subject: [PATCH] Compatibility: Allow fat/data/dir type hints even for disk read in int 21.7305 to fix compat issue found by Christian Wallbaum. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1365 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/inthndlr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/inthndlr.c b/kernel/inthndlr.c index 4fc0f74..e187675 100644 --- a/kernel/inthndlr.c +++ b/kernel/inthndlr.c @@ -351,9 +351,10 @@ int int21_fat32(lregs *r) struct HugeSectorBlock FAR *SectorBlock = (struct HugeSectorBlock FAR *)MK_FP(r->DS, r->BX); UBYTE mode; + /* bit 0 of SI is 0 read / 1 write, bits 13/14 indicate a type: */ + /* 0 any, 1 fat, 2 dir, 3 file. Type is mostly for "write hints" */ - if (r->CX != 0xffff || ((r->SI & 1) == 0 && r->SI != 0) - || (r->SI & ~0x6001)) + if (r->CX != 0xffff || (r->SI & ~0x6001)) { return DE_INVLDPARM; } @@ -361,7 +362,7 @@ int int21_fat32(lregs *r) if (r->DL > lastdrive || r->DL == 0) return -0x207; - if (r->SI == 0) + if ((r->SI & 1) == 0) /* while uncommon, reads CAN have type hints */ mode = DSKREADINT25; else mode = DSKWRITEINT26;