diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-19 08:40:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-19 08:40:12 +0200 |
| commit | f87797692777540eede1d4739199b444bd15340a (patch) | |
| tree | 646ae3f61ebcd3f83c888912c5f72efc0a8c25b0 /public/tools/make_app/src/CommandLine.cc | |
| parent | ee1edba85ea13627871e1ed005931bd502b86ab8 (diff) | |
| parent | 1740a0dff822d7666b8c1f056b6c411ef6b0f9fd (diff) | |
NeKernel: 0.0.10.0.1-release
# NeKernel: 0.0.1
## Features (not all included):
- New extended File System.
- Kernel and Bootloader (NeKernel and BootZ)
- Process Scheduler.
- NeKernel's Preferred Executable Format.
- SysChk.
- Explicit Partition Map scheme.
#### NOTE: The GPT scheme is in WiP! Please run NeKernel on QEMU!
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; } |
