diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-24 10:59:49 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-24 10:59:49 +0200 |
| commit | 386d9a5bffcd66633e4c3c72eb6cb25722796c92 (patch) | |
| tree | 438158dbf0856bf2563cdc9e4b183e290f4bb03a /public | |
| parent | e89d4a1402bdd32b8ad7e2ed04278b7ad54740c3 (diff) | |
feat(kernel): Better syscall routing, also added new tools.
what:
- ping, manual have been added.
- Rework RtlCurrentPID to SchedGetCurrentProcessID.
- Cleanup codebase overall.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'public')
| -rw-r--r-- | public/tools/manual/.keep | 0 | ||||
| -rw-r--r-- | public/tools/manual/manual.json | 19 | ||||
| -rw-r--r-- | public/tools/manual/src/.keep | 0 | ||||
| -rw-r--r-- | public/tools/manual/src/CommandLine.cc | 13 | ||||
| -rw-r--r-- | public/tools/manual/vendor/.keep | 0 | ||||
| -rw-r--r-- | public/tools/ping/.keep | 0 | ||||
| -rw-r--r-- | public/tools/ping/ping.json | 19 | ||||
| -rw-r--r-- | public/tools/ping/src/.keep | 0 | ||||
| -rw-r--r-- | public/tools/ping/src/CommandLine.cc | 29 | ||||
| -rw-r--r-- | public/tools/ping/vendor/.keep | 0 |
10 files changed, 80 insertions, 0 deletions
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..0d9c4136 --- /dev/null +++ b/public/tools/manual/src/CommandLine.cc @@ -0,0 +1,13 @@ +#include <user/SystemCalls.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/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..9aae0ea9 --- /dev/null +++ b/public/tools/ping/src/CommandLine.cc @@ -0,0 +1,29 @@ +#include <user/SystemCalls.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 |
