diff options
Diffstat (limited to 'shim')
| -rw-r--r-- | shim/Makefile | 37 | ||||
| -rw-r--r-- | shim/kc_main.c | 73 |
2 files changed, 0 insertions, 110 deletions
diff --git a/shim/Makefile b/shim/Makefile deleted file mode 100644 index 7183088..0000000 --- a/shim/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -include ../defaults.mk - -VPATH := ../lib - -TARGET := efi.os -.DEFAULT: $(TARGET) - -# EFI API for temporary things - -EFIAPIDIR := /usr/local/include/efi - -CPPFLAGS += -I../api -I$(EFIAPIDIR) -I$(EFIAPIDIR)/$(ARCH) -I$(EFIAPIDIR)/protocol -CFLAGS += -Wno-unused-const-variable -Wno-unused-function -fvisibility=hidden \ - -g -fshort-wchar -mgeneral-regs-only - -LIBDIRS += -L$(dir $(shell $(CC) -print-libgcc-file-name)) -LDSCRIPT := ../lib/component.ld -LDFLAGS += -z max-page-size=4096 --export-dynamic -pic --no-dynamic-linker -LOADLIBES := -lgcc - -OBJS := entry_x86_64.o reloc_x86_64.o kc_main.o elf64.o memcmp.o memcpy.o \ - memmove.o memset.o -$(OBJS): CFLAGS += -fPIC - -DEPS := $(patsubst %.o,%.d,$(OBJS)) - -$(TARGET): $(LDSCRIPT) $(MAKEFILE_LIST) -$(TARGET): $(OBJS) - -CLEANLIST := $(wildcard $(OBJS) $(TARGET)) -DCLEANLIST := $(wildcard $(DEPS)) - -include ../rules.mk --include $(DEPS) - -.DEFAULT: $(TARGET) - diff --git a/shim/kc_main.c b/shim/kc_main.c deleted file mode 100644 index 1829616..0000000 --- a/shim/kc_main.c +++ /dev/null @@ -1,73 +0,0 @@ -#include <loader/efi/shim.h> -#include <kernel/memory/range.h> - -#include <stdbool.h> - -#include "../lib/elf.h" - -struct efi_memory_map -{ - struct memory_range buffer; - UINTN size; - UINTN key; - UINTN descsize; - UINT32 descver; -}; - -struct efi_video_data -{ - struct memory_range buffer; - UINT32 width; - UINT32 height; - UINT32 pitch; - EFI_GRAPHICS_PIXEL_FORMAT format; - EFI_PIXEL_BITMASK mask; -}; - -struct efi_boot_data -{ - struct efi_memory_map memory_map; - struct efi_video_data video_data; - void *acpi_rsdp; - unsigned long acpi_version; -}; - -struct efi_loader_image kernel_image = -{ - .path = L"\\adasoft\\sophia\\kernel.os" -}; - -static struct efi_boot_data boot_data; - -// TODO: split relocation code out into library - -EFI_STATUS kc_main(struct efi_loader_interface *interface) -{ - // 1. load kernel and boot modules into memory - // 2. generate page tables for kernel and boot modules - // 2. gather boot data, store as type SystemMemoryType - // 3. exit boot services - // 5. ??????????? - - EFI_STATUS status; - - if (!interface) - { - return EFI_INVALID_PARAMETER; - } - - if (!EFI_ERROR((status = interface->image_open(&kernel_image))) && - !EFI_ERROR((status = interface->image_alloc(&kernel_image))) && - !EFI_ERROR((status = interface->image_load(&kernel_image)))) - { - (void)boot_data; - } - - __asm__ volatile ( - "cli\n\t" - "hlt\n\t" - ); - - return status; -} - |
