summaryrefslogtreecommitdiffhomepage
path: root/Drv
diff options
context:
space:
mode:
authorAmlal <amlalelmahrouss@icloud.com>2024-06-06 10:27:55 +0000
committerAmlal <amlalelmahrouss@icloud.com>2024-06-06 10:27:55 +0000
commit4e75e05a20ddd0dbca982e8f3bc2ea8043ed3a3f (patch)
tree95409c0e32b644578b94a5c230417da684d79dc9 /Drv
parentf5081a8f9a8537ad5be5d639955cd1d0e68a9e1d (diff)
parent9994b8f3f88131f41be1061fb0947177e66dc7b0 (diff)
Merged in MHR-23 (pull request #14)
Draft: MHR-23
Diffstat (limited to 'Drv')
-rw-r--r--Drv/.gitkeep0
-rw-r--r--Drv/Bonjour/Bonjour.c20
-rw-r--r--Drv/Bonjour/DriverRsrc.rsrc25
-rw-r--r--Drv/Bonjour/x86_64.mk51
-rw-r--r--Drv/SampleDriver/DriverRsrc.rsrc25
-rw-r--r--Drv/SampleDriver/SampleDriver.c26
-rw-r--r--Drv/SampleDriver/x86_64.mk51
7 files changed, 198 insertions, 0 deletions
diff --git a/Drv/.gitkeep b/Drv/.gitkeep
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Drv/.gitkeep
diff --git a/Drv/Bonjour/Bonjour.c b/Drv/Bonjour/Bonjour.c
new file mode 100644
index 00000000..93411e1f
--- /dev/null
+++ b/Drv/Bonjour/Bonjour.c
@@ -0,0 +1,20 @@
+/* -------------------------------------------
+
+ Copyright SoftwareLabs
+
+------------------------------------------- */
+
+#include <DDK/KernelString.h>
+#include <DDK/KernelPrint.h>
+
+int __ImageStart(void)
+{
+ kernelPrintStr("Bonjour: Starting up zeroconf...\r");
+ return 0;
+}
+
+int __ImageEnd(void)
+{
+ kernelPrintStr("Bonjour: Shutting down zeroconf...\r");
+ return 0;
+}
diff --git a/Drv/Bonjour/DriverRsrc.rsrc b/Drv/Bonjour/DriverRsrc.rsrc
new file mode 100644
index 00000000..d2f15f1e
--- /dev/null
+++ b/Drv/Bonjour/DriverRsrc.rsrc
@@ -0,0 +1,25 @@
+1 ICON "../../Kernel/Root/Boot/Icons/driver-logo.ico"
+
+1 VERSIONINFO
+FILEVERSION 1,0,0,0
+PRODUCTVERSION 1,0,0,0
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "080904E4"
+ BEGIN
+ VALUE "CompanyName", "SoftwareLabs"
+ VALUE "FileDescription", "New OS Zeroconf driver."
+ VALUE "FileVersion", "1.00"
+ VALUE "InternalName", "Bonjour."
+ VALUE "LegalCopyright", "Copyright SoftwareLabs, all rights reserved."
+ VALUE "OriginalFilename", "Bonjour.exe"
+ VALUE "ProductName", "Bonjour."
+ VALUE "ProductVersion", "1.00"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x809, 1252
+ END
+END
diff --git a/Drv/Bonjour/x86_64.mk b/Drv/Bonjour/x86_64.mk
new file mode 100644
index 00000000..6a020d28
--- /dev/null
+++ b/Drv/Bonjour/x86_64.mk
@@ -0,0 +1,51 @@
+##################################################
+# (C) SoftwareLabs, all rights reserved.
+# This is the sample driver makefile.
+##################################################
+
+CC_GNU=x86_64-w64-mingw32-gcc
+LD_GNU=x86_64-w64-mingw32-ld
+
+WINDRES=x86_64-w64-mingw32-windres
+
+ADD_FILE=touch
+COPY=cp
+HTTP_GET=wget
+
+LD_FLAGS=-e __ImageStart --subsystem=17
+
+OBJ=*.o
+
+
+REM=rm
+REM_FLAG=-f
+
+FLAG_ASM=-f win64
+FLAG_GNU=-fshort-wchar -D__EFI_x86_64__ -mgeneral-regs-only -mno-red-zone -D__KERNEL__ -DEFI_FUNCTION_WRAPPER -I../ -I../../ -I./ -c -ffreestanding -std=c17 -D__HAVE_MAHROUSS_APIS__ -D__MAHROUSS__ -D__BOOTLOADER__ -I./
+
+.PHONY: invalid-recipe
+invalid-recipe:
+ @echo "invalid-recipe: Use make all instead."
+
+.PHONY: all
+all: compile-amd64
+ $(LD_GNU) $(OBJ) $(LD_FLAGS) -o Bonjour.exe
+
+ifneq ($(DEBUG_SUPPORT), )
+DEBUG = -D__DEBUG__
+endif
+
+.PHONY: compile-amd64
+compile-amd64:
+ $(WINDRES) DriverRsrc.rsrc -O coff -o DriverRsrc.o
+ $(CC_GNU) $(FLAG_GNU) $(DEBUG) $(wildcard *.c) $(wildcard ../../DDK/*.c) $(wildcard ../../DDK/*.S)
+
+.PHONY: clean
+clean:
+ $(REM) $(REM_FLAG) $(OBJ) Bonjour.exe
+
+.PHONY: help
+help:
+ @echo "=== HELP ==="
+ @echo "clean: Clean driver."
+ @echo "compile-amd64: Build driver."
diff --git a/Drv/SampleDriver/DriverRsrc.rsrc b/Drv/SampleDriver/DriverRsrc.rsrc
new file mode 100644
index 00000000..dc819c7e
--- /dev/null
+++ b/Drv/SampleDriver/DriverRsrc.rsrc
@@ -0,0 +1,25 @@
+1 ICON "../../Kernel/Root/Boot/Icons/driver-logo.ico"
+
+1 VERSIONINFO
+FILEVERSION 1,0,0,0
+PRODUCTVERSION 1,0,0,0
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "080904E4"
+ BEGIN
+ VALUE "CompanyName", "SoftwareLabs"
+ VALUE "FileDescription", "New OS driver."
+ VALUE "FileVersion", "1.00"
+ VALUE "InternalName", "SampleDriver"
+ VALUE "LegalCopyright", "Copyright SoftwareLabs, all rights reserved."
+ VALUE "OriginalFilename", "SampleDriver.exe"
+ VALUE "ProductName", "SampleDriver"
+ VALUE "ProductVersion", "1.00"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x809, 1252
+ END
+END
diff --git a/Drv/SampleDriver/SampleDriver.c b/Drv/SampleDriver/SampleDriver.c
new file mode 100644
index 00000000..821927be
--- /dev/null
+++ b/Drv/SampleDriver/SampleDriver.c
@@ -0,0 +1,26 @@
+/* -------------------------------------------
+
+ Copyright SoftwareLabs
+
+------------------------------------------- */
+
+#include <DDK/KernelString.h>
+#include <DDK/KernelPrint.h>
+
+int __ImageStart(void)
+{
+ kernelPrintStr("SampleDriver: Starting up...\r");
+ return 0;
+}
+
+int __ImageEnd(void)
+{
+ kernelPrintStr("SampleDriver: Shutting down...\r");
+ return 0;
+}
+
+///! @brief Use this to check your stack, if using MinGW/MSVC.
+void ___chkstk_ms(void)
+{
+ (void)0;
+}
diff --git a/Drv/SampleDriver/x86_64.mk b/Drv/SampleDriver/x86_64.mk
new file mode 100644
index 00000000..54ee54f0
--- /dev/null
+++ b/Drv/SampleDriver/x86_64.mk
@@ -0,0 +1,51 @@
+##################################################
+# (C) SoftwareLabs, all rights reserved.
+# This is the sample driver makefile.
+##################################################
+
+CC_GNU=x86_64-w64-mingw32-gcc
+LD_GNU=x86_64-w64-mingw32-ld
+
+WINDRES=x86_64-w64-mingw32-windres
+
+ADD_FILE=touch
+COPY=cp
+HTTP_GET=wget
+
+LD_FLAGS=-e __ImageStart --subsystem=17
+
+OBJ=*.o
+
+
+REM=rm
+REM_FLAG=-f
+
+FLAG_ASM=-f win64
+FLAG_GNU=-fshort-wchar -D__EFI_x86_64__ -mgeneral-regs-only -mno-red-zone -D__KERNEL__ -DEFI_FUNCTION_WRAPPER -I../ -I../../ -I./ -c -ffreestanding -std=c17 -D__HAVE_MAHROUSS_APIS__ -D__MAHROUSS__ -D__BOOTLOADER__ -I./
+
+.PHONY: invalid-recipe
+invalid-recipe:
+ @echo "invalid-recipe: Use make all instead."
+
+.PHONY: all
+all: compile-amd64
+ $(LD_GNU) $(OBJ) $(LD_FLAGS) -o SampleDriver.exe
+
+ifneq ($(DEBUG_SUPPORT), )
+DEBUG = -D__DEBUG__
+endif
+
+.PHONY: compile-amd64
+compile-amd64:
+ $(WINDRES) DriverRsrc.rsrc -O coff -o DriverRsrc.o
+ $(CC_GNU) $(FLAG_GNU) $(DEBUG) $(wildcard *.c) $(wildcard ../../DDK/*.c) $(wildcard ../../DDK/*.S)
+
+.PHONY: clean
+clean:
+ $(REM) $(REM_FLAG) $(OBJ) SampleDriver.exe
+
+.PHONY: help
+help:
+ @echo "=== HELP ==="
+ @echo "clean: Clean driver."
+ @echo "compile-amd64: Build driver."