Getting amount of RAM in the computer

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.
Post Reply
User avatar
obiwac
Member
Member
Posts: 149
Joined: Fri Jan 27, 2017 12:15 pm
Libera.chat IRC: obiwac
Location: Belgium

Getting amount of RAM in the computer

Post by obiwac »

Hello all!

Tomorrow, I will release the AQUA OS 1.2, and in it, will be widget pages. Further down the line, in future updates, I'd like to add more and more widgets. And for one of them I'd like to be able to show specs, like RAM. For now, I think that just RAM is enough.
So my question is, how can I get the amount of RAM that is in the computer?

Thanks in advance!
User avatar
Ch4ozz
Member
Member
Posts: 170
Joined: Mon Jul 18, 2016 2:46 pm
Libera.chat IRC: esi

Re: Getting amount of RAM in the computer

Post by Ch4ozz »

Grub gives you a memory map, count the bytes and round it up
User avatar
obiwac
Member
Member
Posts: 149
Joined: Fri Jan 27, 2017 12:15 pm
Libera.chat IRC: obiwac
Location: Belgium

Re: Getting amount of RAM in the computer

Post by obiwac »

That is very true, and quite embarrassing since I just implemented the code for reading the mmap from GRUB! #-o
Just had to multiply all the size values. Derp.

Thanks!
Post Reply