Page 1 of 2 12>
Topic Options
#6246 - 2001-01-15 04:09 PM Retreiving Serial Number
Anonymous
Unregistered


Hey Guys,

I know this isn't the correct BBS for this, but I thought you guys might know the answer. My company heavily uses Dell computers. I know that Dell stores the Service Tag (same as Serial #) somewhere in the BIOS ROM. I know this because you can see it in the BIOS setup screen and the diagnostic disk can access it. I would like to create a script that calls a simple Assembler program to inventory the serial #'s to the computer name. I can write simple assembly program but I was wondering how I might find the memory address to read from?

Thanks,
Mark

Top
#6247 - 2001-01-15 05:16 PM Re: Retreiving Serial Number
Paul_Berquam Offline
Hey THIS is FUN

Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
Actually CJ posted some info on this here . I started working on doing the same thing with the Dells and found that they don't keep it in the same place between the desktops and the laptops, even different models seems to be in various places. I'll track down the code that I have so far and post it.

OK here it is. It is by no means complete, and I would like to change it to use an external data file for each of the manufacturers and set up a sort of 'default' options where it parses the dump for the information.

Hopefully I'll have some time soon to work on it some more. Enjoy

code:

break on

;Bios rev checker - Paul Berquam
;This script checks the model number, service tag and bios rev from bios
;tested on CPX laptops and GX110 desktops

GLOBAL $range
GLOBAL $cline
GLOBAL $outlen
GLOBAL $mfname
GLOBAL $first
GLOBAL $diff
GLOBAL $output2
GLOBAL $outlen2
GLOBAL $biosrev
GLOBAL $Biosdate
Global $sysinfo

:setrange
?
? "Is this computer a Dell? (Y/N) "
get $c
select
case ucase($c) = "Y"
? "Is this Dell a laptop or a desktop? (L/D) "
$sysinfo = "C:\Dell\sysinfo.dat"
$MFname = "Dell Computer Corporation"
$CRLF=chr(13)+chr(10)
$mfg = "Dell"

get $c
select
case ucase($c) = "L"
$range = "65a0 67a0"
$biosrevoffset = 1
$biosrevlen = 3
$biosrevdateoffset = 1
$biosdatelen = 10

case ucase($c) = "D"
$range = "0450 0650"
case ucase($c) = "X"
goto end
case 1
endselect
goto dell

case ucase($c) = "N"

$range = "0d00 0f00" ;or
$mfname = "Intel Corp"
$mfname2 = "Intel Corporation"
$biosrevoffset = 2
$biosrevlen = 21
$biosrevdateoffset = 12
$biosdatelen = 8
$sysinfo = "C:\sysinfo.dat"
$stnumber = "None"
goto intel
case 1

endselect

;**********************************************************************
;***
;*** Start Dell Computers

:dell

$currentST = readprofilestring("$sysinfo","ServiceTag","ServiceTag")

if exist("$sysinfo") = 1
$sysinfoexist = "True"
; File not found
else
$sysinfoexist = "False"
endif

gosub getdump

if $first = 0
goto notdell
endif


$second = instr($output2,$mfname)
$diff2 = $second+$mflen+1

$output3 = substr($output2,$diff2,$outlen2-$mflen-1)
$outlen3 = len($Output3)

$third = instr($output3,$mfname)

$STbegin = instr($output3,".")

$model = substr($output2,$diff2,$stbegin-1)
$STnumber = substr($output3,$STbegin+1,10)

$STend = instr($STNumber,".")
$stnumber = substr($stnumber,1,$stend-1)
$stnumber = rtrim($stnumber)

? "Info From Bios" ?
? "$mfname"
? "Model = $model"
? "Service Tag = $Stnumber"
? "Biosrev = $BiosRev"
? "BiosDate = $BiosDate"
?
? "Sysinfo = $sysinfo"
? "Current ST = $currentST"
?

If $currentST <> $stnumber and $sysinfoexist = "True"
?
? "Service tag in Bios differs from the local system"
? "Local file will be updated from $currentst to $stnumber"
copy "$sysinfo" "$sysinfo.old"
$= writeprofilestring("$sysinfo","Servicetag","Servicetag","$stnumber")
if @error = 0
? "File updated successfully"
else
? "There was an error updating the file."
sleep 2
endif
?
endif

;******************************
? "Done"


get $c

quit
exit


