From 9d6babb9a3b9ffbedc1fa377f47ff6b3f7585056 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 19 Jan 2024 12:44:57 +0100 Subject: Kernel/PowerPC: did some progress on it, got it booting on ofw. Signed-off-by: Amlal El Mahrouss --- Source/KMain.cxx | 1 - Source/NewFS.cxx | 15 ++++++++++----- Source/Utils.cxx | 10 ++++++++++ 3 files changed, 20 insertions(+), 6 deletions(-) (limited to 'Source') diff --git a/Source/KMain.cxx b/Source/KMain.cxx index cc847349..575b283c 100644 --- a/Source/KMain.cxx +++ b/Source/KMain.cxx @@ -13,7 +13,6 @@ extern "C" void __KernelMain(hCore::VoidPtr this_image) { - hCore::Detail::serial_init(); MUST_PASS(hCore::initialize_hardware_components()); hCore::IFilesystemManager::Mount(new hCore::NewFilesystemManager()); diff --git a/Source/NewFS.cxx b/Source/NewFS.cxx index 03a72398..28f7c041 100644 --- a/Source/NewFS.cxx +++ b/Source/NewFS.cxx @@ -16,14 +16,19 @@ namespace hCore NewFilesystemManager::~NewFilesystemManager() = default; - bool NewFilesystemManager::Remove(const char* node) + /** + * Unallocates a file from disk. + * @param node_name it's path. + * @return operation status boolean. + */ + bool NewFilesystemManager::Remove(const char* node_name) { - if (node == nullptr || - *node == 0) + if (node_name == nullptr || + *node_name == 0) return false; - if (auto catalog = fIO->GetCatalog(node); - catalog->Flags == kFlagCatalog) + if (auto catalog = fIO->GetCatalog(node_name); + catalog) return fIO->RemoveCatalog(*catalog); return false; diff --git a/Source/Utils.cxx b/Source/Utils.cxx index 557632c3..2cfb391a 100644 --- a/Source/Utils.cxx +++ b/Source/Utils.cxx @@ -207,3 +207,13 @@ namespace hCore return str; } } // namespace hCore + +extern "C" void memset(void* dst, char src, size_t len) +{ + hCore::rt_set_memory(dst, src, len); +} + +extern "C" void memcpy(void* dst, void* src, size_t len) +{ + hCore::rt_copy_memory(src, dst, len); +} \ No newline at end of file -- cgit v1.2.3