diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-23 15:57:42 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-23 16:00:35 +0200 |
| commit | e2bd3c7b6fcd6147fcbf699be087a475608ffdf7 (patch) | |
| tree | 962ce7dd6efeda9dc6b96b9d0e47dfcc241f1c11 /dev/user/src | |
| parent | 80f5f9dfdaaf68d9e63a7bc3ba1187ca447eadc9 (diff) | |
feat(krnl, libSystem, boot): Make space for LibSystem inside Handover
boot structure.
what:
- Mostly related to the libSystem.sys library.
- Updated the implementation of it, the specs, and added new
APIs.
- Fixed the hooks inside AsmProc.h
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/user/src')
| -rw-r--r-- | dev/user/src/GNUmakefile | 4 | ||||
| -rw-r--r-- | dev/user/src/SystemCalls+IO.asm | 21 | ||||
| -rw-r--r-- | dev/user/src/SystemCalls.cc | 6 |
3 files changed, 25 insertions, 6 deletions
diff --git a/dev/user/src/GNUmakefile b/dev/user/src/GNUmakefile index 09993d16..9b901f9f 100644 --- a/dev/user/src/GNUmakefile +++ b/dev/user/src/GNUmakefile @@ -1,6 +1,6 @@ ################################################## # (c) Amlal El Mahrouss, all rights reserved. -# This file is for user.sys's syscall stubs. +# This file is for libSystem.sys's syscall stubs. ################################################## ASM=nasm @@ -13,4 +13,4 @@ error: .PHONY: sci_asm_io_x64 sci_asm_io_x64: - $(ASM) $(FLAGS) SystemCalls+IO.asm -o SystemCalls+IO.asm.o + $(ASM) $(FLAGS) SystemCalls+IO.asm -o SystemCalls+IO.stub.obj diff --git a/dev/user/src/SystemCalls+IO.asm b/dev/user/src/SystemCalls+IO.asm index 77e22b59..9126b7de 100644 --- a/dev/user/src/SystemCalls+IO.asm +++ b/dev/user/src/SystemCalls+IO.asm @@ -19,17 +19,31 @@ global sci_syscall_arg_3 global sci_syscall_arg_4 sci_syscall_arg_1: + push rbp + mov rbp, rsp + mov r8, rcx syscall + + pop rbp + ret sci_syscall_arg_2: + push rbp + mov rbp, rsp + mov r8, rcx mov r9, rdx syscall + pop rbp + ret sci_syscall_arg_3: + push rbp + mov rbp, rsp + mov rbx, r8 mov r8, rcx @@ -37,9 +51,14 @@ sci_syscall_arg_3: mov r10, rbx syscall + pop rbp + ret sci_syscall_arg_4: + push rbp + mov rbp, rsp + mov rbx, r8 mov rax, r9 @@ -49,4 +68,6 @@ sci_syscall_arg_4: mov r11, rax syscall + pop rbp + ret diff --git a/dev/user/src/SystemCalls.cc b/dev/user/src/SystemCalls.cc index 874f607d..f004718c 100644 --- a/dev/user/src/SystemCalls.cc +++ b/dev/user/src/SystemCalls.cc @@ -4,11 +4,11 @@ ------------------------------------------- */
-#include <user/SciCalls.h>
+#include <user/AsmProc.h>
#include <user/SystemCalls.h>
/// @file SystemCalls.cc
-/// @brief Source file for the memory functions/syscalls for user.sys
+/// @brief Source file for the memory functions/syscalls for libSystem.sys
IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len) {
if (!len || !dest || !src) {
@@ -51,8 +51,6 @@ IMPORT_C VoidPtr MmFillMemory(_Input VoidPtr dest, _Input SizeT len, _Input UInt /// @internal
//-----------------------------------------------------------------------------------------------------------//
-constexpr auto kInvalidSyscall = 0UL;
-
IMPORT_C Ref IoOpenFile(_Input const Char* path, _Input const Char* drv_letter) {
return sci_syscall_arg_3(1, reinterpret_cast<VoidPtr>(const_cast<Char*>(path)),
reinterpret_cast<VoidPtr>(const_cast<Char*>(drv_letter)));
|