:notdell
if $mfg = "Intel"
goto intel
endif
? "This does not appear to be a Dell system"
$mfg = "Intel"
goto setrange
sleep 1

exit


;**********************************************************************
;***
;*** Start Intel

:intel
? "Starting Intel"

;
;$range = 0d00 0f00
gosub getdump

$mflen2 = len(mfname)
$second = instr($output2,$mfname2)
$diff2 = $second+$mflen2+1

$output3 = substr($output2,$diff2,$outlen2-$mflen-1)
$outlen3 = len($Output3)

$modelstart = instr($output3,".")
$model = substr($output3,$modelstart+1,10)
$model = rtrim($model)


? "Info From Bios" ?
? "$mfname"
?
? "Model = $model"
? "Biosrev = $BiosRev"
? "BiosDate = $BiosDate"
?
?


;******************************


? "Done"
get $c


;*******************************************************

:getdump
; Generate DEBUG script
del "c:\temp\debug.scr"
$=open(1, "c:\temp\debug.scr", 5)
$=writeline(1, "d f000:$range"+$CRLF) ; this is the address range in memory
;$=writeline(1, "d f000:0 ffff"+$CRLF)
$=writeline(1, "q"+$CRLF)
$=close(1)
sleep 1

; run script and output to .RES file
shell "cmd /c debug <c:\temp\debug.scr >c:\temp\@wksta.res"

$output = "Begin "
$=open(1, "c:\temp\@wksta.res")
$ = readline(1)
$line = readline(1) ;? "$line"

while $line <> "-q"
$cline =substr($line, 62, 16) ;? "$cline"
$Output = $output + $cline
$line = readline(1)
loop
$=close(1)


$outlen = len($output)
$mflen = len($mfname)
$first = instr($output,$mfname)

$diff = $first+$mflen+$biosrevoffset
$output2 = substr($output,$diff,$outlen-$diff)
$outlen2 = len($output2)

$BiosRev = substr($output,$Diff,$biosrevlen)
$biosdate = substr($output,$diff + $biosrevlen + $biosrevdateoffset,$biosdatelen)


return


------------------


"He was a good little monkey and always very curious..."

[This message has been edited by Paul_Berquam (edited 15 January 2001).]

_________________________
He was a good little monkey and always very curious...

Top
#6248 - 2001-01-15 07:06 PM Re: Retreiving Serial Number
Anonymous
Unregistered


Thanks CJ!

This looks like it will work for what I need. We only use about 5 or 6 different models so I should be able to modify it for each. I will play with it and see what happens.

Mark

Top
#6249 - 2001-01-15 07:17 PM Re: Retreiving Serial Number
Paul_Berquam Offline
Hey THIS is FUN

Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
If you find any different offsets for the different model please post them. No sense in reinventing the wheel.

Glad it worked for you.

------------------

"He was a good little monkey and always very curious..."

_________________________
He was a good little monkey and always very curious...

Top
#6250 - 2001-01-15 07:20 PM Re: Retreiving Serial Number
Anonymous
Unregistered


I will. I also would like to sort of automate it to maybe autodetect Mfg and model. I will need to look at the dumps from several computers to see if I can do that or not though.
Top
#6251 - 2001-01-15 08:43 PM Re: Retreiving Serial Number
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3164
Loc: Houston TX
I just ran this script on my GX1 and it was not able to find the information.

My GX100 gave me this.

Dell Computer Corporation
Model = OptiPlex GX100
Service Tag = 1MVY10B
Biosrev =
BiosDate =

Sysinfo = C:\Dell\sysinfo.dat
Current ST =

I have the following Dell models avaliable to me here.

G1
GX1
Gx100
Gx110
Gx300

Poweredge 1300
Poweredge 2400
Poweredge 4400

Also, all dell computers are wiped clean, and reformatted using a ghost image that was built from the ground up (almost all dell support software is not installed, this includes the c:\dell directory)

I would be glad to assist in any way that i could, for this project (but i have no idea on how to work debug )

Bryce

Top
#6252 - 2001-01-15 08:57 PM Re: Retreiving Serial Number
Anonymous
Unregistered


I have done a BIOS dump (F000:0 FFFF) on two different systems so far. One was a GXi and the other a GX1.

The GX1 had the following things of interest to me:

F000:B5DC B5E8 = "Optiplex GX1" -Could be useful for autodetecting model.
F000:B622 B626 = 5 Digit Service Tag

The GXi had:

