diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-29 10:51:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-29 10:51:53 +0200 |
| commit | 5c0bb7ee7b1b0fee02cc179fb21f4c57a61d6c2d (patch) | |
| tree | cb17577bcdc9714c97a84ce417a075117097f146 /public | |
| parent | d608230b1350b064ceb01e6572519b108f6139b0 (diff) | |
| parent | 3167f59dbb401d6a79b1524537e04218baf49ee3 (diff) | |
Merge pull request #32 from nekernel-org/dev
0.0.2e3
Diffstat (limited to 'public')
34 files changed, 300 insertions, 25 deletions
diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Array.h b/public/frameworks/CoreFoundation.fwrk/headers/Array.h index 0b4a8dbf..55e75e5e 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/Array.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/Array.h @@ -6,7 +6,7 @@ #pragma once -#include <user/SystemCalls.h> +#include <libSystem/System.h> namespace CF { template <typename T, SizeT N> diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h b/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h index 194b7bb7..1f295ea5 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/Foundation.h @@ -10,7 +10,7 @@ #pragma once -#include <user/SystemCalls.h> +#include <libSystem/System.h> namespace CF { class CFString; diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Property.h b/public/frameworks/CoreFoundation.fwrk/headers/Property.h index 58e881e5..4da173c7 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/Property.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/Property.h @@ -8,7 +8,7 @@ #define _PROPS_H #include <CoreFoundation.fwrk/headers/Ref.h> -#include <user/SystemCalls.h> +#include <libSystem/System.h> #define kMaxPropLen (256U) diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Ref.h b/public/frameworks/CoreFoundation.fwrk/headers/Ref.h index c18c6161..cb72a034 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/Ref.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/Ref.h @@ -9,7 +9,7 @@ #define _REF_H_ #include <CoreFoundation.fwrk/headers/Object.h> -#include <user/SystemCalls.h> +#include <libSystem/System.h> namespace CF { template <typename T> diff --git a/public/frameworks/CoreFoundation.fwrk/xml/app.xml b/public/frameworks/CoreFoundation.fwrk/xml/app.xml index 3a2beac4..fe112a09 100644 --- a/public/frameworks/CoreFoundation.fwrk/xml/app.xml +++ b/public/frameworks/CoreFoundation.fwrk/xml/app.xml @@ -1,3 +1,3 @@ <PropertyList/> -<PLEntry Type="MLString" Name="LibraryName" Len="255" Value="CoreFoundation" /> +<PLEntry Type="CFString" Name="LibraryName" Len="255" Value="CoreFoundation" /> <PLEntry Type="BOOL" Name="CacheLibs" Value="YES" /> diff --git a/public/frameworks/DiskImage.fwrk/headers/DiskImage.h b/public/frameworks/DiskImage.fwrk/headers/DiskImage.h index 78b39bf8..efc21253 100644 --- a/public/frameworks/DiskImage.fwrk/headers/DiskImage.h +++ b/public/frameworks/DiskImage.fwrk/headers/DiskImage.h @@ -9,9 +9,14 @@ #pragma once -#include <user/SystemCalls.h> +#include <libSystem/System.h> +#ifndef __DISK_IMAGE_CDROM__ #define kDISectorSz (512) +#else +#define kDISectorSz (2048) +#endif // __DISK_IMAGE_CDROM__ + #define kDIMinDiskSz mib_cast(1) #define kDIDefaultOutputName "disk.eimg" #define kDIDefaultDiskName "Disk" @@ -46,4 +51,9 @@ SInt32 DIFormatPartitionEPM(struct DI_DISK_IMAGE& img) noexcept; /// @return Status code upon completion. SInt32 DIFormatFilesystemNeFS(struct DI_DISK_IMAGE& img) noexcept; +/// @brief HeFS format over EPM. +/// @param img disk image structure. +/// @return Status code upon completion. +SInt32 DIFormatFilesystemHeFS(struct DI_DISK_IMAGE& img) noexcept; + } // namespace DI diff --git a/public/frameworks/DiskImage.fwrk/src/DiskImage+HeFS.cc b/public/frameworks/DiskImage.fwrk/src/DiskImage+HeFS.cc new file mode 100644 index 00000000..7f917052 --- /dev/null +++ b/public/frameworks/DiskImage.fwrk/src/DiskImage+HeFS.cc @@ -0,0 +1,32 @@ +/* ------------------------------------------- + + Copyright (C) 2025, Amlal El Mahrouss, all rights reserved. + + FILE: DiskImage+HeFS.cc + PURPOSE: Disk Imaging framework. + + ------------------------------------------- */ + +#include <DiskImage.fwrk/headers/DiskImage.h> + +#include <FSKit/HeFS.h> +#include <FirmwareKit/EPM.h> + +/// @brief format HeFS over an EPM disk. +/// @param img disk image structure. +/// @return Status code upon completion. +SInt32 DI::DIFormatFilesystemHeFS(struct DI_DISK_IMAGE& img) noexcept { + if (!img.sector_sz || (img.sector_sz % kDISectorSz != 0)) return kDIFailureStatus; + + if (*img.out_name == 0 || *img.disk_name == 0) return kDIFailureStatus; + + IORef handle = IoOpenFile(img.out_name, nullptr); + + if (!handle) return kDIFailureStatus; + + ::IoCloseFile(handle); + + handle = nullptr; + + return kDISuccessStatus; +}
\ No newline at end of file diff --git a/public/frameworks/DiskImage.fwrk/src/DiskImage+NeFS.cc b/public/frameworks/DiskImage.fwrk/src/DiskImage+NeFS.cc index bee84cca..c4f32c95 100644 --- a/public/frameworks/DiskImage.fwrk/src/DiskImage+NeFS.cc +++ b/public/frameworks/DiskImage.fwrk/src/DiskImage+NeFS.cc @@ -12,11 +12,11 @@ #include <FSKit/NeFS.h> #include <FirmwareKit/EPM.h> -/// @brief NeFS format over EPM. +/// @brief format NeFS over an EPM disk. /// @param img disk image structure. /// @return Status code upon completion. SInt32 DI::DIFormatFilesystemNeFS(struct DI_DISK_IMAGE& img) noexcept { - if (!img.sector_sz || (img.sector_sz % 512 != 0)) return kDIFailureStatus; + if (!img.sector_sz || (img.sector_sz % kDISectorSz != 0)) return kDIFailureStatus; if (*img.out_name == 0 || *img.disk_name == 0) return kDIFailureStatus; diff --git a/public/frameworks/DiskImage.fwrk/xml/app.xml b/public/frameworks/DiskImage.fwrk/xml/app.xml index 29d6670f..f498d4ab 100644 --- a/public/frameworks/DiskImage.fwrk/xml/app.xml +++ b/public/frameworks/DiskImage.fwrk/xml/app.xml @@ -1,3 +1,4 @@ -<PropertyList/> -<PLEntry Type="MLString" Name="LibraryName" Len="255" Value="DiskImage" /> -<PLEntry Type="BOOL" Name="CacheLibs" Value="YES" /> +<PropertyList> + <PLEntry Type="CFString" Name="LibraryName" Len="10" Value="DiskImage" /> + <PLEntry Type="BOOL" Name="CacheLibs" Value="YES" /> +</PropertyList>
\ No newline at end of file diff --git a/public/frameworks/KernelTest.fwrk/headers/KernelTest.h b/public/frameworks/KernelTest.fwrk/headers/KernelTest.h index ccb1a903..04e90964 100644 --- a/public/frameworks/KernelTest.fwrk/headers/KernelTest.h +++ b/public/frameworks/KernelTest.fwrk/headers/KernelTest.h @@ -6,13 +6,13 @@ #pragma once -#include <NewKit/KernelPanic.h> +#include <NeKit/KernelPanic.h> /// @brief Kernel Test Framework. /// @file KernelTest.h #define KT_TEST_VERSION_BCD (0x0001) -#define KT_TEST_VERSION "0.0.1" +#define KT_TEST_VERSION "v0.0.1-kerneltest" #define KT_TEST_FAILURE (1) diff --git a/public/frameworks/KernelTest.fwrk/xml/app.xml b/public/frameworks/KernelTest.fwrk/xml/app.xml index f0c48862..e3ff9424 100644 --- a/public/frameworks/KernelTest.fwrk/xml/app.xml +++ b/public/frameworks/KernelTest.fwrk/xml/app.xml @@ -1,3 +1,4 @@ -<PropertyList/> -<PLEntry Type="MLString" Name="LibraryName" Len="255" Value="KernelTest" /> +<PropertyList> +<PLEntry Type="CFString" Name="LibraryName" Len="10" Value="KernelTest" /> <PLEntry Type="BOOL" Name="CacheLibs" Value="YES" /> +</PropertyList>
\ No newline at end of file diff --git a/public/manuals/nekernel/mgmt.util.man b/public/manuals/nekernel/mgmt.util.man new file mode 100644 index 00000000..1c46002b --- /dev/null +++ b/public/manuals/nekernel/mgmt.util.man @@ -0,0 +1,32 @@ +NAME + mgmt — Management utility command + +SYNOPSIS + mgmt [OPTIONS] + +DESCRIPTION + The `mgmt` command provides scheduling, execution, and remote orchestration + capabilities within the System One operating environment. It serves as the + main task and maintenance utility for NeKernel deployments. + + Usages include, but are not limited to: + - Schedule scripts or tasks for future execution. + - Verify device or filesystem integrity. + - Manage and automate remote NeKernel machines. + +OPTIONS + -s, --script <FILE> Script to execute + -t, --time <HH:MMAM/PM> Time to run the script + -d, --day <DAY> Day of the week (e.g., Mon, Tue, Wed) + -m, --month <MONTH> Month (e.g., Jan, Feb, Mar) + -y, --year <YYYY> Year to schedule task + -r, --remote <ADDRESS> Remote machine to manage (optional) + -v, --verify Run integrity checks only + -h, --help Display this help message + +EXAMPLES + mgmt -s pgp-update.script -t 2:30PM -d Wed -m Apr -y 2026 + Schedules `pgp-update.script` to run at 2:30PM on Wednesday, April 2026. + +RELEASE + System One — NeKernel
\ No newline at end of file diff --git a/public/manuals/nekernel/mgmt.util.man.html b/public/manuals/nekernel/mgmt.util.man.html new file mode 100644 index 00000000..6f1ddc13 --- /dev/null +++ b/public/manuals/nekernel/mgmt.util.man.html @@ -0,0 +1,85 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>mgmt Manual Page</title> + <style> + body { + font-family: monospace; + background-color: #f4f4f4; + padding: 2em; + color: #222; + } + + h1, + h2 { + border-bottom: 1px solid #aaa; + } + + code { + background: #eee; + padding: 0.2em 0.4em; + border-radius: 4px; + } + + section { + margin-bottom: 2em; + } + </style> +</head> + +<body> + <h1>mgmt</h1> + <section> + <h2>NAME</h2> + <p><strong>mgmt</strong> — Management utility command</p> + </section> + + <section> + <h2>SYNOPSIS</h2> + <p><code>mgmt [OPTIONS]</code></p> + </section> + + <section> + <h2>DESCRIPTION</h2> + <p> + The <code>mgmt</code> command provides scheduling, execution, and remote orchestration + capabilities within the System One operating environment. It serves as the main task + and maintenance utility for NeKernel deployments. + </p> + <ul> + <li>Schedule scripts or tasks for future execution.</li> + <li>Verify device or filesystem integrity.</li> + <li>Manage and automate remote NeKernel machines.</li> + </ul> + </section> + + <section> + <h2>OPTIONS</h2> + <ul> + <li><code>-s, --script <FILE></code>: Script to execute</li> + <li><code>-t, --time <HH:MMAM/PM></code>: Time to run the script</li> + <li><code>-d, --day <DAY></code>: Day of the week (e.g., Mon, Tue, Wed)</li> + <li><code>-m, --month <MONTH></code>: Month (e.g., Jan, Feb, Mar)</li> + <li><code>-y, --year <YYYY></code>: Year to schedule task</li> + <li><code>-r, --remote <ADDRESS></code>: Remote machine to manage (optional)</li> + <li><code>-v, --verify</code>: Run integrity checks only</li> + <li><code>-h, --help</code>: Display this help message</li> + </ul> + </section> + + <section> + <h2>EXAMPLES</h2> + <pre><code>mgmt -s pgp-update.script -t 2:30PM -d Wed -m Apr -y 2026</code></pre> + <p>Schedules <code>pgp-update.script</code> to run at 2:30PM on Wednesday, April 2026.</p> + </section> + + <section> + <h2>RELEASE</h2> + <p>System One — NeKernel</p> + </section> +</body> + +</html>
\ No newline at end of file diff --git a/public/manuals/troff/cxxdrv.7 b/public/manuals/troff/cxxdrv.7 new file mode 100644 index 00000000..20e28fd4 --- /dev/null +++ b/public/manuals/troff/cxxdrv.7 @@ -0,0 +1,34 @@ +.TH LD64 1 "LibCompiler" "January 2025" "NeKernel Manual" +.SH NAME +.B cxxdrv +\- AE 64-bit C++ compiler for NeKernel + +.SH SYNOPSIS +.B cxxdrv %OPTIONS% %INPUT_FILES% + +.SH DESCRIPTION +.B cxxdrv +is the dedicated compiler used by NeKernel, it compiles to the AE object format. + +.SH OPTIONS +.TP +.B -output <file> +Specify the output file. + +.SH USAGE EXAMPLES +.TP +.B Generate object file from the main.cpp unit. +.B cxxdrv main.cpp + +.SH EXIT STATUS +.TP +0 Successful compilation. +.TP +1 Error encountered during compilation of the C++ unit(s). + +.SH SEE ALSO +.BR cxxdrv (7), asm (7) + +.SH AUTHOR +Amlal El Mahrouss + diff --git a/public/tools/cc/src/CommandLine.cc b/public/tools/cc/src/CommandLine.cc index 719a1555..f1c72b64 100644 --- a/public/tools/cc/src/CommandLine.cc +++ b/public/tools/cc/src/CommandLine.cc @@ -4,7 +4,7 @@ * Copyright (c) 2024-2025 Amlal El Mahrouss */ -#include <user/SystemCalls.h> +#include <libSystem/System.h> /// @brief Placeholder program. diff --git a/public/tools/diutil/diutil.json b/public/tools/diutil/diutil.json index a7a49697..a863634b 100644 --- a/public/tools/diutil/diutil.json +++ b/public/tools/diutil/diutil.json @@ -2,7 +2,7 @@ "compiler_path": "x86_64-w64-mingw32-g++", "compiler_std": "c++20", "headers_path": ["./", "../../../dev/kernel", "../../../public/frameworks/", "../../../dev/", "./"], - "sources_path": ["src/CommandLine.cc", "../../../public/frameworks/DiskImage.fwrk/src/*.cc", "../../../dev/user/src/*.cc"], + "sources_path": ["src/CommandLine.cc", "../../../public/frameworks/DiskImage.fwrk/src/*.cc", "../../../dev/libSystem/src/*.cc"], "output_name": "./dist/diutil", "cpp_macros": [ "kDUTILVersion=0x0100", diff --git a/public/tools/ld.dyn/src/CommandLine.cc b/public/tools/ld.dyn/src/CommandLine.cc index 377f22fa..e76c34a7 100644 --- a/public/tools/ld.dyn/src/CommandLine.cc +++ b/public/tools/ld.dyn/src/CommandLine.cc @@ -4,7 +4,7 @@ * Copyright (c) 2024-2025 Amlal El Mahrouss */ -#include <user/SystemCalls.h> +#include <libSystem/System.h> /// @brief Library loader. diff --git a/public/tools/ld.fwrk/src/CommandLine.cc b/public/tools/ld.fwrk/src/CommandLine.cc index 0fbaaf2e..e7a6e5ca 100644 --- a/public/tools/ld.fwrk/src/CommandLine.cc +++ b/public/tools/ld.fwrk/src/CommandLine.cc @@ -4,7 +4,7 @@ * Copyright (c) 2024-2025 Amlal El Mahrouss */ -#include <user/SystemCalls.h> +#include <libSystem/System.h> /// @brief This program loads a code framework into Kernel's memory. diff --git a/public/tools/manual/.keep b/public/tools/manual/.keep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/public/tools/manual/.keep diff --git a/public/tools/manual/manual.json b/public/tools/manual/manual.json new file mode 100644 index 00000000..04626145 --- /dev/null +++ b/public/tools/manual/manual.json @@ -0,0 +1,19 @@ +{ + "compiler_path": "clang++", + "compiler_std": "c++20", + "headers_path": [ + "./", + "../../../dev/kernel", + "../../../public/frameworks/", + "../../../dev/", + "./" + ], + "sources_path": [], + "output_name": "./dist/manual", + "cpp_macros": [ + "kSampleFWVersion=0x0100", + "kSampleFWVersionHighest=0x0100", + "kSampleFWVersionLowest=0x0100", + "__NE_SDK__" + ] +}
\ No newline at end of file diff --git a/public/tools/manual/src/.keep b/public/tools/manual/src/.keep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/public/tools/manual/src/.keep diff --git a/public/tools/manual/src/CommandLine.cc b/public/tools/manual/src/CommandLine.cc new file mode 100644 index 00000000..0704384a --- /dev/null +++ b/public/tools/manual/src/CommandLine.cc @@ -0,0 +1,13 @@ +#include <libSystem/System.h> + +SInt32 _NeMain(SInt32 argc, Char* argv[]) { + SCI_UNUSED(argc); + SCI_UNUSED(argv); + + if (argc < 2) { + PrintOut(nullptr, "HELP: manual <tutorial_name>\n"); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +}
\ No newline at end of file diff --git a/public/tools/manual/vendor/.keep b/public/tools/manual/vendor/.keep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/public/tools/manual/vendor/.keep diff --git a/public/tools/mgmt/src/CommandLine.cc b/public/tools/mgmt/src/CommandLine.cc index 45990d08..f3840d01 100644 --- a/public/tools/mgmt/src/CommandLine.cc +++ b/public/tools/mgmt/src/CommandLine.cc @@ -1,4 +1,4 @@ -#include <user/SystemCalls.h> +#include <libSystem/System.h> SInt32 _NeMain(SInt32 argc, Char* argv[]) { return EXIT_FAILURE; diff --git a/public/tools/mk.fwrk/Common.h b/public/tools/mk.fwrk/Common.h index be016be6..89e52471 100644 --- a/public/tools/mk.fwrk/Common.h +++ b/public/tools/mk.fwrk/Common.h @@ -7,6 +7,6 @@ #define APPS_COMMON_H #include <CoreFoundation.fwrk/headers/Foundation.h> -#include <user/SystemCalls.h> +#include <libSystem/System.h> #endif // APPS_COMMON_H diff --git a/public/tools/mk.fwrk/src/CommandLine.cc b/public/tools/mk.fwrk/src/CommandLine.cc index 202f21bb..4ef7240a 100644 --- a/public/tools/mk.fwrk/src/CommandLine.cc +++ b/public/tools/mk.fwrk/src/CommandLine.cc @@ -7,7 +7,7 @@ #include <Framework.h> #include <Steps.h> -#include <user/ProcessCodes.h> +#include <libSystem/ProcessCodes.h> #include <CoreFoundation.fwrk/headers/Array.h> diff --git a/public/tools/mk.hefs/src/CommandLine.cc b/public/tools/mk.hefs/src/CommandLine.cc index dd8be97f..711009d5 100644 --- a/public/tools/mk.hefs/src/CommandLine.cc +++ b/public/tools/mk.hefs/src/CommandLine.cc @@ -4,7 +4,7 @@ * Copyright (c) 2025 Amlal El Mahrouss */ -#include <user/SystemCalls.h> +#include <libSystem/System.h> /// @brief Placeholder program. diff --git a/public/tools/mk.nefs/src/CommandLine.cc b/public/tools/mk.nefs/src/CommandLine.cc index dd8be97f..711009d5 100644 --- a/public/tools/mk.nefs/src/CommandLine.cc +++ b/public/tools/mk.nefs/src/CommandLine.cc @@ -4,7 +4,7 @@ * Copyright (c) 2025 Amlal El Mahrouss */ -#include <user/SystemCalls.h> +#include <libSystem/System.h> /// @brief Placeholder program. diff --git a/public/tools/open/src/CommandLine.cc b/public/tools/open/src/CommandLine.cc index f2378599..6fa4e2f2 100644 --- a/public/tools/open/src/CommandLine.cc +++ b/public/tools/open/src/CommandLine.cc @@ -4,7 +4,7 @@ * Copyright (c) 2024-2025 Amlal El Mahrouss */ -#include <user/SystemCalls.h> +#include <libSystem/System.h> /// @brief This program opens an application from **OPEN_APP_BASE_PATH** /// @file CommandLine.cc diff --git a/public/tools/ping/.keep b/public/tools/ping/.keep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/public/tools/ping/.keep diff --git a/public/tools/ping/ping.json b/public/tools/ping/ping.json new file mode 100644 index 00000000..d8d4133a --- /dev/null +++ b/public/tools/ping/ping.json @@ -0,0 +1,19 @@ +{ + "compiler_path": "clang++", + "compiler_std": "c++20", + "headers_path": [ + "./", + "../../../dev/kernel", + "../../../public/frameworks/", + "../../../dev/", + "./" + ], + "sources_path": [], + "output_name": "./dist/ping", + "cpp_macros": [ + "kSampleFWVersion=0x0100", + "kSampleFWVersionHighest=0x0100", + "kSampleFWVersionLowest=0x0100", + "__NE_SDK__" + ] +}
\ No newline at end of file diff --git a/public/tools/ping/src/.keep b/public/tools/ping/src/.keep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/public/tools/ping/src/.keep diff --git a/public/tools/ping/src/CommandLine.cc b/public/tools/ping/src/CommandLine.cc new file mode 100644 index 00000000..f5c82b80 --- /dev/null +++ b/public/tools/ping/src/CommandLine.cc @@ -0,0 +1,29 @@ +#include <libSystem/System.h> + +SInt32 _NeMain(SInt32 argc, Char* argv[]) { + SCI_UNUSED(argc); + + if (argc < 2) { + PrintOut(nullptr, "HELP: ping <hostname>\n"); + return EXIT_FAILURE; + } + + PrintOut(nullptr, "Pinging %s...\n", argv[1]); + + for (SizeT i = 0U; i < 4; ++i) { + SInt32 result = 0; + + if (result != 0) { + PrintOut(nullptr, "Request timed out.\n"); + return EXIT_FAILURE; + } + + SInt32 bytes = 64; // Simulated response size + SInt32 time = 100 + (i * 10); // Simulated response time + SInt32 ttl = 64; + + PrintOut(nullptr, "Reply from %s: bytes=%i time=%ims TTL=%i\n", argv[1], bytes, time, ttl); + } + + return EXIT_SUCCESS; +}
\ No newline at end of file diff --git a/public/tools/ping/vendor/.keep b/public/tools/ping/vendor/.keep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/public/tools/ping/vendor/.keep |
