memory size

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
xyjamepa

memory size

Post by xyjamepa »

Hello
how can i get the size of the memory without using GRUB?
my os 32bit pmode.
thanx
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:memory size

Post by Pype.Clicker »

there should be plenty of methods described in the FAQ, including asking the BIOS, etc.
João Jerónimo

Re:memory size

Post by João Jerónimo »

abuashraf wrote: Hello
how can i get the size of the memory without using GRUB?
my os 32bit pmode.
thanx
Use GRUB! :-)


I don't need because I use grub, but if you really want to do that, you can use BIOS calls (execute them in Real Mode and then save the amount of memory in a structure you can access later) or probe memory directly (PMode)...

It's explained in the FAQ:
http://www.mega-tokyo.com/osfaq/How%20do%20I%20determine%20the%20amount%20of%20RAM%3F

JJ
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re:memory size

Post by Combuster »

afaik in PMode, you have two alternatives:
- Direct probing
- V8086 (or any other form of realmode emulation)
Direct probing can be hazardous and v8086 mode is annoying to program (or even nonexistant if you're up to 64 bits).

So basically you're sortof expected to do it by GRUB or by some ProprietaryBootLoader, but it can be done in PMode. Not that anybody here seems to like it.

<insert faq link here>
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply