summaryrefslogtreecommitdiffhomepage
path: root/dev/launch/src/AppMain.cc
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-10-16 11:58:48 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-10-16 11:58:48 +0200
commitd48b2faedce25990b83076cfd71e713b222da25a (patch)
treebf3dacfe5979588b371c15e06282c40eb9ba2951 /dev/launch/src/AppMain.cc
parentfaec0dd3a9eda081052753f260133d10b2cdbfe7 (diff)
feat: `ne_launch`: cli application - and new framework.
feat: `ddk`: feat: api! breaking api changes - for v0.0.7 NeKernel. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/launch/src/AppMain.cc')
-rw-r--r--dev/launch/src/AppMain.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/dev/launch/src/AppMain.cc b/dev/launch/src/AppMain.cc
new file mode 100644
index 00000000..eef95fba
--- /dev/null
+++ b/dev/launch/src/AppMain.cc
@@ -0,0 +1,31 @@
+/* -------------------------------------------
+
+ Copyright (C) 2025, Amlal El Mahrouss, all rights reserved.
+
+ ------------------------------------------- */
+
+#include <LaunchKit/Foundation.h>
+#include <libSystem/SystemKit/Err.h>
+#include <libSystem/SystemKit/Syscall.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("Turning on launcher...");
+
+ UInt32* ret = (UInt32*) libsys_syscall_arg_1(libsys_hash_64("__launch_register_pid0"));
+
+ if (ret) {
+ switch (*ret) {
+ case kErrorSuccess: {
+ libsys_syscall_arg_1(libsys_hash_64("__launch_listen_as_root"));
+ return *ret;
+ }
+ default:
+ break;
+ }
+ }
+
+ return kErrorExecutable;
+}