summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2026-05-26 21:32:27 +0000
committerAda Christine <adachristine18@gmail.com>2026-05-26 21:32:27 +0000
commita10aabfcd52f702057316018cd7847ab2bfe4aa1 (patch)
treecc4652d2b602798934e8a48b4939cfb20eda1989 /boot
parent90c29fdde317c39384011a6ba97077c138f13ad6 (diff)
we're bringing kjarna back and not doing the crazy stuff with trying to have task management during efi. that was a bit extra.kjarna
Diffstat (limited to 'boot')
-rw-r--r--boot/Makefile4
-rw-r--r--boot/efi/status.h110
-rw-r--r--boot/efi/system_table.h31
-rw-r--r--boot/efi/table.h26
4 files changed, 2 insertions, 169 deletions
diff --git a/boot/Makefile b/boot/Makefile
index 29151cd..87634d3 100644
--- a/boot/Makefile
+++ b/boot/Makefile
@@ -4,11 +4,11 @@ include ../defaults.mk
$(CC.info)
@$(CC) $(LDFLAGS) -o $@ $^
-VPATH := ../lib ../lib/asm/$(ARCH) efi/
+VPATH := ../lib ../lib/libc ../lib/asm/$(ARCH) efi/
IMAGE := kjarna.efi
-CPPFLAGS += -I../api -I../lib
+CPPFLAGS += -I../api -I../lib -I../lib/api
CFLAGS += --target=$(ARCH)-unknown-windows -fshort-wchar -mno-avx \
-mno-sse -mno-mmx -funsigned-char -Wno-pointer-sign -ggdb \
diff --git a/boot/efi/status.h b/boot/efi/status.h
deleted file mode 100644
index bcb6b96..0000000
--- a/boot/efi/status.h
+++ /dev/null
@@ -1,110 +0,0 @@
-#pragma once
-
-#include <cstddef>
-#include <limits>
-#include <type_traits>
-
-namespace Efi
-{
- class Status
- {
- using size_t = std::size_t;
- using ssize_t = std::make_signed_t<size_t>;
-
- size_t m_Value;
-
- constexpr Status(size_t value)
- : m_Value(value)
- {
- }
-
- constexpr bool IsError() const
- {
- return static_cast<ssize_t>(m_Value) < 0;
- }
-
- constexpr bool IsWarning() const
- {
- return m_Value > 0;
- }
-
- constexpr bool IsSuccess() const
- {
- return m_Value == 0;
- }
-
- constexpr static Status ErrorStatus(size_t code)
- {
- auto errorBit = std::numeric_limits<ssize_t>::min();
- return Status(static_cast<size_t>(errorBit) | code);
- }
-
- constexpr static Status WarningStatus(size_t code)
- {
- return Status(code);
- }
-
- public:
-
- operator size_t() const
- {
- return m_Value;
- }
-
- static const Status Success;
-
- class Warning
- {
- public:
-
- static const Status UnknownGlyph;
- static const Status DeleteFailure;
- static const Status WriteFailure;
- static const Status BufferTooSmall;
- static const Status StaleData;
- static const Status FileSystem;
- static const Status ResetRequired;
- };
-
- class Error
- {
- public:
-
- static const Status LoadError;
- static const Status InvalidParameter;
- static const Status Unsupported;
- static const Status BadBufferSize;
- static const Status BufferTooSmall;
- static const Status NotReady;
- static const Status DeviceError;
- static const Status WriteProtected;
- static const Status OutOfResources;
- static const Status VolumeCorrupted;
- static const Status VolumeFull;
- static const Status NoMedia;
- static const Status MediaChanged;
- static const Status NotFound;
- static const Status AccessDenied;
- static const Status NoResponse;
- static const Status NoMapping;
- static const Status Timeout;
- static const Status NotStarted;
- static const Status AlreadyStarted;
- static const Status Aborted;
- static const Status IcmpError;
- static const Status TftpError;
- static const Status ProtocolError;
- static const Status IncompatibleVersion;
- static const Status SecurityViolation;
- static const Status CrcError;
- static const Status EndOfMedia;
- static const Status EndOfFile;
- static const Status InvalidLanguage;
- static const Status CompromisedData;
- static const Status IpAddressConflict;
- static const Status HttpError;
- };
-
- };
-}
-
diff --git a/boot/efi/system_table.h b/boot/efi/system_table.h
deleted file mode 100644
index 93e839d..0000000
--- a/boot/efi/system_table.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#pragma once
-
-#include "table.h"
-
-extern "C"
-{
- struct efi_system_table
- {
- void *m_Value;
- };
-}
-
-namespace Efi
-{
- class SystemTable : private Table
- {
- char16_t *m_FirmwareVendor;
- uint32_t m_FirmwareRevision;
- Handle m_ConsoleInHandle;
- void *m_ConIn;
- Handle m_ConsoleOutHandle;
- void *m_ConOut;
- Handle m_StandardErrorHandle;
- void *m_StdErr;
- void *m_RuntimeServices;
- void *m_BootServices;
- size_t m_NumberOfTableEntries;
- void *m_ConfigurationTable;
- };
-}
-
diff --git a/boot/efi/table.h b/boot/efi/table.h
deleted file mode 100644
index 660bd1e..0000000
--- a/boot/efi/table.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#pragma once
-
-#include <cstddef>
-#include <cstdint>
-
-namespace Efi
-{
- class TableHeader
- {
- using uint64_t = std::uint64_t;
- using uint32_t = std::uint32_t;
- using size_t = std::size_t;
-
- uint64_t m_Signature;
- uint32_t m_Revision;
- uint32_t m_HeaderSize;
- uint32_t m_Crc32;
- uint32_t m_Reserved;
- };
-
- class Table
- {
- TableHeader m_Header;
- };
-}
-