diff options
-rw-r--r-- | bootstrap/stage1/firmware/efi/alloc.c | 5 | ||||
-rw-r--r-- | bootstrap/stage1/firmware/efi/efi.c | 16 | ||||
-rw-r--r-- | bootstrap/stage1/include/tty.h | 1 |
3 files changed, 15 insertions, 7 deletions
diff --git a/bootstrap/stage1/firmware/efi/alloc.c b/bootstrap/stage1/firmware/efi/alloc.c index d57e481..09d3793 100644 --- a/bootstrap/stage1/firmware/efi/alloc.c +++ b/bootstrap/stage1/firmware/efi/alloc.c @@ -18,10 +18,7 @@ */ #include <bootabi/efi.h> - -#ifndef NULL -#define NULL (void*)(0) -#endif +#include <stddef.h> extern uint64_t errno; extern efi_loaded_image_protocol_t *lip; diff --git a/bootstrap/stage1/firmware/efi/efi.c b/bootstrap/stage1/firmware/efi/efi.c index 140a9a6..169ae1f 100644 --- a/bootstrap/stage1/firmware/efi/efi.c +++ b/bootstrap/stage1/firmware/efi/efi.c @@ -188,11 +188,21 @@ uint64_t efi_main(void *handle, efi_system_t *st) { params->firmware_id = FIRMWARE_UEFI; efi_bootparam_t *uefi_params = balloc(sizeof(efi_bootparam_t)); uefi_params->st = st; - uefi_params->gop_info = gop->mode->info; - params->stack_ptr = balloc(4096); - memset(params->stack_ptr, 0, 4096); + uefi_params->gop_mode = gop->mode; params->firmware_params = (void*)uefi_params; + uint64_t heap_addr; + status = st->bootsrv->allocate_pages(AllocateAnyPages, + LoaderData, + 30, + &heap_addr); + if (status != 0) { + print_error(status); + return 0; + } + params->heap_ptr = (void*)heap_addr; + params->stack_ptr = balloc(4096); + if (load_mmap(uefi_params) == NULL) { print_error(errno); return 0; diff --git a/bootstrap/stage1/include/tty.h b/bootstrap/stage1/include/tty.h index af0d8f9..b693685 100644 --- a/bootstrap/stage1/include/tty.h +++ b/bootstrap/stage1/include/tty.h @@ -21,6 +21,7 @@ #define BOOTSTRAP_TTY_H #include <stdint.h> +#include <stddef.h> void tty_putchar(char c); char tty_getchar(void); |