summaryrefslogtreecommitdiffhomepage
path: root/newBoot/Source/FSKit
diff options
context:
space:
mode:
Diffstat (limited to 'newBoot/Source/FSKit')
-rw-r--r--newBoot/Source/FSKit/.hgkeep0
-rw-r--r--newBoot/Source/FSKit/FileType.hxx30
-rw-r--r--newBoot/Source/FSKit/Files32.cxx10
-rw-r--r--newBoot/Source/FSKit/Files32.hxx36
-rw-r--r--newBoot/Source/FSKit/MPT.hxx29
5 files changed, 105 insertions, 0 deletions
diff --git a/newBoot/Source/FSKit/.hgkeep b/newBoot/Source/FSKit/.hgkeep
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/newBoot/Source/FSKit/.hgkeep
diff --git a/newBoot/Source/FSKit/FileType.hxx b/newBoot/Source/FSKit/FileType.hxx
new file mode 100644
index 00000000..26beb114
--- /dev/null
+++ b/newBoot/Source/FSKit/FileType.hxx
@@ -0,0 +1,30 @@
+/*
+ * ========================================================
+ *
+ * newBoot
+ * Copyright Mahrouss Logic, all rights reserved.
+ *
+ * ========================================================
+ */
+
+#pragma once
+
+// @brief this file purpose is to read/write files.
+
+#include <NewKit/Defines.hpp>
+
+/// \brief File buffer class
+/// \tparam _Manager The disk manager
+template <typename _Manager>
+class FileType
+{
+public:
+ hCore::SizeT DiskId{ 0 };
+ hCore::VoidPtr DiskSpace{ nullptr };
+ hCore::SizeT DiskSize{ 0 };
+ hCore::Int32 DiskError{ 0 };
+
+ FileType* Read(const char* path) { return _Manager::Read(path); }
+ FileType* Write(FileType* path) { return _Manager::Write(path); }
+
+}; \ No newline at end of file
diff --git a/newBoot/Source/FSKit/Files32.cxx b/newBoot/Source/FSKit/Files32.cxx
new file mode 100644
index 00000000..e7ba96f9
--- /dev/null
+++ b/newBoot/Source/FSKit/Files32.cxx
@@ -0,0 +1,10 @@
+/*
+ * ========================================================
+ *
+ * newBoot
+ * Copyright Mahrouss Logic, all rights reserved.
+ *
+ * ========================================================
+ */
+
+#include "Files32.hxx"
diff --git a/newBoot/Source/FSKit/Files32.hxx b/newBoot/Source/FSKit/Files32.hxx
new file mode 100644
index 00000000..9e940f6d
--- /dev/null
+++ b/newBoot/Source/FSKit/Files32.hxx
@@ -0,0 +1,36 @@
+/*
+ * ========================================================
+ *
+ * newBoot
+ * Copyright Mahrouss Logic, all rights reserved.
+ *
+ * ========================================================
+ */
+
+#pragma once
+
+struct Files32FileHdr
+{
+ char Filename[32];
+ char Ext[3];
+ char Attr;
+ char Case;
+ char CreateMs;
+ unsigned short Create;
+ unsigned short CreateDate;
+ unsigned short LastAccess;
+ unsigned short Timestamp;
+ unsigned short Datestamp;
+ unsigned short StartLba;
+ unsigned int SizeFile;
+};
+
+#define kFilesR 0x01 /* read-only */
+#define kFilesH 0x02 /* hidden */
+#define kFilesS 0x04 /* system */
+#define kFilesL 0x08 /* volume label */
+#define kFilesD 0x10 /* directory */
+#define kFilesZ 0x20 /* archive */
+
+// @brief Array of unused bits.
+#define kFilesU { 0x40, 0x80 }
diff --git a/newBoot/Source/FSKit/MPT.hxx b/newBoot/Source/FSKit/MPT.hxx
new file mode 100644
index 00000000..e2a548e4
--- /dev/null
+++ b/newBoot/Source/FSKit/MPT.hxx
@@ -0,0 +1,29 @@
+/*
+ * ========================================================
+ *
+ * newBoot
+ * Copyright Mahrouss Logic, all rights reserved.
+ *
+ * ========================================================
+ */
+
+#pragma once
+
+// @brief 255 size partiton header.
+// we use that to gather information about this hard drive.
+
+struct MasterPartitionTable final
+{
+ char fPartName[32];
+ int fPartType;
+ int fPartSectorSz;
+ int fPartSectorCnt;
+ char fReserved[211];
+};
+
+enum
+{
+ kPartEfi = 'efi',
+ kPartXpm = 'xpm',
+ kPartEbr = 'ebr',
+}; \ No newline at end of file