summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Private/FSKit/NewFS.hxx43
-rw-r--r--Private/KernelKit/FileManager.hpp22
-rw-r--r--Private/makefile10
3 files changed, 47 insertions, 28 deletions
diff --git a/Private/FSKit/NewFS.hxx b/Private/FSKit/NewFS.hxx
index 657f6fae..75578af0 100644
--- a/Private/FSKit/NewFS.hxx
+++ b/Private/FSKit/NewFS.hxx
@@ -162,40 +162,51 @@ struct PACKED NewPartitionBlock final {
#define kFilesystemBitWidth (sizeof(NewCharType))
#define kFilesystemLbaType (HCore::Lba)
-#define kNewFSAddressAsLba (1024)
+
+/// Start After the PM headers, pad 1024 bytes.
+#define kNewFSAddressAsLba (1024U)
namespace HCore {
///
-/// \name NewFSImplementation
-/// \brief HCFS filesystem operations. (catalog creation, remove removal, root
-/// fork...)
+/// \name NewFSParser
+/// \brief NewFS parser class. (catalog creation, remove removal, root, forks...)
+/// Designed like the DOM.
///
-class NewFSImplementation {
+class NewFSParser {
+ public:
+ explicit NewFSParser() = default;
+ virtual ~NewFSParser() = default;
+
public:
- explicit NewFSImplementation() = default;
- virtual ~NewFSImplementation() = default;
+ HCORE_COPY_DEFAULT(NewFSParser);
public:
- HCORE_COPY_DEFAULT(NewFSImplementation);
+ virtual _Output NewFork* ForkFrom(NewCatalog& catalog, const Int64& id) = 0;
- virtual NewFork* ForkFrom(NewCatalog& catalog, const Int64& id) = 0;
+ virtual _Output NewCatalog* FindCatalog(const char* catalogName) = 0;
- virtual NewCatalog* RootCatalog() = 0;
- virtual NewCatalog* NextCatalog(_Input _Output NewCatalog& cur) = 0;
- virtual NewCatalog* PrevCatalog(_Input _Output NewCatalog& cur) = 0;
+ virtual _Output NewCatalog* RootCatalog() = 0;
- virtual NewCatalog* GetCatalog(_Input const char* name) = 0;
+ virtual _Output NewCatalog* NextCatalog(_Input _Output NewCatalog& cur) = 0;
- virtual NewCatalog* CreateCatalog(_Input const char* name,
+ virtual _Output NewCatalog* PrevCatalog(_Input _Output NewCatalog& cur) = 0;
+
+ virtual _Output NewCatalog* GetCatalog(_Input const char* name) = 0;
+
+ virtual _Output NewCatalog* CreateCatalog(_Input const char* name,
_Input const Int32& flags,
_Input const Int32& kind) = 0;
- virtual NewCatalog* CreateCatalog(_Input const char* name) = 0;
+
+ virtual _Output NewCatalog* CreateCatalog(_Input const char* name) = 0;
virtual bool WriteCatalog(_Input _Output NewCatalog& catalog,
voidPtr data) = 0;
- virtual bool RemoveCatalog(_Input NewCatalog& catalog) = 0;
+ virtual bool RemoveCatalog(_Input _Output NewCatalog& catalog) = 0;
+ /// @brief Make a EPM+NewFS drive out of the disk.
+ /// @param drive The drive to write on.
+ /// @return If it was sucessful, see DbgLastError().
virtual bool Format(_Input _Output DriveTraits& drive) = 0;
};
diff --git a/Private/KernelKit/FileManager.hpp b/Private/KernelKit/FileManager.hpp
index 22c229db..3d986ddc 100644
--- a/Private/KernelKit/FileManager.hpp
+++ b/Private/KernelKit/FileManager.hpp
@@ -64,26 +64,26 @@ class IFilesystemManager {
static IFilesystemManager *GetMounted();
public:
- virtual NodePtr Create(const char *path) = 0;
- virtual NodePtr CreateAlias(const char *path) = 0;
- virtual NodePtr CreateDirectory(const char *path) = 0;
+ virtual NodePtr Create(_Input const char *path) = 0;
+ virtual NodePtr CreateAlias(_Input const char *path) = 0;
+ virtual NodePtr CreateDirectory(_Input const char *path) = 0;
public:
- virtual bool Remove(const char *path) = 0;
+ virtual bool Remove(_Input const char *path) = 0;
public:
- virtual NodePtr Open(const char *path, const char *r) = 0;
+ virtual NodePtr Open(_Input const char *path, _Input const char *r) = 0;
public:
- virtual void Write(NodePtr node, VoidPtr data, Int32 flags) = 0;
- virtual VoidPtr Read(NodePtr node, Int32 flags, SizeT sz) = 0;
+ virtual void Write(_Input NodePtr node, _Input VoidPtr data, _Input Int32 flags) = 0;
+ virtual _Output VoidPtr Read(_Input NodePtr node, _Input Int32 flags, _Input SizeT sz) = 0;
public:
- virtual bool Seek(NodePtr node, SizeT off) = 0;
+ virtual bool Seek(_Input NodePtr node, _Input SizeT off) = 0;
public:
- virtual SizeT Tell(NodePtr node) = 0;
- virtual bool Rewind(NodePtr node) = 0;
+ virtual SizeT Tell(_Input NodePtr node) = 0;
+ virtual bool Rewind(_Input NodePtr node) = 0;
};
/** @brief invalid position. (n-pos) */
@@ -148,7 +148,7 @@ class NewFilesystemManager final : public IFilesystemManager {
}
public:
- NewFSImplementation *fImpl{nullptr};
+ NewFSParser *fImpl{nullptr};
};
#endif // ifdef __FSKIT_NEWFS__
diff --git a/Private/makefile b/Private/makefile
index 67491247..61ce9a08 100644
--- a/Private/makefile
+++ b/Private/makefile
@@ -43,7 +43,15 @@ link-amd64:
.PHONY: all
all: h-core-amd64 link-amd64
- @echo "[HCoreKrnl] HCore is Linked now."
+ @echo "Fully built."
+
+
+.PHONY: help
+help:
+ @echo "=== HELP ==="
+ @echo "all: Build kernel and link it."
+ @echo "link-amd64: Link kernel. (PC AMD64)"
+ @echo "h-core-amd64: Build kernel. (PC AMD64)"
.PHONY: clean
clean: