Hi!
I have read the detecting memory page on the Osdev-wiki.
There are talking about using BIOS function, and use the E*X extended register in the some time. I miss a point here. Need to call BIOS trough protected mode? What directive have to use in NASM([bits 16] or [bits 32]) or some prefixes.
Thanks for the help!
An doubt about detecting amount of RAM
Re: An doubt about detecting amount of RAM
Hello,
Typically the boot loader would pass this information to the operating system. If this is not possible, you may need to fall back to real mode or v86 mode in order to use the BIOS services for detecting memory.
Typically the boot loader would pass this information to the operating system. If this is not possible, you may need to fall back to real mode or v86 mode in order to use the BIOS services for detecting memory.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Re: An doubt about detecting amount of RAM
But the answer to your other question is that you use the "operand size prefix" in order to use extended registers when you are in real mode. NASM will know to put one in for you, and you do not need to do anything other than say "MOV EAX, 0xe820". You should be in "BITS 16" mode.
Re: An doubt about detecting amount of RAM
Thanks guys!