Solved

Gather Low level system info

Posted on 1997-05-17
7
303 Views
Last Modified: 2010-04-04
I need to gather some low-level info.  I am using Delphi2.  I need to gather DOS Version, BIOS Make and Date, Conventional memory available, CPU Clock Speed - sperling provided an answer for clock speed yesterday and I THOUGHT that it worked, but it doesn't seem to be working correctly on my 200 MHz (detecting it as 119.32 MHz).  Also, how do you detect hardware presence/absence (mouse, keyboard, etc.)?  I read the answer from alon and I am afraid that it looks like alot of info, but I am just too new at Delphi to understand what I am supposed to do with it.  Also, in my previous question I mentioned that I had looked at about 10 "system info" compnonents and none have CPU Clock Speed.  I tried DSP again per Alon's note.  I still do not see anything for Delphi 2.0 that will do this.  Is there a specific component that you KNOW will get this info?
0
Comment
Question by:Rik
7 Comments
 
LVL 2

Expert Comment

by:alona041797
ID: 1336378
Dos Version:

procedure dosver(var ver,rev:byte); assembler;
asm
  MOV AH,30h
  INT 21
  MOV ver,AH
  MOV rev,AL
end;

CPU Speed:
  Freeware component available at the DSP: http://sunsite.icm.edu.pl/delphi/

Equipment: (use int 11)
Interrupt 11h  Equipment Check

(0:0044h)       Reads the BIOS Data Area and returns two bytes of setup info.
entry   no parameters are required
return  AX      Equipment listing word. Bits are:
                0       number of floppy drives
                        0       no drives
                        1       bootable (IPL) diskette drive installed
                1       math chip
                        0       no math coprocessor (80x87) present
                        1       math coprocessor (80x87) present
         (PS/2) 2       0       mouse not installed
                        1       mouse installed
          (PC)  2,3     system board RAM
                        0,0     16k    (PC-0, PC-1)
                        0,1     32k
                        1,0     48k
                        1,1     64k    (PC-2, XT)
                        note 1) not commonly used. Set both bits to 1
                             2) both bits always 1 in AT
                4,5     initial video mode
                        0,0     no video installed (use with dumb terminal)
                        0,1     40x25 color      (CGA)
                        1,0     80x25 color      (CGA, EGA, PGA, MCGA, VGA)
                        1,1     80x25 monochrome (MDA or Hercules, most super-
                                                  hires mono systems)
                6,7     number of diskette drives (only if bit 0 is 1)
                        0,0     1 drives
                        0,1     2 drives
                        1,0     3 drives
                        1,1     4 drives
                8       0       DMA present
                        1       no DMA (PCjr, some Tandy 1000s, 1400LT)
                9,A,B   number of RS232 serial ports (0-3)
                        0,0,0   none
                        0,0,1   1
                        0,1,0   2
                        0,1,1   3
                        1,0,0   4
                C       0       no game I/O attached
                        1       game I/O attached (default for PCjr)
                D       serial accessory installation
                        0       no serial accessories installed
                        1       Convertible - internal modem installed
                                or PCjr - serial printer attached
                E,F     number of parallel printers
                        0,0     none
                        0,1     one   (LPT1, PRN)
                        1,0     two   (LPT2)
                        1,1     three (LPT3)
                        note    Models before PS/2 would allow a fourth
                                parallel printer. Remapping of the BIOS in the
                                PS/2s does not allow the use of LPT4.
        (386 extended AX)
                23d     0       Weitek ABACUS - virtual '86 EMS page tables
                                not correctly initialized
                        1       Weitek ABACUS - virtual '86 EMS page tables OK

                24d     0       Weitek ABACUS NDP not present
                        1       Weitek ABACUS NDP present



0
 

Author Comment

by:Rik
ID: 1336379
Edited text of question
0
 

Author Comment

by:Rik
ID: 1336380
I grade 'F' to this answer only because I do not know how to use this information. Perhaps, if I could get some example code like sperling provided on my previous question (even though that code is not working like I need it to).  Sorry to sound like an idiot, but I am new to Delphi.  Thanks, Rik
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:vorlon
ID: 1336381
Rik,
Below is a brief snipet of code that will get the windows version, dos version and conventional memory for you. I don't have the time to get the other stuff (cpu speed, hardware, etc. at this time. I'll try to get to it tonight. Sorry.) In the mean time, I figure you could use this. The information is placed into a memo control.

   memo1.lines.clear;

   version:=GetVersion;
   memo1.lines.add('Windows Version: '
        + inttostr(LOBYTE(LOWORD(version))) + '.'
        + inttostr(HIBYTE(LOWORD(version))));
   memo1.lines.add('MS-DOS Version: '
        + intostr(HIBYTE(HIWORD(version))) + '.'
        + inttostr(LOBYTE(HIWORD(version))));

   memo1.lines.add('Free Space: '
        +inttostr(GetFreeSpace(0) div 1024)+'kb');

Hope this helps.
0
 

Author Comment

by:Rik
ID: 1336382
Vorlon,

Thanks for taking a "shot" at my question.  I pasted the above code into my project and here are the results:

Windows Version: 4.0
MS-DOS Version: 192.0
Free Space: 1024kb

Obviously this is not returning the correct values (Windows version seems to be correct but that's about it).

The On-Line documentation says that "GetVersion" returns a DWORD,  so that is what I declared version as.  It also says that "GetVersion" will NOT return the DOS version (is that incorrect).

Anyway, the have gotten answers ELSEWHERE for all of my questions except DOS Version, CPU Clock Speed (the most important to me).  

Got any other ideas?
0
 
LVL 2

Expert Comment

by:vorlon
ID: 1336383
The code I posted for you was tested using vb3 on windows 3.1. After reading your comment I went home and verified that GetVersion has changed from win16 to win32. It no longer returns the dos version. I also checked GetVersionEX and it, too, does not return the dos version. I'll keep checking and let you know...

0
 

Accepted Solution

by:
tfwong earned 100 total points
ID: 1336384
Try to download the DrBob.DLL v2.50 from http://home.pi.net/~drbob/

You can find more information at: http://www.drbob42.com/tools/drbob.htm (this page is updated for version 2.01)

The experts there may NOT include all the information you asked for but I think you may find them useful.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question