On Mon, 23 Dec 2002 09:21:53 +0100, Michal H. Tyc wrote:

> Hi Glenn, Hi all,

> On Thu, 19 Dec 2002 13:07:58 -0400, Glenn McCorkle wrote:

>> Have a look at the part of the SRC code for wwwman.exe
>> which then reads the info from there.

>> ---- drvtypes.cpp attached ---
TcKz-�`
> The problem is with INT 25h called when checking for Stacker;
> Win95 set SI to 0, so the stack pointer gets corrupted (MOV SP, SI).
> Then anything may happen, because CPU just jumps to a random address.

> From Ralf Brown's Interrupt List:

> --------D-25----CXFFFF-----------------------
> INT 25 - DOS 3.31+ - ABSOLUTE DISK READ (32M-2047M hard-disk partition)
> CX = FFFFh
> AL = drive number (0=A, 1=B, etc)
> DS:BX -> disk read packet (see #02548)
> Return: CF clear if successful
> CF set on error
>     AH = status (see #02547)
>     AL = error code (same as passed to INT 24 in DI)
>     AX = 0207h for FAT32 drive -- use INT 21/AX=7305h
> may destroy all other registers except segment registers; Win9X always
>   sets SI to 0000h due to an apparent coding bug
> Notes: partition is potentially >32M (and requires this form of the call) if
>   bit 1 of the device attribute word in the device driver is set
> original flags are left on stack, and must be removed by caller
> this call bypasses the DOS filesystem
> for FAT32 drives (which may be up to 2TB in size), use INT 21/AX=7305h
> SeeAlso: INT 13/AH=02h,INT 25,INT 26/CX=FFFFh,INT 21/AX=7305h

> Format of disk read packet:
> Offset        Size Description (Table 02548)
> 00h DWORD sector number
> 04h WORD number of sectors to read
> 06h DWORD transfer address
> SeeAlso: #02552
> ---------------------------------------------

> The simplest workaround is to remove the Stacker check at all.
> Or to add some code to preserve registers while calling INT 25h.
> And don't use SI to remember SP, just pop the flags after INT 25h.

> Merry Christmas to all list members!

Michal,

THANK YOU !!!!

The 'quick-n-dirty' fix is ready for testing.

I simply commented-out the sections of drvtypes.cpp which checked for
stacker drives and then recompiled.

Anyone who would like to test it may grab a copy of w3manw9x.zip from
http://www.angelfire.com/id/glenndoom/wwwman.htm

Now..... how do we re-write ths section of drvtypes.cpp so that
we CAN look for stacker drives WITHOUT locking-up the machine ????

//!!glennmcc: Begin Dec 23, 2002
// removed at the advice of Michal H. Tyc
//Thank you Michal :))
// this is what was causing the 'lock-ups' when used with some versions
//of Dos supplied with W9x
/*
int chkStk4(char drive)
{ CtrlBlk25 cb;
  char boot[512];
  register int r;
  cb.startsect=0;cb.cnt=1;cb.bufoffs=FP_OFF(boot);cb.bufseg=FP_SEG(boot);
  drive--;
  r=0;
  asm{push ds;mov al,drive;or chkABforSTK,0;jnz j1;
      cmp al,1;ja j1;sub al,al;jmp q;}
  j1:;
  asm{push ss;pop ds;
      lea bx,cb;
      sub ax,ax;mov al,drive;
      sub cx,cx;dec cx;
      mov si,sp;
      int 0x25;
      cli;mov sp,si;sti;
      pushf;
      lea si,boot;add si,0x1f0;sub al,al;
      popf;jc q;
      cmp word ptr ds:[si]   ,0x13cd;jnz q;
      cmp word ptr ds:[si][2],0x14cd;jnz q;
      cmp word ptr ds:[si][4],0x01cd;jnz q;
      cmp word ptr ds:[si][6],0x03cd;jnz q;
      mov al,1;
     }
  q:;
  asm{pop ds;xor ah,ah;mov r,ax;}
  return r;
}
*/
//!glennmcc: end

-- 
 Glenn
 http://arachne.cz/
 http://www.delorie.com/listserv/mime/
 http://www.angelfire.com/id/glenndoom/download.htm
 http://www.thispagecannotbedisplayed.com/

Reply via email to