F000:C192 C1A7 = "Optiplex GXi" =Could be useful for autodetecting model.

Unfortunately I could not find the service tag anywhere in the dump from the GXi. I don't know if this means it is not stored in the ROM of GXi's or if I was just not looking in the correct ranges.

Debug is a utility built into DOS (and NT) that is useful for running short Assembly segments, but can also be used to dump data from memory. To use it just type debug at the command prompt and you will be given a new prompt. Type ? for a list of commands. If you type "d F000:0 FFFF" you will be given a memory dump from F000:0000 to F000:FFFF. (This may take a while, debug is slow).

Mark

Top
#6253 - 2001-01-15 09:15 PM Re: Retreiving Serial Number
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Very cool script Paul,

Need to move $CRLF=chr(13)+chr(10) from where it is to under GLOBALs. It is not defined in non-Dell section otherwise and you get a DEBUG.SCR without the CRLFs - hangs the DOS box.

Bryce, (and others)

Debug is used here to dump the information in the BIOS ROM about the computer. The DEBUG.SCR file is a set of keystrokes that we < to DEBUG.EXE and then capture the result.

D is for Dump and it displays memory at a starting address. The range is the amount of mem to dump. The default range is 0x180.

Q is quit. So the script runs DEBUG.EXE, Dumps a small piece of memory and then Quits. The output file is in the format of

Segment:offset/\/\un0ln0/\un1ln1/\...-../\un15ln15/\/\/\c0c1c2....c15CRLF

where
segment:offset = the absolute address
/\ = space
unX = upper nibble of byte X
lnX = lower nibble of byte X
cX = character of byte X

X is the absolute address of the byte. eg:

0ADF:0100 06 F8 96 01 74 09 50 56-9A E0 01 C5 10 5E 58 FF ....t.PV.....^X.

