BIOS function 0x15 E820 returns bad regions

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
alwaysnub
Posts: 20
Joined: Sat Aug 14, 2010 9:49 pm

BIOS function 0x15 E820 returns bad regions

Post 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.
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: BIOS function 0x15 E820 returns bad regions

Post by gerryg400 »

Did you test the carry flag and signature to be sure there is no error?
If a trainstation is where trains stop, what is a workstation ?
alwaysnub
Posts: 20
Joined: Sat Aug 14, 2010 9:49 pm

Re: BIOS function 0x15 E820 returns bad regions

Post 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.
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: BIOS function 0x15 E820 returns bad regions

Post 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.
"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 ]
alwaysnub
Posts: 20
Joined: Sat Aug 14, 2010 9:49 pm

Re: BIOS function 0x15 E820 returns bad regions

Post 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.
Post Reply