We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

Gather Low level system info

Rik
Rik asked
on
Medium Priority
356 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?
Comment
Watch Question

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



Rik

Author

Commented:
Edited text of question
Rik

Author

Commented:
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

Commented:
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.
Rik

Author

Commented:
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?

Commented:
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...

Commented:
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.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.