flat assembler
Message board for the users of flat assembler.

Index > OS Construction > counting ram

Author
Thread Post new topic Reply to topic
thecf



Joined: 23 Dec 2006
Posts: 23
thecf
is there a way of calculating the amount of ram without using the bios interupts??
Post 24 Feb 2008, 23:22
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17269
Location: In your JS exploiting you and your system
revolution
You can scan it until you either find it wraps around or you can't set the value. But be careful of memory mapped I/O, you might cause something to go astray.

Another way is to read the config directly from the chipset, maybe you can download a spec sheet from the MB manufacturer.
Post 24 Feb 2008, 23:36
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
the paging can be used
set a page to the current 4k to test
if the memory is available, then you can read form the offset 0 of the page
increment the Page base
you can then test for all the 4G
and then set a Page Table with present flag updated


but, the ram is not always the one for the ┬ÁP, the specific ram for graphics will be included, the same for several extensions.

so, the method that revolution told to you seems to be good, but dependant on hardware...
and asm coders want to do all by themslve Very Happy
Post 25 Feb 2008, 00:07
View user's profile Send private message Visit poster's website Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto
Quote:

is there a way of calculating the amount of ram without using the bios interupts??


Yes, read SPD ( Serial Presence Detect) from eeprom of your RAM module trough SMBus Wink
Post 25 Feb 2008, 10:29
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Use the BIOS and avoid problems with reserved memory areas...

probing memory manually is a bad idea, unless you're writing a BIOS memory detection routine and know wtf you're doing, including (but not limited to) the exact chipset you're targeting.
Post 25 Feb 2008, 16:09
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.