I am reading Memory Management 1 by Tim Robinson, and its stated that we need to find out the total amount of installed ram in the system, we can get up to 64mb by reading cmos... or by intting 15 in realmode... well I am using GRUB, I check the multiboot header specs... but I honestly can make heads or tails out of it... Is there an absolute way to detect the total amound of ram installing in a system?
I was thinking someting along the lines of psuedo code:
pointer to 2mb mark...
write 'a'
read 'a'
failure break from loop
else add 1mb to pointer and try again...
but my code must be sloppy and it goes through an inft loop.
Thanks for the help.
Rich P.
Detecting the Total Amound of Installed Memory?
Re:Detecting the Total Amound of Installed Memory?
Some newer bios call maybe can do some help for you when detect the installed RAM in the system,but this will depend on the mother board.
Another method is detect the RAM directly, you can get more details about this in www.mega-tokyo.com/os
Hopes help for you.
Another method is detect the RAM directly, you can get more details about this in www.mega-tokyo.com/os
Hopes help for you.
Re:Detecting the Total Amound of Installed Memory?
but if your code goes to, let's say 128 mb and then tries to write to 129 mb (which we say don't exist), what happends then? doesn't your os hang or something?
/ Christoffer
/ Christoffer
Re:Detecting the Total Amound of Installed Memory?
the method does work. The OS will not crash or anything. But, you DO have other things that may exhibit a memory function that you may never use as memory. Say, your acpi tables or your PCI configuration.bubach wrote: but if your code goes to, let?s say 128 mb and then tries to write to 129 mb (witch we say don?t exist), what happends then? does?nt your os hang or something?
/ Christoffer
Use int15/e820 or int15/e801. Just about all computers have them and they're easy to code, let alone that I've heard grub provides e820-ish output anyway..
Re:Detecting the Total Amound of Installed Memory?
I would not use probing memory at 1mb intervils,as i have read that it can DAMAGE your's or someone else's system.
"However, your BIOS knows things you ignore about your motherboard and PCI devices. Probing memory-mapped PCI devices may have unpredictable results and possibly damage your system, "
ASHLEY4.
"However, your BIOS knows things you ignore about your motherboard and PCI devices. Probing memory-mapped PCI devices may have unpredictable results and possibly damage your system, "
ASHLEY4.
Re:Detecting the Total Amound of Installed Memory?
you can either write your own bootloader to get the memory map from the BIOS or, as you are using GRUB see the example kernel that comes with it to see how you can use the memory map info supplied by it.
I haven't tried this as yet as i use my own bootloader. but i read somewhere that GRUB comes with a simple kernel showing you its features.
I haven't tried this as yet as i use my own bootloader. but i read somewhere that GRUB comes with a simple kernel showing you its features.
Only Human
Re:Detecting the Total Amound of Installed Memory?
I found a nice little ASM program that detects memory, trying 3 different ways.. Right now it just prints the blocks, but I've adapted it to store the blocks somehwere in memory where my C program can then read the blocks and do whatnot with them.
Heres the link:
http://my.execpc.com/~geezer/osd/boot/biosmem.asm
Heres the link:
http://my.execpc.com/~geezer/osd/boot/biosmem.asm