Memory Size problem.
Memory Size problem.
Hi.
I wonder how to get the memory size in protected mode?
I wonder how to get the memory size in protected mode?
Re: Memory Size problem.
Ask GRUB to provide it, if you use GRUB.
Re: Memory Size problem.
Hi,
Check out the wiki page on memory detection. If you're using GRUB, you can use the memory map it provides from protected mode. If not, however, you'll need to use the BIOS to detect it somewhere in real mode. Details are on the page.
Toodles,
Abloin
Check out the wiki page on memory detection. If you're using GRUB, you can use the memory map it provides from protected mode. If not, however, you'll need to use the BIOS to detect it somewhere in real mode. Details are on the page.
Toodles,
Abloin
Last edited by Alboin on Sat Jul 26, 2008 1:38 pm, edited 1 time in total.
C8H10N4O2 | #446691 | Trust the nodes.
Re: Memory Size problem.
Unless you're using GRUB (as said above) -- once you have switched to pmode, you are too late, and SOL (you would need to switch back to real/unreal/v86 mode).
- codemastersnake
- Member

- Posts: 148
- Joined: Sun Nov 07, 2004 12:00 am
- Contact:
Re: Memory Size problem.
In protected mode one way is to ask GRUB about the mem specs.
If you are using GRUB then save the global data structure that it provides and check it from there.
If you are using GRUB then save the global data structure that it provides and check it from there.
Re: Memory Size problem.
I direct probe starting from the top of accessible memory (4GB) and work my way down in large incriments until a value returns true and then work up in smaller chunks.. doesnt take very long and is pretty efficient.
Website: https://joscor.com
Re: Memory Size problem.
Hi,

Cheers,
Brendan
I'm sure it finds the video card's memory mapped I/O area fairly quickly, but I thought you were meant to be detecting RAM (instead of trashing the APICs, HPET, etc)?01000101 wrote:I direct probe starting from the top of accessible memory (4GB) and work my way down in large incriments until a value returns true and then work up in smaller chunks.. doesnt take very long and is pretty efficient.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
- codemastersnake
- Member

- Posts: 148
- Joined: Sun Nov 07, 2004 12:00 am
- Contact:
Re: Memory Size problem.
Don't Do that. You'll probably mess up with imp part of memory as said above!01000101 wrote:I direct probe starting from the top of accessible memory (4GB) and work my way down in large incriments until a value returns true and then work up in smaller chunks.. doesnt take very long and is pretty efficient.
Re: Memory Size problem.
hmm, I have never had a problem with any of those things before. I added it recently and it doesn't seem to mess anything up as far as I can tell. I use that memory function before I parse SMP tables and the APIC and no false/weird values get returned.
I guess I will look into it further, but it is not a core function that NEEDS to be there, I can deal without it.
I guess I will look into it further, but it is not a core function that NEEDS to be there, I can deal without it.
Website: https://joscor.com
Re: Memory Size problem.
Hi, I do use GRUB as bootloader.
Where can I find the document about memory information in GRUB?
Where can I find the document about memory information in GRUB?
- codemastersnake
- Member

- Posts: 148
- Joined: Sun Nov 07, 2004 12:00 am
- Contact:
Re: Memory Size problem.
well I tried to upload the pdf the system says file sioze is too big, anyways here's the link:huxuelei wrote:Hi, I do use GRUB as bootloader.
Where can I find the document about memory information in GRUB?
http://www.gnu.org/software/grub/manual ... iboot.html

