summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-31 12:41:06 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-31 12:41:06 +0100
commitf7edf08d067b4c52c3183e8ad0467293e54075e8 (patch)
tree0e2894d78684966993ff2bed2df4d6c5e12aef87
parentfc55f0d69d24fb4908cbd811681f2c3fac53614d (diff)
Add BUG_LIST.TXT, kernel improvements and Public kits improvements.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
-rw-r--r--BUG_LIST.TXT0
-rw-r--r--Private/NewKit/Variant.hpp63
-rw-r--r--Private/Source/DriveManager.cxx4
-rw-r--r--Private/Source/GUIDWizard.cxx3
-rw-r--r--Private/Source/NewFS-IO.cxx2
-rw-r--r--Private/Source/Variant.cxx2
-rw-r--r--Public/Kits/SystemKit/CoreAPI.hxx9
-rw-r--r--Public/Kits/SystemKit/FileAPI.hxx8
-rw-r--r--Public/Kits/SystemKit/HeapAPI.hxx2
-rw-r--r--Public/Kits/SystemKit/SystemCall.hxx2
-rw-r--r--Public/Kits/SystemKit/ThreadAPI.hxx10
-rw-r--r--Public/Kits/SystemKit/compile_flags.txt4
-rw-r--r--Public/Kits/ZipKit/Zip.cxx2
-rw-r--r--Public/Kits/ZipKit/compile_flags.txt4
-rw-r--r--Public/Tools/MakeNewFS.cxx13
15 files changed, 77 insertions, 51 deletions
diff --git a/BUG_LIST.TXT b/BUG_LIST.TXT
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/BUG_LIST.TXT
diff --git a/Private/NewKit/Variant.hpp b/Private/NewKit/Variant.hpp
index 23316ec1..a897b63a 100644
--- a/Private/NewKit/Variant.hpp
+++ b/Private/NewKit/Variant.hpp
@@ -12,38 +12,31 @@
#include <NewKit/Defines.hpp>
#include <NewKit/String.hpp>
-namespace HCore
-{
- class Variant final
- {
- public:
- enum class VariantKind
- {
- kString,
- kPointer,
- kUndefined
- };
-
- public:
- explicit Variant() = delete;
-
- public:
- Variant &operator=(const Variant &) = default;
- Variant(const Variant &) = default;
-
- ~Variant() = default;
-
- public:
- explicit Variant(StringView* stringView) : m_Ptr((voidPtr)stringView), m_Kind(VariantKind::kString) {}
- explicit Variant(nullPtr) : m_Ptr(nullptr), m_Kind(VariantKind::kUndefined) {}
- explicit Variant(voidPtr ptr) : m_Ptr(ptr), m_Kind(VariantKind::kPointer) {}
-
- public:
- const Char* ToString();
-
- private:
- voidPtr m_Ptr{nullptr};
- VariantKind m_Kind{VariantKind::kUndefined};
-
- };
-} // namespace HCore
+namespace HCore {
+class Variant final {
+ public:
+ enum class VariantKind { kString, kPointer, kUndefined };
+
+ public:
+ explicit Variant() = delete;
+
+ public:
+ Variant &operator=(const Variant &) = default;
+ Variant(const Variant &) = default;
+
+ ~Variant() = default;
+
+ public:
+ explicit Variant(StringView *stringView)
+ : m_Ptr((voidPtr)stringView), m_Kind(VariantKind::kString) {}
+ explicit Variant(nullPtr) : m_Ptr(nullptr), m_Kind(VariantKind::kUndefined) {}
+ explicit Variant(voidPtr ptr) : m_Ptr(ptr), m_Kind(VariantKind::kPointer) {}
+
+ public:
+ const Char *ToString();
+
+ private:
+ voidPtr m_Ptr{nullptr};
+ VariantKind m_Kind{VariantKind::kUndefined};
+};
+} // namespace HCore
diff --git a/Private/Source/DriveManager.cxx b/Private/Source/DriveManager.cxx
index 9611575d..10c4d28e 100644
--- a/Private/Source/DriveManager.cxx
+++ b/Private/Source/DriveManager.cxx
@@ -29,7 +29,7 @@ bool DriveSelector::Mount(DriveTraits *drive) {
fDrive = drive;
fDrive->fMount();
- kcout << "[Mount] drive: " << fDrive->fName << "\n";
+ kcout << "Mount drive: " << fDrive->fName << "\n";
return true;
}
@@ -45,7 +45,7 @@ DriveTraits *DriveSelector::Unmount() {
fDrive->fUnmount();
fDrive = nullptr;
- kcout << "[Unmount] drive: " << drivePointer->fName << "\n";
+ kcout << "Unmount drive: " << drivePointer->fName << "\n";
return drivePointer;
}
diff --git a/Private/Source/GUIDWizard.cxx b/Private/Source/GUIDWizard.cxx
index 57915f64..829a27d8 100644
--- a/Private/Source/GUIDWizard.cxx
+++ b/Private/Source/GUIDWizard.cxx
@@ -12,9 +12,8 @@
// begin of ascii 'readable' characters. (A, C, C, 1, 2)
#define kAsciiBegin 47
-
// @brief Size of UUID.
-#define kUUIDSize 32
+#define kUUIDSize 37
namespace HCore::XRN::Version1 {
auto make_sequence(const ArrayList<UShort>& uuidSeq) -> Ref<GUIDSequence*> {
diff --git a/Private/Source/NewFS-IO.cxx b/Private/Source/NewFS-IO.cxx
index f5d550e0..7ecd396d 100644
--- a/Private/Source/NewFS-IO.cxx
+++ b/Private/Source/NewFS-IO.cxx
@@ -11,4 +11,6 @@
#include <KernelKit/DriveManager.hpp>
#include <KernelKit/FileManager.hpp>
+/// @brief this implements NewFS with Device Abstraction in mind.
+
/// bugs 0
diff --git a/Private/Source/Variant.cxx b/Private/Source/Variant.cxx
index a09c847c..a6e34119 100644
--- a/Private/Source/Variant.cxx
+++ b/Private/Source/Variant.cxx
@@ -21,7 +21,7 @@ const Char* Variant::ToString() {
case VariantKind::kPointer:
return ("Memory:{Pointer}");
default:
- return ("Class:{Undefined}");
+ return ("Memory:{Undefined}");
}
}
diff --git a/Public/Kits/SystemKit/CoreAPI.hxx b/Public/Kits/SystemKit/CoreAPI.hxx
index f3e67e96..fa5e8eef 100644
--- a/Public/Kits/SystemKit/CoreAPI.hxx
+++ b/Public/Kits/SystemKit/CoreAPI.hxx
@@ -9,9 +9,18 @@
#pragma once
+#ifndef __cplusplus
+#error This API is meant to be used with C++
+#endif
+
#ifdef MUST_PASS
#undef MUST_PASS
#endif
// unused by user side, it's a kernel thing.
#define MUST_PASS(e) ((void)e)
+
+#define EXTERN_C extern "C"
+
+#define STDCALL __attribute__((stdcall))
+#define CDECL __attribute__((cdecl))
diff --git a/Public/Kits/SystemKit/FileAPI.hxx b/Public/Kits/SystemKit/FileAPI.hxx
index c55d26ff..350e27f4 100644
--- a/Public/Kits/SystemKit/FileAPI.hxx
+++ b/Public/Kits/SystemKit/FileAPI.hxx
@@ -24,11 +24,11 @@ class HFile final {
HCORE_COPY_DEFAULT(HFile);
public:
- void *Read(SizeT off, SizeT sz);
- void Write(void *buf, SizeT off, SizeT sz);
+ voidPtr Read(SizeT off, SizeT sz);
+ void Write(voidPtr buf, SizeT off, SizeT sz);
void Seek(SizeT off);
- void *Read(SizeT sz);
- void Write(void *buf, SizeT sz);
+ voidPtr Read(SizeT sz);
+ void Write(voidPtr buf, SizeT sz);
void Rewind();
public:
diff --git a/Public/Kits/SystemKit/HeapAPI.hxx b/Public/Kits/SystemKit/HeapAPI.hxx
index 11d4c265..c11b1408 100644
--- a/Public/Kits/SystemKit/HeapAPI.hxx
+++ b/Public/Kits/SystemKit/HeapAPI.hxx
@@ -41,7 +41,7 @@ class HHeap final {
public:
void Delete(HHeapPtr me) noexcept;
- SizeT Tell(HHeapPtr me) noexcept;
+ SizeT Size(HHeapPtr me) noexcept;
HHeapPtr New(const SizeT &sz, const Int32 flags = kHeapNoFlags);
};
diff --git a/Public/Kits/SystemKit/SystemCall.hxx b/Public/Kits/SystemKit/SystemCall.hxx
index 77614099..64d65d4b 100644
--- a/Public/Kits/SystemKit/SystemCall.hxx
+++ b/Public/Kits/SystemKit/SystemCall.hxx
@@ -14,3 +14,5 @@
#pragma once
/// @brief System Call Interface
+
+#include <SystemKit/CoreAPI.hxx>
diff --git a/Public/Kits/SystemKit/ThreadAPI.hxx b/Public/Kits/SystemKit/ThreadAPI.hxx
index a9490033..80742ab9 100644
--- a/Public/Kits/SystemKit/ThreadAPI.hxx
+++ b/Public/Kits/SystemKit/ThreadAPI.hxx
@@ -20,11 +20,11 @@ namespace HCore {
/// @brief Thread Information Block for Local Storage.
/// Located in GS on AMD64, Virtual Address 0x10000 (64x0, 32x0, ARM64)
struct ThreadInformationBlock final {
- const Char NAME[255]; // Module Name
- const UIntPtr START_ADDRESS; // Start Address
- const UIntPtr START_ALLOC; // Allocation Heap
- const UIntPtr START_STACK; // Stack Pointer.
- const Int32 ARCH; // Architecture and/or platform.
+ const Char Name[255]; // Module Name
+ const UIntPtr StartAddress; // Start Address
+ const UIntPtr StartHeap; // Allocation Heap
+ const UIntPtr StartStack; // Stack Pointer.
+ const Int32 ARCH; // Architecture and/or platform.
};
enum {
diff --git a/Public/Kits/SystemKit/compile_flags.txt b/Public/Kits/SystemKit/compile_flags.txt
new file mode 100644
index 00000000..6e721e73
--- /dev/null
+++ b/Public/Kits/SystemKit/compile_flags.txt
@@ -0,0 +1,4 @@
+-I./
+-I../
+-I../../../Private
+-std=c++20
diff --git a/Public/Kits/ZipKit/Zip.cxx b/Public/Kits/ZipKit/Zip.cxx
index 71523143..74e2a5d8 100644
--- a/Public/Kits/ZipKit/Zip.cxx
+++ b/Public/Kits/ZipKit/Zip.cxx
@@ -27,7 +27,7 @@ HFilePtr ZipStream::FlushToFile(const char *name) {
HFilePtr fp = new HFile(name);
MUST_PASS(fp);
- this->fSharedSz = HHeap::Shared()->Tell(this->fSharedData);
+ this->fSharedSz = HHeap::Shared()->Size(this->fSharedData);
fp->SetMIME("application/x-bzip");
fp->Write(this->fSharedData, this->fSharedSz);
diff --git a/Public/Kits/ZipKit/compile_flags.txt b/Public/Kits/ZipKit/compile_flags.txt
new file mode 100644
index 00000000..6e721e73
--- /dev/null
+++ b/Public/Kits/ZipKit/compile_flags.txt
@@ -0,0 +1,4 @@
+-I./
+-I../
+-I../../../Private
+-std=c++20
diff --git a/Public/Tools/MakeNewFS.cxx b/Public/Tools/MakeNewFS.cxx
index d4d28e6d..8871d627 100644
--- a/Public/Tools/MakeNewFS.cxx
+++ b/Public/Tools/MakeNewFS.cxx
@@ -1,3 +1,16 @@
+/* -------------------------------------------
+
+ Copyright Mahrouss Logic
+
+ File: MakeNewFS.cpp
+ Purpose:
+
+ Revision History:
+
+ 31/01/24: Added file (amlel)
+
+------------------------------------------- */
+
/***********************************************************************************/
/// @file MakeNewFS.cxx
/// @brief NewFS partition program.