diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-07 22:55:34 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-07 22:55:34 +0200 |
| commit | 64fa0db684db306766280593b0a9717132e636d4 (patch) | |
| tree | 20944794a003b685dae461edb1b677508ed655b2 | |
| parent | c2f59f90cfcf3a6a43eed74a6bbe1a73e240a616 (diff) | |
[IMP]
- Updated the PEF header for NDK.
- Adding ICL parser for SCM (ToDo)
- Updated extensions of PEF.
- Updated start address for exes in PEF.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
| -rw-r--r-- | Boot/Sources/HEL/AMD64/BootMain.cxx | 4 | ||||
| -rw-r--r-- | Boot/Sources/Root/bootloader.json | 2 | ||||
| -rw-r--r-- | Boot/amd64-efi.make | 8 | ||||
| -rw-r--r-- | DDKit/build.json | 2 | ||||
| -rw-r--r-- | DDKit/x86_64.make | 2 | ||||
| -rw-r--r-- | Kernel/KernelKit/PEF.hxx | 14 | ||||
| -rw-r--r-- | Kernel/KernelRsrc.rsrc | 2 | ||||
| -rw-r--r-- | Kernel/Linker/16x0.json | 2 | ||||
| -rw-r--r-- | Kernel/Linker/32x0.json | 2 | ||||
| -rw-r--r-- | Kernel/Linker/64x0.json | 2 | ||||
| -rw-r--r-- | Kernel/Linker/arm64.json | 2 | ||||
| -rw-r--r-- | Kernel/Sources/KernelCheck.cxx | 2 | ||||
| -rw-r--r-- | Kernel/amd64-efi.make | 2 | ||||
| -rw-r--r-- | Kernel/arm64-efi.make | 2 | ||||
| -rw-r--r-- | SCIKit/SCIBase.hxx | 2 | ||||
| -rw-r--r-- | SCIKit/SCM.drawio | 16 | ||||
| -rw-r--r-- | SCIKit/build.json | 2 | ||||
| -rw-r--r-- | SCIKit/makefile | 2 | ||||
| -rw-r--r-- | SCIKit/scm.iclparser.inl | 18 | ||||
| -rw-r--r-- | SCIKit/scm.internal.inl (renamed from SCIKit/rtl.internal.inl) | 0 |
20 files changed, 48 insertions, 40 deletions
diff --git a/Boot/Sources/HEL/AMD64/BootMain.cxx b/Boot/Sources/HEL/AMD64/BootMain.cxx index d2a478c6..2bc2aca1 100644 --- a/Boot/Sources/HEL/AMD64/BootMain.cxx +++ b/Boot/Sources/HEL/AMD64/BootMain.cxx @@ -201,7 +201,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, // format the disk. // ---------------------------------------------------- // - BFileReader readerKernel(L"newoskrnl.lib", ImageHandle); + BFileReader readerKernel(L"newoskrnl.dll", ImageHandle); readerKernel.ReadAll(0); @@ -214,7 +214,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, if (readerKernel.Blob()) { loader = new Boot::ProgramLoader(readerKernel.Blob()); - loader->SetName("\"newoskrnl.lib\" (64-bit SMP DLL)"); + loader->SetName("\"newoskrnl.dll\" (64-bit SMP DLL)"); } writer.Write("newosldr: Running: ").Write(loader->GetName()).Write("\r"); diff --git a/Boot/Sources/Root/bootloader.json b/Boot/Sources/Root/bootloader.json index 51cb36b5..fe1a57d4 100644 --- a/Boot/Sources/Root/bootloader.json +++ b/Boot/Sources/Root/bootloader.json @@ -1,4 +1,4 @@ { - "newoskrnl.lib": "kernel", + "newoskrnl.dll": "kernel", "ZETA/fonts.json": "rsrc" } diff --git a/Boot/amd64-efi.make b/Boot/amd64-efi.make index a0bec415..12bd4941 100644 --- a/Boot/amd64-efi.make +++ b/Boot/amd64-efi.make @@ -50,9 +50,9 @@ FLAG_GNU=-fshort-wchar -D__EFI_x86_64__ -mno-red-zone -D__NEWOSKRNL__ -D__NEWOSL -std=c++20 -D__HAVE_MAHROUSS_APIS__ -D__NEWOS_AMD64__ -D__MAHROUSS__ -D__BOOTLOADER__ -I../ BOOT_LOADER=newosldr.exe -KERNEL=newoskrnl.lib -DDK=libDDK.lib -SCI=libSCI.lib +KERNEL=newoskrnl.dll +DDK=libDDK.dll +SCI=libSCI.dll .PHONY: invalid-recipe invalid-recipe: @@ -97,7 +97,7 @@ download-edk: $(HTTP_GET) https://retrage.github.io/edk2-nightly/bin/DEBUGX64_OVMF.fd -O OVMF.fd BINS=*.bin -EXECUTABLES=newosldr.exe newoskrnl.lib OVMF.fd +EXECUTABLES=newosldr.exe newoskrnl.dll OVMF.fd TARGETS=$(REM_FLAG) $(OBJ) $(BIN) $(IMG) $(IMG_2) $(EXECUTABLES) diff --git a/DDKit/build.json b/DDKit/build.json index 8fbde6ac..bfa2b829 100644 --- a/DDKit/build.json +++ b/DDKit/build.json @@ -3,7 +3,7 @@ "compiler_std": "c++20",
"headers_path": ["../", "./"],
"sources_path": ["*.c", "*.cxx", "*.S"],
- "output_name": "libDDK.lib",
+ "output_name": "libDDK.dll",
"compiler_flags": ["-ffreestanding", "-shared", "-std=c17", "-std=c++20", "-fno-rtti", "-fno-exceptions", " -Wl,--subsystem=17"],
"cpp_macros": ["__NEWOSKRNL__", "__DDK_AMD64__", "cDDKVersionHighest=1", "cDDKVersionLowest=1"]
}
diff --git a/DDKit/x86_64.make b/DDKit/x86_64.make index 4e641acd..b79d74f0 100644 --- a/DDKit/x86_64.make +++ b/DDKit/x86_64.make @@ -7,7 +7,7 @@ CC=x86_64-w64-mingw32-gcc INC=-I./ -I../
FLAGS=-ffreestanding -shared -std=c17 -std=c++20 -D__NEWOSKRNL__ -fno-rtti -fno-exceptions -D__DDK_AMD64__ -Wl,--subsystem=17
VERSION=-DcDDKVersionLowest=1 -DcDDKVersionHighest=1
-OUTPUT=libDDK.lib
+OUTPUT=libDDK.dll
.PHONY: x86_64-build
x86_64-build:
diff --git a/Kernel/KernelKit/PEF.hxx b/Kernel/KernelKit/PEF.hxx index b560c572..70320103 100644 --- a/Kernel/KernelKit/PEF.hxx +++ b/Kernel/KernelKit/PEF.hxx @@ -23,7 +23,7 @@ #define kPefMagicLen 5 -#define kPefVersion 1 +#define kPefVersion 3 #define kPefNameLen 255 namespace Kernel @@ -96,16 +96,18 @@ namespace Kernel } // namespace Kernel /* not mandatory, only for non fork based filesystems */ -#define kPefExt ".exec" -#define kPefDylibExt ".lib" -#define kPefLibExt ".slib" +#define kPefExt ".exe" +#define kPefDylibExt ".dll" +#define kPefLibExt ".lib" #define kPefObjectExt ".obj" #define kPefDebugExt ".dbg" // Kernel System Binary Interface. -#define kPefAbi (0x5046) +#define kPefAbi (0x5046) -#define kPefStart "__ImageStart" +#define kPefBaseOrigin (0x40000000) + +#define kPefStart "__ImageStart" #define kPefForkKind kPefMagic #define kPefForkKindFAT kPefMagicFat diff --git a/Kernel/KernelRsrc.rsrc b/Kernel/KernelRsrc.rsrc index f7b42292..4cf7e352 100644 --- a/Kernel/KernelRsrc.rsrc +++ b/Kernel/KernelRsrc.rsrc @@ -15,7 +15,7 @@ BEGIN VALUE "FileVersion", KERNEL_VERSION VALUE "InternalName", "newoskrnl" VALUE "LegalCopyright", "(c) ZKA Technologies, all rights reserved." - VALUE "OriginalFilename", "newoskrnl.lib" + VALUE "OriginalFilename", "newoskrnl.dll" VALUE "ProductName", "newoskrnl" VALUE "ProductVersion", KERNEL_VERSION END diff --git a/Kernel/Linker/16x0.json b/Kernel/Linker/16x0.json index 1f769a4c..9c284b53 100644 --- a/Kernel/Linker/16x0.json +++ b/Kernel/Linker/16x0.json @@ -1,7 +1,7 @@ { "linker": "link.exe", "executable_type": "kernel", - "output_name": "newoskrnl.lib", + "output_name": "newoskrnl.dll", "start_proc": "__ImageStart", "arch": "16x0", "format": "PEF" diff --git a/Kernel/Linker/32x0.json b/Kernel/Linker/32x0.json index a78a1090..05a3db9b 100644 --- a/Kernel/Linker/32x0.json +++ b/Kernel/Linker/32x0.json @@ -1,7 +1,7 @@ { "linker": "link.exe", "executable_type": "kernel", - "output_name": "newoskrnl.lib", + "output_name": "newoskrnl.dll", "start_proc": "__ImageStart", "arch": "32x0", "format": "PEF" diff --git a/Kernel/Linker/64x0.json b/Kernel/Linker/64x0.json index b9b9a34e..c1d0e388 100644 --- a/Kernel/Linker/64x0.json +++ b/Kernel/Linker/64x0.json @@ -1,7 +1,7 @@ { "linker": "link.exe", "executable_type": "kernel", - "output_name": "newoskrnl.lib", + "output_name": "newoskrnl.dll", "start_proc": "__ImageStart", "arch": "64x0", "format": "PEF" diff --git a/Kernel/Linker/arm64.json b/Kernel/Linker/arm64.json index 2e75f9fd..99c190bf 100644 --- a/Kernel/Linker/arm64.json +++ b/Kernel/Linker/arm64.json @@ -1,7 +1,7 @@ { "linker": "link.exe", "executable_type": "kernel", - "output_name": "newoskrnl.lib", + "output_name": "newoskrnl.dll", "start_proc": "__ImageStart", "arch": "arm64", "format": "PEF" diff --git a/Kernel/Sources/KernelCheck.cxx b/Kernel/Sources/KernelCheck.cxx index cd8e8ef9..b9843cd0 100644 --- a/Kernel/Sources/KernelCheck.cxx +++ b/Kernel/Sources/KernelCheck.cxx @@ -40,7 +40,7 @@ namespace Kernel auto start_y = 10; auto x = 10; - cg_write_text("*** Kernel panic! ***\rnewoskrnl.lib stopped working properly so we had to shut it down.", start_y, x, panicTxt); + cg_write_text("*** Kernel panic! ***\rnewoskrnl.dll stopped working properly so we had to shut it down.", start_y, x, panicTxt); CGFini(); diff --git a/Kernel/amd64-efi.make b/Kernel/amd64-efi.make index e233ebdc..52532223 100644 --- a/Kernel/amd64-efi.make +++ b/Kernel/amd64-efi.make @@ -39,7 +39,7 @@ LDFLAGS = -e ke_startup_platform --subsystem=17 --image-base 0x10000000 LDOBJ = Objects/*.obj # This file is the kernel, responsible of task management and memory. -KERNEL = newoskrnl.lib +KERNEL = newoskrnl.dll .PHONY: error error: diff --git a/Kernel/arm64-efi.make b/Kernel/arm64-efi.make index 92324d46..410e7789 100644 --- a/Kernel/arm64-efi.make +++ b/Kernel/arm64-efi.make @@ -27,7 +27,7 @@ LDFLAGS = -subsystem:efi_application -entry:hal_init_platform /nodefaultlib LDOBJ = Objects/*.obj # This file is the kernel, responsible of task management and memory. -KERNEL = newoskrnl.lib +KERNEL = newoskrnl.dll .PHONY: error error: diff --git a/SCIKit/SCIBase.hxx b/SCIKit/SCIBase.hxx index b084a17b..e8208c49 100644 --- a/SCIKit/SCIBase.hxx +++ b/SCIKit/SCIBase.hxx @@ -52,7 +52,7 @@ inline constexpr auto cLPCCloseMsgSyscall = 0x27; inline constexpr auto cLPCSanitizeMsgSyscall = 0x28;
#ifdef __NEWOS_SYMS__
-#include <SCIKit/rtl.internal.inl>
+#include <SCIKit/scm.internal.inl>
#else
class UnknownInterface; // Refrenced from an IDB entry.
class UnknownUCLSID; // From the IDB, the constructor of the object, e.g: WordUCLSID.
diff --git a/SCIKit/SCM.drawio b/SCIKit/SCM.drawio index 56974466..978ebb6d 100644 --- a/SCIKit/SCM.drawio +++ b/SCIKit/SCM.drawio @@ -1,15 +1,9 @@ <mxfile host="65bd71144e"> <diagram name="Page-1" id="_vc7fxBdNKI2W8YhI8VA"> - <mxGraphModel dx="746" dy="307" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"> + <mxGraphModel dx="746" dy="563" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"> <root> <mxCell id="0"/> <mxCell id="1" parent="0"/> - <mxCell id="eRehIIeIVOPW1y23kRkx-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="eRehIIeIVOPW1y23kRkx-1" target="eRehIIeIVOPW1y23kRkx-6" edge="1"> - <mxGeometry relative="1" as="geometry"/> - </mxCell> - <mxCell id="eRehIIeIVOPW1y23kRkx-1" value="Kernel level interfaces" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> - <mxGeometry x="431" y="450" width="226" height="60" as="geometry"/> - </mxCell> <mxCell id="eRehIIeIVOPW1y23kRkx-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="eRehIIeIVOPW1y23kRkx-2" target="eRehIIeIVOPW1y23kRkx-8" edge="1"> <mxGeometry relative="1" as="geometry"/> </mxCell> @@ -19,20 +13,14 @@ <mxCell id="eRehIIeIVOPW1y23kRkx-4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="eRehIIeIVOPW1y23kRkx-3" target="eRehIIeIVOPW1y23kRkx-2" edge="1"> <mxGeometry relative="1" as="geometry"/> </mxCell> - <mxCell id="eRehIIeIVOPW1y23kRkx-5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0;exitDx=0;exitDy=52.5;exitPerimeter=0;" parent="1" source="eRehIIeIVOPW1y23kRkx-3" target="eRehIIeIVOPW1y23kRkx-1" edge="1"> - <mxGeometry relative="1" as="geometry"/> - </mxCell> <mxCell id="eRehIIeIVOPW1y23kRkx-3" value="IDB" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" parent="1" vertex="1"> <mxGeometry x="283" y="290" width="60" height="80" as="geometry"/> </mxCell> - <mxCell id="eRehIIeIVOPW1y23kRkx-6" value="HAL #1<div>Takes care of a specific device support.</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> - <mxGeometry x="484" y="570" width="120" height="60" as="geometry"/> - </mxCell> <mxCell id="eRehIIeIVOPW1y23kRkx-8" value="Program #2<div>Is a web browser, it uses an HTML parser component.</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> <mxGeometry x="253" y="570" width="120" height="60" as="geometry"/> </mxCell> <mxCell id="eRehIIeIVOPW1y23kRkx-10" value="<h1 style="margin-top: 0px;">System Component Model</h1><p>SCM is a standardized way of sharing code within DLLs in NewOS.</p>" style="text;html=1;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1"> - <mxGeometry x="590" y="230" width="180" height="180" as="geometry"/> + <mxGeometry x="430" y="240" width="180" height="180" as="geometry"/> </mxCell> </root> </mxGraphModel> diff --git a/SCIKit/build.json b/SCIKit/build.json index 91e64384..770d1622 100644 --- a/SCIKit/build.json +++ b/SCIKit/build.json @@ -3,7 +3,7 @@ "compiler_std": "c++20",
"headers_path": ["../"],
"sources_path": ["*.cxx"],
- "output_name": "libSCI.lib",
+ "output_name": "libSCI.dll",
"compiler_flags": ["-fPIC", "-shared", "-std=c++20"],
"cpp_macros": ["__NEWOS_SYMS__"]
}
diff --git a/SCIKit/makefile b/SCIKit/makefile index 9a2b836e..7757440e 100644 --- a/SCIKit/makefile +++ b/SCIKit/makefile @@ -5,7 +5,7 @@ CC=g++
FLAGS=-I../ -shared -fPIC -D__NEWOS_SYMS__
-OUTPUT=libSCI.lib
+OUTPUT=libSCI.dll
.PHONY: build-sci
build-sci:
diff --git a/SCIKit/scm.iclparser.inl b/SCIKit/scm.iclparser.inl new file mode 100644 index 00000000..acedc9d8 --- /dev/null +++ b/SCIKit/scm.iclparser.inl @@ -0,0 +1,18 @@ +/* -------------------------------------------
+
+Copyright ZKA Technologies.
+
+File: rt.internal.inl
+Purpose: Base code of SCM.
+
+------------------------------------------- */
+
+/// @internal
+
+#ifndef __ZECC__
+#define object class
+#define protocol class
+#define clsid(X) __attribute__((uuid(X)))
+
+#warning ! you may be using the clang version of the newos kit, please be cautious that some thing mayn't be present. !
+#endif // !__ZECC__
\ No newline at end of file diff --git a/SCIKit/rtl.internal.inl b/SCIKit/scm.internal.inl index b4e8e7dd..b4e8e7dd 100644 --- a/SCIKit/rtl.internal.inl +++ b/SCIKit/scm.internal.inl |
