summaryrefslogtreecommitdiffhomepage
path: root/dev/launch
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-09-09 21:28:04 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-09-09 21:28:04 +0200
commitb1e3dac861c0d6c28bdb7768d7f96f19456e9ad0 (patch)
tree7868c5e081e86f72ec0203f3c8b1ed4bcb9b1598 /dev/launch
parent42832ec1b72baf244a1290ccf747b79db0caa69f (diff)
feat:! ddk/dki, ne_launch, ifs: Big architectural changes and
improvements. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/launch')
-rw-r--r--dev/launch/LaunchKit/LaunchKit.h2
-rw-r--r--dev/launch/ne_launch.json2
-rw-r--r--dev/launch/src/CRT0.S17
-rw-r--r--dev/launch/src/LaunchSrv.cc5
4 files changed, 23 insertions, 3 deletions
diff --git a/dev/launch/LaunchKit/LaunchKit.h b/dev/launch/LaunchKit/LaunchKit.h
index 1a134e8f..2fa9607b 100644
--- a/dev/launch/LaunchKit/LaunchKit.h
+++ b/dev/launch/LaunchKit/LaunchKit.h
@@ -14,5 +14,7 @@
#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
index 38379de9..e3d26a46 100644
--- a/dev/launch/ne_launch.json
+++ b/dev/launch/ne_launch.json
@@ -2,7 +2,7 @@
"compiler_path": "x86_64-w64-mingw32-g++",
"compiler_std": "c++20",
"headers_path": ["../", "./"],
- "sources_path": ["src/*.cc"],
+ "sources_path": ["src/*.cc", "src/*.S"],
"output_name": "ne_launch",
"compiler_flags": [
"-ffreestanding",
diff --git a/dev/launch/src/CRT0.S b/dev/launch/src/CRT0.S
new file mode 100644
index 00000000..ffc7398a
--- /dev/null
+++ b/dev/launch/src/CRT0.S
@@ -0,0 +1,17 @@
+/* -------------------------------------------
+
+ Copyright (C) 2025, Amlal El Mahrouss, all rights reserved.
+
+ ------------------------------------------- */
+
+ .text
+
+.extern nelaunch_startup_fn
+
+_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
index 40027f65..f5c9ee3c 100644
--- a/dev/launch/src/LaunchSrv.cc
+++ b/dev/launch/src/LaunchSrv.cc
@@ -7,10 +7,11 @@
#include <LaunchKit/LaunchKit.h>
#include <libSystem/SystemKit/Err.h>
-SInt32 _NeMain(Void) {
+/// @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 services...");
+ NELAUNCH_INFO("Starting NeKernel services...");
return kErrorSuccess;
}