Page 1 of 1

BIOS function 0x15 E820 returns bad regions

Posted: Sat Oct 16, 2010 8:32 pm
by alwaysnub
Let me start by saying hi!
This would be my first post.

(The Problem)
One of the things i have been working on in my os is maping/Detecting memory.
Using BIOS function 0x15 0xE820 i can successfully map the memory on my main PC, however.
On an older PC the function returns regions that all have the region Type (0xC4700)

(Region Example)
0x0808080808080808 = Base Address
0x17CF000808080808 = Length
0xC4700 = Type

Also the address and length cant be right ether, becuase theres only 256 MB of ram...
Yes!, i check the return values.

EAX = 0x534D4150
ECX = 20 - What i asked for.

Anyone know why the BIOS is returning this type of regions.

Re: BIOS function 0x15 E820 returns bad regions

Posted: Sun Oct 17, 2010 1:22 am
by gerryg400
Did you test the carry flag and signature to be sure there is no error?

Re: BIOS function 0x15 E820 returns bad regions

Posted: Sun Oct 17, 2010 11:44 am
by alwaysnub
Yes, i check the carry flag. Its fine.
Yes, i do check the signature in eax, but not edx becuase the Ralf Brown's Interrupt List does not list it as a return value.

Re: BIOS function 0x15 E820 returns bad regions

Posted: Sun Oct 17, 2010 12:47 pm
by Combuster
Known issue with some bioses, if you pass a non-zeroed struct to E820 it will not always remove the garbage that might be in there.

That and you seem to have an offset/printing problem.

Re: BIOS function 0x15 E820 returns bad regions

Posted: Sun Oct 17, 2010 2:30 pm
by alwaysnub
Ok, found the problem.

It was infact a printing problem, one of the things i was doing wrong was using the LODSB instruction and assuming DS was 0...
Dah!

Anyways thanks for the help guys, if i run into anymore problems il be sure to post.
The regions look correct now.