Page 1 of 1

int 0x15 0xE820

Posted: Wed May 03, 2017 3:03 pm
by Bipman
Hi all

Is there a way to do the same as an Int 15H from long mode or does this need to be done before switching to 64 long mode? i.e. get the memory layout. I've allocated 4GB to my OS for starters and was writing just near the limit of the 4GB (in Virtualbox) but got a reserved page error so I need to map where I can write and where I cannot.

Bipman

Re: int 0x15 0xE820

Posted: Wed May 03, 2017 4:02 pm
by mariuszp
You must do this before entering protected/long mode, unless you are using UEFI.

Re: int 0x15 0xE820

Posted: Thu May 04, 2017 2:35 am
by LtG
Why would you want to do it from long mode? I mean the system starts in real mode, where do you load your OS to? Are you now just blindly hoping 1M physical address space maps to actual RAM?

Without the memory map you have no way of knowing what's a valid physical address and what isn't. Note, if you are using GRUB/Multiboot then you don't need BIOS, they already provide the memory map (which they got from BIOS).

Re: int 0x15 0xE820

Posted: Thu May 04, 2017 3:12 am
by Bipman
Hi

I'm not using GRUB so would need to do it myself. I'll run from real mode first before getting into long mode as per the replies.

Bipman