_dos_getdiskfree call in MS-DOS to SD card hangs PC

February 17, 2012 at 07:00:08
Specs: MS-DOS 6.22, 1GHz+ pentium / 1Gb Ram
I have several PC's running MS-DOS 6.22 and need to support them on a customer's installation. Changing operating system is not an option, as it's supporting already installed equipment in a highly secure environment.
We use an Addonics Digidrive as an SD card interface to a program which we wrote several years ago (in the mid 1990's).
I find that calling _dos_getdiskfree from Borland C++ 4.5 sometimes hangs the PC completely. When this happens, the only thing to do is power off and on again.
DOS itself seems to do this sometimes- If I type
It lists the files, then sometimes, it hangs before displaying the number of free bytes on the SD card.
This happened sometimes on the IDE version of the DigiDrive, but much more often on the SATA version (the IDE version is now getting difficult to get hold of).
The program needs to be able to check that there is an SD card in the drive periodically, and return an error if it doesn't, not just lock up !
Anyone got any ideas ?

See More: _dos_getdiskfree call in MS-DOS to SD card hangs PC

March 31, 2012 at 10:57:00
SD cards are quite problematic when hooking up to an ATA based interface as they use differing command sets/protocols, the adapter has to do a lot of (usually unreliable or buggy) translation work. My recommendation would be to get an IDE to Compact Flash adapter and use a Compact Flash card instead. Compact Flash cards are based on PCMCIA, just like IDE and so the adapter is nothing more than two types of sockets wired together without any translational systems in between (hence why they are dirt cheap). They can communicate fully natively.


Report •
Related Solutions

Ask Question