Avoiding "invalid drives" error with USBDRIVE?

The intent of this forum is to discuss my DOS TSR programs (available at http://bretjohnson.us), how they work and don't work, new/missing features, status of updates, and anything else related to them that may need to be discussed.

Avoiding "invalid drives" error with USBDRIVE?

Postby japheth » Sat Sep 19, 2009 10:18 pm

Hello,

Thanks, Bret, for your USBDOS drivers!

FYI: the first version of USBDRIVE which worked with my system is the version from 20. Aug 2009. The version from 10. Aug 2009 didn't work, although I'm not using EDR-DOS, but MS-DOS 7.1.

The reason for this post is: when I install USBDRIVE, it accepts my USB-stick and assigns it the first of its 8 reserved drive letters. However, the remaining 7 drive letters still point to nowhere and trying to access those drives gives an io-error. Is it possible to change this behavior? Perhaps by changing the flags in the CDS on the fly?

Regards

Japheth
japheth
 
Posts: 6
Joined: Fri Aug 28, 2009 10:35 pm

Re: Avoiding "invalid drives" error with USBDRIVE?

Postby Bret » Sun Sep 20, 2009 2:48 am

While it would be possible to do that, it's not a good idea. Such a scenario would allow you to change the quantity of accessible INT 13h disk numbers, partition types and sizes, DOS Drive Letters, etc. while another program was already running. Many programs, if they need to access and manage the drives, take an "inventory" of how many there are at the beginning of the program and assume it can't change while the program is running. Having the number or type of available disks or partitions or drive letters change while a program is running could be catastrophic. In addition, it would take quite a bit more TSR memory to do something like that.

USBDRIVE treats USB disks as removable hard drives, not permanent hard drives the way most other drivers do. With USBDRIVE, it may be easier to think of USB drives more like floppy drives than hard drives, but with the floppy slots being virtual instead of physical. You can change the number of physical slots that are reserved for USB Devices with the /Devices:# option, the number of "virtual slots" it reserves for INT 13h disk numbers with the /Disks:# option, and the number of "virtual slots" it reserves for partitions/DOS drive letters with the /Drives:# option.

If you only intend to use one USB disk at a time, and will only have one partition on it, you can set /Devices, /Disks, and /Drives all to 1 (this will also minimize the amount of TSR memory). If you want to be able to copy directly between two USB disks each with one partition, set all of the values to 2. If you have a multimedia card reader with 4 slots, but you only need to access one of the slots at a time, set /Devices to 1, /Disks to 4, and /Drives to 1. If you have a single USB disk with multiple partitions, set /Devices and /Disks to 1, and /Drives to the number of DOS partitions on the disk.

*********************

I know the recent version of USBDRIVE doesn't work any more for some drives that used to be OK. I'm working on that now, and hope to have it fixed later this week.
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Avoiding "invalid drives" error with USBDRIVE?

Postby c.m » Tue Sep 22, 2009 2:16 am

Bret wrote:While it would be possible to do that, it's not a good idea. Such a scenario would allow you to change the quantity of accessible [DOS Drives] while another program was already running. Many programs, if they need to access and manage the drives, take an "inventory" of how many there are at the beginning of the program and assume it can't change while the program is running. Having the number or type of available [drives] change while a program is running could be catastrophic.

Well, yeah, that's true. But you could provide dummy drives on DOS drives that aren't inserted. Currently, some of the information of these drives is already faked by the USBDRIVES block device, such as the sector size (32) and number of root directory entries (2). Why not (to DOS) 'change' the media to a read-only virtual empty FAT12 drive when there's no actual disks to associate with this DOS drive?

You could also enable "dynamic" allocation of free CDS entries (DOS drives) only optionally. Or listen to some DOS soft ints to determine when it's safe to allocate or deallocate CDS entries. This could be switched from "only when USBDRIVES is running" (as now) to other methods such as "on Int28", "when idling in COMMAND.COM" or "when the Int2A DOS critical sections aren't in use".
C. Masloch
c.m
 
Posts: 18
Joined: Sat Sep 12, 2009 5:49 am
Location: Germany

Re: Avoiding "invalid drives" error with USBDRIVE?

Postby Bret » Tue Sep 22, 2009 4:21 pm

c.m wrote:But you could provide dummy drives on DOS drives that aren't inserted. Currently, some of the information of these drives is already faked by the USBDRIVES block device, such as the sector size (32) and number of root directory entries (2). Why not (to DOS) 'change' the media to a read-only virtual empty FAT12 drive when there's no actual disks to associate with this DOS drive?


It would certainly be possible to create a small virtual read-only drive with no files on it until a real disk was inserted, but still not a good idea IMHO. The reason USBDRIVE inserts "fake" drive information is simply to reserve the CDS so DOS treats it as a drive with no media, which is exactly the same way an empty or unaccessed floppy drive is handled. I believe it's better to just start treating USB drives like floppies or removable hard drives (which is exactly what they are) rather than continuing to pretend they're permanent hard drives.
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM


Return to Programs

Who is online

Users browsing this forum: No registered users and 3 guests

cron