EFI_BOOT_SERVICES.AllocatePages issue
-
- Member
- Posts: 34
- Joined: Sat May 04, 2024 7:48 am
- Libera.chat IRC: wishedtobe
EFI_BOOT_SERVICES.AllocatePages issue
Having the function called, I was confused to find that the base address it returned cannot be divisible by 0x1000. Is the so-called 'page allocation' actually just allocating 4kb of space in integer multiples?
Re: EFI_BOOT_SERVICES.AllocatePages issue
Reading the spec (https://uefi.org/specs/UEFI/2.11/07_Ser ... ocatepages), it seems that the memory address is an in/out parameter, i.e. it must be initialized on input. Not seeing your code, I can only guess that this is a mistake you may have made. Other than that, yes, AllocatePages should return a page-aligned address.
Carpe diem!
Re: EFI_BOOT_SERVICES.AllocatePages issue
The significance of that IN OUT parameter depends upon the Type parameter.
-
- Member
- Posts: 5655
- Joined: Mon Mar 25, 2013 7:01 pm
Re: EFI_BOOT_SERVICES.AllocatePages issue
No, it really does allocate pages. There must be a problem with your code.wishedtobe wrote: ↑Fri Jan 24, 2025 1:21 amIs the so-called 'page allocation' actually just allocating 4kb of space in integer multiples?
-
- Member
- Posts: 34
- Joined: Sat May 04, 2024 7:48 am
- Libera.chat IRC: wishedtobe
Re: EFI_BOOT_SERVICES.AllocatePages issue
I'm allocating with an EFI_ALLOCATE_TYPE of AllocateAnyPages, which indicates that the inputting Memory is ignored.nullplan wrote: ↑Fri Jan 24, 2025 9:23 am Reading the spec (https://uefi.org/specs/UEFI/2.11/07_Ser ... ocatepages), it seems that the memory address is an in/out parameter, i.e. it must be initialized on input. Not seeing your code, I can only guess that this is a mistake you may have made. Other than that, yes, AllocatePages should return a page-aligned address.