diff options
| -rw-r--r-- | Drv/GSMDrv/CheckStck.c | 11 | ||||
| -rw-r--r-- | Drv/GSMDrv/DriverRsrc.rsrc | 25 | ||||
| -rw-r--r-- | Drv/GSMDrv/GSMDrv.c | 23 | ||||
| -rw-r--r-- | Drv/GSMDrv/x86_64.make | 51 | ||||
| -rw-r--r-- | Drv/VideoDrv/CheckStck.c | 11 | ||||
| -rw-r--r-- | Drv/VideoDrv/DriverRsrc.rsrc | 25 | ||||
| -rw-r--r-- | Drv/VideoDrv/VideoDrv.c | 22 | ||||
| -rw-r--r-- | Drv/VideoDrv/x86_64.make | 51 | ||||
| -rw-r--r-- | Kernel/Builtins/GPRS/.keepme | 0 | ||||
| -rw-r--r-- | Kernel/Builtins/GSM/.keepme | 0 | ||||
| -rw-r--r-- | Kernel/Builtins/GSM/IO.hxx | 29 | ||||
| -rw-r--r-- | Kernel/KernelKit/ProcessScheduler.hxx | 6 | ||||
| -rw-r--r-- | Kernel/NetworkKit/GSM.hxx | 2 | ||||
| -rw-r--r-- | Kernel/NetworkKit/NetworkDevice.hpp | 8 |
14 files changed, 260 insertions, 4 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." diff --git a/Kernel/Builtins/GPRS/.keepme b/Kernel/Builtins/GPRS/.keepme new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/Kernel/Builtins/GPRS/.keepme diff --git a/Kernel/Builtins/GSM/.keepme b/Kernel/Builtins/GSM/.keepme new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/Kernel/Builtins/GSM/.keepme diff --git a/Kernel/Builtins/GSM/IO.hxx b/Kernel/Builtins/GSM/IO.hxx new file mode 100644 index 00000000..39de1a0f --- /dev/null +++ b/Kernel/Builtins/GSM/IO.hxx @@ -0,0 +1,29 @@ +/* -------------------------------------------
+
+Copyright Zeta Electronics Corporation.
+
+File: GSM\IO.hxx.
+Purpose: GSM I/O.
+
+------------------------------------------- */
+
+#ifndef _INC_NETWORK_GSM_IO_HXX_
+#define _INC_NETWORK_GSM_IO_HXX_
+
+#include <NewKit/Defines.hpp>
+#include <NewKit/String.hpp>
+
+/// @brief GSM I/O routines.
+
+/// @brief Turn on SIM slot.
+NewOS::Boolean gsm_turn_on_slot(NewOS::Int32 slot);
+
+/// @brief Turn off SIM slot.
+NewOS::Boolean gsm_turn_off_slot(NewOS::Int32 slot);
+
+/// @brief Send AT command.
+NewOS::Boolean gsm_send_at_command(NewOS::Char* buf,
+ NewOS::Size bufSz);
+
+
+#endif // ifndef _INC_NETWORK_GSM_IO_HXX_
diff --git a/Kernel/KernelKit/ProcessScheduler.hxx b/Kernel/KernelKit/ProcessScheduler.hxx index f49292f1..7c8f99be 100644 --- a/Kernel/KernelKit/ProcessScheduler.hxx +++ b/Kernel/KernelKit/ProcessScheduler.hxx @@ -4,8 +4,8 @@ ------------------------------------------- */ -#ifndef __PROCESS_SCHEDULER__ -#define __PROCESS_SCHEDULER__ +#ifndef _INC_PROCESS_SCHEDULER_HXX_ +#define _INC_PROCESS_SCHEDULER_HXX_ #include <ArchKit/ArchKit.hpp> #include <KernelKit/FileManager.hpp> @@ -283,4 +283,4 @@ namespace NewOS //////////////////////////////////////////////////// -#endif /* ifndef __PROCESS_SCHEDULER__ */ +#endif /* ifndef _INC_PROCESS_SCHEDULER_HXX_ */ diff --git a/Kernel/NetworkKit/GSM.hxx b/Kernel/NetworkKit/GSM.hxx index 9a785344..f4b040b3 100644 --- a/Kernel/NetworkKit/GSM.hxx +++ b/Kernel/NetworkKit/GSM.hxx @@ -3,7 +3,7 @@ Copyright Zeta Electronics Corporation. File: GSM.hxx. - Purpose: GSM protocol. + Purpose: GSM protocol classes. ------------------------------------------- */ diff --git a/Kernel/NetworkKit/NetworkDevice.hpp b/Kernel/NetworkKit/NetworkDevice.hpp index 49b142d5..58b9a98b 100644 --- a/Kernel/NetworkKit/NetworkDevice.hpp +++ b/Kernel/NetworkKit/NetworkDevice.hpp @@ -10,6 +10,8 @@ #include <KernelKit/DeviceManager.hpp> #include <NetworkKit/IP.hpp> +/// @note Can either work with: Ethernet, GPRS, WiFi + namespace NewOS { struct NetworkDeviceCommand; @@ -58,6 +60,12 @@ namespace NewOS /// @brief IPCEP device. using IPCEPNetworkDevice = NetworkDevice; + + /// @brief GRPS device. + using GPRSNetworkDevice = NetworkDevice; + + /// @brief GSM device. + using GSMNetworkDevice = NetworkDevice; } // namespace NewOS #include <NetworkKit/NetworkDevice.inl> |
