From 132d3236bb884433bf94e961f6d32264e0334aec Mon Sep 17 00:00:00 2001 From: ornitorrincos Date: Tue, 18 Aug 2026 12:15:05 +0200 Subject: --- bootloader/memory.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 bootloader/memory.c (limited to 'bootloader/memory.c') diff --git a/bootloader/memory.c b/bootloader/memory.c new file mode 100644 index 0000000..1e310ae --- /dev/null +++ b/bootloader/memory.c @@ -0,0 +1,29 @@ +#include "memory.h" + + +void * EFIAPI AllocatePagesType(IN UINTN size, IN UINTN type) +{ + + void * ret = NULL; + + Print(L"About to allocate\n"); + EFI_STATUS status = uefi_call_wrapper(BS->AllocatePool, 3, type, size, &ret); + + if(status == EFI_SUCCESS) + { + Print(L"Pool Allocated\n"); + return ret; + } + + Print(L"Allocation Failed\n"); + return NULL; +} + +void bootloader_memset(void * in, uint64_t size, uint8_t value) +{ + uint8_t * tmpin = in; + for(int i = 0; i < size; i++) + { + tmpin[i] = value; + } +} -- cgit v1.2.3-70-g09d2