Detecting memory

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Locked
User avatar
BMW
Member
Member
Posts: 286
Joined: Mon Nov 05, 2012 8:31 pm
Location: New Zealand

Detecting memory

Post by BMW »

Whats the best way to detect how much memory is installed in the system??? All the BIOS functions have some pathetic limitation where they stop at memory holes above 16MB or something.... or is manual probing the way to go? (the wiki advises against this).

In my os, I give it 128MB of memory, and int 0x15 E801 reports 17.75MB.... thats a waste of time.
Currently developing Lithium OS (LiOS).

Recursive paging saves lives.
"I want to change the world, but they won't give me the source code."
FallenAvatar
Member
Member
Posts: 283
Joined: Mon Jan 03, 2011 6:58 pm

Re: Detecting memory

Post by FallenAvatar »

Please search the Wiki properly before posting here...

http://wiki.osdev.org/Detecting_Memory_ ... .3D_0xE820
Casm
Member
Member
Posts: 221
Joined: Sun Oct 17, 2010 2:21 pm
Location: United Kingdom

Re: Detecting memory

Post by Casm »

int 15h, fn 0xe820 will get you a memory map (which you will need), and you can find out the total size of memory by adding up the sizes of the blocks.

http://www.uruk.org/orig-grub/mem64mb.html
Locked