summaryrefslogtreecommitdiffhomepage
path: root/Private/KernelKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-05 19:19:12 +0100
committerAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-05 19:19:12 +0100
commitf3e49a9d6b865e7a3f6361ed88863cd12a5f90f1 (patch)
treebb1ba85c3bc627be09f397f44eb216459f34d902 /Private/KernelKit
parent6191833a26e887c2b91ba4ad655297bfe70c97d5 (diff)
HCR-13 : Optimize filesystem operations on UEFI.
- Stream concept, on demand. Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/KernelKit')
-rw-r--r--Private/KernelKit/FileManager.hpp2
-rw-r--r--Private/KernelKit/MSDOS.hpp44
-rw-r--r--Private/KernelKit/PE.hpp2
-rw-r--r--Private/KernelKit/ProcessManager.hpp4
-rw-r--r--Private/KernelKit/SMPManager.hpp16
5 files changed, 56 insertions, 12 deletions
diff --git a/Private/KernelKit/FileManager.hpp b/Private/KernelKit/FileManager.hpp
index d31cdf68..fea63a0a 100644
--- a/Private/KernelKit/FileManager.hpp
+++ b/Private/KernelKit/FileManager.hpp
@@ -232,6 +232,8 @@ class FileStream final {
using FileStreamUTF8 = FileStream<char>;
using FileStreamUTF16 = FileStream<wchar_t>;
+typedef UInt64 CursorType;
+
template <typename Encoding, typename Class>
FileStream<Encoding, Class>::FileStream(const Encoding *path,
const Encoding *restrict_type)
diff --git a/Private/KernelKit/MSDOS.hpp b/Private/KernelKit/MSDOS.hpp
new file mode 100644
index 00000000..021d62aa
--- /dev/null
+++ b/Private/KernelKit/MSDOS.hpp
@@ -0,0 +1,44 @@
+/* -------------------------------------------
+
+ Copyright Mahrouss Logic
+
+ File: MSDOS.hpp
+ Purpose: MS-DOS header for HCore.
+
+ Revision History:
+
+ 30/01/24: Added file (amlel)
+
+------------------------------------------- */
+
+#ifndef __MSDOS_EXEC__
+#define __MSDOS_EXEC__
+
+#include <NewKit/Defines.hpp>
+
+typedef HCore::UInt32 DosWord;
+typedef HCore::Long DosLong;
+
+typedef struct _DosHeader {
+ DosWord eMagic;
+ DosWord eMagLen;
+ DosWord ePagesCount;
+ DosWord eCrlc;
+ DosWord eCParHdr;
+ DosWord eMinAlloc;
+ DosWord eMaxAlloc;
+ DosWord eStackSeg;
+ DosWord eStackPtr;
+ DosWord eChksum;
+ DosWord eIp;
+ DosWord eCs;
+ DosWord eLfarlc;
+ DosWord eOvno;
+ DosWord eRes[4];
+ DosWord eOemid;
+ DosWord eOeminfo;
+ DosWord eRes2[10];
+ DosLong eLfanew;
+} DosHeader, *DosHeaderPtr;
+
+#endif /* ifndef __MSDOS_EXEC__ */
diff --git a/Private/KernelKit/PE.hpp b/Private/KernelKit/PE.hpp
index 88ee319a..6cc0ff60 100644
--- a/Private/KernelKit/PE.hpp
+++ b/Private/KernelKit/PE.hpp
@@ -27,7 +27,7 @@ typedef char CHAR;
#define kPeMagic 0x00004550
typedef struct ExecHeader final {
- U32 mMagic; // PE\0\0 or 0x00004550
+ U8 mMagic[4]; // PE\0\0 or 0x00004550
U16 mMachine;
U16 mNumberOfSections;
U32 mTimeDateStamp;
diff --git a/Private/KernelKit/ProcessManager.hpp b/Private/KernelKit/ProcessManager.hpp
index 52c3e7b3..ddde3d3c 100644
--- a/Private/KernelKit/ProcessManager.hpp
+++ b/Private/KernelKit/ProcessManager.hpp
@@ -17,7 +17,7 @@
#include <NewKit/MutableArray.hpp>
#include <NewKit/UserHeap.hpp>
-#define kMinMicroTime AffinityKind::kStandard
+#define kMinMicroTime AffinityKind::kHartStandard
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -48,7 +48,7 @@ enum class AffinityKind : Int32 {
kInvalid = 300,
kVeryHigh = 250,
kHigh = 200,
- kStandard = 150,
+ kHartStandard = 150,
kLowUsage = 100,
kVeryLowUsage = 50,
};
diff --git a/Private/KernelKit/SMPManager.hpp b/Private/KernelKit/SMPManager.hpp
index 8cbe3259..dc3518a7 100644
--- a/Private/KernelKit/SMPManager.hpp
+++ b/Private/KernelKit/SMPManager.hpp
@@ -22,13 +22,13 @@ namespace HCore {
using ThreadID = UInt32;
enum ThreadKind {
- kSystemReserved, // System reserved thread, well user can't use it
- kStandard, // user thread, cannot be used by kernel
- kFallback, // fallback thread, cannot be used by user if not clear or used by
- // kernel.
- kBoot, // The core we booted from, the mama.
- kInvalidThread,
- kThreadCount,
+ kHartSystemReserved, // System reserved thread, well user can't use it
+ kHartStandard, // user thread, cannot be used by kernel
+ kHartFallback, // fallback thread, cannot be used by user if not clear or
+ // used by kernel.
+ kHartBoot, // The core we booted from, the mama.
+ kInvalidHart,
+ kHartCount,
};
///
@@ -105,8 +105,6 @@ class SMPManager final {
private:
Array<HardwareThread, kMaxHarts> m_ThreadList;
ThreadID m_CurrentThread{0};
- SizeT m_UsedThreads{0};
- SizeT m_MaxThreads{0};
};
// @brief wakes up thread.