diff options
| -rw-r--r-- | Boot/BootKit/BootKit.hxx | 6 | ||||
| -rw-r--r-- | Boot/BootKit/Device.hxx | 2 | ||||
| -rw-r--r-- | Boot/BootKit/HW/ATA.hxx | 2 | ||||
| -rw-r--r-- | Boot/BootKit/HW/SATA.hxx | 2 | ||||
| -rw-r--r-- | Boot/BootKit/Vendor/Qr.hxx | 2 | ||||
| -rw-r--r-- | Boot/Sources/HEL/AMD64/BootMain.cxx | 7 | ||||
| -rw-r--r-- | Comm/herror.hxx | 46 | ||||
| -rw-r--r-- | Comm/newstd.hxx | 119 | ||||
| -rw-r--r-- | Drv/VideoDrv/VideoDrv.c | 2 | ||||
| -rw-r--r-- | Kernel/FSKit/IndexableProperty.hxx | 3 | ||||
| -rw-r--r-- | Kernel/FirmwareKit/EFI/API.hxx | 2 | ||||
| -rw-r--r-- | Kernel/FirmwareKit/EPM.hxx | 6 | ||||
| -rw-r--r-- | Kernel/HALKit/AMD64/HalACPIFactoryInterface.cxx | 2 | ||||
| -rw-r--r-- | Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp | 2 | ||||
| -rw-r--r-- | Kernel/HALKit/AMD64/HalHart.cpp | 1 | ||||
| -rw-r--r-- | Kernel/HALKit/AMD64/HalKernelMain.cxx | 70 | ||||
| -rw-r--r-- | Kernel/HALKit/AMD64/HalKernelMouse.cxx | 6 | ||||
| -rw-r--r-- | Kernel/HALKit/AMD64/HalPageAlloc.hpp | 18 | ||||
| -rw-r--r-- | Kernel/HALKit/AMD64/Processor.hpp | 12 | ||||
| -rw-r--r-- | Kernel/HALKit/AMD64/Storage/AHCI.cxx | 2 | ||||
| -rw-r--r-- | Kernel/HALKit/AMD64/Storage/ATA-DMA.cxx | 6 | ||||
| -rw-r--r-- | Kernel/HALKit/AMD64/Storage/ATA-PIO.cxx | 2 | ||||
| -rw-r--r-- | Kernel/HALKit/ARM64/HalPageAlloc.hpp | 40 | ||||
| -rw-r--r-- | Kernel/HALKit/ARM64/Processor.hxx | 6 | ||||
| -rw-r--r-- | Kernel/KernelKit/FileManager.hpp | 46 | ||||
| -rw-r--r-- | Kernel/KernelKit/HError.hpp | 10 | ||||
| -rw-r--r-- | Kernel/KernelKit/PEFCodeManager.hxx | 8 | ||||
| -rw-r--r-- | Kernel/KernelKit/ProcessScheduler.hxx | 16 | ||||
| -rw-r--r-- | Kernel/Modules/.gitkeep (renamed from Kernel/Builtins/.gitkeep) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/ACPI/.gitkeep (renamed from Kernel/Builtins/ACPI/.gitkeep) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/ACPI/ACPI.hxx (renamed from Kernel/Builtins/ACPI/ACPI.hxx) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/ACPI/ACPIFactoryInterface.hxx (renamed from Kernel/Builtins/ACPI/ACPIFactoryInterface.hxx) | 2 | ||||
| -rw-r--r-- | Kernel/Modules/ACPI/compile_flags.txt (renamed from Kernel/Builtins/ACPI/compile_flags.txt) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/AHCI/.gitkeep (renamed from Kernel/Builtins/AHCI/.gitkeep) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/AHCI/AHCI.hxx (renamed from Kernel/Builtins/AHCI/AHCI.hxx) | 2 | ||||
| -rw-r--r-- | Kernel/Modules/AHCI/compile_flags.txt (renamed from Kernel/Builtins/AHCI/compile_flags.txt) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/APM/.gitkeep (renamed from Kernel/Builtins/APM/.gitkeep) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/ATA/ATA.hxx (renamed from Kernel/Builtins/ATA/ATA.hxx) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/ATA/compile_flags.txt (renamed from Kernel/Builtins/ATA/compile_flags.txt) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/CoreCG/Accessibility.hxx | 59 | ||||
| -rw-r--r-- | Kernel/Modules/CoreCG/CoreCG.hxx (renamed from Kernel/Builtins/GX/GX) | 36 | ||||
| -rw-r--r-- | Kernel/Modules/CoreCG/Lerp.hxx (renamed from Kernel/Builtins/GX/Lerp) | 2 | ||||
| -rw-r--r-- | Kernel/Modules/CoreCG/Rsrc/Cursor.rsrc (renamed from Kernel/Builtins/GX/Rsrc/Cursor.rsrc) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/Flash/Flash.hxx (renamed from Kernel/Builtins/Flash/Flash.hxx) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/GPRS/.keepme (renamed from Kernel/Builtins/GPRS/.keepme) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/HPET/.gitkeep (renamed from Kernel/Builtins/HPET/.gitkeep) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/HPET/Defines.hxx (renamed from Kernel/Builtins/HPET/Defines.hxx) | 4 | ||||
| -rw-r--r-- | Kernel/Modules/IEEE802/.gitkeep (renamed from Kernel/Builtins/IEEE802/.gitkeep) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/IEEE802/compile_flags.txt (renamed from Kernel/Builtins/IEEE802/compile_flags.txt) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/LTE/.keepme (renamed from Kernel/Builtins/LTE/.keepme) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/LTE/IO.hxx (renamed from Kernel/Builtins/LTE/IO.hxx) | 3 | ||||
| -rw-r--r-- | Kernel/Modules/MBCI/Interface.hxx (renamed from Kernel/Builtins/MBCI/Interface.hxx) | 2 | ||||
| -rw-r--r-- | Kernel/Modules/MBCI/MBCI.hxx (renamed from Kernel/Builtins/MBCI/MBCI.hxx) | 2 | ||||
| -rw-r--r-- | Kernel/Modules/NVME/.gitkeep (renamed from Kernel/Builtins/NVME/.gitkeep) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/NVME/compile_flags.txt (renamed from Kernel/Builtins/NVME/compile_flags.txt) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/OHCI/.gitkeep (renamed from Kernel/Builtins/OHCI/.gitkeep) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/PS2/PS2MouseInterface.hxx (renamed from Kernel/Builtins/PS2/PS2MouseInterface.hxx) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/ReadMe.txt (renamed from Kernel/Builtins/ReadMe.txt) | 6 | ||||
| -rw-r--r-- | Kernel/Modules/SCSI/.gitkeep (renamed from Kernel/Builtins/SCSI/.gitkeep) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/SCSI/SCSI.hxx (renamed from Kernel/Builtins/SCSI/SCSI.hxx) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/WiFi/.gitkeep (renamed from Kernel/Builtins/WiFi/.gitkeep) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/WiFi/compile_flags.txt (renamed from Kernel/Builtins/WiFi/compile_flags.txt) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/XHCI/.gitkeep (renamed from Kernel/Builtins/XHCI/.gitkeep) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/XHCI/Defines.hxx (renamed from Kernel/Builtins/XHCI/Defines.hxx) | 0 | ||||
| -rw-r--r-- | Kernel/Modules/XHCI/compile_flags.txt (renamed from Kernel/Builtins/XHCI/compile_flags.txt) | 0 | ||||
| -rw-r--r-- | Kernel/NetworkKit/IPCEP.hxx | 14 | ||||
| -rw-r--r-- | Kernel/NetworkKit/NetworkDevice.hpp | 3 | ||||
| -rw-r--r-- | Kernel/Sources/DriveManager.cxx | 4 | ||||
| -rw-r--r-- | Kernel/Sources/FS/NewFS.cxx | 8 | ||||
| -rw-r--r-- | Kernel/Sources/FileManager.cxx | 13 | ||||
| -rw-r--r-- | Kernel/Sources/IndexableProperty.cxx | 2 | ||||
| -rw-r--r-- | Kernel/Sources/KeMain.cxx | 6 | ||||
| -rw-r--r-- | Kernel/Sources/Network/NetworkDevice.cxx | 2 | ||||
| -rw-r--r-- | Kernel/Sources/PEFCodeManager.cxx | 13 | ||||
| -rw-r--r-- | Kernel/Sources/ProcessScheduler.cxx | 10 | ||||
| -rw-r--r-- | Kernel/Sources/Property.cxx | 2 | ||||
| -rw-r--r-- | Kernel/Sources/SMPManager.cxx | 2 | ||||
| -rw-r--r-- | Kernel/Sources/ThreadLocalStorage.cxx | 3 | ||||
| -rw-r--r-- | Kernel/StorageKit/SCSI.hxx | 2 | ||||
| -rw-r--r-- | Kernel/amd64-efi.make | 2 |
80 files changed, 384 insertions, 266 deletions
diff --git a/Boot/BootKit/BootKit.hxx b/Boot/BootKit/BootKit.hxx index f24f75b2..a253f137 100644 --- a/Boot/BootKit/BootKit.hxx +++ b/Boot/BootKit/BootKit.hxx @@ -26,7 +26,7 @@ /***********************************************************************************/ #include <NewKit/Defines.hpp> -#include <Builtins/ATA/ATA.hxx> +#include <Modules/ATA/ATA.hxx> #include <FirmwareKit/EFI.hxx> @@ -365,7 +365,7 @@ inline Boolean BDiskFormatFactory<BootDev>::Format(const char* partName, BootBlockType* epmBoot = (BootBlockType*)buf; - constexpr auto cFsName = "NewFS"; + constexpr auto cFsName = "NewFS"; constexpr auto cBlockName = "Zeta:"; CopyMem(reinterpret_cast<VoidPtr>(const_cast<Char*>(cFsName)), epmBoot->Fs, StrLen(cFsName)); @@ -385,7 +385,7 @@ inline Boolean BDiskFormatFactory<BootDev>::Format(const char* partName, fDiskDev.Leak().mSize = sectorSz; fDiskDev.Write(buf, sectorSz); - + return true; } else diff --git a/Boot/BootKit/Device.hxx b/Boot/BootKit/Device.hxx index d7ac7a74..ca427dc7 100644 --- a/Boot/BootKit/Device.hxx +++ b/Boot/BootKit/Device.hxx @@ -6,7 +6,7 @@ #pragma once -#include <Builtins/ATA/ATA.hxx> +#include <Modules/ATA/ATA.hxx> using namespace NewOS; diff --git a/Boot/BootKit/HW/ATA.hxx b/Boot/BootKit/HW/ATA.hxx index 6d7c0894..e789a48f 100644 --- a/Boot/BootKit/HW/ATA.hxx +++ b/Boot/BootKit/HW/ATA.hxx @@ -6,7 +6,7 @@ #pragma once -#include <Builtins/ATA/ATA.hxx> +#include <Modules/ATA/ATA.hxx> #include <BootKit/Device.hxx> using namespace NewOS; diff --git a/Boot/BootKit/HW/SATA.hxx b/Boot/BootKit/HW/SATA.hxx index c4dca4c0..f41879cc 100644 --- a/Boot/BootKit/HW/SATA.hxx +++ b/Boot/BootKit/HW/SATA.hxx @@ -7,7 +7,7 @@ #pragma once #include <CompilerKit/CompilerKit.hxx> -#include <Builtins/AHCI/AHCI.hxx> +#include <Modules/AHCI/AHCI.hxx> class BootDeviceSATA final { diff --git a/Boot/BootKit/Vendor/Qr.hxx b/Boot/BootKit/Vendor/Qr.hxx index 7e1e85ed..1cfc214e 100644 --- a/Boot/BootKit/Vendor/Qr.hxx +++ b/Boot/BootKit/Vendor/Qr.hxx @@ -9,7 +9,7 @@ #include <BootKit/Vendor/Shared/bit.h> #include <BootKit/Vendor/QrPrelude.hxx> -#include <Builtins/GX/GX> +#include <Modules/CoreCG/CoreCG.hxx> #include <BootKit/Vendor/Support.hxx> #include <CompilerKit/Detail.hxx> diff --git a/Boot/Sources/HEL/AMD64/BootMain.cxx b/Boot/Sources/HEL/AMD64/BootMain.cxx index 6591f61e..c786c16d 100644 --- a/Boot/Sources/HEL/AMD64/BootMain.cxx +++ b/Boot/Sources/HEL/AMD64/BootMain.cxx @@ -6,7 +6,7 @@ #include <BootKit/BootKit.hxx> #include <BootKit/Rsrc/NewBoot.rsrc> -#include <Builtins/GX/GX> +#include <Modules/CoreCG/CoreCG.hxx> #include <FirmwareKit/EFI.hxx> #include <FirmwareKit/EFI/API.hxx> #include <FirmwareKit/Handover.hxx> @@ -89,10 +89,11 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, /// Splash screen stuff writer.Write(L"Zeta Electronics Corporation (R) newosldr: ") - .Write(BVersionString::The()).Write("\r"); + .Write(BVersionString::The()) + .Write("\r"); #ifndef __DEBUG__ - writer.Write(L"\rnewosldr: AMD64 is only supported in debug mode.\r"); + writer.Write(L"\rnewosldr: AMD64 is only supported in debug mode.\r"); EFI::Stop(); diff --git a/Comm/herror.hxx b/Comm/herror.hxx new file mode 100644 index 00000000..8cf15d17 --- /dev/null +++ b/Comm/herror.hxx @@ -0,0 +1,46 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + +------------------------------------------- */ + +#pragma once + +#include <Comm/newstd.hxx> + +typedef SInt32 HError; + +inline constexpr HError kErrorSuccess = 0; +inline constexpr HError kErrorExecutable = 33; +inline constexpr HError kErrorExecutableLib = 34; // no such library!!! +inline constexpr HError kErrorFileNotFound = 35; +inline constexpr HError kErrorDirectoryNotFound = 36; +inline constexpr HError kErrorDiskReadOnly = 37; +inline constexpr HError kErrorDiskIsFull = 38; +inline constexpr HError kErrorProcessFault = 39; +inline constexpr HError kErrorSocketHangUp = 40; +inline constexpr HError kErrorThreadLocalStorage = 41; +inline constexpr HError kErrorMath = 42; +inline constexpr HError kErrorNoNetwork = 43; +inline constexpr HError kErrorHeapOutOfMemory = 44; +inline constexpr HError kErrorNoSuchDisk = 45; +inline constexpr HError kErrorFileExists = 46; +inline constexpr HError kErrorFormatFailed = 47; +inline constexpr HError kErrorNetworkTimeout = 48; +inline constexpr HError kErrorInternal = 49; +inline constexpr HError kErrorForkAlreadyExists = 50; +inline constexpr HError kErrorOutOfTeamSlot = 51; +inline constexpr HError kErrorHeapNotPresent = 52; +inline constexpr HError kErrorNoEntrypoint = 53; +inline constexpr HError kErrorDiskIsCorrupted = 54; +inline constexpr HError kErrorDisk = 55; +inline constexpr HError kErrorInvalidData = 56; +inline constexpr HError kErrorAsync = 57; +inline constexpr HError kErrorNonBlocking = 58; +inline constexpr HError kErrorUnimplemented = 0; + +#define DbgOk() (kLastError == kErrorSuccess) +#define DbgFailed() (kLastError != kErrorSuccess) +#define DbgLastError() kLastError + +inline HError kLastError = 0; diff --git a/Comm/newstd.hxx b/Comm/newstd.hxx index d7665c78..7362f8e9 100644 --- a/Comm/newstd.hxx +++ b/Comm/newstd.hxx @@ -14,33 +14,33 @@ Purpose: NewOS standard interface. #endif // __KERNEL__
#define ML_IMPORT_CXX extern "C++"
-#define ML_IMPORT_C extern "C"
+#define ML_IMPORT_C extern "C"
#define cRestrictR "r"
#define cRestrictRB "rb"
#define cRestrictW "w"
#define cRestrictRW "rw"
-class NUser; /// @brief User application class.
-class NWindow; /// @brief Window class.
+class NUser; /// @brief User application class.
+class NWindow; /// @brief Window class.
class NWindowAlert; /// @brief Window alert object
-class NURL; /// @brief URL object.
+class NURL; /// @brief URL object.
-typedef void(*NWindowCallback)(NWindow*);
+typedef void (*NWindowCallback)(NWindow*);
-typedef int OSType;
+typedef int OSType;
typedef bool Bool;
typedef void UInt0;
typedef __UINT64_TYPE__ UInt64;
typedef __UINT32_TYPE__ UInt32;
typedef __UINT16_TYPE__ UInt16;
-typedef __UINT8_TYPE__ UInt8;
+typedef __UINT8_TYPE__ UInt8;
typedef __INT64_TYPE__ SInt64;
typedef __INT32_TYPE__ SInt32;
typedef __INT16_TYPE__ SInt16;
-typedef __INT8_TYPE__ SInt8;
+typedef __INT8_TYPE__ SInt8;
/**
@brief Standard library class.
@@ -48,30 +48,30 @@ typedef __INT8_TYPE__ SInt8; class NUser final
{
public:
- // THOSE REQUIRES PERMISSIONS FROM THE USER. ///
+ // THOSE REQUIRES PERMISSIONS FROM THE USER. ///
- static UInt0 Poweroff();
- static UInt0 Reboot();
- static Bool IsWokeup();
+ static UInt0 Poweroff();
+ static UInt0 Reboot();
+ static Bool IsWokeup();
- // THOSE DOESNT REQUIRE PERMISSIONS FROM THE USER. ///
+ // THOSE DOESNT REQUIRE PERMISSIONS FROM THE USER. ///
- static UInt0 Terminate();
- static Bool Exit(OSType code);
- static UInt0* New(long long sz);
- static UInt0 Delete(void* ptr);
+ static UInt0 Terminate();
+ static Bool Exit(OSType code);
+ static UInt0* New(long long sz);
+ static UInt0 Delete(void* ptr);
- // ASK FOR ELEVATION ///
+ // ASK FOR ELEVATION ///
- static Bool RaiseUAC();
+ static Bool RaiseUAC();
- // THOSE MAY REQUIRE PERMISSIONS FROM THE USER. ///
+ // THOSE MAY REQUIRE PERMISSIONS FROM THE USER. ///
- static OSType Open(const char* path);
- static UInt0 Close(OSType fd);
- static NURL* Execute(const NURL* command);
- static UInt0* Read(const char* forkName, OSType fd);
- static UInt0* Write(const char* forkName, OSType fd);
+ static OSType Open(const char* path);
+ static UInt0 Close(OSType fd);
+ static NURL* Execute(const NURL* command);
+ static UInt0* Read(const char* forkName, OSType fd);
+ static UInt0* Write(const char* forkName, OSType fd);
};
/**
@@ -80,61 +80,55 @@ public: class NWindowAlert
{
public:
- explicit NWindowAlert() = default;
- virtual ~NWindowAlert() = default;
+ explicit NWindowAlert() = default;
+ virtual ~NWindowAlert() = default;
public:
- /// @brief Opens an alert dialog.
- virtual NWindowAlert* Alert(const char* message, const char* title) = 0;
+ /// @brief Opens an alert dialog.
+ virtual NWindowAlert* Alert(const char* message, const char* title) = 0;
- /// @brief Makes a prompt dialog.
- virtual NWindowAlert* Prompt(const char* message, const char* title) = 0;
+ /// @brief Makes a prompt dialog.
+ virtual NWindowAlert* Prompt(const char* message, const char* title) = 0;
- /// @brief Makes a prompt notification dialog.
- virtual NWindowAlert* PromptNotification(const char* message, const char* title) = 0;
+ /// @brief Makes a prompt notification dialog.
+ virtual NWindowAlert* PromptNotification(const char* message, const char* title) = 0;
- /// @brief Makes a notification dialog.
- virtual NWindowAlert* Notification(const char* message, const char* title) = 0;
+ /// @brief Makes a notification dialog.
+ virtual NWindowAlert* Notification(const char* message, const char* title) = 0;
- /// Collect result of prompt/notification.
- virtual NWindowAlert* Collect(const char* resultBuf, long resultBufSz) = 0;
+ /// Collect result of prompt/notification.
+ virtual NWindowAlert* Collect(const char* resultBuf, long resultBufSz) = 0;
public:
- Bool fAsyncOperationMode;
- NWindowCallback fAsyncOnComplete;
-
+ Bool fAsyncOperationMode;
+ NWindowCallback fAsyncOnComplete;
};
/// @brief Window object.
class NWindow
{
public:
- explicit NWindow() = default;
- virtual ~NWindow() = default;
+ explicit NWindow() = default;
+ virtual ~NWindow() = default;
public:
- virtual NWindow* New(const char* pageName) = 0;
+ virtual NWindow* New(const char* pageName) = 0;
- virtual NWindow* Ref(NWindow* pagee) = 0;
+ virtual NWindow* Ref(NWindow* pagee) = 0;
- virtual NWindow* Text(const char* text) = 0;
+ virtual NWindow* Text(const char* text) = 0;
- virtual NWindow* Button(const char* text, NWindowCallback onClick = nullptr,
- NWindowCallback onDblClick = nullptr) = 0;
+ virtual NWindow* Button(const char* text, NWindowCallback onClick = nullptr, NWindowCallback onDblClick = nullptr) = 0;
- virtual NWindow* Checkbox(const char* text, NWindowCallback onSelect = nullptr,
- NWindowCallback onUnselect = nullptr) = 0;
+ virtual NWindow* Checkbox(const char* text, NWindowCallback onSelect = nullptr, NWindowCallback onUnselect = nullptr) = 0;
- virtual NWindow* Radio(const char* text, NWindowCallback onSelect = nullptr,
- NWindowCallback onUnselect = nullptr) = 0;
+ virtual NWindow* Radio(const char* text, NWindowCallback onSelect = nullptr, NWindowCallback onUnselect = nullptr) = 0;
- virtual NWindow* Link(const char* where, const char* textIfAny = "", NWindowCallback onClick = nullptr,
- NWindowCallback onHover = nullptr) = 0;
+ virtual NWindow* Link(const char* where, const char* textIfAny = "", NWindowCallback onClick = nullptr, NWindowCallback onHover = nullptr) = 0;
public:
- Bool fWindowEnabled;
- void* fWindowDataPtr;
-
+ Bool fWindowEnabled;
+ void* fWindowDataPtr;
};
/**
@@ -143,15 +137,14 @@ This class contains an URL class NURL
{
public:
- explicit NURL() = default;
- virtual ~NURL() = default;
+ explicit NURL() = default;
+ virtual ~NURL() = default;
public:
- virtual NURL* Navigate(const char* url) = 0;
- virtual NURL* Protocol(const char* protocol) = 0;
+ virtual NURL* Navigate(const char* url) = 0;
+ virtual NURL* Protocol(const char* protocol) = 0;
public:
- char* fBufferPtr;
- long fBufferLen;
-
+ char* fBufferPtr;
+ long fBufferLen;
};
diff --git a/Drv/VideoDrv/VideoDrv.c b/Drv/VideoDrv/VideoDrv.c index 2e389358..742abaf2 100644 --- a/Drv/VideoDrv/VideoDrv.c +++ b/Drv/VideoDrv/VideoDrv.c @@ -6,7 +6,7 @@ #include <DDK/KernelString.h> #include <DDK/KernelPrint.h> -#include <Builtins/GX/GX> +#include <Modules/CoreCG/CoreCG.hxx> int __at_enter(void) { diff --git a/Kernel/FSKit/IndexableProperty.hxx b/Kernel/FSKit/IndexableProperty.hxx index 892083a2..9e9ccf22 100644 --- a/Kernel/FSKit/IndexableProperty.hxx +++ b/Kernel/FSKit/IndexableProperty.hxx @@ -24,7 +24,6 @@ namespace NewOS Char Path[kIndexerNodeNameLength]; }; - class IndexableProperty final : public Property { public: @@ -32,7 +31,7 @@ namespace NewOS : Property(StringBuilder::Construct("\\Filesystem\\IsIndexable?").Leak().Leak()) { } - + ~IndexableProperty() override = default; NEWOS_COPY_DEFAULT(IndexableProperty); diff --git a/Kernel/FirmwareKit/EFI/API.hxx b/Kernel/FirmwareKit/EFI/API.hxx index 0f7da5a4..691c19d7 100644 --- a/Kernel/FirmwareKit/EFI/API.hxx +++ b/Kernel/FirmwareKit/EFI/API.hxx @@ -21,7 +21,7 @@ class BTextWriter; #include <BootKit/BootKit.hxx> #include <BootKit/Rsrc/NewBootFatal.rsrc> #include <BootKit/Vendor/Qr.hxx> -#include <Builtins/GX/GX> +#include <Modules/CoreCG/CoreCG.hxx> #endif // ifdef __NEWBOOT__ inline EfiSystemTable* ST = nullptr; diff --git a/Kernel/FirmwareKit/EPM.hxx b/Kernel/FirmwareKit/EPM.hxx index b3f17889..3b2335cf 100644 --- a/Kernel/FirmwareKit/EPM.hxx +++ b/Kernel/FirmwareKit/EPM.hxx @@ -44,7 +44,7 @@ struct PACKED BootBlock NewOS::Int16 Kind; NewOS::Int32 FsVersion; NewOS::Char Fs[kEPMFilesystemLength]; /* NewFS, ffs2... */ - NewOS::Char Reserved[409]; // to fill a full sector. + NewOS::Char Reserved[409]; // to fill a full sector. }; /* @brief AMD64 magic for EPM */ @@ -107,11 +107,11 @@ typedef struct BootBlock BootBlockType; #define kEPMStartPartitionBlk (sizeof(BootBlock)) ///! @brief Current EPM revision -#define kEPMRevision (0xAD) +#define kEPMRevision (0xAD) ///! @brief Current EPM revision #define kEPMRevisionUEFI (0xAF) /// !@brief EPM base address -#define kEpmBase (0U) +#define kEpmBase (0U) /// END OF SPECS diff --git a/Kernel/HALKit/AMD64/HalACPIFactoryInterface.cxx b/Kernel/HALKit/AMD64/HalACPIFactoryInterface.cxx index 213be057..7a54edfa 100644 --- a/Kernel/HALKit/AMD64/HalACPIFactoryInterface.cxx +++ b/Kernel/HALKit/AMD64/HalACPIFactoryInterface.cxx @@ -4,7 +4,7 @@ ------------------------------------------- */ -#include <Builtins/ACPI/ACPIFactoryInterface.hxx> +#include <Modules/ACPI/ACPIFactoryInterface.hxx> #include <HALKit/AMD64/Processor.hpp> #include <NewKit/String.hpp> #include <ArchKit/ArchKit.hpp> diff --git a/Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp b/Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp index c8eb094c..e4a2d99c 100644 --- a/Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp +++ b/Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp @@ -4,7 +4,7 @@ ------------------------------------------- */ -#include <Builtins/ACPI/ACPIFactoryInterface.hxx> +#include <Modules/ACPI/ACPIFactoryInterface.hxx> #include <HALKit/AMD64/Processor.hpp> #include <NewKit/KernelCheck.hpp> #include <ArchKit/ArchKit.hpp> diff --git a/Kernel/HALKit/AMD64/HalHart.cpp b/Kernel/HALKit/AMD64/HalHart.cpp index 069f3767..4718d4ab 100644 --- a/Kernel/HALKit/AMD64/HalHart.cpp +++ b/Kernel/HALKit/AMD64/HalHart.cpp @@ -29,6 +29,5 @@ namespace NewOS { /* nohing, code is spinning */ } - } } // namespace NewOS diff --git a/Kernel/HALKit/AMD64/HalKernelMain.cxx b/Kernel/HALKit/AMD64/HalKernelMain.cxx index 88add1d1..0381e4ab 100644 --- a/Kernel/HALKit/AMD64/HalKernelMain.cxx +++ b/Kernel/HALKit/AMD64/HalKernelMain.cxx @@ -5,7 +5,7 @@ ------------------------------------------- */ #include <ArchKit/ArchKit.hpp> -#include <Builtins/GX/GX> +#include <Modules/CoreCG/CoreCG.hxx> #include <FirmwareKit/Handover.hxx> #include <KernelKit/FileManager.hpp> #include <KernelKit/Framebuffer.hpp> @@ -14,6 +14,7 @@ #include <KernelKit/ProcessScheduler.hxx> #include <KernelKit/UserHeap.hpp> #include <NewKit/Json.hpp> +#include <Modules/CoreCG/Accessibility.hxx> #include <KernelKit/CodeManager.hpp> /// @brief This symbol is the kernel main symbol. @@ -24,7 +25,7 @@ EXTERN_C NewOS::VoidPtr kInterruptVectorTable[]; struct PACKED HeapAllocInfo final { NewOS::VoidPtr fThe; - NewOS::Size fTheSz; + NewOS::Size fTheSz; }; struct PACKED ProcessBlockInfo final @@ -38,7 +39,7 @@ struct PACKED ProcessExitInfo final STATIC constexpr auto cReasonLen = 512; NewOS::Int64 fCode; - NewOS::Char fReason[cReasonLen]; + NewOS::Char fReason[cReasonLen]; }; namespace NewOS::HAL @@ -98,30 +99,30 @@ EXTERN_C void hal_init_platform( register basic syscalls. */ - constexpr auto cSerialWriteInterrupt = 0x10; // 16 - constexpr auto cTlsInterrupt = 0x11; // 17 - constexpr auto cTlsInstallInterrupt = 0x12; // 18 - constexpr auto cNewInterrupt = 0x13; // 19 - constexpr auto cDeleteInterrupt = 0x14; // 20 - constexpr auto cExitInterrupt = 0x15; - constexpr auto cLastExitInterrupt = 0x16; - constexpr auto cCatalogOpen = 0x17; - constexpr auto cForkRead = 0x18; - constexpr auto cForkWrite = 0x19; - constexpr auto cCatalogClose = 0x20; - constexpr auto cCatalogRemove = 0x21; - constexpr auto cCatalogCreate = 0x22; - - kSyscalls[cSerialWriteInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx) -> void { + constexpr auto cSerialAlertInterrupt = 0x10; // 16 + constexpr auto cTlsInterrupt = 0x11; // 17 + constexpr auto cTlsInstallInterrupt = 0x12; // 18 + constexpr auto cNewInterrupt = 0x13; // 19 + constexpr auto cDeleteInterrupt = 0x14; // 20 + constexpr auto cExitInterrupt = 0x15; + constexpr auto cLastExitInterrupt = 0x16; + constexpr auto cCatalogOpen = 0x17; + constexpr auto cForkRead = 0x18; + constexpr auto cForkWrite = 0x19; + constexpr auto cCatalogClose = 0x20; + constexpr auto cCatalogRemove = 0x21; + constexpr auto cCatalogCreate = 0x22; + + kSyscalls[cSerialAlertInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx) -> void { const char* msg = (const char*)rdx; NewOS::kcout << "newoskrnl: " << msg << "\r"; }; - kSyscalls[cTlsInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx)->void { + kSyscalls[cTlsInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx) -> void { tls_check_syscall_impl(rdx); }; - kSyscalls[cNewInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx)->void { + kSyscalls[cNewInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx) -> void { /// get HAC struct. HeapAllocInfo* rdxInf = reinterpret_cast<HeapAllocInfo*>(rdx); @@ -129,7 +130,7 @@ EXTERN_C void hal_init_platform( rdxInf->fThe = NewOS::ProcessScheduler::The().Leak().TheCurrent().Leak().New(rdxInf->fTheSz); }; - kSyscalls[cDeleteInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx)->void { + kSyscalls[cDeleteInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx) -> void { /// get HAC struct. HeapAllocInfo* rdxInf = reinterpret_cast<HeapAllocInfo*>(rdx); @@ -137,36 +138,37 @@ EXTERN_C void hal_init_platform( NewOS::ProcessScheduler::The().Leak().TheCurrent().Leak().Delete(rdxInf->fThe, rdxInf->fTheSz); }; - kSyscalls[cTlsInstallInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx)->void { + kSyscalls[cTlsInstallInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx) -> void { ProcessBlockInfo* rdxPb = reinterpret_cast<ProcessBlockInfo*>(rdx); /// install the process's fTIB and fPIB. rt_install_tib(rdxPb->fTIB, rdxPb->fPIB); }; - kSyscalls[cExitInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx)->void { + kSyscalls[cExitInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx) -> void { ProcessExitInfo* rdxEi = reinterpret_cast<ProcessExitInfo*>(rdx); NewOS::kcout << "newoskrnl: " << rdxEi->fReason << "\r"; NewOS::ProcessScheduler::The().Leak().TheCurrent().Leak().Exit(rdxEi->fCode); }; - kSyscalls[cLastExitInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx)->void { + kSyscalls[cLastExitInterrupt].Leak().Leak()->fProc = [](NewOS::VoidPtr rdx) -> void { ProcessExitInfo* rdxEi = reinterpret_cast<ProcessExitInfo*>(rdx); - rdxEi->fCode = NewOS::rt_get_exit_code(); + rdxEi->fCode = NewOS::rt_get_exit_code(); }; - kSyscalls[cSerialWriteInterrupt].Leak().Leak()->fHooked = true; - kSyscalls[cTlsInterrupt].Leak().Leak()->fHooked = true; - kSyscalls[cTlsInstallInterrupt].Leak().Leak()->fHooked = true; - kSyscalls[cDeleteInterrupt].Leak().Leak()->fHooked = true; - kSyscalls[cNewInterrupt].Leak().Leak()->fHooked = true; - kSyscalls[cExitInterrupt].Leak().Leak()->fHooked = true; - kSyscalls[cLastExitInterrupt].Leak().Leak()->fHooked = true; - - KeMain(); + kSyscalls[cSerialAlertInterrupt].Leak().Leak()->fHooked = true; + kSyscalls[cTlsInterrupt].Leak().Leak()->fHooked = true; + kSyscalls[cTlsInstallInterrupt].Leak().Leak()->fHooked = true; + kSyscalls[cDeleteInterrupt].Leak().Leak()->fHooked = true; + kSyscalls[cNewInterrupt].Leak().Leak()->fHooked = true; + kSyscalls[cExitInterrupt].Leak().Leak()->fHooked = true; + kSyscalls[cLastExitInterrupt].Leak().Leak()->fHooked = true; + NewOS::UIAccessibilty::The().Show("RCM", NewOS::UIAccessibilty::The().Width(), NewOS::UIAccessibilty::The().Height()); NewOS::HAL::hal_system_get_cores(kHandoverHeader->f_HardwareTables.f_RsdPtr); + KeMain(); + NewOS::ke_stop(RUNTIME_CHECK_BOOTSTRAP); } diff --git a/Kernel/HALKit/AMD64/HalKernelMouse.cxx b/Kernel/HALKit/AMD64/HalKernelMouse.cxx index 5d50e4f2..71644d46 100644 --- a/Kernel/HALKit/AMD64/HalKernelMouse.cxx +++ b/Kernel/HALKit/AMD64/HalKernelMouse.cxx @@ -4,9 +4,9 @@ ------------------------------------------- */ -#include <Builtins/PS2/PS2MouseInterface.hxx> -#include <Builtins/GX/GX> -#include <Builtins/GX/Rsrc/Cursor.rsrc> +#include <Modules/PS2/PS2MouseInterface.hxx> +#include <Modules/CoreCG/CoreCG.hxx> +#include <Modules/CoreCG/Rsrc/Cursor.rsrc> #include <KernelKit/Framebuffer.hpp> #include <NewKit/Defines.hpp> diff --git a/Kernel/HALKit/AMD64/HalPageAlloc.hpp b/Kernel/HALKit/AMD64/HalPageAlloc.hpp index 332c8ed4..bda7d902 100644 --- a/Kernel/HALKit/AMD64/HalPageAlloc.hpp +++ b/Kernel/HALKit/AMD64/HalPageAlloc.hpp @@ -38,16 +38,16 @@ namespace NewOS::HAL { struct PACKED PageTable64 final { - bool Present : 1; - bool Rw : 1; - bool User : 1; - bool Wt : 1; - bool Cache : 1; - bool Accessed : 1; - NewOS::Int32 Reserved : 6; + bool Present : 1; + bool Rw : 1; + bool User : 1; + bool Wt : 1; + bool Cache : 1; + bool Accessed : 1; + NewOS::Int32 Reserved : 6; NewOS::UInt64 PhysicalAddress : 36; - NewOS::Int32 Reserved1 : 15; - bool ExecDisable : 1; + NewOS::Int32 Reserved1 : 15; + bool ExecDisable : 1; }; namespace Detail diff --git a/Kernel/HALKit/AMD64/Processor.hpp b/Kernel/HALKit/AMD64/Processor.hpp index 98a5aee6..d39a7984 100644 --- a/Kernel/HALKit/AMD64/Processor.hpp +++ b/Kernel/HALKit/AMD64/Processor.hpp @@ -28,10 +28,10 @@ #define IsActiveLow(FLG) (FLG & 2) #define IsLevelTriggered(FLG) (FLG & 8) -#define kInterruptGate (0x8E) -#define kTrapGate (0xEF) -#define kTaskGate (0b10001100) -#define kGdtCodeSelector (0x08) +#define kInterruptGate (0x8E) +#define kTrapGate (0xEF) +#define kTaskGate (0b10001100) +#define kGdtCodeSelector (0x08) #define cHeapStartOffset (0x10000000) namespace NewOS @@ -54,7 +54,7 @@ namespace NewOS namespace NewOS::HAL { - /// @brief Virtual memory flags. + /// @brief Virtual memory flags. enum { eFlagsUser, @@ -147,7 +147,7 @@ namespace NewOS::HAL using RawRegister = UInt64; - using InterruptId = UShort; /* For each element in the IVT */ + using InterruptId = UShort; /* For each element in the IVT */ using InterruptTrapKind = UIntPtr(UIntPtr sp); typedef UIntPtr Reg; diff --git a/Kernel/HALKit/AMD64/Storage/AHCI.cxx b/Kernel/HALKit/AMD64/Storage/AHCI.cxx index 587c64cb..8555b3de 100644 --- a/Kernel/HALKit/AMD64/Storage/AHCI.cxx +++ b/Kernel/HALKit/AMD64/Storage/AHCI.cxx @@ -15,7 +15,7 @@ * */ -#include <Builtins/AHCI/AHCI.hxx> +#include <Modules/AHCI/AHCI.hxx> #include <KernelKit/PCI/Iterator.hpp> #ifdef __AHCI__ diff --git a/Kernel/HALKit/AMD64/Storage/ATA-DMA.cxx b/Kernel/HALKit/AMD64/Storage/ATA-DMA.cxx index 4e41e3ce..b6dacf21 100644 --- a/Kernel/HALKit/AMD64/Storage/ATA-DMA.cxx +++ b/Kernel/HALKit/AMD64/Storage/ATA-DMA.cxx @@ -17,7 +17,7 @@ #include <StorageKit/PRDT.hpp> -#include <Builtins/ATA/ATA.hxx> +#include <Modules/ATA/ATA.hxx> #include <ArchKit/ArchKit.hpp> using namespace NewOS; @@ -28,11 +28,11 @@ STATIC PRDT kPRDT; #ifdef __ATA_DMA__ #ifdef __ATA_PIO__ -#error !!! You cant have both PIO and DMA enabled! !!! +#error !!! You cant have both PIO and DMA enabled! !!! #endif /* ifdef __ATA_PIO__ */ #ifdef __AHCI__ -#error !!! You cant have both ATA and AHCI enabled! !!! +#error !!! You cant have both ATA and AHCI enabled! !!! #endif /* ifdef __AHCI__ */ #endif /* ifdef __ATA_DMA__ */ diff --git a/Kernel/HALKit/AMD64/Storage/ATA-PIO.cxx b/Kernel/HALKit/AMD64/Storage/ATA-PIO.cxx index e4ab1367..7853d497 100644 --- a/Kernel/HALKit/AMD64/Storage/ATA-PIO.cxx +++ b/Kernel/HALKit/AMD64/Storage/ATA-PIO.cxx @@ -15,7 +15,7 @@ * */ -#include <Builtins/ATA/ATA.hxx> +#include <Modules/ATA/ATA.hxx> #include <ArchKit/ArchKit.hpp> #ifdef __ATA_PIO__ diff --git a/Kernel/HALKit/ARM64/HalPageAlloc.hpp b/Kernel/HALKit/ARM64/HalPageAlloc.hpp index 2959f0fc..fbdbfea8 100644 --- a/Kernel/HALKit/ARM64/HalPageAlloc.hpp +++ b/Kernel/HALKit/ARM64/HalPageAlloc.hpp @@ -29,31 +29,43 @@ //! short format address range #define c16KBPage 0b000 -#define c8KBPage 0b001 -#define c4KBPage 0b010 -#define c2KBPage 0b011 -#define c1KBPage 0b100 +#define c8KBPage 0b001 +#define c4KBPage 0b010 +#define c2KBPage 0b011 +#define c1KBPage 0b100 #define c512BPage 0b101 #define c256BPage 0b110 #define c128BPage 0b111 /// Long format address range -#define cPageMAll { 0b000, 0b000 } -#define cPageMToMax(M) { M, 0b000 } -#define cPageMaxToM(M) { 0b000, M } -#define cPageMToN(M, N) { M, N } +#define cPageMAll \ + { \ + 0b000, 0b000 \ + } +#define cPageMToMax(M) \ + { \ + M, 0b000 \ + } +#define cPageMaxToM(M) \ + { \ + 0b000, M \ + } +#define cPageMToN(M, N) \ + { \ + M, N \ + } namespace NewOS::HAL { struct PACKED LongDescLevel3 final { - Boolean Present : 1; - Boolean Rw : 1; - UInt16 Lpat : 9; - UInt32 Address : 27; - UInt32 Sbzp : 12; - UInt32 UPat : 11; + Boolean Present : 1; + Boolean Rw : 1; + UInt16 Lpat : 9; + UInt32 Address : 27; + UInt32 Sbzp : 12; + UInt32 UPat : 11; }; namespace Detail diff --git a/Kernel/HALKit/ARM64/Processor.hxx b/Kernel/HALKit/ARM64/Processor.hxx index ae0fc86d..d9a86270 100644 --- a/Kernel/HALKit/ARM64/Processor.hxx +++ b/Kernel/HALKit/ARM64/Processor.hxx @@ -27,13 +27,13 @@ namespace NewOS::HAL { - struct PACKED Register64 final + struct PACKED Register64 final { UShort Limit; UIntPtr Base; }; - typedef UIntPtr Reg; + typedef UIntPtr Reg; typedef Register64 Register; struct PACKED StackFrame final @@ -45,7 +45,7 @@ namespace NewOS::HAL }; typedef StackFrame* StackFramePtr; -} +} // namespace NewOS::HAL inline NewOS::VoidPtr kKernelVirtualStart = (NewOS::VoidPtr)cHeapStartOffset; inline NewOS::UIntPtr kKernelVirtualSize = 0UL; diff --git a/Kernel/KernelKit/FileManager.hpp b/Kernel/KernelKit/FileManager.hpp index c154438e..a687b301 100644 --- a/Kernel/KernelKit/FileManager.hpp +++ b/Kernel/KernelKit/FileManager.hpp @@ -50,7 +50,8 @@ namespace NewOS }; /// @brief filesystem node generic type. - struct PACKED FMNode final { + struct PACKED FMNode final + { VoidPtr _Unused; }; @@ -95,19 +96,23 @@ namespace NewOS virtual NodePtr Open(_Input const char* path, _Input const char* r) = 0; public: - virtual Void Write(_Input NodePtr node, _Input VoidPtr data, - _Input Int32 flags, _Input SizeT size) = 0; - + virtual Void Write(_Input NodePtr node, _Input VoidPtr data, _Input Int32 flags, _Input SizeT size) = 0; + virtual _Output VoidPtr Read(_Input NodePtr node, - _Input Int32 flags, _Input SizeT sz) = 0; - + _Input Int32 flags, + _Input SizeT sz) = 0; + virtual Void Write(_Input const Char* name, - _Input NodePtr node, _Input VoidPtr data, - _Input Int32 flags, _Input SizeT size) = 0; + _Input NodePtr node, + _Input VoidPtr data, + _Input Int32 flags, + _Input SizeT size) = 0; virtual _Output VoidPtr Read(_Input const Char* name, - _Input NodePtr node, - _Input Int32 flags, _Input SizeT sz) = 0; + _Input NodePtr node, + _Input Int32 flags, + _Input SizeT sz) = 0; + public: virtual bool Seek(_Input NodePtr node, _Input SizeT off) = 0; @@ -143,17 +148,18 @@ namespace NewOS bool Seek(NodePtr node, SizeT off); SizeT Tell(NodePtr node) override; bool Rewind(NodePtr node) override; - + Void Write(_Input const Char* name, - _Input NodePtr node, _Input VoidPtr data, - _Input Int32 flags, - _Input SizeT size) override; + _Input NodePtr node, + _Input VoidPtr data, + _Input Int32 flags, + _Input SizeT size) override; _Output VoidPtr Read(_Input const Char* name, - _Input NodePtr node, - _Input Int32 flags, - _Input SizeT sz) override; - + _Input NodePtr node, + _Input Int32 flags, + _Input SizeT sz) override; + public: void SetResourceFork(const char* forkName); void SetDataFork(const char* forkName); @@ -292,7 +298,7 @@ namespace NewOS using FileStreamUTF16 = FileStream<WideChar>; typedef UInt64 CursorType; - + /// @brief constructor template <typename Encoding, typename Class> FileStream<Encoding, Class>::FileStream(const Encoding* path, @@ -303,7 +309,7 @@ namespace NewOS } /// @brief destructor - template<typename Encoding, typename Class> + template <typename Encoding, typename Class> FileStream<Encoding, Class>::~FileStream() { delete fFile; diff --git a/Kernel/KernelKit/HError.hpp b/Kernel/KernelKit/HError.hpp index 61cfd5af..a160508d 100644 --- a/Kernel/KernelKit/HError.hpp +++ b/Kernel/KernelKit/HError.hpp @@ -8,6 +8,10 @@ #include <NewKit/Defines.hpp> +#define DbgOk() (kLastError == NewOS::kErrorSuccess) +#define DbgFailed() (kLastError != NewOS::kErrorSuccess) +#define DbgLastError() kLastError + namespace NewOS { typedef Int32 HError; @@ -37,13 +41,11 @@ namespace NewOS inline constexpr HError kErrorDiskIsCorrupted = 54; inline constexpr HError kErrorDisk = 55; inline constexpr HError kErrorInvalidData = 56; + inline constexpr HError kErrorAsync = 57; + inline constexpr HError kErrorNonBlocking = 58; inline constexpr HError kErrorUnimplemented = 0; Boolean ke_bug_check(void) noexcept; } // namespace NewOS -#define DbgOk() (kLastError == NewOS::kErrorSuccess) -#define DbgFailed() (kLastError != NewOS::kErrorSuccess) -#define DbgLastError() kLastError - inline NewOS::HError kLastError = 0; diff --git a/Kernel/KernelKit/PEFCodeManager.hxx b/Kernel/KernelKit/PEFCodeManager.hxx index 32ebfe8e..1faecb5e 100644 --- a/Kernel/KernelKit/PEFCodeManager.hxx +++ b/Kernel/KernelKit/PEFCodeManager.hxx @@ -47,10 +47,10 @@ namespace NewOS private: OwnPtr<FileStream<Char>> fFile; - Ref<StringView> fPath; - VoidPtr fCachedBlob; - bool fFatBinary; - bool fBad; + Ref<StringView> fPath; + VoidPtr fCachedBlob; + bool fFatBinary; + bool fBad; }; namespace Utils diff --git a/Kernel/KernelKit/ProcessScheduler.hxx b/Kernel/KernelKit/ProcessScheduler.hxx index 633cdca3..98008d69 100644 --- a/Kernel/KernelKit/ProcessScheduler.hxx +++ b/Kernel/KernelKit/ProcessScheduler.hxx @@ -121,8 +121,8 @@ namespace NewOS }; // Helper types. - using ImagePtr = VoidPtr; - using HeapPtrKind = VoidPtr; + using ImagePtr = VoidPtr; + using HeapPtrKind = VoidPtr; // @name ProcessHeader // @brief Process Header (PH) @@ -152,9 +152,9 @@ namespace NewOS ProcessStatus Status; // Memory, images. - HeapPtrKind HeapCursor{nullptr}; - ImagePtr Image{nullptr}; - HeapPtrKind HeapPtr{nullptr}; + HeapPtrKind HeapCursor{nullptr}; + ImagePtr Image{nullptr}; + HeapPtrKind HeapPtr{nullptr}; // memory usage SizeT UsedMemory{0}; @@ -266,9 +266,9 @@ namespace NewOS class ProcessHelper final { public: - static bool Switch(HAL::StackFrame* newStack, const PID& newPid); - static bool CanBeScheduled(Ref<ProcessHeader>& process); - static PID& TheCurrentPID(); + static bool Switch(HAL::StackFrame* newStack, const PID& newPid); + static bool CanBeScheduled(Ref<ProcessHeader>& process); + static PID& TheCurrentPID(); static SizeT StartScheduling(); }; diff --git a/Kernel/Builtins/.gitkeep b/Kernel/Modules/.gitkeep index e69de29b..e69de29b 100644 --- a/Kernel/Builtins/.gitkeep +++ b/Kernel/Modules/.gitkeep diff --git a/Kernel/Builtins/ACPI/.gitkeep b/Kernel/Modules/ACPI/.gitkeep index e69de29b..e69de29b 100644 --- a/Kernel/Builtins/ACPI/.gitkeep +++ b/Kernel/Modules/ACPI/.gitkeep diff --git a/Kernel/Builtins/ACPI/ACPI.hxx b/Kernel/Modules/ACPI/ACPI.hxx index 019bcb11..019bcb11 100644 --- a/Kernel/Builtins/ACPI/ACPI.hxx +++ b/Kernel/Modules/ACPI/ACPI.hxx diff --git a/Kernel/Builtins/ACPI/ACPIFactoryInterface.hxx b/Kernel/Modules/ACPI/ACPIFactoryInterface.hxx index 7da42f33..7fbe6192 100644 --- a/Kernel/Builtins/ACPI/ACPIFactoryInterface.hxx +++ b/Kernel/Modules/ACPI/ACPIFactoryInterface.hxx @@ -7,7 +7,7 @@ #ifndef __ACPI_MANAGER__ #define __ACPI_MANAGER__ -#include <Builtins/ACPI/ACPI.hxx> +#include <Modules/ACPI/ACPI.hxx> #include <KernelKit/DebugOutput.hpp> #include <NewKit/Defines.hpp> #include <NewKit/Ref.hpp> diff --git a/Kernel/Builtins/ACPI/compile_flags.txt b/Kernel/Modules/ACPI/compile_flags.txt index 1bc51142..1bc51142 100644 --- a/Kernel/Builtins/ACPI/compile_flags.txt +++ b/Kernel/Modules/ACPI/compile_flags.txt diff --git a/Kernel/Builtins/AHCI/.gitkeep b/Kernel/Modules/AHCI/.gitkeep index e69de29b..e69de29b 100644 --- a/Kernel/Builtins/AHCI/.gitkeep +++ b/Kernel/Modules/AHCI/.gitkeep diff --git a/Kernel/Builtins/AHCI/AHCI.hxx b/Kernel/Modules/AHCI/AHCI.hxx index a62d02cd..b090c229 100644 --- a/Kernel/Builtins/AHCI/AHCI.hxx +++ b/Kernel/Modules/AHCI/AHCI.hxx @@ -14,7 +14,7 @@ #pragma once #include <NewKit/Defines.hpp> -#include <Builtins/ACPI/ACPI.hxx> +#include <Modules/ACPI/ACPI.hxx> // Forward declarations of structs. diff --git a/Kernel/Builtins/AHCI/compile_flags.txt b/Kernel/Modules/AHCI/compile_flags.txt index 1bc51142..1bc51142 100644 --- a/Kernel/Builtins/AHCI/compile_flags.txt +++ b/Kernel/Modules/AHCI/compile_flags.txt diff --git a/Kernel/Builtins/APM/.gitkeep b/Kernel/Modules/APM/.gitkeep index e69de29b..e69de29b 100644 --- a/Kernel/Builtins/APM/.gitkeep +++ b/Kernel/Modules/APM/.gitkeep diff --git a/Kernel/Builtins/ATA/ATA.hxx b/Kernel/Modules/ATA/ATA.hxx index 98732c72..98732c72 100644 --- a/Kernel/Builtins/ATA/ATA.hxx +++ b/Kernel/Modules/ATA/ATA.hxx diff --git a/Kernel/Builtins/ATA/compile_flags.txt b/Kernel/Modules/ATA/compile_flags.txt index 1bc51142..1bc51142 100644 --- a/Kernel/Builtins/ATA/compile_flags.txt +++ b/Kernel/Modules/ATA/compile_flags.txt diff --git a/Kernel/Modules/CoreCG/Accessibility.hxx b/Kernel/Modules/CoreCG/Accessibility.hxx new file mode 100644 index 00000000..7f310719 --- /dev/null +++ b/Kernel/Modules/CoreCG/Accessibility.hxx @@ -0,0 +1,59 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + +------------------------------------------- */ + +#pragma once + +#include "CompilerKit/Detail.hxx" +#include <NewKit/NewKit.hpp> +#include <KernelKit/HError.hpp> +#include <Modules/CoreCG/CoreCG.hxx> +#include <Modules/CoreCG/Lerp.hxx> +#include <ArchKit/ArchKit.hpp> + +namespace NewOS +{ + inline Bool cKTSyncCall = false; + + inline float cDeviceWidthAlert = 150; + inline float cDeviceHeightAlert = 141; + + class UIAccessibilty final + { + explicit UIAccessibilty() = default; + + public: + NEWOS_COPY_DELETE(UIAccessibilty); + + static UIAccessibilty& The() + { + static UIAccessibilty the; + return the; + } + + Int32 Show(const char* text, int x, int y) + { + if (!text || *text == 0) + return kErrorHeapNotPresent; + + // GXDrawText("Sleek", text, cDeviceWidthAlert, x, cDeviceHeightAlert, y); + + if (cKTSyncCall) + return kErrorAsync; + + return kErrorSuccess; + } + + Int64 Width() noexcept + { + return kHandoverHeader->f_GOP.f_Width; + } + + Int64 Height() noexcept + { + return kHandoverHeader->f_GOP.f_Height; + } + }; +} // namespace NewOS diff --git a/Kernel/Builtins/GX/GX b/Kernel/Modules/CoreCG/CoreCG.hxx index 62fdb006..5720ef13 100644 --- a/Kernel/Builtins/GX/GX +++ b/Kernel/Modules/CoreCG/CoreCG.hxx @@ -10,13 +10,15 @@ #define GXInit() NewOS::SizeT __GXCursor = 0 -#define gxClearClr RGB(00, 00, 00) +#define GXRgba(R, G, B) (UInt32)(R | G | B) + +#define gxClearClr RGB(9d, 9d, 9d) #define GXFini() __GXCursor = 0 /// @brief Performs OR drawing on the framebuffer. -#define GXDrawAlphaImg(ImgPtr, _Height, _Width, BaseX, BaseY) \ - __GXCursor = 0; \ +#define GXDrawAlphaImg(ImgPtr, _Height, _Width, BaseX, BaseY) \ + __GXCursor = 0; \ \ for (NewOS::SizeT i = BaseX; i < (_Height + BaseX); ++i) \ { \ @@ -25,15 +27,15 @@ *(((volatile NewOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ i + \ - 4 * u))) |= ImgPtr[__GXCursor]; \ + 4 * u))) |= ImgPtr[__GXCursor]; \ \ - ++__GXCursor; \ + ++__GXCursor; \ } \ } /// @brief Draws a resource. -#define GXDrawImg(ImgPtr, _Height, _Width, BaseX, BaseY) \ - __GXCursor = 0; \ +#define GXDrawImg(ImgPtr, _Height, _Width, BaseX, BaseY) \ + __GXCursor = 0; \ \ for (NewOS::SizeT i = BaseX; i < (_Height + BaseX); ++i) \ { \ @@ -42,14 +44,14 @@ *(((volatile NewOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ i + \ - 4 * u))) = ImgPtr[__GXCursor]; \ + 4 * u))) = ImgPtr[__GXCursor]; \ \ - ++__GXCursor; \ + ++__GXCursor; \ } \ } /// @brief Cleans a resource. -#define GXClear(_Height, _Width, BaseX, BaseY) \ +#define GXClear(_Height, _Width, BaseX, BaseY) \ \ for (NewOS::SizeT i = BaseX; i < _Height + BaseX; ++i) \ { \ @@ -58,12 +60,12 @@ *(((volatile NewOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ i + \ - 4 * u))) = gxClearClr; \ + 4 * u))) = gxClearClr; \ } \ } /// @brief Draws inside a zone. -#define GXDraw(_Clr, _Height, _Width, BaseX, BaseY) \ +#define GXDraw(_Clr, _Height, _Width, BaseX, BaseY) \ \ for (NewOS::SizeT i = BaseX; i < (_Width + BaseX); ++i) \ { \ @@ -76,16 +78,16 @@ } \ } -/// This is enabled if Cairo is compiled with GX. +/// This is enabled if Cairo is compiled with CoreCG. #ifdef __CG_USE_GX__ -/// @brief This function creates a new framebuffer for GX. +/// @brief This function creates a new framebuffer for CoreCG. /// @return inline cairo_surface_t* GXCreateFramebufferCairo() { - cairo_format_t format = CAIRO_FORMAT_ARGB32; + cairo_format_t format = CAIRO_FORMAT_ARGB32; - NewOS::Int32 stride = cairo_format_stride_for_width(format, kHandoverHeader->f_GOP.f_Width); + NewOS::Int32 stride = cairo_format_stride_for_width(format, kHandoverHeader->f_GOP.f_Width); - return cairo_image_surface_create_for_data((unsigned char *)kHandoverHeader->f_GOP.f_The, format, kHandoverHeader->f_GOP.f_Width, kHandoverHeader->f_GOP.f_Height, stride); + return cairo_image_surface_create_for_data((unsigned char*)kHandoverHeader->f_GOP.f_The, format, kHandoverHeader->f_GOP.f_Width, kHandoverHeader->f_GOP.f_Height, stride); } #endif diff --git a/Kernel/Builtins/GX/Lerp b/Kernel/Modules/CoreCG/Lerp.hxx index eff198ee..b62a8266 100644 --- a/Kernel/Builtins/GX/Lerp +++ b/Kernel/Modules/CoreCG/Lerp.hxx @@ -17,6 +17,6 @@ typedef float GXReal; /// @param at which state we're at **to**. inline GXReal GXLerp(GXReal to, GXReal from, GXReal stat) { - register GXReal difference = to - from; + GXReal difference = to - from; return from + (difference * stat); } diff --git a/Kernel/Builtins/GX/Rsrc/Cursor.rsrc b/Kernel/Modules/CoreCG/Rsrc/Cursor.rsrc index 2283cb32..2283cb32 100644 --- a/Kernel/Builtins/GX/Rsrc/Cursor.rsrc +++ b/Kernel/Modules/CoreCG/Rsrc/Cursor.rsrc diff --git a/Kernel/Builtins/Flash/Flash.hxx b/Kernel/Modules/Flash/Flash.hxx index d75539b6..d75539b6 100644 --- a/Kernel/Builtins/Flash/Flash.hxx +++ b/Kernel/Modules/Flash/Flash.hxx diff --git a/Kernel/Builtins/GPRS/.keepme b/Kernel/Modules/GPRS/.keepme index e69de29b..e69de29b 100644 --- a/Kernel/Builtins/GPRS/.keepme +++ b/Kernel/Modules/GPRS/.keepme diff --git a/Kernel/Builtins/HPET/.gitkeep b/Kernel/Modules/HPET/.gitkeep index e69de29b..e69de29b 100644 --- a/Kernel/Builtins/HPET/.gitkeep +++ b/Kernel/Modules/HPET/.gitkeep diff --git a/Kernel/Builtins/HPET/Defines.hxx b/Kernel/Modules/HPET/Defines.hxx index 697eee65..b0366ad2 100644 --- a/Kernel/Builtins/HPET/Defines.hxx +++ b/Kernel/Modules/HPET/Defines.hxx @@ -12,7 +12,7 @@ #pragma once #include <NewKit/Defines.hpp> -#include <Builtins/ACPI/ACPI.hxx> +#include <Modules/ACPI/ACPI.hxx> namespace NewOS { @@ -39,4 +39,4 @@ namespace NewOS NewOS::UInt8 PageProtection; }; -} // namespace NewOS
\ No newline at end of file +} // namespace NewOS diff --git a/Kernel/Builtins/IEEE802/.gitkeep b/Kernel/Modules/IEEE802/.gitkeep index e69de29b..e69de29b 100644 --- a/Kernel/Builtins/IEEE802/.gitkeep +++ b/Kernel/Modules/IEEE802/.gitkeep diff --git a/Kernel/Builtins/IEEE802/compile_flags.txt b/Kernel/Modules/IEEE802/compile_flags.txt index 1fbcad21..1fbcad21 100644 --- a/Kernel/Builtins/IEEE802/compile_flags.txt +++ b/Kernel/Modules/IEEE802/compile_flags.txt diff --git a/Kernel/Builtins/LTE/.keepme b/Kernel/Modules/LTE/.keepme index e69de29b..e69de29b 100644 --- a/Kernel/Builtins/LTE/.keepme +++ b/Kernel/Modules/LTE/.keepme diff --git a/Kernel/Builtins/LTE/IO.hxx b/Kernel/Modules/LTE/IO.hxx index a3f62fa9..7ae256e9 100644 --- a/Kernel/Builtins/LTE/IO.hxx +++ b/Kernel/Modules/LTE/IO.hxx @@ -23,7 +23,6 @@ NewOS::Boolean lte_turn_off_slot(NewOS::Int32 slot); /// @brief Send AT command.
NewOS::Boolean lte_send_at_command(NewOS::Char* buf,
- NewOS::Size bufSz);
-
+ NewOS::Size bufSz);
#endif // ifndef _INC_NETWORK_LTE_IO_HXX_
diff --git a/Kernel/Builtins/MBCI/Interface.hxx b/Kernel/Modules/MBCI/Interface.hxx index 3c504376..fa6f479b 100644 --- a/Kernel/Builtins/MBCI/Interface.hxx +++ b/Kernel/Modules/MBCI/Interface.hxx @@ -7,4 +7,4 @@ #pragma once #include <NewKit/Defines.hpp> -#include <Builtins/MBCI/MBCI.hxx>
\ No newline at end of file +#include <Modules/MBCI/MBCI.hxx> diff --git a/Kernel/Builtins/MBCI/MBCI.hxx b/Kernel/Modules/MBCI/MBCI.hxx index ab5dabf1..473013a2 100644 --- a/Kernel/Builtins/MBCI/MBCI.hxx +++ b/Kernel/Modules/MBCI/MBCI.hxx @@ -7,7 +7,7 @@ #pragma once #include <NewKit/Defines.hpp> -#include <Builtins/ACPI/ACPI.hxx> +#include <Modules/ACPI/ACPI.hxx> namespace NewOS { diff --git a/Kernel/Builtins/NVME/.gitkeep b/Kernel/Modules/NVME/.gitkeep index e69de29b..e69de29b 100644 --- a/Kernel/Builtins/NVME/.gitkeep +++ b/Kernel/Modules/NVME/.gitkeep diff --git a/Kernel/Builtins/NVME/compile_flags.txt b/Kernel/Modules/NVME/compile_flags.txt index 1bc51142..1bc51142 100644 --- a/Kernel/Builtins/NVME/compile_flags.txt +++ b/Kernel/Modules/NVME/compile_flags.txt diff --git a/Kernel/Builtins/OHCI/.gitkeep b/Kernel/Modules/OHCI/.gitkeep index e69de29b..e69de29b 100644 --- a/Kernel/Builtins/OHCI/.gitkeep +++ b/Kernel/Modules/OHCI/.gitkeep diff --git a/Kernel/Builtins/PS2/PS2MouseInterface.hxx b/Kernel/Modules/PS2/PS2MouseInterface.hxx index 124d4380..124d4380 100644 --- a/Kernel/Builtins/PS2/PS2MouseInterface.hxx +++ b/Kernel/Modules/PS2/PS2MouseInterface.hxx diff --git a/Kernel/Builtins/ReadMe.txt b/Kernel/Modules/ReadMe.txt index df63e0be..acbc3de7 100644 --- a/Kernel/Builtins/ReadMe.txt +++ b/Kernel/Modules/ReadMe.txt @@ -1,5 +1,5 @@ ============== -NewOS Builtins +NewOS Modules ============== =============== @@ -14,6 +14,6 @@ Maintainers/Authors ACPI: Amlal EL Mahrouss. AHCI: Amlal EL Mahrouss. -GX: Amlal EL Mahrouss. +CoreCG: Amlal EL Mahrouss. PS2: Amlal EL Mahrouss. -ATA: Amlal EL Mahrouss.
\ No newline at end of file +ATA: Amlal EL Mahrouss. diff --git a/Kernel/Builtins/SCSI/.gitkeep b/Kernel/Modules/SCSI/.gitkeep index e69de29b..e69de29b 100644 --- a/Kernel/Builtins/SCSI/.gitkeep +++ b/Kernel/Modules/SCSI/.gitkeep diff --git a/Kernel/Builtins/SCSI/SCSI.hxx b/Kernel/Modules/SCSI/SCSI.hxx index a0feb649..a0feb649 100644 --- a/Kernel/Builtins/SCSI/SCSI.hxx +++ b/Kernel/Modules/SCSI/SCSI.hxx diff --git a/Kernel/Builtins/WiFi/.gitkeep b/Kernel/Modules/WiFi/.gitkeep index e69de29b..e69de29b 100644 --- a/Kernel/Builtins/WiFi/.gitkeep +++ b/Kernel/Modules/WiFi/.gitkeep diff --git a/Kernel/Builtins/WiFi/compile_flags.txt b/Kernel/Modules/WiFi/compile_flags.txt index 1bc51142..1bc51142 100644 --- a/Kernel/Builtins/WiFi/compile_flags.txt +++ b/Kernel/Modules/WiFi/compile_flags.txt diff --git a/Kernel/Builtins/XHCI/.gitkeep b/Kernel/Modules/XHCI/.gitkeep index e69de29b..e69de29b 100644 --- a/Kernel/Builtins/XHCI/.gitkeep +++ b/Kernel/Modules/XHCI/.gitkeep diff --git a/Kernel/Builtins/XHCI/Defines.hxx b/Kernel/Modules/XHCI/Defines.hxx index 91147a58..91147a58 100644 --- a/Kernel/Builtins/XHCI/Defines.hxx +++ b/Kernel/Modules/XHCI/Defines.hxx diff --git a/Kernel/Builtins/XHCI/compile_flags.txt b/Kernel/Modules/XHCI/compile_flags.txt index 1bc51142..1bc51142 100644 --- a/Kernel/Builtins/XHCI/compile_flags.txt +++ b/Kernel/Modules/XHCI/compile_flags.txt diff --git a/Kernel/NetworkKit/IPCEP.hxx b/Kernel/NetworkKit/IPCEP.hxx index 6c7578b3..c92f79cd 100644 --- a/Kernel/NetworkKit/IPCEP.hxx +++ b/Kernel/NetworkKit/IPCEP.hxx @@ -46,15 +46,15 @@ namespace NewOS typedef struct IPCEPConnectionHeader { - UInt32 IpcHeader; // cRemoteHeaderMagic - UInt8 IpcEndianess; // 0 : LE, 1 : BE - SizeT IpcPacketSize; + UInt32 IpcHeader; // cRemoteHeaderMagic + UInt8 IpcEndianess; // 0 : LE, 1 : BE + SizeT IpcPacketSize; IPCEPAddressType IpcFrom; IPCEPAddressType IpcTo; - UInt32 IpcCRC32; - UInt32 IpcMsg; - UInt32 IpcMsgSz; - UInt8 IpcData[]; + UInt32 IpcCRC32; + UInt32 IpcMsg; + UInt32 IpcMsgSz; + UInt8 IpcData[]; } PACKED IPCEPConnectionHeader; } // namespace NewOS diff --git a/Kernel/NetworkKit/NetworkDevice.hpp b/Kernel/NetworkKit/NetworkDevice.hpp index c6f0cca3..b2c29b62 100644 --- a/Kernel/NetworkKit/NetworkDevice.hpp +++ b/Kernel/NetworkKit/NetworkDevice.hpp @@ -35,14 +35,13 @@ namespace NewOS public: const char* Name() const override; - Boolean Name(const char* strView); + Boolean Name(const char* strView); private: static constexpr auto cNetworkNameLen = 512; Void (*fCleanup)(void); Char fNetworkName[cNetworkNameLen]; - }; struct NetworkDeviceCommand final diff --git a/Kernel/Sources/DriveManager.cxx b/Kernel/Sources/DriveManager.cxx index b2266121..23fb99fa 100644 --- a/Kernel/Sources/DriveManager.cxx +++ b/Kernel/Sources/DriveManager.cxx @@ -6,8 +6,8 @@ #include <KernelKit/DebugOutput.hpp> #include <KernelKit/DriveManager.hxx> -#include <Builtins/ATA/ATA.hxx> -#include <Builtins/AHCI/AHCI.hxx> +#include <Modules/ATA/ATA.hxx> +#include <Modules/AHCI/AHCI.hxx> #include <NewKit/Utils.hpp> /// @file DriveManager.cxx diff --git a/Kernel/Sources/FS/NewFS.cxx b/Kernel/Sources/FS/NewFS.cxx index 5c5b50ca..4e212164 100644 --- a/Kernel/Sources/FS/NewFS.cxx +++ b/Kernel/Sources/FS/NewFS.cxx @@ -6,9 +6,9 @@ #ifdef __FSKIT_NEWFS__ -#include <Builtins/AHCI/AHCI.hxx> -#include <Builtins/ATA/ATA.hxx> -#include <Builtins/Flash/Flash.hxx> +#include <Modules/AHCI/AHCI.hxx> +#include <Modules/ATA/ATA.hxx> +#include <Modules/Flash/Flash.hxx> #include <FSKit/NewFS.hxx> #include <KernelKit/HError.hpp> #include <NewKit/Crc32.hpp> @@ -496,7 +496,7 @@ bool NewFSParser::Format(_Input _Output DriveTrait* drive) BootBlockType* epmBoot = (BootBlockType*)bufEpmHdr; - constexpr auto cFsName = "NewFS"; + constexpr auto cFsName = "NewFS"; constexpr auto cBlockName = "Zeta:"; rt_copy_memory(reinterpret_cast<VoidPtr>(const_cast<Char*>(cFsName)), epmBoot->Fs, rt_string_len(cFsName)); diff --git a/Kernel/Sources/FileManager.cxx b/Kernel/Sources/FileManager.cxx index 9f81c260..2c0bd366 100644 --- a/Kernel/Sources/FileManager.cxx +++ b/Kernel/Sources/FileManager.cxx @@ -97,9 +97,10 @@ namespace NewOS } Void NewFilesystemManager::Write(_Input const Char* name, - _Input NodePtr node, _Input VoidPtr data, - _Input Int32 flags, - _Input SizeT size) + _Input NodePtr node, + _Input VoidPtr data, + _Input Int32 flags, + _Input SizeT size) { if (!size || size > kNewFSForkSize) @@ -116,9 +117,9 @@ namespace NewOS } _Output VoidPtr NewFilesystemManager::Read(_Input const Char* name, - _Input NodePtr node, - _Input Int32 flags, - _Input SizeT sz) + _Input NodePtr node, + _Input Int32 flags, + _Input SizeT sz) { if (sz > kNewFSForkSize) return nullptr; diff --git a/Kernel/Sources/IndexableProperty.cxx b/Kernel/Sources/IndexableProperty.cxx index 457e2c53..7e609037 100644 --- a/Kernel/Sources/IndexableProperty.cxx +++ b/Kernel/Sources/IndexableProperty.cxx @@ -29,7 +29,7 @@ namespace NewOS { fFlags |= flag; } - + Void IndexableProperty::RemoveFlag(Int16 flag) { fFlags &= flag; diff --git a/Kernel/Sources/KeMain.cxx b/Kernel/Sources/KeMain.cxx index 3ff754c2..b64d4409 100644 --- a/Kernel/Sources/KeMain.cxx +++ b/Kernel/Sources/KeMain.cxx @@ -8,7 +8,7 @@ ------------------------------------------- */ #include <ArchKit/ArchKit.hpp> -#include <Builtins/GX/GX> +#include <Modules/CoreCG/CoreCG.hxx> #include <CompilerKit/Detail.hxx> #include <FirmwareKit/Handover.hxx> #include <KernelKit/FileManager.hpp> @@ -63,7 +63,7 @@ namespace NewOS::Detail if (catalogDir) { - NewOS::kcout << "newoskrnl: Already here\r"; + NewOS::kcout << "newoskrnl: Already here\r"; delete catalogDir; continue; @@ -186,7 +186,7 @@ namespace NewOS::Detail /// @return void no return value. STATIC NewOS::Void ke_launch_srv(NewOS::Void) { - // load security server. + // load security server. NewOS::PEFLoader secureSrv("C:\\System\\securesrv.exe"); if (!secureSrv.IsLoaded()) diff --git a/Kernel/Sources/Network/NetworkDevice.cxx b/Kernel/Sources/Network/NetworkDevice.cxx index 027613ac..24af10eb 100644 --- a/Kernel/Sources/Network/NetworkDevice.cxx +++ b/Kernel/Sources/Network/NetworkDevice.cxx @@ -27,7 +27,7 @@ namespace NewOS if (rt_string_len(strView) > cNetworkNameLen) return false; - rt_copy_memory((VoidPtr)strView, + rt_copy_memory((VoidPtr)strView, (VoidPtr)this->fNetworkName, rt_string_len(strView)); return true; diff --git a/Kernel/Sources/PEFCodeManager.cxx b/Kernel/Sources/PEFCodeManager.cxx index 12ca9b10..09f6e90e 100644 --- a/Kernel/Sources/PEFCodeManager.cxx +++ b/Kernel/Sources/PEFCodeManager.cxx @@ -86,7 +86,7 @@ namespace NewOS fBad = true; ke_delete_ke_heap(fCachedBlob); - + fCachedBlob = nullptr; } } @@ -121,18 +121,15 @@ namespace NewOS switch (kind) { - case kPefCode: - { + case kPefCode: { errOrSym = StringBuilder::Construct(cContainerKinds[0]); // code symbol. break; } - case kPefData: - { + case kPefData: { errOrSym = StringBuilder::Construct(cContainerKinds[1]); // data symbol. break; } - case kPefZero: - { + case kPefZero: { errOrSym = StringBuilder::Construct(cContainerKinds[2]); // block starting symbol. break; } @@ -177,7 +174,7 @@ namespace NewOS } } } - + ke_delete_ke_heap(blob); return nullptr; } diff --git a/Kernel/Sources/ProcessScheduler.cxx b/Kernel/Sources/ProcessScheduler.cxx index aae69386..315dc07a 100644 --- a/Kernel/Sources/ProcessScheduler.cxx +++ b/Kernel/Sources/ProcessScheduler.cxx @@ -64,7 +64,7 @@ namespace NewOS if (this->FreeMemory < 1) { DbgLastError() = kErrorHeapOutOfMemory; - + /* we're going out of memory */ this->Crash(); @@ -208,7 +208,7 @@ namespace NewOS ke_new_ke_heap(sizeof(HAL::StackFrame), true, false)); MUST_PASS(process.Leak().StackFrame); - + process.Leak().Status = ProcessStatus::kRunning; process.Leak().ProcessId = (mTeam.AsArray().Count() - 1); @@ -237,7 +237,7 @@ namespace NewOS SizeT ProcessScheduler::Run() noexcept { SizeT process_index = 0; //! we store this guy to tell the scheduler how many - //! things we have scheduled. + //! things we have scheduled. for (; process_index < mTeam.AsArray().Count(); ++process_index) { @@ -256,7 +256,7 @@ namespace NewOS // tell helper to find a core to schedule on. ProcessHelper::Switch(mTeam.AsRef().Leak().StackFrame, mTeam.AsRef().Leak().ProcessId); - + kcout << unwrapped_process.Name << ": process switched.\r"; } else @@ -332,7 +332,7 @@ namespace NewOS SizeT ProcessHelper::StartScheduling() { auto& process_ref = ProcessScheduler::The().Leak(); - SizeT ret = process_ref.Run(); + SizeT ret = process_ref.Run(); return ret; } diff --git a/Kernel/Sources/Property.cxx b/Kernel/Sources/Property.cxx index b58de469..285d7aaa 100644 --- a/Kernel/Sources/Property.cxx +++ b/Kernel/Sources/Property.cxx @@ -9,7 +9,7 @@ namespace NewOS { Property::Property(const StringView& sw) - : fName(sw) + : fName(sw) { kcout << "Property: created: " << sw.CData() << endl; } diff --git a/Kernel/Sources/SMPManager.cxx b/Kernel/Sources/SMPManager.cxx index 149b1334..f00fbee1 100644 --- a/Kernel/Sources/SMPManager.cxx +++ b/Kernel/Sources/SMPManager.cxx @@ -103,7 +103,7 @@ namespace NewOS delete fStack; fStack = nullptr; } - + fStack = stack; rt_do_context_switch(fStack); diff --git a/Kernel/Sources/ThreadLocalStorage.cxx b/Kernel/Sources/ThreadLocalStorage.cxx index 4d6fec14..a48b942c 100644 --- a/Kernel/Sources/ThreadLocalStorage.cxx +++ b/Kernel/Sources/ThreadLocalStorage.cxx @@ -46,7 +46,8 @@ Boolean tls_check_tib(ThreadInformationBlock* tib) */ EXTERN_C Void tls_check_syscall_impl(NewOS::VoidPtr TIB) noexcept { - if (!TIB) return; + if (!TIB) + return; ThreadInformationBlock* tib = (ThreadInformationBlock*)TIB; diff --git a/Kernel/StorageKit/SCSI.hxx b/Kernel/StorageKit/SCSI.hxx index cc526b75..646b1844 100644 --- a/Kernel/StorageKit/SCSI.hxx +++ b/Kernel/StorageKit/SCSI.hxx @@ -6,6 +6,6 @@ #pragma once -#include <Builtins/SCSI/SCSI.hxx> +#include <Modules/SCSI/SCSI.hxx> extern const scsi_packet_type kCDRomPacketTemplate; diff --git a/Kernel/amd64-efi.make b/Kernel/amd64-efi.make index c230bc48..e88741fc 100644 --- a/Kernel/amd64-efi.make +++ b/Kernel/amd64-efi.make @@ -3,7 +3,7 @@ # This is the microkernel makefile. ################################################## -CC = x86_64-w64-mingw32-gcc +CC = x86_64-w64-mingw32-g++ LD = x86_64-w64-mingw32-ld CCFLAGS = -c -fPIC -ffreestanding -D__NEWOS_AMD64__ -mno-red-zone -fno-rtti -fno-exceptions \ -std=c++20 -D__FSKIT_NEWFS__ -D__KERNEL__ -D__HAVE_MAHROUSS_APIS__ -D__MAHROUSS__ -I./ |