at address 0adf:0100 is byte 0x06 which looks like "." (it doesn't really, but that is what DEBUG.EXE shows for non-displayable characters)

as an aside... 0adf:0100 translates to 0adf0 + 100 = 0aef0 in physical memory. This is the 44,784th btye (prob on the first sim)

I love assembly!

cj

Top
#6254 - 2001-01-15 09:31 PM Re: Retreiving Serial Number
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8609
I've got a neat little DOS program called smbios.exe that pumps out bios info to an INI type file...

Works great on HP's - not too sure 'bout DELL's - I'll email it to anyone that's interested...

Shawn.

Top
#6255 - 2001-01-15 09:33 PM Re: Retreiving Serial Number
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3164
Loc: Houston TX
Sent it my way please!

Bryce

Top
#6256 - 2001-01-15 09:46 PM Re: Retreiving Serial Number
Paul_Berquam Offline
Hey THIS is FUN

Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
I would be interested in checking that out as well. Wouldn't hurt to see if it would work on the Dells.

Thanks

------------------

"He was a good little monkey and always very curious..."

_________________________
He was a good little monkey and always very curious...

Top
#6257 - 2001-01-15 10:10 PM Re: Retreiving Serial Number
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3164
Loc: Houston TX
Shawn, i got the program and it seems to be working just fine with my dell gx1, and gx100

Nice little program!

Bryce

Top
#6258 - 2001-01-15 10:14 PM Re: Retreiving Serial Number
Paul_Berquam Offline
Hey THIS is FUN

Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
I second that one. Very cool. What did you write it in?

------------------

"He was a good little monkey and always very curious..."

_________________________
He was a good little monkey and always very curious...

Top
#6259 - 2001-01-15 10:24 PM Re: Retreiving Serial Number
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8609
Guys...

Unfortunately - I can't take the credit for this one... it was developed by one of our external consultants (or he lifted it from somewhere else) not too sure of the history here...

But yes - I do own the source code. It was developed using Borland C++ ... glad you like it...

Shawn.

Top
#6260 - 2001-01-15 10:47 PM Re: Retreiving Serial Number
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
Shawn

I wonder if your smbios.exe is the same as found on this site: http://www.ibm.com/products/surepath/other/smbios.html
Sourcecode also found on this site. Anyway lots of info. Other utils found in WinBios.exe

Erik

[This message has been edited by kholm (edited 15 January 2001).]

Top
#6261 - 2001-01-16 12:20 AM Re: Retreiving Serial Number
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8609
Erik:

hmmm - I just download the source code for IBM's SMBIOS - it's definitely not the same one I have (but maybe it was based on an earlier version of this utility)...

But the brief look I did have seems to suggest that this is one cool tool - there's TONS of command line switches (ours has none) - definitely worth a look-see ...

We use our version of smbios during the discovery portion of our automated NT installs - we create one CD that will support the entire line of HP Vectra workstations...

In a week or two - we have to do the same thing with an IBM line of computers - will definitely check this program out at that time...

Thanks...

Shawn.

Top
#6262 - 2001-01-16 06:48 PM Re: Retreiving Serial Number
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
could you shoot it to me also??

I have to SP6a every PC we have but not the dell laptops...

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#6263 - 2001-01-16 08:19 PM Re: Retreiving Serial Number
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
here is the debug range for compaq deskpros

-d f000:a336 a35a

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#6264 - 2001-01-16 08:38 PM Re: Retreiving Serial Number
Anonymous
Unregistered


this is the code I have used for a while now that allows me to get bios info from a system during a dos lan logon . I can then load the image that is correct for the system.

I am using 2 programs vpdump.exe and smbios2.exe both supplied to me from IBM (we have 4000 ibm systems)

the command line switches in smbios2.exe allow for geting more info from the bios if needed ( on some systems I can get the network card that is installed.)

I am useing kixtart version that works in dos so this code could be done better if you could do it from windows

I'm not sure if the code will post correctly as I don't know what the commands are to to separate it from the text.

;***********************************************************8
;********* kixtart for dos login that gets model and serial no.
;*************
;************* sections
;************* :
;************* :10/11/00 had to add provision to use smbios2 before vpddump... t-20s don't reconize serial number and model
;************* :
;************* :
shell "%comspec% /c n:\dosboot\smbios2.exe/g 01 >a:\smbios.txt"
"@error"?
"@ldrive"?
IF EXIST ("a:\smbios.txt")
$rc=OPEN(1,"a:\smbios.txt")

$offset=0
$string="Serial Number"
while $offset=0
$Line=READLINE(1)
$offset=INSTR("$Line","$string") ;************* serial no line is 22 model no is 34 both are both are 7 char long
;?"offset is : $offset"?
;" serial : $Line"?

if $offset=1 ;found serial no
$serial=$line ;this will change the $string to look for Model no because we have alredy found serial number
$offset=0
$string="Model Number"
$Serial=SUBSTR("$serial",LEN($serial)-6,7)
endif

if $offset=14 ;found model no
$model=$line
;$mod_lgth=LEN("$model")
$model=SUBSTR("$model",LEN($model)-6,7)
endif
Loop
? "$serial"?
"$model"
$rc=close(1)

;sleep 20

Endif

IF $serial = "" OR $model = ""
shell "%comspec% /c n:\dosboot\vpddump.exe >a:\vpd.txt"
"@error"?
"@ldrive"?


IF EXIST ("a:\vpd.txt")
$rc=OPEN(1,"a:\vpd.txt")

$offset=0
$string="Serial Number"
while $offset=0
$Line=READLINE(1)
$offset=INSTR("$Line","$string") ;************* serial no line is 22 model no is 34 both are both are 7 char long
;?"offset is : $offset"?
;" serial : $Line"?

if $offset=1 ;found serial no
$serial=$line ;this will change the $string to look for Model no because we have alredy found serial number
$offset=0
$string="Model Number"
$Serial=SUBSTR("$serial",LEN($serial)-6,7)
endif

if $offset=14 ;found model no
$model=$line
;$mod_lgth=LEN("$model")
$model=SUBSTR("$model",LEN($model)-6,7)
endif
Loop
? "$serial"?
"$model"
$rc=close(1)

;sleep 20

Endif

endif

;************* :
;************* :
;************* :
;************* :

Top
#6265 - 2001-01-16 09:01 PM Re: Retreiving Serial Number
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8609
brown, et al...

yeah - that smbios2 from IBM seems to work pretty well.. I just ran it over here on some HP's like this...

smbios2 /g 01
smbios2 /g 02
smbios2 /g 03

spits out the bios in pieces... neat...

Shawn.

Top
Page 1 of 2 12>


Moderator:  Jochen, Allen, Radimus, Chris S., Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
2 registered (Allen, ShaneEP) and 158 anonymous users online.
Newest Members
Sjaak, Biybucket, Markus1961, Ian231, kixnewbie12
17480 Registered Users

Generated in 0.056 seconds in which 0.023 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org