summaryrefslogtreecommitdiffhomepage
path: root/Private
diff options
context:
space:
mode:
Diffstat (limited to 'Private')
-rw-r--r--Private/CRT/__cxxkit_defines.hxx11
-rw-r--r--Private/FirmwareKit/EFI/API.hxx9
-rw-r--r--Private/KernelKit/ProcessScheduler.hpp4
-rwxr-xr-xPrivate/MoveAll.sh2
-rw-r--r--Private/NewBoot/Source/makefile2
-rw-r--r--Private/ObjectKit/ObjectKit.hxx2
-rw-r--r--Private/Objects/.hgkeep (renamed from Private/Obj/.hgkeep)0
-rw-r--r--Private/Source/PageManager.cxx4
-rw-r--r--Private/makefile16
9 files changed, 24 insertions, 26 deletions
diff --git a/Private/CRT/__cxxkit_defines.hxx b/Private/CRT/__cxxkit_defines.hxx
index 1558fbe9..54b50716 100644
--- a/Private/CRT/__cxxkit_defines.hxx
+++ b/Private/CRT/__cxxkit_defines.hxx
@@ -28,14 +28,12 @@ typedef char *caddr_t;
#ifdef __GNUC__
#include <CRT/__cxxkit_alloca.hxx>
#define __cxxkit_alloca(sz) __cxxkit_alloca_gcc(sz)
-#elif defined(__HISYS__)
+#elif defined(__MPCC__)
-#define __alloca(SZ) __cxxkit_alloca(SZ)
-
-#define __deref(ptr) (*(PTR))
+#define __alloca(sz) __cxxkit_alloca(sz)
+#endif
-#define __libexport __lib(export)
-#define __libimport __lib(import)
+#define __deref(ptr) (*(ptr))
#ifdef __cplusplus
#define __init_decl() \
@@ -48,7 +46,6 @@ typedef char *caddr_t;
#define __init_decl()
#define __fini_decl()
#endif
-#endif
#if __has_builtin(__builtin_alloca)
#define alloca(sz) __builtin_alloca(sz)
diff --git a/Private/FirmwareKit/EFI/API.hxx b/Private/FirmwareKit/EFI/API.hxx
index b2d6c940..e025e7e0 100644
--- a/Private/FirmwareKit/EFI/API.hxx
+++ b/Private/FirmwareKit/EFI/API.hxx
@@ -14,14 +14,15 @@
inline EfiSystemTable *ST = nullptr;
inline EfiBootServices *BS = nullptr;
-extern "C" void rt_cli();
+EXTERN_C void rt_cli();
+EXTERN_C void rt_hlt();
namespace EFI {
-/**
-@brief Stop Execution of program.
-*/
+/// @brief Halt and clear interrupts.
+/// @return
inline Void Stop() noexcept {
while (1) {
+ rt_hlt();
rt_cli();
}
}
diff --git a/Private/KernelKit/ProcessScheduler.hpp b/Private/KernelKit/ProcessScheduler.hpp
index fa59be4b..ba453fbe 100644
--- a/Private/KernelKit/ProcessScheduler.hpp
+++ b/Private/KernelKit/ProcessScheduler.hpp
@@ -156,10 +156,10 @@ class Process final {
//! @brief boolean operator, check status.
operator bool() { return Status != ProcessStatus::kDead; }
- //! @brief Crash program, exits with code ~0.
+ //! @brief Crash app, exits with code ~0.
void Crash();
- //! @brief Exits program.
+ //! @brief Exits app.
void Exit(Int32 exitCode = 0);
//! @brief TLS Allocate
diff --git a/Private/MoveAll.sh b/Private/MoveAll.sh
index 0544cd8b..7170a262 100755
--- a/Private/MoveAll.sh
+++ b/Private/MoveAll.sh
@@ -4,4 +4,4 @@ for file in *.o; do
mv -- "$file" "${file%.o}.obj"
done
-mv *.obj HALKit/AMD64/*.obj Obj/ \ No newline at end of file
+mv *.obj HALKit/AMD64/*.obj Objects/ \ No newline at end of file
diff --git a/Private/NewBoot/Source/makefile b/Private/NewBoot/Source/makefile
index fbedfd52..d5490556 100644
--- a/Private/NewBoot/Source/makefile
+++ b/Private/NewBoot/Source/makefile
@@ -17,7 +17,7 @@ EMU=qemu-system-x86_64w.exe
endif
LD_FLAGS=-e efi_main --subsystem=10
-OBJ=$(wildcard *.o) $(wildcard ../../Obj/*.obj) $(wildcard HEL/AMD64/*.obj)
+OBJ=$(wildcard *.o) $(wildcard ../../Objects/*.obj) $(wildcard HEL/AMD64/*.obj)
REM=rm
REM_FLAG=-f
diff --git a/Private/ObjectKit/ObjectKit.hxx b/Private/ObjectKit/ObjectKit.hxx
index 329b2c78..904e23cb 100644
--- a/Private/ObjectKit/ObjectKit.hxx
+++ b/Private/ObjectKit/ObjectKit.hxx
@@ -34,4 +34,4 @@ typedef struct Object final {
HCore::Void(*Query)(struct Object* Self, HCore::VoidPtr* Dst, HCore::SizeT SzDst, HCore::XRN::GUIDSequence GuidOf);
} Object, *ObjectPtr;
-#define object_cast reinterpret_cast
+#define object_cast reinterpret_cast<ObjectPtr>
diff --git a/Private/Obj/.hgkeep b/Private/Objects/.hgkeep
index e69de29b..e69de29b 100644
--- a/Private/Obj/.hgkeep
+++ b/Private/Objects/.hgkeep
diff --git a/Private/Source/PageManager.cxx b/Private/Source/PageManager.cxx
index 572effae..843aa66c 100644
--- a/Private/Source/PageManager.cxx
+++ b/Private/Source/PageManager.cxx
@@ -11,8 +11,8 @@
#include <HALKit/AMD64/HalPageAlloc.hpp>
#endif // ifdef __x86_64__
-//! null deref will throw (Page Zero detected, aborting program!)
-#define kProtectedRegionEnd 512
+//! null deref will throw (Page Zero detected, aborting app!)
+#define kProtectedRegionEnd (512)
namespace HCore {
PTEWrapper::PTEWrapper(Boolean Rw, Boolean User, Boolean ExecDisable,
diff --git a/Private/makefile b/Private/makefile
index e9528a48..56561324 100644
--- a/Private/makefile
+++ b/Private/makefile
@@ -11,7 +11,7 @@ ASM = nasm
# Add assembler, linker, and object files variables.
ASMFLAGS = -f win64
LDFLAGS = -e Main --subsystem=17
-LDOBJ = $(wildcard Obj/*.obj)
+LDOBJ = $(wildcard Objects/*.obj)
# This file is the kernel, responsible of task management, memory, drivers and more.
KERNEL = HCoreKrnl.exe
@@ -19,14 +19,14 @@ KERNEL = HCoreKrnl.exe
# The kernel entrypoint
SCRIPT = --script=Linker/Platforms/PC.lds
-.PHONY: invalid-recipe
-invalid-recipe:
+.PHONY: error
+error:
@echo "Use a specific target."
MOVEALL=./MoveAll.sh
-.PHONY: h-core-amd64
-h-core-amd64: clean
+.PHONY: h-core-amd64-pc
+h-core-amd64-pc: clean
$(CC) $(CCFLAGS) $(DEBUG) Source/*.cxx HALKit/AMD64/PCI/*.cxx Source/Network/*.cxx\
Source/Storage/*.cxx HALKit/AMD64/*.cxx HALKit/AMD64/*.cpp HALKit/AMD64/*.s
$(ASM) $(ASMFLAGS) HALKit/AMD64/HalInterruptRouting.asm
@@ -37,12 +37,12 @@ h-core-amd64: clean
OBJCOPY=x86_64-w64-mingw32-objcopy
-.PHONY: link-amd64
-link-amd64:
+.PHONY: link-amd64-pc
+link-amd64-pc:
$(LD) $(LDFLAGS) $(LDOBJ) -o $(KERNEL)
.PHONY: all
-all: h-core-amd64 link-amd64
+all: h-core-amd64-pc link-amd64-pc
@echo "Fully built."