From 9db58da40cfcb6643412bfae25aefc0cd1077f9d Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 27 May 2024 20:45:46 +0200 Subject: MHR-23: Improve project structure, make it better. Signed-off-by: Amlal El Mahrouss --- .vscode/c_cpp_properties.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to '.vscode') diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index cda7d4a1..d9d86a41 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -4,9 +4,11 @@ "name": "MicroKernel (Macintosh)", "includePath": [ "${workspaceFolder}/Kernel/**", + "${workspaceFolder}/Drivers/**", "${workspaceFolder}/Boot/**", - "${workspaceFolder}/SDK/Library/CoreSystem/**", - "${workspaceFolder}/SDK/Library/**" + "${workspaceFolder}/**", + "${workspaceFolder}/SDK/Libraries/CoreSystem/**", + "${workspaceFolder}/SDK/Libraries/**" ], "defines": [ "__MAHROUSS__", @@ -36,10 +38,12 @@ { "name": "MicroKernel (Windows)", "includePath": [ + "${workspaceFolder}/Drivers/**", "${workspaceFolder}/Kernel/**", "${workspaceFolder}/Boot/**", - "${workspaceFolder}/SDK/Library/CoreSystem/**", - "${workspaceFolder}/SDK/Library/**" + "${workspaceFolder}/**", + "${workspaceFolder}/SDK/Libraries/CoreSystem/**", + "${workspaceFolder}/SDK/Libraries/**" ], "defines": [ "__MAHROUSS__", -- cgit v1.2.3 From 8f262d685126a9a9f68beb6d4002ba30bebae401 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 28 May 2024 11:52:48 +0200 Subject: MHR-23: Improve scheduler code: Dont use 39, write kErrorProcessFault instead. MHR-23: Improve filesystem structure. Signed-off-by: Amlal El Mahrouss --- .vscode/c_cpp_properties.json | 4 +-- DDK/KernelCall.c | 25 +++++++++++++++++ DDK/KernelDev.c | 37 +++++++++++++++++++++++++ DDK/KernelDev.h | 33 +++++++++++++++++++++++ DDK/KernelDispatchCall.S | 21 +++++++++++++++ DDK/KernelPrint.c | 33 +++++++++++++++++++++++ DDK/KernelPrint.h | 18 +++++++++++++ DDK/KernelStd.h | 22 +++++++++++++++ DDK/KernelStdCxx.cc | 24 +++++++++++++++++ DDK/KernelString.c | 34 +++++++++++++++++++++++ DDK/KernelString.h | 16 +++++++++++ DDK/ReadMe.txt | 4 +++ DriverKit/KernelCall.c | 25 ----------------- DriverKit/KernelDev.c | 37 ------------------------- DriverKit/KernelDev.h | 33 ----------------------- DriverKit/KernelDispatchCall.S | 21 --------------- DriverKit/KernelPrint.c | 33 ----------------------- DriverKit/KernelPrint.h | 18 ------------- DriverKit/KernelStd.h | 22 --------------- DriverKit/KernelStdCxx.cc | 24 ----------------- DriverKit/KernelString.c | 34 ----------------------- DriverKit/KernelString.h | 16 ----------- DriverKit/ReadMe.txt | 4 --- Drivers/.gitkeep | 0 Drivers/Bonjour/Bonjour.c | 20 -------------- Drivers/Bonjour/DriverRsrc.rsrc | 25 ----------------- Drivers/Bonjour/x86_64.mk | 51 ----------------------------------- Drivers/DynamicLoader/DriverRsrc.rsrc | 25 ----------------- Drivers/DynamicLoader/DynamicLoader.c | 26 ------------------ Drivers/DynamicLoader/x86_64.mk | 51 ----------------------------------- Drivers/SampleDriver/DriverRsrc.rsrc | 25 ----------------- Drivers/SampleDriver/SampleDriver.c | 26 ------------------ Drivers/SampleDriver/x86_64.mk | 51 ----------------------------------- Drv/.gitkeep | 0 Drv/Bonjour/Bonjour.c | 20 ++++++++++++++ Drv/Bonjour/DriverRsrc.rsrc | 25 +++++++++++++++++ Drv/Bonjour/x86_64.mk | 51 +++++++++++++++++++++++++++++++++++ Drv/DynamicLoader/DriverRsrc.rsrc | 25 +++++++++++++++++ Drv/DynamicLoader/DynamicLoader.c | 26 ++++++++++++++++++ Drv/DynamicLoader/x86_64.mk | 51 +++++++++++++++++++++++++++++++++++ Drv/SampleDriver/DriverRsrc.rsrc | 25 +++++++++++++++++ Drv/SampleDriver/SampleDriver.c | 26 ++++++++++++++++++ Drv/SampleDriver/x86_64.mk | 51 +++++++++++++++++++++++++++++++++++ Kernel/Sources/ProcessScheduler.cxx | 2 +- 44 files changed, 570 insertions(+), 570 deletions(-) create mode 100644 DDK/KernelCall.c create mode 100644 DDK/KernelDev.c create mode 100644 DDK/KernelDev.h create mode 100644 DDK/KernelDispatchCall.S create mode 100644 DDK/KernelPrint.c create mode 100644 DDK/KernelPrint.h create mode 100644 DDK/KernelStd.h create mode 100644 DDK/KernelStdCxx.cc create mode 100644 DDK/KernelString.c create mode 100644 DDK/KernelString.h create mode 100644 DDK/ReadMe.txt delete mode 100644 DriverKit/KernelCall.c delete mode 100644 DriverKit/KernelDev.c delete mode 100644 DriverKit/KernelDev.h delete mode 100644 DriverKit/KernelDispatchCall.S delete mode 100644 DriverKit/KernelPrint.c delete mode 100644 DriverKit/KernelPrint.h delete mode 100644 DriverKit/KernelStd.h delete mode 100644 DriverKit/KernelStdCxx.cc delete mode 100644 DriverKit/KernelString.c delete mode 100644 DriverKit/KernelString.h delete mode 100644 DriverKit/ReadMe.txt delete mode 100644 Drivers/.gitkeep delete mode 100644 Drivers/Bonjour/Bonjour.c delete mode 100644 Drivers/Bonjour/DriverRsrc.rsrc delete mode 100644 Drivers/Bonjour/x86_64.mk delete mode 100644 Drivers/DynamicLoader/DriverRsrc.rsrc delete mode 100644 Drivers/DynamicLoader/DynamicLoader.c delete mode 100644 Drivers/DynamicLoader/x86_64.mk delete mode 100644 Drivers/SampleDriver/DriverRsrc.rsrc delete mode 100644 Drivers/SampleDriver/SampleDriver.c delete mode 100644 Drivers/SampleDriver/x86_64.mk create mode 100644 Drv/.gitkeep create mode 100644 Drv/Bonjour/Bonjour.c create mode 100644 Drv/Bonjour/DriverRsrc.rsrc create mode 100644 Drv/Bonjour/x86_64.mk create mode 100644 Drv/DynamicLoader/DriverRsrc.rsrc create mode 100644 Drv/DynamicLoader/DynamicLoader.c create mode 100644 Drv/DynamicLoader/x86_64.mk create mode 100644 Drv/SampleDriver/DriverRsrc.rsrc create mode 100644 Drv/SampleDriver/SampleDriver.c create mode 100644 Drv/SampleDriver/x86_64.mk (limited to '.vscode') diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index d9d86a41..ff4a5912 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -4,7 +4,7 @@ "name": "MicroKernel (Macintosh)", "includePath": [ "${workspaceFolder}/Kernel/**", - "${workspaceFolder}/Drivers/**", + "${workspaceFolder}/Drv/**", "${workspaceFolder}/Boot/**", "${workspaceFolder}/**", "${workspaceFolder}/SDK/Libraries/CoreSystem/**", @@ -38,7 +38,7 @@ { "name": "MicroKernel (Windows)", "includePath": [ - "${workspaceFolder}/Drivers/**", + "${workspaceFolder}/Drv/**", "${workspaceFolder}/Kernel/**", "${workspaceFolder}/Boot/**", "${workspaceFolder}/**", diff --git a/DDK/KernelCall.c b/DDK/KernelCall.c new file mode 100644 index 00000000..17e0b5d5 --- /dev/null +++ b/DDK/KernelCall.c @@ -0,0 +1,25 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + + Purpose: Kernel Definitions. + +------------------------------------------- */ + +#include +#include + +DK_EXTERN __attribute__((naked)) void __kernelDispatchCall(int32_t cnt, ...); + +DK_EXTERN void* kernelCall(const char* kernelRpcName, int32_t cnt, ...) +{ + if (!kernelRpcName || cnt == 0) + return NIL; + + va_list arg; + va_start(arg, cnt); + + __kernelDispatchCall(cnt, arg); + + va_end(arg); +} diff --git a/DDK/KernelDev.c b/DDK/KernelDev.c new file mode 100644 index 00000000..ee7aa84b --- /dev/null +++ b/DDK/KernelDev.c @@ -0,0 +1,37 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + + Purpose: Kernel Text I/O. + +------------------------------------------- */ + +#include + +/// @brief Open a new binary device from path. +DK_EXTERN kernelDeviceRef kernelOpenBinaryDevice(const char* devicePath) +{ + if (!devicePath) + return NIL; + + return kernelCall("OpenBinaryDevice", 1, devicePath); +} + +/// @brief Open a new character device from path. +DK_EXTERN kernelDeviceRef kernelOpenCharDevice(const char* devicePath) +{ + if (!devicePath) + return NIL; + + return kernelCall("OpenCharDevice", 1, devicePath); +} + +/// @brief Close any device. +/// @param device valid device. +DK_EXTERN void kernelCloseDevice(kernelDeviceRef device) +{ + if (!device) + return; + + kernelCall("CloseDevice", 1, device); +} diff --git a/DDK/KernelDev.h b/DDK/KernelDev.h new file mode 100644 index 00000000..4710023a --- /dev/null +++ b/DDK/KernelDev.h @@ -0,0 +1,33 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + + Purpose: Kernel Devices. + +------------------------------------------- */ + +#pragma once + +#include + +struct _kernelDevice; + +/// @brief Kernel Device driver. +typedef struct _kernelDevice +{ + char name[255]; // the device name. Could be /./DEVICE_NAME/ + int32_t (*read)(); // read from device. + int32_t (*write)(); // write to device. + struct _kernelDevice* (*open)(const char* path); // open device. + void (*close)(struct _kernelDevice* dev); // close device. +} kernelDevice, *kernelDeviceRef; + +/// @brief Open a new binary device from path. +DK_EXTERN kernelDeviceRef kernelOpenBinaryDevice(const char* devicePath); + +/// @brief Open a new character device from path. +DK_EXTERN kernelDeviceRef kernelOpenCharDevice(const char* devicePath); + +/// @brief Close any device. +/// @param device valid device. +DK_EXTERN void kernelCloseDevice(kernelDeviceRef device); diff --git a/DDK/KernelDispatchCall.S b/DDK/KernelDispatchCall.S new file mode 100644 index 00000000..64b6663e --- /dev/null +++ b/DDK/KernelDispatchCall.S @@ -0,0 +1,21 @@ +.globl __kernelDispatchCall + +.section .text + +/* Really simple function, takes our va-list, + and brings it to the trap handler in the kernel. */ + +#ifdef __x86_64__ + +__kernelDispatchCall: + int $0x33 + ret + +#elif defined(__powerpc64__) + +__kernelDispatchCall: + /* There is no specific interrupt request id for a system call in POWER. */ + sc + blr + +#endif diff --git a/DDK/KernelPrint.c b/DDK/KernelPrint.c new file mode 100644 index 00000000..9e25d31b --- /dev/null +++ b/DDK/KernelPrint.c @@ -0,0 +1,33 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + + Purpose: Kernel Text I/O. + +------------------------------------------- */ + +#include + +DK_EXTERN void kernelPrintChar(const char ch) +{ + kernelCall("WriteCharacter", 1, ch); +} + +/// @brief print string to UART. +/// @param message UART to transmit. +DK_EXTERN void kernelPrintStr(const char* message) +{ + if (!message) + return; + if (*message == 0) + return; + + size_t index = 0; + size_t len = kernelStringLength(message); + + while (index < len) + { + kernelPrintChar(message[index]); + ++index; + } +} diff --git a/DDK/KernelPrint.h b/DDK/KernelPrint.h new file mode 100644 index 00000000..135abcc0 --- /dev/null +++ b/DDK/KernelPrint.h @@ -0,0 +1,18 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + + Purpose: Kernel Text I/O. + +------------------------------------------- */ + +#pragma once + +#include + +/// @brief print character into UART. +DK_EXTERN void kernelPrintChar(const char ch); + +/// @brief print string to UART. +/// @param message UART to transmit. +DK_EXTERN void kernelPrintStr(const char* message); diff --git a/DDK/KernelStd.h b/DDK/KernelStd.h new file mode 100644 index 00000000..b0dba70e --- /dev/null +++ b/DDK/KernelStd.h @@ -0,0 +1,22 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + + Purpose: Kernel Definitions. + +------------------------------------------- */ + +#pragma once + +#if defined(__cplusplus) +#define DK_EXTERN extern "C" +#define NIL nullptr +#else +#define DK_EXTERN extern +#define NIL NULL +#endif // defined(__cplusplus) + +#include +#include + +DK_EXTERN void* kernelCall(const char* kernelRpcName, int32_t cnt, ...); diff --git a/DDK/KernelStdCxx.cc b/DDK/KernelStdCxx.cc new file mode 100644 index 00000000..7d8c9ff3 --- /dev/null +++ b/DDK/KernelStdCxx.cc @@ -0,0 +1,24 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + + Purpose: Driver C++ Definitions. + +------------------------------------------- */ + +#include + +void* operator new(size_t sz) { + if (!sz) ++sz; + + auto ptr = kernelCall("NewKernelHeap", 1, sz); + kernelCall("ProtectKernelHeap", 1, ptr); + + return ptr; +} + +void operator delete(void* ptr) noexcept { + if (!ptr) return; + + kernelCall("DeleteKernelHeap", 1,ptr); +} diff --git a/DDK/KernelString.c b/DDK/KernelString.c new file mode 100644 index 00000000..1bd4c8c6 --- /dev/null +++ b/DDK/KernelString.c @@ -0,0 +1,34 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + + Purpose: Kernel Strings. + +------------------------------------------- */ + +#include + +DK_EXTERN size_t kernelStringLength(const char* str) +{ + size_t index = 0; + + while (str[index] != 0) + { + ++index; + } + + return index; +} + +DK_EXTERN int kernelStringCopy(char* dst, const char* src, size_t len) +{ + size_t index = 0; + + while (index != len) + { + dst[index] = src[index]; + ++index; + } + + return index; +} diff --git a/DDK/KernelString.h b/DDK/KernelString.h new file mode 100644 index 00000000..d39aeea1 --- /dev/null +++ b/DDK/KernelString.h @@ -0,0 +1,16 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + + Purpose: Kernel Strings. + +------------------------------------------- */ + +#pragma once + +#include + +/// @brief DDK equivalent of POSIX's string.h. + +DK_EXTERN size_t kernelStringLength(const char* str); +DK_EXTERN int kernelStringCopy(char* dst, const char* src, size_t len); diff --git a/DDK/ReadMe.txt b/DDK/ReadMe.txt new file mode 100644 index 00000000..e33c88ec --- /dev/null +++ b/DDK/ReadMe.txt @@ -0,0 +1,4 @@ +== The Driver Kit == + +-> A kit used to write user level drivers. +-> Use MPCC to compile the code, it can work on a patched GNU compiler. diff --git a/DriverKit/KernelCall.c b/DriverKit/KernelCall.c deleted file mode 100644 index d61f8439..00000000 --- a/DriverKit/KernelCall.c +++ /dev/null @@ -1,25 +0,0 @@ -/* ------------------------------------------- - - Copyright SoftwareLabs - - Purpose: Kernel Definitions. - -------------------------------------------- */ - -#include -#include - -DK_EXTERN __attribute__((naked)) void __kernelDispatchCall(int32_t cnt, ...); - -DK_EXTERN void* kernelCall(const char* kernelRpcName, int32_t cnt, ...) -{ - if (!kernelRpcName || cnt == 0) - return NIL; - - va_list arg; - va_start(arg, cnt); - - __kernelDispatchCall(cnt, arg); - - va_end(arg); -} diff --git a/DriverKit/KernelDev.c b/DriverKit/KernelDev.c deleted file mode 100644 index 704f17da..00000000 --- a/DriverKit/KernelDev.c +++ /dev/null @@ -1,37 +0,0 @@ -/* ------------------------------------------- - - Copyright SoftwareLabs - - Purpose: Kernel Text I/O. - -------------------------------------------- */ - -#include - -/// @brief Open a new binary device from path. -DK_EXTERN kernelDeviceRef kernelOpenBinaryDevice(const char* devicePath) -{ - if (!devicePath) - return NIL; - - return kernelCall("OpenBinaryDevice", 1, devicePath); -} - -/// @brief Open a new character device from path. -DK_EXTERN kernelDeviceRef kernelOpenCharDevice(const char* devicePath) -{ - if (!devicePath) - return NIL; - - return kernelCall("OpenCharDevice", 1, devicePath); -} - -/// @brief Close any device. -/// @param device valid device. -DK_EXTERN void kernelCloseDevice(kernelDeviceRef device) -{ - if (!device) - return; - - kernelCall("CloseDevice", 1, device); -} diff --git a/DriverKit/KernelDev.h b/DriverKit/KernelDev.h deleted file mode 100644 index c3435e8d..00000000 --- a/DriverKit/KernelDev.h +++ /dev/null @@ -1,33 +0,0 @@ -/* ------------------------------------------- - - Copyright SoftwareLabs - - Purpose: Kernel Devices. - -------------------------------------------- */ - -#pragma once - -#include - -struct _kernelDevice; - -/// @brief Kernel Device driver. -typedef struct _kernelDevice -{ - char name[255]; // the device name. Could be /./DEVICE_NAME/ - int32_t (*read)(); // read from device. - int32_t (*write)(); // write to device. - struct _kernelDevice* (*open)(const char* path); // open device. - void (*close)(struct _kernelDevice* dev); // close device. -} kernelDevice, *kernelDeviceRef; - -/// @brief Open a new binary device from path. -DK_EXTERN kernelDeviceRef kernelOpenBinaryDevice(const char* devicePath); - -/// @brief Open a new character device from path. -DK_EXTERN kernelDeviceRef kernelOpenCharDevice(const char* devicePath); - -/// @brief Close any device. -/// @param device valid device. -DK_EXTERN void kernelCloseDevice(kernelDeviceRef device); diff --git a/DriverKit/KernelDispatchCall.S b/DriverKit/KernelDispatchCall.S deleted file mode 100644 index 64b6663e..00000000 --- a/DriverKit/KernelDispatchCall.S +++ /dev/null @@ -1,21 +0,0 @@ -.globl __kernelDispatchCall - -.section .text - -/* Really simple function, takes our va-list, - and brings it to the trap handler in the kernel. */ - -#ifdef __x86_64__ - -__kernelDispatchCall: - int $0x33 - ret - -#elif defined(__powerpc64__) - -__kernelDispatchCall: - /* There is no specific interrupt request id for a system call in POWER. */ - sc - blr - -#endif diff --git a/DriverKit/KernelPrint.c b/DriverKit/KernelPrint.c deleted file mode 100644 index 533bf34a..00000000 --- a/DriverKit/KernelPrint.c +++ /dev/null @@ -1,33 +0,0 @@ -/* ------------------------------------------- - - Copyright SoftwareLabs - - Purpose: Kernel Text I/O. - -------------------------------------------- */ - -#include - -DK_EXTERN void kernelPrintChar(const char ch) -{ - kernelCall("WriteCharacter", 1, ch); -} - -/// @brief print string to UART. -/// @param message UART to transmit. -DK_EXTERN void kernelPrintStr(const char* message) -{ - if (!message) - return; - if (*message == 0) - return; - - size_t index = 0; - size_t len = kernelStringLength(message); - - while (index < len) - { - kernelPrintChar(message[index]); - ++index; - } -} diff --git a/DriverKit/KernelPrint.h b/DriverKit/KernelPrint.h deleted file mode 100644 index 7bf0dda9..00000000 --- a/DriverKit/KernelPrint.h +++ /dev/null @@ -1,18 +0,0 @@ -/* ------------------------------------------- - - Copyright SoftwareLabs - - Purpose: Kernel Text I/O. - -------------------------------------------- */ - -#pragma once - -#include - -/// @brief print character into UART. -DK_EXTERN void kernelPrintChar(const char ch); - -/// @brief print string to UART. -/// @param message UART to transmit. -DK_EXTERN void kernelPrintStr(const char* message); diff --git a/DriverKit/KernelStd.h b/DriverKit/KernelStd.h deleted file mode 100644 index b0dba70e..00000000 --- a/DriverKit/KernelStd.h +++ /dev/null @@ -1,22 +0,0 @@ -/* ------------------------------------------- - - Copyright SoftwareLabs - - Purpose: Kernel Definitions. - -------------------------------------------- */ - -#pragma once - -#if defined(__cplusplus) -#define DK_EXTERN extern "C" -#define NIL nullptr -#else -#define DK_EXTERN extern -#define NIL NULL -#endif // defined(__cplusplus) - -#include -#include - -DK_EXTERN void* kernelCall(const char* kernelRpcName, int32_t cnt, ...); diff --git a/DriverKit/KernelStdCxx.cc b/DriverKit/KernelStdCxx.cc deleted file mode 100644 index 633437dc..00000000 --- a/DriverKit/KernelStdCxx.cc +++ /dev/null @@ -1,24 +0,0 @@ -/* ------------------------------------------- - - Copyright SoftwareLabs - - Purpose: Driver C++ Definitions. - -------------------------------------------- */ - -#include - -void* operator new(size_t sz) { - if (!sz) ++sz; - - auto ptr = kernelCall("NewKernelHeap", 1, sz); - kernelCall("ProtectKernelHeap", 1, ptr); - - return ptr; -} - -void operator delete(void* ptr) noexcept { - if (!ptr) return; - - kernelCall("DeleteKernelHeap", 1,ptr); -} diff --git a/DriverKit/KernelString.c b/DriverKit/KernelString.c deleted file mode 100644 index 6f28f4d8..00000000 --- a/DriverKit/KernelString.c +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------- - - Copyright SoftwareLabs - - Purpose: Kernel Strings. - -------------------------------------------- */ - -#include - -DK_EXTERN size_t kernelStringLength(const char* str) -{ - size_t index = 0; - - while (str[index] != 0) - { - ++index; - } - - return index; -} - -DK_EXTERN int kernelStringCopy(char* dst, const char* src, size_t len) -{ - size_t index = 0; - - while (index != len) - { - dst[index] = src[index]; - ++index; - } - - return index; -} diff --git a/DriverKit/KernelString.h b/DriverKit/KernelString.h deleted file mode 100644 index db063a1b..00000000 --- a/DriverKit/KernelString.h +++ /dev/null @@ -1,16 +0,0 @@ -/* ------------------------------------------- - - Copyright SoftwareLabs - - Purpose: Kernel Strings. - -------------------------------------------- */ - -#pragma once - -#include - -/// @brief DriverKit equivalent of POSIX's string.h. - -DK_EXTERN size_t kernelStringLength(const char* str); -DK_EXTERN int kernelStringCopy(char* dst, const char* src, size_t len); diff --git a/DriverKit/ReadMe.txt b/DriverKit/ReadMe.txt deleted file mode 100644 index e33c88ec..00000000 --- a/DriverKit/ReadMe.txt +++ /dev/null @@ -1,4 +0,0 @@ -== The Driver Kit == - --> A kit used to write user level drivers. --> Use MPCC to compile the code, it can work on a patched GNU compiler. diff --git a/Drivers/.gitkeep b/Drivers/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/Drivers/Bonjour/Bonjour.c b/Drivers/Bonjour/Bonjour.c deleted file mode 100644 index 52187ac1..00000000 --- a/Drivers/Bonjour/Bonjour.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ------------------------------------------- - - Copyright SoftwareLabs - -------------------------------------------- */ - -#include -#include - -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/Drivers/Bonjour/DriverRsrc.rsrc b/Drivers/Bonjour/DriverRsrc.rsrc deleted file mode 100644 index 494e85ee..00000000 --- a/Drivers/Bonjour/DriverRsrc.rsrc +++ /dev/null @@ -1,25 +0,0 @@ -1 ICON "../../Root/Boot/Icons/bonjour-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 Bonjour 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/Drivers/Bonjour/x86_64.mk b/Drivers/Bonjour/x86_64.mk deleted file mode 100644 index afbc70ad..00000000 --- a/Drivers/Bonjour/x86_64.mk +++ /dev/null @@ -1,51 +0,0 @@ -################################################## -# (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 ../../DriverKit/*.c) $(wildcard ../../DriverKit/*.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/Drivers/DynamicLoader/DriverRsrc.rsrc b/Drivers/DynamicLoader/DriverRsrc.rsrc deleted file mode 100644 index 3a3b8774..00000000 --- a/Drivers/DynamicLoader/DriverRsrc.rsrc +++ /dev/null @@ -1,25 +0,0 @@ -1 ICON "../../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/Drivers/DynamicLoader/DynamicLoader.c b/Drivers/DynamicLoader/DynamicLoader.c deleted file mode 100644 index 16ffc06e..00000000 --- a/Drivers/DynamicLoader/DynamicLoader.c +++ /dev/null @@ -1,26 +0,0 @@ -/* ------------------------------------------- - - Copyright SoftwareLabs - -------------------------------------------- */ - -#include -#include - -int __ImageStart(void) -{ - kernelPrintStr("DynamicLoader: Starting up...\r"); - return 0; -} - -int __ImageEnd(void) -{ - kernelPrintStr("DynamicLoader: 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/Drivers/DynamicLoader/x86_64.mk b/Drivers/DynamicLoader/x86_64.mk deleted file mode 100644 index 1d46948b..00000000 --- a/Drivers/DynamicLoader/x86_64.mk +++ /dev/null @@ -1,51 +0,0 @@ -################################################## -# (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 ../../DriverKit/*.c) $(wildcard ../../DriverKit/*.S) - -.PHONY: clean -clean: - $(REM) $(REM_FLAG) $(OBJ) SampleDriver.exe - -.PHONY: help -help: - @echo "=== HELP ===" - @echo "clean: Clean driver." - @echo "compile-amd64: Build driver." diff --git a/Drivers/SampleDriver/DriverRsrc.rsrc b/Drivers/SampleDriver/DriverRsrc.rsrc deleted file mode 100644 index 3a3b8774..00000000 --- a/Drivers/SampleDriver/DriverRsrc.rsrc +++ /dev/null @@ -1,25 +0,0 @@ -1 ICON "../../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/Drivers/SampleDriver/SampleDriver.c b/Drivers/SampleDriver/SampleDriver.c deleted file mode 100644 index 4085bf4f..00000000 --- a/Drivers/SampleDriver/SampleDriver.c +++ /dev/null @@ -1,26 +0,0 @@ -/* ------------------------------------------- - - Copyright SoftwareLabs - -------------------------------------------- */ - -#include -#include - -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/Drivers/SampleDriver/x86_64.mk b/Drivers/SampleDriver/x86_64.mk deleted file mode 100644 index 1d46948b..00000000 --- a/Drivers/SampleDriver/x86_64.mk +++ /dev/null @@ -1,51 +0,0 @@ -################################################## -# (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 ../../DriverKit/*.c) $(wildcard ../../DriverKit/*.S) - -.PHONY: clean -clean: - $(REM) $(REM_FLAG) $(OBJ) SampleDriver.exe - -.PHONY: help -help: - @echo "=== HELP ===" - @echo "clean: Clean driver." - @echo "compile-amd64: Build driver." diff --git a/Drv/.gitkeep b/Drv/.gitkeep new file mode 100644 index 00000000..e69de29b 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 +#include + +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..494e85ee --- /dev/null +++ b/Drv/Bonjour/DriverRsrc.rsrc @@ -0,0 +1,25 @@ +1 ICON "../../Root/Boot/Icons/bonjour-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 Bonjour 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/DynamicLoader/DriverRsrc.rsrc b/Drv/DynamicLoader/DriverRsrc.rsrc new file mode 100644 index 00000000..3a3b8774 --- /dev/null +++ b/Drv/DynamicLoader/DriverRsrc.rsrc @@ -0,0 +1,25 @@ +1 ICON "../../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/DynamicLoader/DynamicLoader.c b/Drv/DynamicLoader/DynamicLoader.c new file mode 100644 index 00000000..83ca555e --- /dev/null +++ b/Drv/DynamicLoader/DynamicLoader.c @@ -0,0 +1,26 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + +------------------------------------------- */ + +#include +#include + +int __ImageStart(void) +{ + kernelPrintStr("DynamicLoader: Starting up...\r"); + return 0; +} + +int __ImageEnd(void) +{ + kernelPrintStr("DynamicLoader: 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/DynamicLoader/x86_64.mk b/Drv/DynamicLoader/x86_64.mk new file mode 100644 index 00000000..54ee54f0 --- /dev/null +++ b/Drv/DynamicLoader/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." diff --git a/Drv/SampleDriver/DriverRsrc.rsrc b/Drv/SampleDriver/DriverRsrc.rsrc new file mode 100644 index 00000000..3a3b8774 --- /dev/null +++ b/Drv/SampleDriver/DriverRsrc.rsrc @@ -0,0 +1,25 @@ +1 ICON "../../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 +#include + +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." diff --git a/Kernel/Sources/ProcessScheduler.cxx b/Kernel/Sources/ProcessScheduler.cxx index 63d566b7..32e1fbde 100644 --- a/Kernel/Sources/ProcessScheduler.cxx +++ b/Kernel/Sources/ProcessScheduler.cxx @@ -42,7 +42,7 @@ namespace NewOS void ProcessHeader::Crash() { - kcout << this->Name << ": crashed. (id = " << number(39); + kcout << this->Name << ": crashed. (id = " << number(kErrorProcessFault); kcout << ")\r"; if (this->Ring != kRingUserKind) -- cgit v1.2.3