diff options
| author | Ada Christine <adachristine18@gmail.com> | 2024-02-13 01:04:02 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2024-02-13 01:04:02 +0000 |
| commit | 96ff1a24a7474b91c44a3dcd6f3abf3ec0542191 (patch) | |
| tree | f79dc76febe07d23d1ee6caf9a0b93bfcb85919d | |
| parent | 3f9278b48ff4bc0d2cf1604034b3bba548572f04 (diff) | |
reorganize a bit
| -rw-r--r-- | kjarna/Makefile | 7 | ||||
| -rw-r--r-- | kjarna/efi/file.c (renamed from kjarna/file.c) | 0 | ||||
| -rw-r--r-- | kjarna/efi/kjarna_efi.h (renamed from kjarna/kjarna_efi.h) | 4 | ||||
| -rw-r--r-- | kjarna/efi/memory.c (renamed from kjarna/memory.c) | 0 | ||||
| -rw-r--r-- | kjarna/efi/protocol.c (renamed from kjarna/protocol.c) | 0 | ||||
| -rw-r--r-- | kjarna/efi/runtime.c (renamed from kjarna/runtime.c) | 0 | ||||
| -rw-r--r-- | kjarna/efi/start.c (renamed from kjarna/start.c) | 5 | ||||
| -rw-r--r-- | kjarna/kjarna.h | 7 | ||||
| -rw-r--r-- | kjarna/main.c | 5 |
9 files changed, 18 insertions, 10 deletions
diff --git a/kjarna/Makefile b/kjarna/Makefile index 4cf6102..b02fbe6 100644 --- a/kjarna/Makefile +++ b/kjarna/Makefile @@ -1,7 +1,7 @@ include ../defaults.mk include ../efi.mk -VPATH := ../lib +VPATH := ../lib efi/ IMAGE := kjarna.efi @@ -18,9 +18,10 @@ all: $(IMAGE) CRT_OBJS := start.o LIB_OBJS := memcmp.o memset.o memcpy.o memmove.o string.o elf64.o -APP_OBJS := file.o memory.o protocol.o runtime.o +EFI_OBJS := file.o memory.o protocol.o runtime.o +APP_OBJS := main.o -OBJS := $(CRT_OBJS) $(LIB_OBJS) $(APP_OBJS) +OBJS := $(CRT_OBJS) $(LIB_OBJS) $(EFI_OBJS) $(APP_OBJS) DEPS := $(OBJS:.o=.d) $(IMAGE): $(OBJS) diff --git a/kjarna/file.c b/kjarna/efi/file.c index 6888390..6888390 100644 --- a/kjarna/file.c +++ b/kjarna/efi/file.c diff --git a/kjarna/kjarna_efi.h b/kjarna/efi/kjarna_efi.h index e24cc7f..48b0034 100644 --- a/kjarna/kjarna_efi.h +++ b/kjarna/efi/kjarna_efi.h @@ -5,7 +5,7 @@ #include <efi/types.h> #include <efi/tables.h> -#include <kjarna/interface.h> +#include "../kjarna.h" struct efi_context { @@ -34,5 +34,3 @@ void *efi_alloc_pool(size_t size); void *efi_calloc_pool(size_t count, size_t size); void efi_free_pool(void *block); -int runtime_start(void); - diff --git a/kjarna/memory.c b/kjarna/efi/memory.c index 7fbb4a8..7fbb4a8 100644 --- a/kjarna/memory.c +++ b/kjarna/efi/memory.c diff --git a/kjarna/protocol.c b/kjarna/efi/protocol.c index e4be9cd..e4be9cd 100644 --- a/kjarna/protocol.c +++ b/kjarna/efi/protocol.c diff --git a/kjarna/runtime.c b/kjarna/efi/runtime.c index 5f2e7e1..5f2e7e1 100644 --- a/kjarna/runtime.c +++ b/kjarna/efi/runtime.c diff --git a/kjarna/start.c b/kjarna/efi/start.c index 6a737b3..4a10541 100644 --- a/kjarna/start.c +++ b/kjarna/efi/start.c @@ -3,6 +3,7 @@ #include <efi/media.h> #include <efi/tables.h> +#include "../kjarna.h" #include "kjarna_efi.h" struct efi_context const *efi_context; @@ -18,9 +19,7 @@ EFI_STATUS _start(EFI_HANDLE handle, EFI_SYSTEM_TABLE *system_table) struct efi_context app_context = { handle, system_table }; efi_context = &app_context; - int runtime_result = runtime_start(); - - if (runtime_result < 0) + if (main(0, nullptr) != 0) { efi_errno = EFI_ABORTED; } diff --git a/kjarna/kjarna.h b/kjarna/kjarna.h new file mode 100644 index 0000000..d9291ca --- /dev/null +++ b/kjarna/kjarna.h @@ -0,0 +1,7 @@ +#pragma once + +#include <kjarna/interface.h> + +int main(int argc, char **argv); +int runtime_start(void); + diff --git a/kjarna/main.c b/kjarna/main.c index 3d34bf4..6420e83 100644 --- a/kjarna/main.c +++ b/kjarna/main.c @@ -1,6 +1,9 @@ -#include "kjarna_efi.h" +#include "kjarna.h" int main(int argc, char **argv) { + (void)argc; + (void)argv; + return runtime_start(); } |
