problems with int 0x15 E820

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
User avatar
kmtdk
Member
Member
Posts: 263
Joined: Sat May 17, 2008 4:05 am
Location: Cyperspace, Denmark
Contact:

problems with int 0x15 E820

Post by kmtdk »

well
as the title says, im having a little problem with the int 0x15 ( get memory map)
i can get the input, but i get some strange numbers, and i tryed to calculate the size( which shuld give 64 mb), but with no good result.
It is with ACPI 3.x
but dont think about that part ..
here is the raw input:

Code: Select all


0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xFC 0x09 0x00 0x00 0x00 0x00 0x00
0x01 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0xFC 0x09 0x00 0x00 0x00 0x00 0x00
0x00 0x04 0x00 0x00 0x00 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x01 0x00 0x00 0x00
0x00 0x80 0x0E 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x01 0x00 0x00 0x00 0x00 0x00
0x02 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0xEF 0x03 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x01 0x00 0x00 0x00
0x00 0x00 0xFF 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00
0x03 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0xFC 0xFF 0x00 0x00 0x00 0x00
0x00 0x00 0x04 0x00 0x00 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00
then i split it, and analyse it: ( the data after the "|" is when i use litlle ending)

Code: Select all

from 	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |0x0000000000000000
length 	0x00 0xFC 0x09 0x00 0x00 0x00 0x00 0x00 |0x000000000090cf00
type   	0x01 0x00 0x00 0x00 0x01 0x00 0x00 0x00 |0x01 
 
from 	0x00 0xFC 0x09 0x00 0x00 0x00 0x00 0x00 |0x000000000090cf00
length	0x00 0x04 0x00 0x00 0x00 0x00 0x00 0x00 |0x0000000000004000
type  	0x02 0x00 0x00 0x00 0x01 0x00 0x00 0x00 |0x02

from 	0x00 0x80 0x0E 0x00 0x00 0x00 0x00 0x00 |0x0000000000e00800
length	0x00 0x80 0x01 0x00 0x00 0x00 0x00 0x00 |0x0000000000100800
type	        0x02 0x00 0x00 0x00 0x01 0x00 0x00 0x00 |0x02

from 	0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x00 |0x0000000000010000
length	0x00 0x00 0xEF 0x03 0x00 0x00 0x00 0x00 |0x0000000030fe0000
type	        0x01 0x00 0x00 0x00 0x01 0x00 0x00 0x00 |0x01

from 	0x00 0x00 0xFF 0x03 0x00 0x00 0x00 0x00 |0x0000000030ff0000
length	0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 |0x0000000000100000
type	        0x03 0x00 0x00 0x00 0x01 0x00 0x00 0x00 |0x3

from 	0x00 0x00 0xFC 0xFF 0x00 0x00 0x00 0x00 |0x00000000ffcf0000
length	0x00 0x00 0x04 0x00 0x00 0x00 0x00 0x00 |0x0000000000400000
type   	0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |0x02

and if i add the usable memory together i get the hex number : 0x318ECF00


can anyone tell me what i do wrong ??
and secound: how can it be that 2 addresses cross eachother ???
aint BIOS supossed to do "avoid" that ??
[ just to be sure i use bochs, with 64 mb memory]

KMT dk
well, what to say, to much to do in too little space.
when it goes up hill, increase work, when it goes straight, test yourself but when going down, slow down.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: problems with int 0x15 E820

Post by AJ »

Beware the endianness :)

0x000000000090cf00 --> 0x00000000 009FC00 and so on...

Cheers,
Adam
Hyperdrive
Member
Member
Posts: 93
Joined: Mon Nov 24, 2008 9:13 am

Re: problems with int 0x15 E820

Post by Hyperdrive »

kmtdk wrote:well
as the title says, im having a little problem with the int 0x15 ( get memory map)
i can get the input, but i get some strange numbers, and i tryed to calculate the size( which shuld give 64 mb), but with no good result.
[snipped]
and if i add the usable memory together i get the hex number : 0x318ECF00

can anyone tell me what i do wrong ??
and secound: how can it be that 2 addresses cross eachother ???
aint BIOS supossed to do "avoid" that ??
[ just to be sure i use bochs, with 64 mb memory]
IIRC, E820 doesn't necessarily report all address ranges. Just assume those missing address ranges to be not usable...

In your map the address range 0xA0000-0xE7FFF (288 KiB) is not reported. If you fix your endianness issues (as AJ already said), your map should be correct for Bochs.

EDIT:
Note the following map entry:

Code: Select all

from     0x00 0x00 0xFF 0x03 0x00 0x00 0x00 0x00   --> 0x0000000003FF0000
length   0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00   --> 0x0000000000010000
type     0x03 0x00 0x00 0x00 0x01 0x00 0x00 0x00   --> 0x0000000000000003
That's a 64 KiB ACPI reclaimable area at the end of "extended memory", just below 0x4000000 = 64 MiB.

--TS
User avatar
kmtdk
Member
Member
Posts: 263
Joined: Sat May 17, 2008 4:05 am
Location: Cyperspace, Denmark
Contact:

Re: problems with int 0x15 E820

Post by kmtdk »

THx guys ..
( DARN i knew it, stupid endianness )

KMT dk
well, what to say, to much to do in too little space.
when it goes up hill, increase work, when it goes straight, test yourself but when going down, slow down.
Post Reply