Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ramfind 1

Status
Not open for further replies.

bloaty

Technical User
Mar 30, 2006
6
GB
Hello Newbie here,
To all you Assembly Guru's out there PLEASE HELP!
Explanation:
looking to create a ramsniffer that will detect how much ram any given pc has, why! Well I want to make a bolt on routine to XMSDSK.EXE (RAMDISK Maker)that will find out how much ram you have on your pc, pipe this info into a .txt file, then use a small DOS calc todo 0.75x%variable%, then as a calculated variable %xxxxxxx% place this info into a batch file to auto create a ramdisk that is say 70% of the system ram of a Pc (with a built in safety guard of say no less than 16388-16mb's). This would need to be undertaken in dos7.1 with Himem.sys loaded. E.g. path\XMSDSK.EXE [%Variablesize%] r: /t /C1 /y

I found a routine called biosmem.asm which can be found at that uses bios calls in 3 stages to identify the ramsize. I then used a program called NASM (DOS)with the folowing code [NASM -f bin -o biosmem.com biosmem.asm] "Without brackets" to compile it into a .com file called biosmem.com. It displays the following text upon running:
memory ranges:
base=0x0, size=0x9FC00
base=0x100000, size=0x7EF0000
What I need is this progey to list only the ramsize in in Kb's. I was wondering if someone with Assembly knowledge would be able to adapt the biosmem.asm file to display only the ramsize with no text at all just the size in decimal numbers NOT Hex as I have no absolutely no idea at all in coding ASM otherwise I would try do it myself.

Regards,

Bloaty
 
Hi denc4,

Ummm, Yes I would do that once the size=0x7EF0000 could be isolated to whatever the decimal equivelant of 0x7EF0000 is identified to in RAMsize. Then, in theory pipe that to a .txt file, then use the DOS Calc progey, or Am I missing the point here?

However thanks for the reply, are you able to adapt the biosmem.asm to filter out the unneeded info just leaving the RAM figure in Decimal not HEX. It just seems simpler that way but I may be unerestimating the task of the ASM alterations, can you advise please? Please note the link in original message to Biosmem.asm.

Regards,

Dave
 
what kind of DOS Calc program are you talking about?
DOS doesn't have a calculator program that reads its input from a text file..

why don't you run the biosmem program and then convert
it's output manually.

if you are confined to DOS, use
ftp://ftp.cdrom.com/pub/simtelnet/msdos/calculte/numconv.zip

to convert hex to decimal.
otherwise just use the Windows Calculator to convert.

hope this helps.
 
Yes I could do that but the whole idea as I see it is to be able to undertake this task automatically within the batch file. So it looks like the biosmem.asm/biosmem.com program program would need to be adapted to detect the total value of the ram in decimal format, do the math conversion, then be able to input that info into a variable to then insert that into the batch code to load the ramdisk.

Ummm sounds very complicated looks as if it cannot be done, also Himem.sys & Emm386.exe would need to be loaded to make the said ram XMS area available for dos to.

Thanks for the link to the numconv.zip program Kewl
Regards,

Dave
 
you don't need EMM386.EXE to access extended memory,
just load HIMEM.SYS and XMSDSK.EXE can do its job.
 
Yes U R right however I have found a dos util that fullfills part of the jigsaw. it is called Ramfree & issues forth 1 line of text namely: ram bytes available: xxxxxxx.
If I could export this with Ramfree|find etc may be able to export to text file.

Thanks for the advise though denc4

best wishes

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top