Author: hbelusca Date: Tue Jul 7 23:51:57 2015 New Revision: 68377
URL: http://svn.reactos.org/svn/reactos?rev=68377&view=rev Log: [NTVDM] - Add few remaining members to the SYSVARS list. - Implement retrieving the (DOS) boot drive (by using the host boot drive letter from %SYSTEMDRIVE%). Should fix Win3.11 and MSD 2.0+ boot drive retrieval.
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/d... ============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Tue Jul 7 23:51:57 2015 @@ -333,7 +333,7 @@ break; }
- /* Write string to STDOUT */ + /* Write String to STDOUT */ case 0x09: { String = (PCHAR)SEG_OFF_TO_PTR(getDS(), getDX()); @@ -756,8 +756,17 @@ /* Extended functionalities */ case 0x33: { - if (getAL() == 0x06) - { + switch (getAL()) + { + /* + * DOS 4+ - GET BOOT DRIVE + */ + case 0x05: + { + setDL(SysVars->BootDrive); + break; + } + /* * DOS 5+ - GET TRUE VERSION NUMBER * This function always returns the true version number, unlike @@ -765,24 +774,29 @@ * See Ralf Brown: http://www.ctyme.com/intr/rb-2730.htm * for more information. */ - - /* - * Return the true DOS version: Minor:Major in BH:BL - * The Windows NT DOS box returns BX=3205h (version 5.50). - */ - setBX(NTDOS_VERSION); - - /* DOS revision 0 */ - setDL(0x00); - - /* Unpatched DOS */ - setDH(0x00); - } - // else - // { - // /* Invalid subfunction */ - // setAL(0xFF); - // } + case 0x06: + { + /* + * Return the true DOS version: Minor:Major in BH:BL + * The Windows NT DOS box returns BX=3205h (version 5.50). + */ + setBX(NTDOS_VERSION); + + /* DOS revision 0 */ + setDL(0x00); + + /* Unpatched DOS */ + setDH(0x00); + + break; + } + + default: + { + DPRINT1("INT 21h, AH = 33h, subfunction AL = %Xh NOT IMPLEMENTED\n", + getAL()); + } + }
break; } @@ -841,7 +855,7 @@ /* SWITCH character - AVAILDEV */ case 0x37: { - if (getAL() == 0x00) + switch (getAL()) { /* * DOS 2+ - "SWITCHAR" - GET SWITCH CHARACTER @@ -850,44 +864,46 @@ * See Ralf Brown: http://www.ctyme.com/intr/rb-2752.htm * for more information. */ - setDL('/'); - setAL(0x00); - } - else if (getAL() == 0x01) - { + case 0x00: + setDL('/'); + setAL(0x00); + break; + /* * DOS 2+ - "SWITCHAR" - SET SWITCH CHARACTER * This setting is ignored by MS-DOS 5+. * See Ralf Brown: http://www.ctyme.com/intr/rb-2753.htm * for more information. */ - // getDL(); - setAL(0xFF); - } - else if (getAL() == 0x02) - { + case 0x01: + // getDL(); + setAL(0xFF); + break; + /* * DOS 2.x and 3.3+ only - "AVAILDEV" - SPECIFY \DEV\ PREFIX USE * See Ralf Brown: http://www.ctyme.com/intr/rb-2754.htm * for more information. */ - // setDL(); - setAL(0xFF); - } - else if (getAL() == 0x03) - { + case 0x02: + // setDL(); + setAL(0xFF); + break; + /* * DOS 2.x and 3.3+ only - "AVAILDEV" - SPECIFY \DEV\ PREFIX USE * See Ralf Brown: http://www.ctyme.com/intr/rb-2754.htm * for more information. */ - // getDL(); - setAL(0xFF); - } - else - { + case 0x03: + // getDL(); + setAL(0xFF); + break; + /* Invalid subfunction */ - setAL(0xFF); + default: + setAL(0xFF); + break; }
break; @@ -1379,7 +1395,7 @@ break; }
- /* Terminate With Return Code */ + /* Terminate with Return Code */ case 0x4C: { DosTerminateProcess(Sda->CurrentPsp, getAL(), 0); @@ -2090,6 +2106,10 @@ /* The last drive can be redefined with the LASTDRIVE command. At the moment, set the real maximum possible, 'Z'. */ SysVars->NumLocalDrives = 'Z' - 'A' + 1;
+ /* The boot drive is initialized to the %SYSTEMDRIVE% value */ + // NOTE: Using the NtSystemRoot system variable might be OS-specific... + SysVars->BootDrive = SharedUserData->NtSystemRoot[0] - 'A' + 1; + /* Initialize the NUL device driver */ SysVars->NullDevice.Link = 0xFFFFFFFF; SysVars->NullDevice.DeviceAttributes = DOS_DEVATTR_NUL | DOS_DEVATTR_CHARACTER;
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/d... ============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h [iso-8859-1] Tue Jul 7 23:51:57 2015 @@ -91,6 +91,10 @@ BYTE NumLocalDrives; // Set by LASTDRIVE DOS_DRIVER NullDevice; BYTE NullDriverRoutine[7]; + BYTE Reserved2[8]; + BYTE BootDrive; + BYTE UseDwordMoves; + WORD ExtMemSize; } DOS_SYSVARS, *PDOS_SYSVARS;
typedef struct _DOS_CLOCK_TRANSFER_RECORD