diff options
| -rw-r--r-- | src/kernel/src/FS/OpenHeFS+FileMgr.cpp | 6 | ||||
| -rw-r--r-- | tools/chk.hefs.cpp (renamed from tools/chk.hefs.cc) | 29 | ||||
| -rw-r--r-- | tools/chk.hefs.json | 4 | ||||
| -rw-r--r-- | tools/libmkfs/mkfs.hpp (renamed from tools/libmkfs/mkfs.h) | 2 | ||||
| -rw-r--r-- | tools/libmkfs/openhefs.hpp (renamed from tools/libmkfs/openhefs.h) | 2 | ||||
| -rwxr-xr-x | tools/mkapp.py | 13 | ||||
| -rw-r--r-- | tools/mkfs.hefs.cpp (renamed from tools/mkfs.hefs.cc) | 6 | ||||
| -rw-r--r-- | tools/mkfs.hefs.json | 4 |
8 files changed, 33 insertions, 33 deletions
diff --git a/src/kernel/src/FS/OpenHeFS+FileMgr.cpp b/src/kernel/src/FS/OpenHeFS+FileMgr.cpp index 3161ec8c..e7df9200 100644 --- a/src/kernel/src/FS/OpenHeFS+FileMgr.cpp +++ b/src/kernel/src/FS/OpenHeFS+FileMgr.cpp @@ -156,7 +156,7 @@ NodePtr HeFileSystemMgr::CreateSwapFile(const Char* path) { } kout << "OpenHEFS: ERROR: Swap Files are not supported natively by OpenHeFS.\r"; - err_local_get() = kErrorProcessFault; + err_local_get() = kErrorInvalidData; return nullptr; } @@ -212,9 +212,9 @@ Void HeFileSystemMgr::Write(_Input NodePtr node, _Input VoidPtr data, _Input Int } _Output VoidPtr HeFileSystemMgr::Read(_Input NodePtr node, _Input Int32 flags, _Input SizeT size) { - NE_UNUSED(node); NE_UNUSED(flags); - NE_UNUSED(size); + + if (!node || !size) return nullptr; return nullptr; } diff --git a/tools/chk.hefs.cc b/tools/chk.hefs.cpp index cce1c7a9..d9141f1f 100644 --- a/tools/chk.hefs.cc +++ b/tools/chk.hefs.cpp @@ -1,30 +1,29 @@ -// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) +// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org) // Licensed under the Apache License, Version 2.0 (see LICENSE file) // Official repository: https://github.com/nekernel-org/nekernel -#include <tools/libmkfs/mkfs.h> -#include <tools/libmkfs/openhefs.h> +#include <tools/libmkfs/mkfs.hpp> +#include <tools/libmkfs/openhefs.hpp> #include <cstdlib> #include <fstream> /// @note decimal base. static uint16_t kNumericalBase = 10; +static auto kMinArgs = 2; int main(int argc, char** argv) { - if (argc < 2) { - mkfs::console_out() << "fsck: hefs: usage: chk.hefs -in=<input_device> -b=<origin>" + if (argc < kMinArgs) { + mkfs::console_out() << "chk: hefs: usage: chk.hefs -in=<input_device> -b=<origin>" << "\n"; return EXIT_FAILURE; } auto args = mkfs::detail::build_args(argc, argv); - auto opt_disk = mkfs::get_option<char>(args, "in"); - auto origin = mkfs::get_option<char>(args, "b"); if (opt_disk.empty()) { - mkfs::console_out() << "fsck: hefs: error: OpenHeFS partition is empty! Exiting..." + mkfs::console_out() << "chk: hefs: error: OpenHeFS partition is empty! Exiting..." << "\n"; return EXIT_FAILURE; } @@ -32,21 +31,21 @@ int main(int argc, char** argv) { auto out_origin = 0UL; if (!mkfs::detail::parse_signed(origin, out_origin, kNumericalBase)) { - mkfs::console_out() << "hefs: error: Invalid -org=<dec> argument.\n"; + mkfs::console_out() << "chk: hefs: error: Invalid -org=<dec> argument.\n"; return EXIT_FAILURE; } std::ifstream output_device(opt_disk, std::ios::binary); if (!output_device.good()) { - mkfs::console_out() << "hefs: error: Unable to open output device: " << opt_disk << "\n"; + mkfs::console_out() << "chk: hefs: error: Unable to open output device: " << opt_disk << "\n"; return EXIT_FAILURE; } output_device.seekg(out_origin); if (!output_device.good()) { - mkfs::console_out() << "hefs: error: Failed seek to origin.\n"; + mkfs::console_out() << "chk: hefs: error: Failed seek to origin.\n"; return EXIT_FAILURE; } @@ -57,20 +56,18 @@ int main(int argc, char** argv) { if (strncmp(boot_node.magic, kOpenHeFSMagic, kOpenHeFSMagicLen) != 0 || boot_node.sectorCount < 1 || boot_node.sectorSize < kMkFsSectorSz) { - mkfs::console_out() << "hefs: error: Device does not contain an OpenHeFS disk: " << opt_disk + mkfs::console_out() << "chk: hefs: error: Device does not contain an OpenHeFS disk: " << opt_disk << "\n"; return EXIT_FAILURE; } if (boot_node.badSectors > kMkFsMaxBadSectors) { - mkfs::console_out() << "hefs: error: OpenHeFS disk has too much bad sectors: " << opt_disk + mkfs::console_out() << "chk: hefs: error: OpenHeFS disk has too much bad sectors: " << opt_disk << "\n"; return EXIT_FAILURE; } - mkfs::console_out() << "hefs: OpenHeFS partition is healthy. Exiting...\n"; - - output_device.close(); + mkfs::console_out() << "chk: hefs: OpenHeFS partition is healthy. Exiting...\n"; return EXIT_SUCCESS; } diff --git a/tools/chk.hefs.json b/tools/chk.hefs.json index 649c5e7f..5bb665b3 100644 --- a/tools/chk.hefs.json +++ b/tools/chk.hefs.json @@ -5,7 +5,7 @@ "../" ], "sources_path": [ - "chk.hefs.cc" + "chk.hefs.cpp" ], "output_name": "./dist/chk.hefs", "cpp_macros": [ @@ -13,4 +13,4 @@ "kFsckOpenHeFSVersionHighest=0x0100", "kFsckOpenHeFSVersionLowest=0x0100" ] -}
\ No newline at end of file +} diff --git a/tools/libmkfs/mkfs.h b/tools/libmkfs/mkfs.hpp index 240d7b16..41e79996 100644 --- a/tools/libmkfs/mkfs.h +++ b/tools/libmkfs/mkfs.hpp @@ -1,4 +1,4 @@ -// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) +// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org) // Licensed under the Apache License, Version 2.0 (see LICENSE file) // Official repository: https://github.com/nekernel-org/nekernel diff --git a/tools/libmkfs/openhefs.h b/tools/libmkfs/openhefs.hpp index 8db113ed..6b77bf1b 100644 --- a/tools/libmkfs/openhefs.h +++ b/tools/libmkfs/openhefs.hpp @@ -1,4 +1,4 @@ -// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) +// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org) // Licensed under the Apache License, Version 2.0 (see LICENSE file) // Official repository: https://github.com/nekernel-org/nekernel diff --git a/tools/mkapp.py b/tools/mkapp.py index 5f65bfb2..e3128a52 100755 --- a/tools/mkapp.py +++ b/tools/mkapp.py @@ -45,9 +45,7 @@ def create_directory_structure(base_path, project_name): "compiler_path": "clang++", "compiler_std": "c++20", "headers_path": ["./", "../../../src/kernel", "../../../public/frameworks/", "../../../src/", "./"], - "sources_path": [ - - ], + "sources_path": [], "output_name": f"./dist/{project_name}", "cpp_macros": [ "kSampleFWVersion=0x0100", @@ -56,7 +54,7 @@ def create_directory_structure(base_path, project_name): "__NE_SDK__" ] } - + with open(proj_json_path, 'w') as json_file: json.dump(manifest, json_file, indent=4) @@ -67,6 +65,8 @@ def create_directory_structure(base_path, project_name): with open(proj_cpp_path, 'w') as cpp_file_io: cpp_file_io.write(cpp_file) + + if __name__ == "__main__": if len(sys.argv) != 2: print("HELP: mkapp.py <project_name>") @@ -74,5 +74,8 @@ if __name__ == "__main__": base_path = os.getcwd() # Use the current working directory as the base path create_directory_structure(base_path, sys.argv[1]) - print("INFO: Application created successfully.") + + + + diff --git a/tools/mkfs.hefs.cc b/tools/mkfs.hefs.cpp index 879b5668..b698105e 100644 --- a/tools/mkfs.hefs.cc +++ b/tools/mkfs.hefs.cpp @@ -1,9 +1,9 @@ -// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) +// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org) // Licensed under the Apache License, Version 2.0 (see LICENSE file) // Official repository: https://github.com/nekernel-org/nekernel -#include <tools/libmkfs/mkfs.h> -#include <tools/libmkfs/openhefs.h> +#include <tools/libmkfs/mkfs.hpp> +#include <tools/libmkfs/openhefs.hpp> #include <algorithm> #include <cstdlib> #include <cstring> diff --git a/tools/mkfs.hefs.json b/tools/mkfs.hefs.json index 542fa473..2ced7cf8 100644 --- a/tools/mkfs.hefs.json +++ b/tools/mkfs.hefs.json @@ -5,7 +5,7 @@ "../" ], "sources_path": [ - "mkfs.hefs.cc" + "mkfs.hefs.cpp" ], "output_name": "./dist/mkfs.hefs", "cpp_macros": [ @@ -13,4 +13,4 @@ "kMkfsHeFSVersionHighest=0x0100", "kMkfsHeFSVersionLowest=0x0100" ] -}
\ No newline at end of file +} |
