Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-06

Drive detection (was: Intel ASM syntax problem)

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

AITOR.SM

Hi Marco (and the rest),

there seems to be a problem with EDOS' drive detection routine. I checked this program in several PCs:

====
program test;
uses EDOS;
var c,d: byte;
begin
        for c:=1 to 10 do  {no more than 10 drives!}
            begin
                 d := drivetype(c);
                 if d>0 then begin
                        write (chr(c+ord('A')-1),': is of type ');
                        case d of
                                 1: WriteLn ('remote');
                                 2: WriteLn ('fixed');
                                 3: WriteLn ('removable');
                                 4: WriteLn ('substed');
                                 5: WriteLn ('cdrom');
                        end
                 end
            end
end.
====

And in every cases:
Hard drives are DETECTED
Floppies and CD-ROMs are NOT detected. For example, I get:

C: is of type fixed

although I have also a floppy (A:) and a CD-ROM (D:). Same at home: I have several visible primary partitions, which are recognised, but I was unlucky with the floppy and cd-rom. In addition:
- I hear it is doing some noise in the floppy drive during the test (I hope it's not the case that it only works if a floppy is inserted)
- The CD-ROM is not detected, regardless of wether I use a CD-ROM driver+MSCDEX (in CONFIG and AUTOEXEC) or not.

I am interested in the DOS (Go32V2) case, not windows. Does any of you have an idea of what is wrong, or have some extra code to do this?

Aitor

Earlier message 30 lines
----- Mensaje Original ----- De: (Marco van de Voort) Fecha: Lunes, Junio 25, 2001 11:48 pm Asunto: Re: [fpc-pascal]Intel ASM syntax problem > > > code, so I didn't write it myself. I simply tried to compile > under FPK, > > just forgetting that I am doing these seg:ofs calls and the like. > > > > Well, I don't believe this will compile even if I change bx by > ebx. My > > solutions could be: > > > > (a) any of you has a piece of code to detect fd/cd/hd/ram/net > disks > > under GO32V2 > > Www.stack.nl/~marcov/xtdfpc.htm > > Download xtdfpc[xx].zip and check unit edos. > > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > ___________________________________________________________________ Consigue tu e-mail gratuito TERRA.ES Haz clic en http://www.terra.es/correo/
Unknown author
to AITOR.SM

From: "AITOR.SM"
To:
Date sent: Wed, 27 Jun 2001 11:03:04 +0200
Subject: [fpc-pascal]Drive detection (was: Intel ASM syntax problem) Send reply to:

the case that it only works if a floppy is inserted) - The CD-ROM is not detected, regardless of wether I use a CD-ROM driver+MSCDEX (in CONFIG and AUTOEXEC) or not.

You must definitely use the CD-ROM driver, otherwise it's no drive, just an ATAPI device (so it wouldn't have a letter assigned otherwise, for example).

I am interested in the DOS (Go32V2) case, not windows. Does any of you have an idea of what is wrong, or have some extra code to do this?

I can't help with Marco's unit. Regarding some extra code - just try the test program delivered with my unit and you'll see whether it works for you, or not, at once. ;-)

Tomas

AITOR.SM

This is the first thing that I did, and this was the first place (SWAG) from where I posted the sources. Ok, I just did have a look at the 'complete drive detection' stuff, and that is what gave me problems even with ASMMODE Intel.
Perhaps I should have checked more sources, but I have something now that seems to be working for me (you'll hear from this soon...)

Aitor

Show quoted text 21 lines
For detecting available drives there are routines on: http://www.gdsoft.com/swag/swag.html (SWAG). If You download the snippets about drives handling (drives.swg, You ned the viewer too), You will find 5 or more routines for detectingdrives, for finding out parameters of drives (CDROM, HDD, FDD) etc. Or write to me, I will send You the package. But remember to put directive {$ASMMODE intel} to all codes, because there are made for TP and without this directive cannot be compiled under FPC. Have a good time Martin H. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

___________________________________________________________________ Consigue tu e-mail gratuito TERRA.ES
Haz clic en http://www.terra.es/correo/

AITOR.SM
Show quoted text 9 lines
>This is the first thing that I did, and this was the first place (SWAG) >from where I posted the sources. Ok, I just did have a look at the >'complete drive detection' stuff, and that is what gave me problems even >with ASMMODE Intel. I have no problem to compile them. But - I agree that some

So perhaps you were using a differnt snippet...

programs don't work OK. Some detects diskette drive B even if You don't have it, some

I think you can do this using int 11

Show quoted text 7 lines
returns a bit confused list of drives (I have realized, that for example Norton Commander maybe sometimes creates a virtual disk B for copying from diskette to diskette and running Your program from NC will detect drive B). In my unit NGTVIEW for creating text GUI I have leaved the way of

text GUI? it will be a TUI then? ;-)))

Show quoted text 11 lines
list of drives, because I haven't found working routine without direct testing of drives. But I have test them under WinNT and maybe some problems became from this reason :-) (more mapped drives etc.). Have a nice day Martin H.

Thanks!

Aitor

___________________________________________________________________ Consigue tu e-mail gratuito TERRA.ES
Haz clic en http://www.terra.es/correo/