Solved

Gather Low level system info

Posted on 1997-05-17
7
299 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now