From 67716b2871b1117510b26bc1aaf6fce7195272dc Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 9 Nov 2024 10:30:58 +0100 Subject: META: Important refactors and include SCIKit.dylib when building bootloader. --- dev/SCIKit/src/DispatchSysCalls.asm | 4 +++- dev/SCIKit/src/Foundation.cc | 45 ------------------------------------- dev/SCIKit/src/Makefile | 10 ++++++++- dev/SCIKit/src/MemoryMgr.cc | 45 +++++++++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 47 deletions(-) delete mode 100644 dev/SCIKit/src/Foundation.cc create mode 100644 dev/SCIKit/src/MemoryMgr.cc (limited to 'dev/SCIKit/src') diff --git a/dev/SCIKit/src/DispatchSysCalls.asm b/dev/SCIKit/src/DispatchSysCalls.asm index f1668e21..d56f283f 100644 --- a/dev/SCIKit/src/DispatchSysCalls.asm +++ b/dev/SCIKit/src/DispatchSysCalls.asm @@ -1,7 +1,7 @@ ;; /* ;; * ======================================================== ;; * -;; * ZKA +;; * SCI ;; * Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved., all rights reserved. ;; * ;; * ======================================================== @@ -9,6 +9,8 @@ [bits 64] +section .text + global sci_syscall_arg_1 global sci_syscall_arg_2 global sci_syscall_arg_3 diff --git a/dev/SCIKit/src/Foundation.cc b/dev/SCIKit/src/Foundation.cc deleted file mode 100644 index e280aab8..00000000 --- a/dev/SCIKit/src/Foundation.cc +++ /dev/null @@ -1,45 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -/// @file Foundation.cc -/// @brief Foundation source file for SCI Kit. - -/// @brief Copy memory region. -IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len) -{ - if (!len || - !dest || - !src) - { - return nullptr; - } - - for (SizeT i = 0; i < len; i++) - { - ((Char*)dest)[i] = ((Char*)src)[i]; - } - - return dest; -} - -/// @brief Fill memory region with **value**. -IMPORT_C VoidPtr MmFillMemory(_Input VoidPtr dest, _Input SizeT len, _Input UInt8 value) -{ - if (!len || - !dest) - { - return nullptr; - } - - for (SizeT i = 0; i < len; i++) - { - ((Char*)dest)[i] = value; - } - - return dest; -} diff --git a/dev/SCIKit/src/Makefile b/dev/SCIKit/src/Makefile index 68a6407b..90da7b01 100644 --- a/dev/SCIKit/src/Makefile +++ b/dev/SCIKit/src/Makefile @@ -1,3 +1,11 @@ +################################################## +# (c) Amlal EL Mahrouss, all rights reserved. +# This is the bootloader makefile. +################################################## + +ASM=nasm +FLAGS=-f win64 + .PHONY: syscall_unit syscall_unit: - nasm -f win64 DispatchSysCalls.asm -o DispatchSysCalls.obj + $(ASM) $(FLAGS) DispatchSysCalls.asm -o DispatchSysCalls.obj diff --git a/dev/SCIKit/src/MemoryMgr.cc b/dev/SCIKit/src/MemoryMgr.cc new file mode 100644 index 00000000..bf8e1142 --- /dev/null +++ b/dev/SCIKit/src/MemoryMgr.cc @@ -0,0 +1,45 @@ +/* ------------------------------------------- + + Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +/// @file MemoryMgr.cc +/// @brief Source file for the memory functions. + +/// @brief Copy memory region. +IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len) +{ + if (!len || + !dest || + !src) + { + return nullptr; + } + + for (SizeT i = 0; i < len; i++) + { + ((Char*)dest)[i] = ((Char*)src)[i]; + } + + return dest; +} + +/// @brief Fill memory region with **value**. +IMPORT_C VoidPtr MmFillMemory(_Input VoidPtr dest, _Input SizeT len, _Input UInt8 value) +{ + if (!len || + !dest) + { + return nullptr; + } + + for (SizeT i = 0; i < len; i++) + { + ((Char*)dest)[i] = value; + } + + return dest; +} -- cgit v1.2.3