diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-18 09:18:55 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-18 09:18:55 +0200 |
| commit | 95f1448a371f563071a755b9ed507cd64d70ed5b (patch) | |
| tree | e728a7c260e3daa02eaf82c89ec384183be170d4 /public/tools/make_app/src/CommandLine.cc | |
| parent | 7bfa36c2215e13097bb5ddcb15d2a8a476102b55 (diff) | |
kernel, boot: improvements and tweaks on the kernel's filesystems.
- HeFS requires a 4gb disk at minimum now.
- make_app fully supports STEPS.
- Errata of NeFS.tex, add HeFS.tex.
- Better boot flow.
- New filesystems for FileMgr.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'public/tools/make_app/src/CommandLine.cc')
| -rw-r--r-- | public/tools/make_app/src/CommandLine.cc | 48 |
1 files changed, 38 insertions, 10 deletions
diff --git a/public/tools/make_app/src/CommandLine.cc b/public/tools/make_app/src/CommandLine.cc index a00e0ec0..c30e02a0 100644 --- a/public/tools/make_app/src/CommandLine.cc +++ b/public/tools/make_app/src/CommandLine.cc @@ -7,9 +7,15 @@ #include <Framework.h> #include <Steps.h> +#include <user/ProcessCodes.h> + #include <CoreFoundation.fwrk/headers/Array.h> -/// @brief This program makes a framework directory for NeKernel OS. +/// @brief This program makes a framework/app/steps directory for NeKernel OS. + +static Char* kStepsName = "Steps"; +static Char* kStepsAuthor = "John Doe"; +static Char* kStepsCompany = "Company, Inc"; int main(int argc, char* argv[]) { @@ -28,7 +34,25 @@ int main(int argc, char* argv[]) PrintOut(nullptr, "%s", "make_app: -s: Steps (Setup pages) format.\n"); PrintOut(nullptr, "%s", "make_app: -f: Framework format.\n"); - return EXIT_SUCCESS; + return kErrorSuccess; + } + + if (MmStrCmp(argv[i], "--author") == 0) + { + MmCopyMemory(kStepsAuthor, const_cast<Char*>(argv[i + 1]), MmStrLen(argv[i + 1])); + continue; + } + + if (MmStrCmp(argv[i], "--company") == 0) + { + MmCopyMemory(kStepsCompany, const_cast<Char*>(argv[i + 1]), MmStrLen(argv[i + 1])); + continue; + } + + if (MmStrCmp(argv[i], "--name") == 0) + { + MmCopyMemory(kStepsName, const_cast<Char*>(argv[i + 1]), MmStrLen(argv[i + 1])); + continue; } if (MmStrCmp(argv[i], "-a") == 0) @@ -63,13 +87,17 @@ int main(int argc, char* argv[]) auto handle = IoOpenFile(StrFmt("{}{}{}{}", path, kRootDirectory, "_setup", kStepsExtension), nullptr); - struct STEPS_COMMON_RECORD record - { - 0 - }; + struct STEPS_COMMON_RECORD record; + + MmFillMemory(&record, sizeof(STEPS_COMMON_RECORD), 0); + + MmCopyMemory(record.name, const_cast<Char*>(kStepsName), kStepsStrLen); + MmCopyMemory(record.author, const_cast<Char*>(kStepsAuthor), kStepsStrLen); + MmCopyMemory(record.company, const_cast<Char*>(kStepsCompany), kStepsStrLen); + + MmCopyMemory(record.magic, const_cast<Char*>(kStepsMagic), kStepsMagicLen); - record.setup_magic = 0xAABB; - record.setup_version = 1; + record.version = kStepsVersion; IoWriteFile(handle, (void*)&record, sizeof(STEPS_COMMON_RECORD)); IoCloseFile(handle); @@ -84,8 +112,8 @@ int main(int argc, char* argv[]) FsCopy(path, StrFmt("{}{}", path, file)); } - return EXIT_SUCCESS; + return kErrorSuccess; } - return EXIT_FAILURE; + return kErrorInternal; } |
