summaryrefslogtreecommitdiffhomepage
path: root/dev/user
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-24 10:59:49 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-05-24 10:59:49 +0200
commit386d9a5bffcd66633e4c3c72eb6cb25722796c92 (patch)
tree438158dbf0856bf2563cdc9e4b183e290f4bb03a /dev/user
parente89d4a1402bdd32b8ad7e2ed04278b7ad54740c3 (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 'dev/user')
-rw-r--r--dev/user/SystemCalls.h14
-rw-r--r--dev/user/src/SystemCalls+IO.asm9
2 files changed, 7 insertions, 16 deletions
diff --git a/dev/user/SystemCalls.h b/dev/user/SystemCalls.h
index d40dc127..e8b4e59c 100644
--- a/dev/user/SystemCalls.h
+++ b/dev/user/SystemCalls.h
@@ -331,19 +331,17 @@ IMPORT_C IORef PrintGet(const Char* path);
typedef SInt32 AffinityRef;
typedef UInt64 ProcessRef;
-IMPORT_C SInt32 SchedSetAffinity(ProcessRef, SInt32 req, AffinityRef* local);
+IMPORT_C SInt32 SchedSetAffinity(_Input ProcessRef, SInt32 req, _Input AffinityRef*);
-IMPORT_C SInt32 SchedGetAffinity(ProcessRef, AffinityRef* local);
+IMPORT_C SInt32 SchedGetAffinity(_Input ProcessRef, _InOut AffinityRef*);
-IMPORT_C SInt32 SchedFireSignal(ProcessRef, SInt32 req);
+IMPORT_C SInt32 SchedFireSignal(_Input ProcessRef, SInt32);
-IMPORT_C SInt32 SchedReadMemory(ProcessRef, SInt32 address, SInt32 data);
+IMPORT_C SInt32 SchedReadMemory(_Input ProcessRef, SInt32, SInt32);
-IMPORT_C SInt32 SchedWriteMemory(ProcessRef, SInt32 address, SInt32 data);
+IMPORT_C SInt32 SchedWriteMemory(_Input ProcessRef, SInt32, SInt32);
-/// @brief Get current ProcessRef of process.
-/// @return Current process ID.
-IMPORT_C UIntPtr RtlCurrentPID(Void);
+IMPORT_C UIntPtr SchedGetCurrentProcessID(Void);
// ------------------------------------------------------------------------------------------ //
// @brief Filesystem API.
diff --git a/dev/user/src/SystemCalls+IO.asm b/dev/user/src/SystemCalls+IO.asm
index 9126b7de..097046af 100644
--- a/dev/user/src/SystemCalls+IO.asm
+++ b/dev/user/src/SystemCalls+IO.asm
@@ -1,7 +1,7 @@
;; /*
;; * ========================================================
;; *
-;; * user/src/SystemCalls+IO.asm
+;; * libSystem/src/SystemCalls+IO.asm
;; * Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
;; *
;; * ========================================================
@@ -9,8 +9,6 @@
[bits 64]
-;; @brief Syscall dispatch, also taking note the Microsoft's calling convention to translate it to NeKernel's ABI.
-
section .text
global sci_syscall_arg_1
@@ -44,8 +42,6 @@ sci_syscall_arg_3:
push rbp
mov rbp, rsp
- mov rbx, r8
-
mov r8, rcx
mov r9, rdx
mov r10, rbx
@@ -59,9 +55,6 @@ sci_syscall_arg_4:
push rbp
mov rbp, rsp
- mov rbx, r8
- mov rax, r9
-
mov r8, rcx
mov r9, rdx
mov r10, rbx