summaryrefslogtreecommitdiffhomepage
path: root/Drv
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlal@softwarelabs.com>2024-06-16 18:05:36 +0200
committerAmlal EL Mahrouss <amlal@softwarelabs.com>2024-06-16 18:05:36 +0200
commitc4cbc986ac68dbfdc743efec58c72ebb74d3f3b0 (patch)
tree8aee3becceae40efd8e3a5198266cc800a962d93 /Drv
parent30bcb0416e8acaf3fb7b224e18534e7f64df26af (diff)
MHR-31: Start work on drivers for ARM64.
Signed-off-by: Amlal EL Mahrouss <amlal@softwarelabs.com>
Diffstat (limited to 'Drv')
-rw-r--r--Drv/GSMDrv/CheckStck.c11
-rw-r--r--Drv/GSMDrv/DriverRsrc.rsrc25
-rw-r--r--Drv/GSMDrv/GSMDrv.c23
-rw-r--r--Drv/GSMDrv/x86_64.make51
-rw-r--r--Drv/VideoDrv/CheckStck.c11
-rw-r--r--Drv/VideoDrv/DriverRsrc.rsrc25
-rw-r--r--Drv/VideoDrv/VideoDrv.c22
-rw-r--r--Drv/VideoDrv/x86_64.make51
8 files changed, 219 insertions, 0 deletions
diff --git a/Drv/GSMDrv/CheckStck.c b/Drv/GSMDrv/CheckStck.c
new file mode 100644
index 00000000..3eb157ba
--- /dev/null
+++ b/Drv/GSMDrv/CheckStck.c
@@ -0,0 +1,11 @@
+/* -------------------------------------------
+
+ Copyright Zeta Electronics Corporation
+
+------------------------------------------- */
+
+///! @brief Use this to check your stack, if using MinGW/MSVC/CodeTools.
+void ___chkstk_ms(void)
+{
+ (void)0;
+}
diff --git a/Drv/GSMDrv/DriverRsrc.rsrc b/Drv/GSMDrv/DriverRsrc.rsrc
new file mode 100644
index 00000000..f8e9c05f
--- /dev/null
+++ b/Drv/GSMDrv/DriverRsrc.rsrc
@@ -0,0 +1,25 @@
+1 ICON "../../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", "Zeta Electronics Corporation"
+ VALUE "FileDescription", "New OS driver."
+ VALUE "FileVersion", "1.00"
+ VALUE "InternalName", "SampleDriver"
+ VALUE "LegalCopyright", "Copyright Zeta Electronics Corporation, 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/GSMDrv/GSMDrv.c b/Drv/GSMDrv/GSMDrv.c
new file mode 100644
index 00000000..791c0678
--- /dev/null
+++ b/Drv/GSMDrv/GSMDrv.c
@@ -0,0 +1,23 @@
+/* -------------------------------------------
+
+ Copyright Zeta Electronics Corporation
+
+------------------------------------------- */
+
+#include <DDK/KernelString.h>
+#include <DDK/KernelPrint.h>
+
+int __ImageStart(void)
+{
+ kernelPrintStr("GSMDrv: Starting up...\r");
+
+ /// @brief activate SIM 0..n
+
+ return 0;
+}
+
+int __ImageEnd(void)
+{
+ kernelPrintStr("GSMDrv: Shutting down...\r");
+ return 0;
+}
diff --git a/Drv/GSMDrv/x86_64.make b/Drv/GSMDrv/x86_64.make
new file mode 100644
index 00000000..a47c40ae
--- /dev/null
+++ b/Drv/GSMDrv/x86_64.make
@@ -0,0 +1,51 @@
+##################################################
+# (C) Zeta Electronics Corporation, 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 GSMDrv.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) GSMDrv.exe
+
+.PHONY: help
+help:
+ @echo "=== HELP ==="
+ @echo "clean: Clean driver."
+ @echo "compile-amd64: Build driver."
diff --git a/Drv/VideoDrv/CheckStck.c b/Drv/VideoDrv/CheckStck.c
new file mode 100644
index 00000000..3eb157ba
--- /dev/null
+++ b/Drv/VideoDrv/CheckStck.c
@@ -0,0 +1,11 @@
+/* -------------------------------------------
+
+ Copyright Zeta Electronics Corporation
+
+------------------------------------------- */
+
+///! @brief Use this to check your stack, if using MinGW/MSVC/CodeTools.
+void ___chkstk_ms(void)
+{
+ (void)0;
+}
diff --git a/Drv/VideoDrv/DriverRsrc.rsrc b/Drv/VideoDrv/DriverRsrc.rsrc
new file mode 100644
index 00000000..f8e9c05f
--- /dev/null
+++ b/Drv/VideoDrv/DriverRsrc.rsrc
@@ -0,0 +1,25 @@
+1 ICON "../../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", "Zeta Electronics Corporation"
+ VALUE "FileDescription", "New OS driver."
+ VALUE "FileVersion", "1.00"
+ VALUE "InternalName", "SampleDriver"
+ VALUE "LegalCopyright", "Copyright Zeta Electronics Corporation, 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/VideoDrv/VideoDrv.c b/Drv/VideoDrv/VideoDrv.c
new file mode 100644
index 00000000..3ba104d6
--- /dev/null
+++ b/Drv/VideoDrv/VideoDrv.c
@@ -0,0 +1,22 @@
+/* -------------------------------------------
+
+ Copyright Zeta Electronics Corporation
+
+------------------------------------------- */
+
+#include <DDK/KernelString.h>
+#include <DDK/KernelPrint.h>
+
+#include <Builtins/GX/GX>
+
+int __ImageStart(void)
+{
+ kernelPrintStr("VideoDrv: Starting up...\r");
+ return 0;
+}
+
+int __ImageEnd(void)
+{
+ kernelPrintStr("VideoDrv: Shutting down...\r");
+ return 0;
+}
diff --git a/Drv/VideoDrv/x86_64.make b/Drv/VideoDrv/x86_64.make
new file mode 100644
index 00000000..8ec42277
--- /dev/null
+++ b/Drv/VideoDrv/x86_64.make
@@ -0,0 +1,51 @@
+##################################################
+# (C) Zeta Electronics Corporation, 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 VideoDrv.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) VideoDrv.exe
+
+.PHONY: help
+help:
+ @echo "=== HELP ==="
+ @echo "clean: Clean driver."
+ @echo "compile-amd64: Build driver."