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 | |
| 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')
| -rw-r--r-- | public/tools/diutil/src/CommandLine.cc | 8 | ||||
| -rw-r--r-- | public/tools/make_app/Steps.h | 20 | ||||
| -rw-r--r-- | public/tools/make_app/src/CommandLine.cc | 48 |
3 files changed, 55 insertions, 21 deletions
diff --git a/public/tools/diutil/src/CommandLine.cc b/public/tools/diutil/src/CommandLine.cc index 9f11e778..604520a9 100644 --- a/public/tools/diutil/src/CommandLine.cc +++ b/public/tools/diutil/src/CommandLine.cc @@ -9,10 +9,10 @@ #include <DiskImage.fwrk/headers/DiskImage.h> -static const Char kDiskName[kDIDiskNameLen] = "Disk"; -static SInt32 kDiskSectorSz = 512; -static SizeT kDiskSz = gib_cast(4); -static const Char kOutDisk[kDIOutNameLen] = "disk.eimg"; +static const Char kDiskName[kDIDiskNameLen] = "Disk"; +static SInt32 kDiskSectorSz = 512; +static SizeT kDiskSz = gib_cast(4); +static const Char kOutDisk[kDIOutNameLen] = "disk.eimg"; /// @brief Filesystem tool entrypoint. int main(int argc, char** argv) diff --git a/public/tools/make_app/Steps.h b/public/tools/make_app/Steps.h index 76976dd3..51927def 100644 --- a/public/tools/make_app/Steps.h +++ b/public/tools/make_app/Steps.h @@ -12,15 +12,21 @@ #define kStepsExtension ".stp" #define kStepsStrLen (256U) +#define kStepsMagic " pls" +#define kStepsMagicLen (4U) +#define kStepsVersion (0x0100) + +#define kStepsMime "ne-application-kind/steps" + struct STEPS_COMMON_RECORD final { - SInt32 setup_magic; - Char setup_name[kStepsStrLen]; - Char setup_company[kStepsStrLen]; - Char setup_author[kStepsStrLen]; - SInt32 setup_version; - SInt32 setup_pages; - SInt32 setup_check_page, setup_eula_page; + Char magic[kStepsMagicLen]; + Char name[kStepsStrLen]; + Char company[kStepsStrLen]; + Char author[kStepsStrLen]; + SInt32 version; + SInt32 pages; + SInt32 check_page, eula_page; }; #endif // ifndef APPS_STEPS_H
\ No newline at end of file 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; } |
