View Full Version : Intercepting DOS Error Message

05-18-2002, 10:43 AM
How do I prevent the MS-DOS message "Disk is Not Ready", when there is no floppy in the drive? My eventual target is an embedded system that is using a flash card as drive E:. I need to be able to some know if the card is there (is the drive valid or not) or prevent the MS-Dos message from appearing on the screen. I am looking for a solution that really works.

05-18-2002, 10:50 PM
There are several ways to do this. Just hook the correct int 21h DOS handler. For info on this consult the RBIL.

Some errors automatically use the critical error handler which is on int 24h

06-08-2002, 07:29 PM
I don't know if C++ does anything similar, but Java (which, instructure and syntax, is very similar to C++ (becasue it is derived from C also)) has a system where you label a section try, and catch. You try it, if anything goes wrong, you "catch it". Noodle with it - see what you can came up with.

06-09-2002, 04:05 PM
Most DOS compilers did not support the try/catch mechanism. My BC 4.52 does, but it is a Windows-based IDE. I have Turbo C++ 3.0 and it does not support the try/catch. For other versions I'm really not sure

Again it is not hard to setup error mechanisms in C compilers that do not support try/catch. It is interrupt driven and exception driven but it still works, just not as nice and neat as try/catch blocks.

06-09-2002, 07:00 PM
I just had an idea. you write that part of the code in java, partially compile it(like into a library or object code or something), and then incorporate it into your code like you would with every other library and stuff.