diff -u 304/shsucdx.nsm 305/shsucdx.nsm --- 304/shsucdx.nsm Sun Oct 01 17:41:40 2006 +++ 305/shsucdx.nsm Fri Feb 11 16:09:48 2011 @@ -9,6 +9,7 @@ ; v3.02, April/May, 2005. ; v3.03, December, 2005. ; v3.04, October, 2006. +; v3.05, February, 2011. ; ;*** Begin original comments (abridged): ;*************************************************************************** @@ -136,7 +137,7 @@ %define RC_OK 0 ; help, tilde/ro, successful uninstall ; 1..32 first drive number (A=1) -%assign COMPILE_FLAG hl(4,0) +%assign COMPILE_FLAG hl(5,0) %ifdef i8086 %assign COMPILE_FLAG COMPILE_FLAG | bit(0) %endif @@ -168,10 +169,43 @@ db 13 ; overwrite JMP if TYPEd CopyrightMsg dln "SHSUCDX by Jason Hood . | Derived from v1.4b by" -dln "Version 3.04 (1 October, 2006). Freeware. | John H. McCoy, October 2000," +dln "Version 3.05 (11 February, 2011). Freeware. | John H. McCoy, October 2000," dlz "http://shsucdx.adoxa.cjb.net/ | Sam Houston State University." db 26 +; Put the options here, to make room for the stack. +%macro dopt 2.nolist + dw %2 + db %1 +%endmacro + +Options dopt '?', Opt? + dopt 'C', OptC + dopt 'D', DoDriver + dopt 'E', OptIgn ; MSCDEX: expanded memory + dopt 'I', OptI + dopt 'K', OptIgn ; MSCDEX: Kanji + dopt 'L', DoLetter + dopt 'M', OptIgn ; MSCDEX: buffers + dopt 'Q', OptQ + dopt 'R', OptR + dopt 'S', OptIgn ; MSCDEX: sharing + dopt 'U', OptU + dopt 'V', OptV + dopt '~', Opt~ + dopt 255, OptUnk + +UnknownOpt db "Unknown option: '" +OptChar dlz "?'." +DInvalid dlz "/D: invalid drive letter." +DUnitNumber dlz "/D: expecting unit number (0-99)." +DMaxNumber dlz "/D: expecting maximum units (1-9)." +LMissingValue dlz "/L: expecting value." +LNoD dlz "/L: must follow /D." +LInvalid dlz "/L: invalid drive letter." +LBadNumber dlz "/L: only two digits allowed." + + CritInit: ; zero out the sector buffers (security and directory scan sentinel) mov di, [Drive+DrvEnt.Bufp] @@ -205,8 +239,8 @@ align 16 -Res_Begin equ $-$$+100h - 192*2 -local_stack equ $ - 192*2 ; stack goes back into the PSP +Res_Begin equ $-$$+100h - 280*2 +local_stack equ $ - 280*2 ; stack goes back into the PSP throw_sp equ $-2 DriveOfs dw 0 ; EAX, but low word is not needed scratch dw 0 ; used by 8086 code @@ -317,7 +351,7 @@ %ifdef JOLIET dw CD_VolDesc ; 0E Get/Set vol. descriptor preference %else - dw CD_Unsupported ; 0E Get/Set vol. descriptor preference + dw CD_unsupported ; 0E Get/Set vol. descriptor preference %endif dw CD_DirEntry ; 0F Get directory entry dw CD_Request ; 10 Send device request @@ -1194,12 +1228,14 @@ stosw ; SDB.ParentSize mov al, 8 ; volume label attribute - if [es:si-1] ,ne, al ; SAttrp - sub di, SDB.ParentSize+2 ; point back to beginning - call DoFindFirst - mov al, FILENOTFOUND ; DOS will apparently zero on success - ret - fi + ;if [es:si-1] ,ne, al ; SAttrp + ;sub di, SDB.ParentSize+2 ; point back to beginning + ;call DoFindFirst + ;mov al, FILENOTFOUND ; DOS will apparently zero on success + ;ret ; seems it should return NOMOREFILES + ;fi ; (makes DOS 6.22 TREE work) + sub di, SDB.ParentSize+2 ; point back to beginning + jif [es:si-1], ne, al, DoFindFirst ; Handle vol id lea si, [bx+DrvEnt.RootEnt] ; VLabel @@ -1820,10 +1856,10 @@ Match uses all call CDtoFCB repeat 11 - dec si ; dir_name - 1 == file_name + 10 - mov al, [si] - ;mov al, [si-1] ; alternative to provide - ;dec si ; alignment at cdxsda/Drive + ;dec si ; dir_name - 1 == file_name + 10 + ;mov al, [si] + mov al, [si-1] ; alternative to provide + dec si ; alignment at cdxsda/Drive next al ,e, {'?',[si+11]} return @@ -2333,7 +2369,7 @@ save dx mov dx, [BP_(scratch)] %endif - for si, bx, {[si] ,ne, ch}, cx ; {[si] nzb} + for0 si, bx, {[si] ,ne, ch}, cx ; {[si] nzb} call Match Matchfunc iw %ifdef i8086 @@ -2647,37 +2683,7 @@ FullStop equ $-2 CantInstallMsg dlz " SHSUCDX can't install." -UnknownOpt db "Unknown option: '" -OptChar dlz "?'." DDriver dlz "/D: driver name required." -DInvalid dlz "/D: invalid drive letter." -DUnitNumber dlz "/D: expecting unit number (0-99)." -DMaxNumber dlz "/D: expecting maximum units (1-9)." -LMissingValue dlz "/L: expecting value." -LNoD dlz "/L: must follow /D." -LInvalid dlz "/L: invalid drive letter." -LBadNumber dlz "/L: only two digits allowed." - -%macro dopt 2.nolist - dw %2 - db %1 -%endmacro - -Options dopt '?', Opt? - dopt 'C', OptC - dopt 'D', DoDriver - dopt 'E', OptIgn ; MSCDEX: expanded memory - dopt 'I', OptI - dopt 'K', OptIgn ; MSCDEX: Kanji - dopt 'L', DoLetter - dopt 'M', OptIgn ; MSCDEX: buffers - dopt 'Q', OptQ - dopt 'R', OptR - dopt 'S', OptIgn ; MSCDEX: sharing - dopt 'U', OptU - dopt 'V', OptV - dopt '~', Opt~ - dopt 255, OptUnk struc DrvrEnt diff -u 304/shsucdx.txt 305/shsucdx.txt --- 304/shsucdx.txt Sun Oct 01 17:57:26 2006 +++ 305/shsucdx.txt Fri Feb 11 16:15:40 2011 @@ -1,9 +1,9 @@ SHSUCDX - Copyright 2006 Jason Hood + Copyright 2006-2011 Jason Hood - Freeware. Version 3.04 + Freeware. Version 3.05 Derived from v1.4b by John McCoy @@ -12,8 +12,8 @@ Description =========== - SHSUCDX is an unloadable CD-ROM redirector substitute for MSCDEX. It - supports up to 10 drives. Each drive is single-sector buffered and the + SHSUCDX is an unloadable CD-ROM redirector substitute for MSCDEX. It + supports up to 10 drives. Each drive is single-sector buffered and the last 10 directory entries are cached. Each unit from each driver can be assigned a specific drive letter. @@ -22,8 +22,8 @@ Usage ===== - Run SHSUCDX with the name of one or more CD-ROM device drivers. If the - drivers are valid, SHSUCDX will install a drive letter for each unit on + Run SHSUCDX with the name of one or more CD-ROM device drivers. If the + drivers are valid, SHSUCDX will install a drive letter for each unit on each driver. ------- @@ -42,20 +42,20 @@ /D - Driver - This option is used to specify the name of the device driver. It can - also indicate which unit(s) should be assigned and to what letter. The + This option is used to specify the name of the device driver. It can + also indicate which unit(s) should be assigned and to what letter. The complete syntax is: /D[:][?|*]driver[,[letter][,[unit][,[max]]]] - DRIVER is the name of the device driver installed to control the CD-ROM + DRIVER is the name of the device driver installed to control the CD-ROM drive. Prefixing the driver with '?' will silently ignore it if it does - not exist (or is not actually a CD-ROM); prefixing with '*' will also + not exist (or is not actually a CD-ROM); prefixing with '*' will also ignore it, but a drive will be reserved (see below). - LETTER is the first drive letter to assign to the units on this driver. - The default is the first available letter. Note: the drive letters - assigned to subsequent units will always be higher than those assigned + LETTER is the first drive letter to assign to the units on this driver. + The default is the first available letter. Note: the drive letters + assigned to subsequent units will always be higher than those assigned to previous units. UNIT is the first unit on this driver to be assigned a drive. Unit 0 is @@ -69,26 +69,26 @@ /D - Drive manipulation - At install time, /D can also be used to reserve space for additional - drives. Use a single digit to indicate how many drives should be - reserved (eg: /D1). (If you should happen to have a device driver name - with a single digit, use the '?' prefix.) After installation, the same + At install time, /D can also be used to reserve space for additional + drives. Use a single digit to indicate how many drives should be + reserved (eg: /D1). (If you should happen to have a device driver name + with a single digit, use the '?' prefix.) After installation, the same option will remove the drive(s) that were last assigned. It is possible - to specify both forms of /D, in which case the current drive(s) will be + to specify both forms of /D, in which case the current drive(s) will be removed, then the new drive(s) added. /L - Letter - This option is an alternative to the LETTER component of /D, which it - must follow (ie: /D:driver /L:letter). It can also be used to return - the number of drives installed (/L:0, will return 255 if not installed) + This option is an alternative to the LETTER component of /D, which it + must follow (ie: /D:driver /L:letter). It can also be used to return + the number of drives installed (/L:0, will return 255 if not installed) and the letter of each assigned drive (/L:1, /L:2, etc., with A: = 1 and 255 if the drive is not assigned). /C - Memory usage - By default, SHSUCDX will load itself into high memory, if available, or - into low memory if it is already high. This option will prevent that. + By default, SHSUCDX will load itself into high memory, if available, or + into low memory if it is already high. This option will prevent that. To be exact: SHSUCDX relocate high @@ -107,7 +107,7 @@ /V - Information - When used with /?, or after installation, this option displays the + When used with /?, or after installation, this option displays the compile- and run-time options of SHSUCDX. This information includes: 8086/386 the minimum processor required @@ -118,20 +118,20 @@ /~ - Tilde usage - The ISO standard allows for CDs to have names up to 31 characters and - Joliet can have names up to 64 characters. When this is reduced to 8.3 - for DOS it may lead to duplicated entries. This option will remove the + The ISO standard allows for CDs to have names up to 31 characters and + Joliet can have names up to 64 characters. When this is reduced to 8.3 + for DOS it may lead to duplicated entries. This option will remove the duplication by appending a tilded number after the name (similar to what - Windows does). By default, tildes are off. This option is also avail- - able after installation. By itself it will toggle the status (ie. if - tildes are currently on, /~ will turn them off and vice versa). Tildes - can be explicitly turned on or off by adding a '+' or '-' sign (ie: /~+ + Windows does). By default, tildes are off. This option is also avail- + able after installation. By itself it will toggle the status (ie. if + tildes are currently on, /~ will turn them off and vice versa). Tildes + can be explicitly turned on or off by adding a '+' or '-' sign (ie: /~+ will turn tildes on, irrespective of the current state). /R - Read-only attribute usage - By default, files on the CD are given the read-only attribute. Should - you wish to remove this attribute, this option will do so. As with /~, + By default, files on the CD are given the read-only attribute. Should + you wish to remove this attribute, this option will do so. As with /~, it can be used after installation and it accepts '+' and '-'. /I - Install @@ -145,9 +145,9 @@ /Q - Quiet - Prevent display of the sign-on banner (the copyright notice). /Q+ will + Prevent display of the sign-on banner (the copyright notice). /Q+ will only display the drive assignments (when used after install '-' will in- - dicate a removed drive and '+' an added drive). /QQ will display noth- + dicate a removed drive and '+' an added drive). /QQ will display noth- ing at all. @@ -155,13 +155,13 @@ SMARTDrive ========== - SMARTDrive caches MSCDEX by modifying MSCDEX' memory, so it is not - directly capable of caching SHSUCDX. However, the supplied SMARTER - program (see README.TXT) can patch SMARTDrive, enabling it to modify - SHSUCDX in the same way. Due to the method employed, if /D is used to - remove a drive, then later to install it again, it will no longer be - cached. If a drive is created from an image file, SMARTDrive should be - instructed not to cache it, since the image itself will be cached + SMARTDrive caches MSCDEX by modifying MSCDEX' memory, so it is not + directly capable of caching SHSUCDX. However, the supplied SMARTER + program (see README.TXT) can patch SMARTDrive, enabling it to modify + SHSUCDX in the same way. Due to the method employed, if /D is used to + remove a drive, then later to install it again, it will no longer be + cached. If a drive is created from an image file, SMARTDrive should be + instructed not to cache it, since the image itself will be cached (unless, of course, the image is located on a network). Note: upgrading from SHSUCDX v2 will require re-running SMARTER. @@ -171,7 +171,7 @@ ====== This version of SHSUCDX will only work with DOSLFN 0.40a or later. Att- - empting to use an earlier version of DOSLFN may render the entire CD or + empting to use an earlier version of DOSLFN may render the entire CD or some files inaccessible. @@ -179,10 +179,10 @@ Critical Errors =============== - A critical error is only generated on the initial access to the CD. If + A critical error is only generated on the initial access to the CD. If a read error occurs, the calling function will fail with error 15 (drive - not ready). If an image is located on a CD, and that CD is removed, do - NOT abort, but fail and then abort (the first error is for the CD, the + not ready). If an image is located on a CD, and that CD is removed, do + NOT abort, but fail and then abort (the first error is for the CD, the second is for the image). @@ -232,8 +232,8 @@ DX = alias number (0 for none) The alias number is the number of the directory entry within the sector, - plus 64 times the sector number (both zero based). For example, the - third entry in the third sector of a directory would have an alias num- + plus 64 times the sector number (both zero based). For example, the + third entry in the third sector of a directory would have an alias num- ber of 130 (2 + 2 * 64). @@ -261,18 +261,18 @@ SHSUCDX /D:SHSU-CDH - SHSUCDX finds the first available drive letter and assigns it to device - unit 0 of the driver SHSU-CDH. If there is a second and/or third CD - drive they are assigned to the next available letters in sequence. + SHSUCDX finds the first available drive letter and assigns it to device + unit 0 of the driver SHSU-CDH. If there is a second and/or third CD + drive they are assigned to the next available letters in sequence. Drive letters in use are skipped. The first CD supported by a driver is device unit 0 regardless of its SCSI address. SHSUCDX /D:IDE-CD,F /D:?USB-CD,U /D:*SHSU-CDH,W /L:0 - Assign drive F to the IDE-CD driver, or abort if it is not loaded. If - the USB-CD driver is loaded, assign it to drive U; else do nothing. If - the SHSU-CDH driver is loaded, assign it to drive W; else reserve space - for it, so it can be loaded later. SHSUCDX will return the number of + Assign drive F to the IDE-CD driver, or abort if it is not loaded. If + the USB-CD driver is loaded, assign it to drive U; else do nothing. If + the SHSU-CDH driver is loaded, assign it to drive W; else reserve space + for it, so it can be loaded later. SHSUCDX will return the number of drives assigned (or 252 if aborted). SHSUCDX /L:0 @@ -283,7 +283,7 @@ SHSUCDX /D:CD001,,1,1 /D:CD001,,4,1 SHSUCDX assigns the first available drive letter to device unit 1 of the - driver CD001 and the next letter to unit 4. This allows access to non- + driver CD001 and the next letter to unit 4. This allows access to non- contiguous drive units without having to support un-needed units. @@ -293,6 +293,11 @@ Legend: + added, - bug-fixed, * changed. + v3.05 - 11 February, 2011: + - fixed reading an empty directory sector + * Find First will return "no more files" (18) not "file not found" (2) + * increased stack (as per SHCDX33C). + v3.04 - 1 October, 2006: - 8086 version trashed memory when the disc was missing * align sector buffers on a DWORD boundary @@ -326,5 +331,5 @@ * clean slate. - ============================ - Jason Hood, 1 October, 2006. + ============================== + Jason Hood, 11 February, 2011.