int 0x15 0xE820

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
Bipman
Member
Member
Posts: 40
Joined: Wed Mar 15, 2017 9:22 am

int 0x15 0xE820

Post 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
mariuszp
Member
Member
Posts: 587
Joined: Sat Oct 16, 2010 3:38 pm

Re: int 0x15 0xE820

Post by mariuszp »

You must do this before entering protected/long mode, unless you are using UEFI.
LtG
Member
Member
Posts: 384
Joined: Thu Aug 13, 2015 4:57 pm

Re: int 0x15 0xE820

Post 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).
Bipman
Member
Member
Posts: 40
Joined: Wed Mar 15, 2017 9:22 am

Re: int 0x15 0xE820

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