From 9f3ed9465eacc0811a2397b0b807779729aa1b9e Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 19 Nov 2025 09:26:49 +0100 Subject: feat: new commits on components, new libsteps library. Signed-off-by: Amlal El Mahrouss --- compile_flags.txt | 1 + dev/nebuild | 2 +- dev/necti | 2 +- lib/.keep | 0 lib/libocl | 2 +- lib/libsteps/steps.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ sbin/.keep | 0 sbin/install.cc | 18 ------------------ sbin/install.toml | 8 -------- tools/.keep | 0 tools/steps.cc | 27 +++++++++++++++++++++++++++ tools/steps.toml | 8 ++++++++ 12 files changed, 86 insertions(+), 29 deletions(-) create mode 100644 lib/.keep create mode 100644 lib/libsteps/steps.h delete mode 100644 sbin/.keep delete mode 100644 sbin/install.cc delete mode 100644 sbin/install.toml create mode 100644 tools/.keep create mode 100644 tools/steps.cc create mode 100644 tools/steps.toml diff --git a/compile_flags.txt b/compile_flags.txt index 36d5b7d..6f5638b 100644 --- a/compile_flags.txt +++ b/compile_flags.txt @@ -6,3 +6,4 @@ -Idev/nekernel/dev -Idev/necti/dev -Ilib/libocl/dev/ +-I/opt/homebrew/Cellar/boost/1.89.0/include diff --git a/dev/nebuild b/dev/nebuild index 8cf214b..dc87375 160000 --- a/dev/nebuild +++ b/dev/nebuild @@ -1 +1 @@ -Subproject commit 8cf214b3e06556aa0aa18133aac60ddbedebc06e +Subproject commit dc87375b9a0103e8c9dd39393abc21113e2dd917 diff --git a/dev/necti b/dev/necti index 3651a18..281bef7 160000 --- a/dev/necti +++ b/dev/necti @@ -1 +1 @@ -Subproject commit 3651a188c829ab0e85b3f3ea337d069be9a5103d +Subproject commit 281bef7f35e63a9c5daf37cca5bb8eea64c12693 diff --git a/lib/.keep b/lib/.keep new file mode 100644 index 0000000..e69de29 diff --git a/lib/libocl b/lib/libocl index c9fd682..3bc2fca 160000 --- a/lib/libocl +++ b/lib/libocl @@ -1 +1 @@ -Subproject commit c9fd682f3662e0eec09de49a36a4ea199656da34 +Subproject commit 3bc2fca2c9beff13586b8bf3089ce439acb09de1 diff --git a/lib/libsteps/steps.h b/lib/libsteps/steps.h new file mode 100644 index 0000000..357f0df --- /dev/null +++ b/lib/libsteps/steps.h @@ -0,0 +1,47 @@ +/* ------------------------------------------- + +Copyright (C) 2025, Amlal El Mahrouss, licensed under the Apache 2.0 license. + +------------------------------------------- */ + +#pragma once + +#include + +#define kSysStepsExtension ".stp" +#define kSysStepsStrLen (256U) + +#define kSysStepsMagic " pls" +#define kSysStepsMagicLen (4U) +#define kSysStepsVersion (0x0100) + +#define kStepsMime "ne-application-kind/steps" + +namespace steps { +struct record final { + char magic[kSysStepsMagicLen] = {kSysStepsMagic[0], kSysStepsMagic[1], + kSysStepsMagic[2], kSysStepsMagic[3]}; + char name[kSysStepsStrLen] = ""; + char company[kSysStepsStrLen] = ""; + char author[kSysStepsStrLen] = ""; + int32_t version = 0; + int32_t pages = 0; + int32_t check_page = 0, eula_page = 0; +}; + +namespace operators { +/// =========================================================== /// +/// @brief Equal operator for steps records. +/// =========================================================== /// +inline bool operator==(const record &r, const record &l) { + return (std::strncmp(r.magic, l.magic, kSysStepsMagicLen) == 0); +} + +/// =========================================================== /// +/// @brief Not equal operator for steps records. +/// =========================================================== /// +inline bool operator!=(const record &r, const record &l) { + return (std::strncmp(r.magic, l.magic, kSysStepsMagicLen) > 0); +} +} // namespace operators +} // namespace steps diff --git a/sbin/.keep b/sbin/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/sbin/install.cc b/sbin/install.cc deleted file mode 100644 index 4bdb4fa..0000000 --- a/sbin/install.cc +++ /dev/null @@ -1,18 +0,0 @@ -/* ------------------------------------------- - -Copyright (C) 2025, Amlal El Mahrouss, licensed under the Apache 2.0 license. - -------------------------------------------- */ - -#include - -int main(int argc, char** argv) -{ - ocl::io::print("install: Installing distribution...\n"); - - /// AMLALE: TODO: implement the install logic here. - - ocl::io::print("install: Done!\n"); - - return EXIT_SUCCESS; -} \ No newline at end of file diff --git a/sbin/install.toml b/sbin/install.toml deleted file mode 100644 index 219da21..0000000 --- a/sbin/install.toml +++ /dev/null @@ -1,8 +0,0 @@ -compiler_path = "clang++" -compiler_std = "c++20" -headers_path = [ "../lib/libocl/dev/", "/opt/homebrew/Cellar/boost/1.89.0/include" ] -sources_path = [ "install.cc" ] -output_name = "install.o" -compiler_flags = [ "-fPIC" ] -cpp_macros = [ "__INSTALL__" ] -run_after_build = false diff --git a/tools/.keep b/tools/.keep new file mode 100644 index 0000000..e69de29 diff --git a/tools/steps.cc b/tools/steps.cc new file mode 100644 index 0000000..551203c --- /dev/null +++ b/tools/steps.cc @@ -0,0 +1,27 @@ +/* ------------------------------------------- + +Copyright (C) 2025, Amlal El Mahrouss, licensed under the Apache 2.0 license. + +------------------------------------------- */ + +#include +#include + +/// Use operators from steps namespace to compare steps records. +using namespace steps::operators; + +/// =========================================================== /// +/// @brief Main function for running steps on NeKernel. +/// =========================================================== /// +int main(int argc, char** argv) +{ + ocl::io::print("steps: running steps for program...\n"); + + steps::record steps; + + /// AMLALE: Read steps from file and process them. + + ocl::io::print("steps: done!\n"); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/tools/steps.toml b/tools/steps.toml new file mode 100644 index 0000000..f9e3734 --- /dev/null +++ b/tools/steps.toml @@ -0,0 +1,8 @@ +compiler_path = "clang++" +compiler_std = "c++20" +headers_path = [ "../lib", "../lib/libocl/dev/", "/opt/homebrew/Cellar/boost/1.89.0/include" ] +sources_path = [ "steps.cc" ] +output_name = "steps.o" +compiler_flags = [ "-fPIC" ] +cpp_macros = [ "__NE_STEPS__" ] +run_after_build = false -- cgit v1.2.3