summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-20 03:53:47 +0100
committerAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-20 03:53:47 +0100
commit834ba2852f69e4dceec1a0a63400fe5171a97c48 (patch)
treea35794c9892e4f44285f6d29950b4a97e4a3965c
parent0fb009de376a89aab2a7c0839d1c17442d9257e2 (diff)
unstable: Add ODF header, still in WiP, althougth priority is on the
AHCI driver and HCFS/NewFS support. Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
-rw-r--r--Private/Source/CxxAbi.cxx2
-rw-r--r--Private/Source/NewFS+Journal.cxx31
-rw-r--r--Private/Source/PEFCodeManager.cxx2
-rw-r--r--Private/Source/URL.cxx7
-rw-r--r--Public/Kits/System.Core/Containers/ODF.hxx43
-rw-r--r--Public/Kits/System.Core/Containers/XIFF.hxx24
-rw-r--r--Public/Kits/System.Graphics/Frame.hxx7
7 files changed, 81 insertions, 35 deletions
diff --git a/Private/Source/CxxAbi.cxx b/Private/Source/CxxAbi.cxx
index d251ffca..619fe8e0 100644
--- a/Private/Source/CxxAbi.cxx
+++ b/Private/Source/CxxAbi.cxx
@@ -13,7 +13,7 @@ atexit_func_entry_t __atexit_funcs[kDSOMaxObjects];
uarch_t __atexit_func_count;
extern "C" void __cxa_pure_virtual() {
- HCore::kcout << "HCoreKrnl.exe: Placeholder method.\n";
+ HCore::kcout << "HCoreKrnl.exe: C++ placeholder method.\n";
}
extern "C" void ___chkstk_ms() {
diff --git a/Private/Source/NewFS+Journal.cxx b/Private/Source/NewFS+Journal.cxx
index 7b76149d..472db1fe 100644
--- a/Private/Source/NewFS+Journal.cxx
+++ b/Private/Source/NewFS+Journal.cxx
@@ -9,21 +9,22 @@
#ifdef __FSKIT_NEWFS__
-//! bugs: 0
+//! BUGS: 0
//! @brief Journaling for NewFS.
-#define kOpCache (4)
+#define kNewFSOpLog (4)
-namespace HCore {
-typedef Boolean (*NewFSRunner)(VoidPtr delegate);
+namespace HCore::Detail {
+typedef Boolean (*NewFSRunnerType)(VoidPtr delegate);
+/// @brief Journal thread class.
class NewFSJournalRunner final {
public:
- NewFSRunner fLoadRoutine{nullptr};
- NewFSRunner fCacheRoutine{nullptr};
- NewFSRunner fUnloadRoutine{nullptr};
+ NewFSRunnerType fLoadRoutine{nullptr};
+ NewFSRunnerType fCacheRoutine{nullptr};
+ NewFSRunnerType fUnloadRoutine{nullptr};
- explicit NewFSJournalRunner(NewFSRunner load_runner)
+ explicit NewFSJournalRunner(NewFSRunnerType load_runner)
: fLoadRoutine(load_runner) {
MUST_PASS(fLoadRoutine);
@@ -39,23 +40,25 @@ class NewFSJournalRunner final {
HCORE_COPY_DEFAULT(NewFSJournalRunner);
public:
- Boolean Run(const Int32& operation, VoidPtr class_ptr) {
+ Boolean Run(const Int32& operation, VoidPtr classPtr) {
switch (operation) {
- case kOpCache: {
- if (!class_ptr) {
- kcout << "Miss for class_ptr at NewFSJournalManager::Run(class_ptr) "
+ case kNewFSOpLog: {
+ if (!classPtr) {
+ kcout << "HCoreKrnl.exe: Miss for classPtr at NewFSJournalManager::Run(classPtr) "
<< __FILE__ << "\n";
return false;
}
MUST_PASS(fCacheRoutine);
- return fCacheRoutine(class_ptr);
+ return fCacheRoutine(classPtr);
}
};
return false;
}
};
-} // namespace HCore
+} // namespace HCore::Detail
+
+using namespace HCore;
#endif // ifdef __FSKIT_NEWFS__
diff --git a/Private/Source/PEFCodeManager.cxx b/Private/Source/PEFCodeManager.cxx
index d0ca40d3..ec9525dc 100644
--- a/Private/Source/PEFCodeManager.cxx
+++ b/Private/Source/PEFCodeManager.cxx
@@ -26,7 +26,7 @@ UInt32 rt_get_pef_platform(void) noexcept {
return kPefArchAMD64;
#else
return kPefArchInvalid;
-#endif // __POWER || __x86_64__
+#endif // __32x0__ || __64x0__ || __x86_64__
}
} // namespace Detail
diff --git a/Private/Source/URL.cxx b/Private/Source/URL.cxx
index 8c569f87..121003a2 100644
--- a/Private/Source/URL.cxx
+++ b/Private/Source/URL.cxx
@@ -20,12 +20,11 @@ constexpr const char *kURLProtocols[] = {
"http", // http without the secure
"file", // filesystem protocol
"ftp", // file transfer protocol
- "krnlconf", // system settings
- "guisys", // remote shell (gui)
+ "sysconf", // system settings
};
-constexpr const int kUrlOutSz = 3; //! ://
-constexpr const int kProtosCount = 6;
+constexpr const int kUrlOutSz = 3; //! such as: ://
+constexpr const int kProtosCount = 5;
constexpr const int kRangeSz = 4096;
static ErrorOr<StringView> url_extract_location(const char *url) {
diff --git a/Public/Kits/System.Core/Containers/ODF.hxx b/Public/Kits/System.Core/Containers/ODF.hxx
new file mode 100644
index 00000000..3c4e81fc
--- /dev/null
+++ b/Public/Kits/System.Core/Containers/ODF.hxx
@@ -0,0 +1,43 @@
+/** ===========================================
+ (C) Mahrouss Logic
+ ===========================================*/
+
+#ifndef __ODF__
+#define __ODF__
+
+#include <System.Core/Defs.hxx>
+
+/**
+ * @brief Open Document Format
+ * @file ODF.hxx
+*/
+
+/// @brief four-character code for ODF.
+#define kFourCCLength_ODF 4
+
+/// @brief Document file header.
+typedef struct ODFFileHeader
+{
+ CHAR f_Ident[kFourCCLength_ODF];
+
+ INT32 f_DocumentKind;
+ INT32 f_DocumentSize;
+
+ INT64 f_MetaForkOffset;
+ INT64 f_DocumentForkOffset;
+
+ CHAR f_Padding[4];
+} PACKED ODFFileHeader;
+
+/// @brief ODF Fork header
+typedef struct ODFForkHeader
+{
+ CHAR f_MetadataName[255];
+
+ INT32 f_MetadataKind;
+ INT32 f_MetadataSize;
+
+ CHAR f_Padding;
+} PACKED ODFForkHeader;
+
+#endif // !__ODF__ \ No newline at end of file
diff --git a/Public/Kits/System.Core/Containers/XIFF.hxx b/Public/Kits/System.Core/Containers/XIFF.hxx
index b9fa741e..622a5a87 100644
--- a/Public/Kits/System.Core/Containers/XIFF.hxx
+++ b/Public/Kits/System.Core/Containers/XIFF.hxx
@@ -17,26 +17,26 @@
/// @brief four-character code for XIFF.
#define kFourCCLength_XIFF 4
+#define kXIFFContainerVideo "XVFF"
+#define kXIFFContainerAudio "XAFF"
+#define kXIFFContainerInstaller "XNFF"
+#define kXIFFContainerGeneric "XIFF"
+#define kXIFFContainerBinary "XBFF"
+
/***
* @brief Generic XIFF header
* Used by XIFF based containers.
*/
struct PACKED XiffHeader final {
- BYTE f_Mag[kFourCCLength_XIFF]; // XIFF string (includes \0)
- DWORD f_Size; // overall size of header (XiffHeader) in bytes
- DWORD f_FormatType; // format type. generic
- BYTE f_SpecificMag[4]; // The sub header magic
- DWORD f_SpecificSize; // length of the format data
- DWORD f_SpecificFormatType; // format type. generic
+ BYTE f_Magic[kFourCCLength_XIFF]; // XIFF string (includes \0)
+ DWORD f_Size; // overall size of header (XiffHeader) in bytes
+ DWORD f_FormatType; // format type. generic
+ BYTE f_SpecificMag[kFourCCLength_XIFF]; // The sub header magic
+ DWORD f_SpecificSize; // length of the format data
+ DWORD f_SpecificFormatType; // format type. generic
};
typedef struct XiffHeader XiffHeader;
-#define kXIFFContainerVideo "XVFF"
-#define kXIFFContainerAudio "XAFF"
-#define kXIFFContainerInstaller "XNFF"
-#define kXIFFContainerGeneric "XIFF"
-#define kXIFFContainerBinary "XBFF"
-
#endif // ifndef __XIFF__
diff --git a/Public/Kits/System.Graphics/Frame.hxx b/Public/Kits/System.Graphics/Frame.hxx
index 6c305cd3..318f01cd 100644
--- a/Public/Kits/System.Graphics/Frame.hxx
+++ b/Public/Kits/System.Graphics/Frame.hxx
@@ -15,6 +15,7 @@
#include <System.Graphics/Core.hxx>
#include <System.Graphics/Dim2d.hxx>
+#include <System.Core/Defs.hxx>
#include <NewKit/MutableArray.hpp>
namespace System::Graphics {
@@ -29,7 +30,7 @@ class G_API GFrame {
virtual void Update() {
if (m_Frames.Count() == 0) return;
- for (int x = 0; x < m_Frames.Count(); ++x) {
+ for (DWORD x = 0; x < m_Frames.Count(); ++x) {
if (!m_Frames[x]->ShouldBeUpdated()) continue;
m_Frames[x]->Update();
@@ -41,7 +42,7 @@ class G_API GFrame {
virtual void UpdateInput() {
if (m_Frames.Count() == 0) return;
- for (int x = 0; x < m_Frames.Count(); ++x) {
+ for (DWORD x = 0; x < m_Frames.Count(); ++x) {
if (!m_Frames[x]->ShouldBeUpdated()) continue;
m_Frames[x]->UpdateInput();
@@ -50,7 +51,7 @@ class G_API GFrame {
virtual bool ShouldBeUpdated() { return false; }
- virtual void Paint() = 0;
+ virtual void Paint() {}
private:
HCore::MutableArray<GFrame*> m_Frames;