From dd192787a70a973f2474720aea49af3f6ddabb7a Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 26 Jan 2024 19:17:00 +0100 Subject: h-core: Breaking kernel changes, IDevice becomes DeviceInterface, the UPT is Read Only by default. DebugManager allocates space for users by default (for a debug message) Update PEF enum kPefArch. Move Seeker into the /Services directory. Complete merge of SupportKit to KernelKit. Signed-off-by: Amlal El Mahrouss --- KernelKit/CodeManager.hpp | 11 +++++------ KernelKit/DebugOutput.hpp | 4 ++-- KernelKit/Device.hpp | 20 ++++++++++---------- KernelKit/DriveManager.hpp | 2 +- KernelKit/PEF.hpp | 2 +- KernelKit/SharedObjectCore.hxx | 6 +++--- 6 files changed, 22 insertions(+), 23 deletions(-) (limited to 'KernelKit') diff --git a/KernelKit/CodeManager.hpp b/KernelKit/CodeManager.hpp index fdf80e91..04d5647b 100644 --- a/KernelKit/CodeManager.hpp +++ b/KernelKit/CodeManager.hpp @@ -56,16 +56,15 @@ namespace hCore namespace Utils { /// \brief Much like Mac OS's UPP. + /// This is read-only by design. /// It handles different kind of code. /// PowerPC <-> AMD64 for example. typedef struct UniversalProcedureTable { - public: - Char symbolName[kPefNameLen]; - VoidPtr symbolPtr; - SizeT symbolArchitecture; - - } UniversalProcedureTableType; + const Char NAME[kPefNameLen]; + const VoidPtr TRAP; + const SizeT ARCH; + } __attribute__((packed)) UniversalProcedureTableType; bool execute_from_image(PEFLoader& exec); } diff --git a/KernelKit/DebugOutput.hpp b/KernelKit/DebugOutput.hpp index 3bfb0144..1e30e6a4 100644 --- a/KernelKit/DebugOutput.hpp +++ b/KernelKit/DebugOutput.hpp @@ -16,10 +16,10 @@ namespace hCore { // @brief Emulates a VT100 terminal. - class TerminalDevice final : public IDevice + class TerminalDevice final : public DeviceInterface { public: - TerminalDevice(void (*print)(const char *), void (*get)(const char *)) : IDevice(print, get) {} + TerminalDevice(void (*print)(const char *), void (*get)(const char *)) : DeviceInterface(print, get) {} virtual ~TerminalDevice() {} /// @brief returns device name (terminal name) diff --git a/KernelKit/Device.hpp b/KernelKit/Device.hpp index e407f4e9..b117cf7f 100644 --- a/KernelKit/Device.hpp +++ b/KernelKit/Device.hpp @@ -19,37 +19,37 @@ namespace hCore { template - class IDevice; + class DeviceInterface; template - class IDevice + class DeviceInterface { public: - IDevice(void (*Out)(T), void (*In)(T)) + explicit DeviceInterface(void (*Out)(T), void (*In)(T)) : m_Out(Out), m_In(In) {} - virtual ~IDevice() = default; + virtual ~DeviceInterface() = default; public: - IDevice &operator=(const IDevice &) = default; - IDevice(const IDevice &) = default; + DeviceInterface &operator=(const DeviceInterface &) = default; + DeviceInterface(const DeviceInterface &) = default; public: - IDevice &operator<<(T Data) + DeviceInterface &operator<<(T Data) { m_Out(Data); return *this; } - IDevice &operator>>(T Data) + DeviceInterface &operator>>(T Data) { m_In(Data); return *this; } - virtual const char *Name() const + virtual const char* Name() const { - return ("IDevice"); + return ("DeviceInterface"); } operator bool() { return m_Out && m_In; } diff --git a/KernelKit/DriveManager.hpp b/KernelKit/DriveManager.hpp index bb4e453c..9951c9cf 100644 --- a/KernelKit/DriveManager.hpp +++ b/KernelKit/DriveManager.hpp @@ -64,7 +64,7 @@ namespace hCore #define kPacketZip "file/x-zip" //! drive as a device. - typedef IDevice Drive; + typedef DeviceInterface Drive; typedef Drive* DrivePtr; class DriveSelector final diff --git a/KernelKit/PEF.hpp b/KernelKit/PEF.hpp index 40c9f8a0..a2f5c5b8 100644 --- a/KernelKit/PEF.hpp +++ b/KernelKit/PEF.hpp @@ -32,7 +32,7 @@ namespace hCore kPefArchAMD64, kPefArchRISCV, kPefArch64x0, /* 64x000. */ - kPefArchPOWER, + kPefArch32x0, kPefArchInvalid = 0xFF, }; diff --git a/KernelKit/SharedObjectCore.hxx b/KernelKit/SharedObjectCore.hxx index f648fdc0..94b0ead2 100644 --- a/KernelKit/SharedObjectCore.hxx +++ b/KernelKit/SharedObjectCore.hxx @@ -7,8 +7,8 @@ * ======================================================== */ -#ifndef __SUPPORTKIT_SHARED_OBJECT_CORE_HXX__ -#define __SUPPORTKIT_SHARED_OBJECT_CORE_HXX__ +#ifndef __KERNELKIT_SHARED_OBJECT_CORE_HXX__ +#define __KERNELKIT_SHARED_OBJECT_CORE_HXX__ #include #include @@ -54,4 +54,4 @@ namespace hCore } } -#endif /* ifndef __SUPPORTKIT_SHARED_OBJECT_CORE_HXX__ */ +#endif /* ifndef __KERNELKIT_SHARED_OBJECT_CORE_HXX__ */ -- cgit v1.2.3