summaryrefslogtreecommitdiffhomepage
path: root/dev/launch
diff options
context:
space:
mode:
Diffstat (limited to 'dev/launch')
-rw-r--r--dev/launch/.keep0
-rw-r--r--dev/launch/LaunchKit/.keep0
-rw-r--r--dev/launch/LaunchKit/LaunchKit.h20
-rw-r--r--dev/launch/ne_launch.json20
-rw-r--r--dev/launch/obj/.keep0
-rw-r--r--dev/launch/src/.keep0
-rw-r--r--dev/launch/src/CRT0.S18
-rw-r--r--dev/launch/src/LaunchSrv.cc17
8 files changed, 75 insertions, 0 deletions
diff --git a/dev/launch/.keep b/dev/launch/.keep
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/dev/launch/.keep
diff --git a/dev/launch/LaunchKit/.keep b/dev/launch/LaunchKit/.keep
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/dev/launch/LaunchKit/.keep
diff --git a/dev/launch/LaunchKit/LaunchKit.h b/dev/launch/LaunchKit/LaunchKit.h
new file mode 100644
index 00000000..2fa9607b
--- /dev/null
+++ b/dev/launch/LaunchKit/LaunchKit.h
@@ -0,0 +1,20 @@
+/* -------------------------------------------
+
+ Copyright (C) 2025, Amlal El Mahrouss, all rights reserved.
+
+ ------------------------------------------- */
+
+#pragma once
+
+#include <libSystem/SystemKit/System.h>
+
+/// @author Amlal El Mahrouss
+/// @brief NeKernel Launch Kit.
+
+#define NELAUNCH_INFO(MSG) PrintOut(nullptr, "INFO: [LAUNCH] %s\n", MSG)
+#define NELAUNCH_WARN(MSG) PrintOut(nullptr, "WARN: [LAUNCH] %s\n", MSG)
+
+namespace Launch {
+using LaunchHandle = VoidPtr;
+using KernelStatus = SInt32;
+} // namespace Launch
diff --git a/dev/launch/ne_launch.json b/dev/launch/ne_launch.json
new file mode 100644
index 00000000..e3d26a46
--- /dev/null
+++ b/dev/launch/ne_launch.json
@@ -0,0 +1,20 @@
+{
+ "compiler_path": "x86_64-w64-mingw32-g++",
+ "compiler_std": "c++20",
+ "headers_path": ["../", "./"],
+ "sources_path": ["src/*.cc", "src/*.S"],
+ "output_name": "ne_launch",
+ "compiler_flags": [
+ "-ffreestanding",
+ "-shared",
+ "-fPIC",
+ "-fno-rtti",
+ "-fno-exceptions",
+ "-Wl,--subsystem=17"
+ ],
+ "cpp_macros": [
+ "kNeLaunchVersion=0x0100",
+ "kNeLaunchVersionHighest=0x0100",
+ "kNeLaunchVersionLowest=0x0100"
+ ]
+}
diff --git a/dev/launch/obj/.keep b/dev/launch/obj/.keep
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/dev/launch/obj/.keep
diff --git a/dev/launch/src/.keep b/dev/launch/src/.keep
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/dev/launch/src/.keep
diff --git a/dev/launch/src/CRT0.S b/dev/launch/src/CRT0.S
new file mode 100644
index 00000000..84a293e6
--- /dev/null
+++ b/dev/launch/src/CRT0.S
@@ -0,0 +1,18 @@
+/* -------------------------------------------
+
+ Copyright (C) 2025, Amlal El Mahrouss, all rights reserved.
+
+ ------------------------------------------- */
+
+ .text
+
+.extern nelaunch_startup_fn
+.globl _NeMain
+
+_NeMain:
+ push %rbp
+ movq %rsp, %rbp
+ callq nelaunch_startup_fn
+ popq %rbp
+
+ retq
diff --git a/dev/launch/src/LaunchSrv.cc b/dev/launch/src/LaunchSrv.cc
new file mode 100644
index 00000000..f5c9ee3c
--- /dev/null
+++ b/dev/launch/src/LaunchSrv.cc
@@ -0,0 +1,17 @@
+/* -------------------------------------------
+
+ Copyright (C) 2025, Amlal El Mahrouss, all rights reserved.
+
+ ------------------------------------------- */
+
+#include <LaunchKit/LaunchKit.h>
+#include <libSystem/SystemKit/Err.h>
+
+/// @note This called by _NeMain from its own runtime.
+extern "C" SInt32 nelaunch_startup_fn(Void) {
+ /// @todo Start LaunchServices.fwrk services, make the launcher manageable too (via mgmt.launch)
+
+ NELAUNCH_INFO("Starting NeKernel services...");
+
+ return kErrorSuccess;
+}