Page 1 of 1

problems with int 0x15 E820

Posted: Thu Feb 12, 2009 6:02 pm
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

Re: problems with int 0x15 E820

Posted: Thu Feb 12, 2009 6:28 pm
by AJ
Beware the endianness :)

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

Cheers,
Adam

Re: problems with int 0x15 E820

Posted: Fri Feb 13, 2009 1:43 am
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

Re: problems with int 0x15 E820

Posted: Fri Feb 13, 2009 6:01 am
by kmtdk
THx guys ..
( DARN i knew it, stupid endianness )

KMT dk