summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/KernelKit
diff options
context:
space:
mode:
Diffstat (limited to 'dev/kernel/KernelKit')
-rw-r--r--dev/kernel/KernelKit/DeviceMgr.h17
-rw-r--r--dev/kernel/KernelKit/FileMgr.h7
-rw-r--r--dev/kernel/KernelKit/IDylibObject.h15
-rw-r--r--dev/kernel/KernelKit/IPEFDylibObject.h8
-rw-r--r--dev/kernel/KernelKit/KPC.h5
5 files changed, 31 insertions, 21 deletions
diff --git a/dev/kernel/KernelKit/DeviceMgr.h b/dev/kernel/KernelKit/DeviceMgr.h
index 8d749ec9..7c7b9da3 100644
--- a/dev/kernel/KernelKit/DeviceMgr.h
+++ b/dev/kernel/KernelKit/DeviceMgr.h
@@ -8,8 +8,8 @@
Revision History:
- 31/01/24: Add kDeviceCnt (amlel)
- 15/11/24: Add NE_DEVICE macro, to inherit from device object.
+ 31/01/24: Add kDeviceCnt (amlel)
+ 15/11/24: Add NE_DEVICE macro, to inherit from device object.
------------------------------------------- */
@@ -26,12 +26,15 @@
#define NE_DEVICE : public ::Kernel::IDeviceObject
-// Last Rev: Wed, Apr 3, 2024 9:09:41 AM
+// Last Rev: Wed, May 27, 2025 6:22 PM
namespace Kernel {
template <typename T>
class IDeviceObject;
+template <typename T>
+class IOBuf;
+
/***********************************************************************************/
/// @brief Device contract interface, represents an HW device.
/***********************************************************************************/
@@ -103,7 +106,8 @@ class IOBuf final {
///! @brief Device enum types.
enum {
- kDeviceTypeIDE,
+ kDeviceTypeInvalid = 0,
+ kDeviceTypeIDE = 100,
kDeviceTypeEthernet,
kDeviceTypeWiFi,
kDeviceTypeFW,
@@ -114,7 +118,10 @@ enum {
kDeviceTypeMBCI,
kDeviceTypeATA,
kDeviceTypeUSB,
- kDeviceTypeMediaCtrl, // MM controller
+ kDeviceTypeAPM, // Adv. Pwr. Mgmt.
+ kDeviceTypePCI,
+ kDeviceTypeVGA,
+ kDeviceTypeGPU,
kDeviceTypeCount,
};
} // namespace Kernel
diff --git a/dev/kernel/KernelKit/FileMgr.h b/dev/kernel/KernelKit/FileMgr.h
index dcce787f..13eeabdf 100644
--- a/dev/kernel/KernelKit/FileMgr.h
+++ b/dev/kernel/KernelKit/FileMgr.h
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright (C) 2024-2025, Amlal El Mahrouss Labs, all rights reserved.
+ Copyright (C) 2024-2025, Amlal El Mahrouss , all rights reserved.
File: FileMgr.h
Purpose: Kernel file manager.
@@ -52,6 +52,7 @@
@note Refer to first enum.
*/
#define kFileOpsCount (4U)
+
#define kFileMimeGeneric "ne-application-kind/all"
/** @brief invalid position. (n-pos) */
@@ -344,7 +345,7 @@ using FileStreamUTF16 = FileStream<WideChar>;
typedef UInt64 CursorType;
-inline static const auto kRestrictStrLen = 8U;
+inline STATIC const auto kRestrictStrLen = 8U;
/// @brief restrict information about the file descriptor.
struct FILEMGR_RESTRICT final {
@@ -386,7 +387,7 @@ inline FileStream<Encoding, Class>::FileStream(const Encoding* path, const Encod
}
}
- kout << "FileMgr: New file at: " << path << ".\r";
+ kout << "FileMgr: Open file at: " << path << ".\r";
}
/// @brief destructor of the file stream.
diff --git a/dev/kernel/KernelKit/IDylibObject.h b/dev/kernel/KernelKit/IDylibObject.h
index da6c3a7a..b673766c 100644
--- a/dev/kernel/KernelKit/IDylibObject.h
+++ b/dev/kernel/KernelKit/IDylibObject.h
@@ -15,26 +15,29 @@
#define NE_DYLIB_OBJECT : public IDylibObject
namespace Kernel {
+class IDylibObject;
+
/// @brief Dylib class object. A handle to a shared library.
class IDylibObject {
public:
explicit IDylibObject() = default;
virtual ~IDylibObject() = default;
- struct DLL_TRAITS final {
+ struct DylibTraits final {
VoidPtr ImageObject{nullptr};
VoidPtr ImageEntrypointOffset{nullptr};
- Bool IsValid() { return ImageObject && ImageEntrypointOffset; }
+ VoidPtr Image() const { return ImageObject; }
+ Bool IsValid() const { return ImageObject && ImageEntrypointOffset; }
};
NE_COPY_DEFAULT(IDylibObject)
- virtual DLL_TRAITS** GetAddressOf() = 0;
- virtual DLL_TRAITS* Get() = 0;
+ virtual DylibTraits** GetAddressOf() = 0;
+ virtual DylibTraits* Get() = 0;
- virtual Void Mount(DLL_TRAITS* to_mount) = 0;
- virtual Void Unmount() = 0;
+ virtual Void Mount(DylibTraits* to_mount) = 0;
+ virtual Void Unmount() = 0;
};
/// @brief Pure implementation, missing method/function handler.
diff --git a/dev/kernel/KernelKit/IPEFDylibObject.h b/dev/kernel/KernelKit/IPEFDylibObject.h
index f4461a69..66b4895d 100644
--- a/dev/kernel/KernelKit/IPEFDylibObject.h
+++ b/dev/kernel/KernelKit/IPEFDylibObject.h
@@ -30,15 +30,15 @@ class IPEFDylibObject final NE_DYLIB_OBJECT {
NE_COPY_DEFAULT(IPEFDylibObject)
private:
- DLL_TRAITS* fMounted{nullptr};
+ DylibTraits* fMounted{nullptr};
public:
- DLL_TRAITS** GetAddressOf() { return &fMounted; }
+ DylibTraits** GetAddressOf() { return &fMounted; }
- DLL_TRAITS* Get() { return fMounted; }
+ DylibTraits* Get() { return fMounted; }
public:
- void Mount(DLL_TRAITS* to_mount) {
+ void Mount(DylibTraits* to_mount) {
if (!to_mount || !to_mount->ImageObject) return;
fMounted = to_mount;
diff --git a/dev/kernel/KernelKit/KPC.h b/dev/kernel/KernelKit/KPC.h
index 811d7f5d..a3b13de6 100644
--- a/dev/kernel/KernelKit/KPC.h
+++ b/dev/kernel/KernelKit/KPC.h
@@ -63,9 +63,8 @@ inline constexpr KPCError kErrorCDTrayBroken = 62;
inline constexpr KPCError kErrorUnrecoverableDisk = 63;
inline constexpr KPCError kErrorFileLocked = 64;
inline constexpr KPCError kErrorDiskIsTooTiny = 65;
-/// Kernel errors.
-inline constexpr KPCError kErrorDmaExhausted = 101;
-inline constexpr KPCError kErrorOutOfBitMapMemory = 102;
+inline constexpr KPCError kErrorDmaExhausted = 66;
+inline constexpr KPCError kErrorOutOfBitMapMemory = 67;
/// Generic errors.
inline constexpr KPCError kErrorUnimplemented = -1;