From 9784f940cf71aef91ccbeb1a11651a83a3eff213 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 24 Jun 2024 14:33:40 +0200 Subject: IMP: UIAccessibilty class, work in progress Core CoreGraphics (GPU/FB SDK). REFACTOR: Moved Builtins to Modules/ Signed-off-by: Amlal El Mahrouss --- Boot/BootKit/BootKit.hxx | 6 +- Boot/BootKit/Device.hxx | 2 +- Boot/BootKit/HW/ATA.hxx | 2 +- Boot/BootKit/HW/SATA.hxx | 2 +- Boot/BootKit/Vendor/Qr.hxx | 2 +- Boot/Sources/HEL/AMD64/BootMain.cxx | 7 +- Comm/herror.hxx | 46 +++ Comm/newstd.hxx | 119 ++++--- Drv/VideoDrv/VideoDrv.c | 2 +- Kernel/Builtins/.gitkeep | 0 Kernel/Builtins/ACPI/.gitkeep | 0 Kernel/Builtins/ACPI/ACPI.hxx | 88 ----- Kernel/Builtins/ACPI/ACPIFactoryInterface.hxx | 55 --- Kernel/Builtins/ACPI/compile_flags.txt | 4 - Kernel/Builtins/AHCI/.gitkeep | 0 Kernel/Builtins/AHCI/AHCI.hxx | 368 --------------------- Kernel/Builtins/AHCI/compile_flags.txt | 4 - Kernel/Builtins/APM/.gitkeep | 0 Kernel/Builtins/ATA/ATA.hxx | 156 --------- Kernel/Builtins/ATA/compile_flags.txt | 4 - Kernel/Builtins/Flash/Flash.hxx | 19 -- Kernel/Builtins/GPRS/.keepme | 0 Kernel/Builtins/GX/GX | 91 ----- Kernel/Builtins/GX/Lerp | 22 -- Kernel/Builtins/GX/Rsrc/Cursor.rsrc | 64 ---- Kernel/Builtins/HPET/.gitkeep | 0 Kernel/Builtins/HPET/Defines.hxx | 42 --- Kernel/Builtins/IEEE802/.gitkeep | 0 Kernel/Builtins/IEEE802/compile_flags.txt | 4 - Kernel/Builtins/LTE/.keepme | 0 Kernel/Builtins/LTE/IO.hxx | 29 -- Kernel/Builtins/MBCI/Interface.hxx | 10 - Kernel/Builtins/MBCI/MBCI.hxx | 55 --- Kernel/Builtins/NVME/.gitkeep | 0 Kernel/Builtins/NVME/compile_flags.txt | 4 - Kernel/Builtins/OHCI/.gitkeep | 0 Kernel/Builtins/PS2/PS2MouseInterface.hxx | 112 ------- Kernel/Builtins/ReadMe.txt | 19 -- Kernel/Builtins/SCSI/.gitkeep | 0 Kernel/Builtins/SCSI/SCSI.hxx | 14 - Kernel/Builtins/WiFi/.gitkeep | 0 Kernel/Builtins/WiFi/compile_flags.txt | 4 - Kernel/Builtins/XHCI/.gitkeep | 0 Kernel/Builtins/XHCI/Defines.hxx | 70 ---- Kernel/Builtins/XHCI/compile_flags.txt | 4 - Kernel/FSKit/IndexableProperty.hxx | 3 +- Kernel/FirmwareKit/EFI/API.hxx | 2 +- Kernel/FirmwareKit/EPM.hxx | 6 +- Kernel/HALKit/AMD64/HalACPIFactoryInterface.cxx | 2 +- .../HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp | 2 +- Kernel/HALKit/AMD64/HalHart.cpp | 1 - Kernel/HALKit/AMD64/HalKernelMain.cxx | 70 ++-- Kernel/HALKit/AMD64/HalKernelMouse.cxx | 6 +- Kernel/HALKit/AMD64/HalPageAlloc.hpp | 18 +- Kernel/HALKit/AMD64/Processor.hpp | 12 +- Kernel/HALKit/AMD64/Storage/AHCI.cxx | 2 +- Kernel/HALKit/AMD64/Storage/ATA-DMA.cxx | 6 +- Kernel/HALKit/AMD64/Storage/ATA-PIO.cxx | 2 +- Kernel/HALKit/ARM64/HalPageAlloc.hpp | 40 ++- Kernel/HALKit/ARM64/Processor.hxx | 6 +- Kernel/KernelKit/FileManager.hpp | 46 +-- Kernel/KernelKit/HError.hpp | 10 +- Kernel/KernelKit/PEFCodeManager.hxx | 8 +- Kernel/KernelKit/ProcessScheduler.hxx | 16 +- Kernel/Modules/.gitkeep | 0 Kernel/Modules/ACPI/.gitkeep | 0 Kernel/Modules/ACPI/ACPI.hxx | 88 +++++ Kernel/Modules/ACPI/ACPIFactoryInterface.hxx | 55 +++ Kernel/Modules/ACPI/compile_flags.txt | 4 + Kernel/Modules/AHCI/.gitkeep | 0 Kernel/Modules/AHCI/AHCI.hxx | 368 +++++++++++++++++++++ Kernel/Modules/AHCI/compile_flags.txt | 4 + Kernel/Modules/APM/.gitkeep | 0 Kernel/Modules/ATA/ATA.hxx | 156 +++++++++ Kernel/Modules/ATA/compile_flags.txt | 4 + Kernel/Modules/CoreCG/Accessibility.hxx | 59 ++++ Kernel/Modules/CoreCG/CoreCG.hxx | 93 ++++++ Kernel/Modules/CoreCG/Lerp.hxx | 22 ++ Kernel/Modules/CoreCG/Rsrc/Cursor.rsrc | 64 ++++ Kernel/Modules/Flash/Flash.hxx | 19 ++ Kernel/Modules/GPRS/.keepme | 0 Kernel/Modules/HPET/.gitkeep | 0 Kernel/Modules/HPET/Defines.hxx | 42 +++ Kernel/Modules/IEEE802/.gitkeep | 0 Kernel/Modules/IEEE802/compile_flags.txt | 4 + Kernel/Modules/LTE/.keepme | 0 Kernel/Modules/LTE/IO.hxx | 28 ++ Kernel/Modules/MBCI/Interface.hxx | 10 + Kernel/Modules/MBCI/MBCI.hxx | 55 +++ Kernel/Modules/NVME/.gitkeep | 0 Kernel/Modules/NVME/compile_flags.txt | 4 + Kernel/Modules/OHCI/.gitkeep | 0 Kernel/Modules/PS2/PS2MouseInterface.hxx | 112 +++++++ Kernel/Modules/ReadMe.txt | 19 ++ Kernel/Modules/SCSI/.gitkeep | 0 Kernel/Modules/SCSI/SCSI.hxx | 14 + Kernel/Modules/WiFi/.gitkeep | 0 Kernel/Modules/WiFi/compile_flags.txt | 4 + Kernel/Modules/XHCI/.gitkeep | 0 Kernel/Modules/XHCI/Defines.hxx | 70 ++++ Kernel/Modules/XHCI/compile_flags.txt | 4 + Kernel/NetworkKit/IPCEP.hxx | 14 +- Kernel/NetworkKit/NetworkDevice.hpp | 3 +- Kernel/Sources/DriveManager.cxx | 4 +- Kernel/Sources/FS/NewFS.cxx | 8 +- Kernel/Sources/FileManager.cxx | 13 +- Kernel/Sources/IndexableProperty.cxx | 2 +- Kernel/Sources/KeMain.cxx | 6 +- Kernel/Sources/Network/NetworkDevice.cxx | 2 +- Kernel/Sources/PEFCodeManager.cxx | 13 +- Kernel/Sources/ProcessScheduler.cxx | 10 +- Kernel/Sources/Property.cxx | 2 +- Kernel/Sources/SMPManager.cxx | 2 +- Kernel/Sources/ThreadLocalStorage.cxx | 3 +- Kernel/StorageKit/SCSI.hxx | 2 +- Kernel/amd64-efi.make | 2 +- 116 files changed, 1597 insertions(+), 1479 deletions(-) create mode 100644 Comm/herror.hxx delete mode 100644 Kernel/Builtins/.gitkeep delete mode 100644 Kernel/Builtins/ACPI/.gitkeep delete mode 100644 Kernel/Builtins/ACPI/ACPI.hxx delete mode 100644 Kernel/Builtins/ACPI/ACPIFactoryInterface.hxx delete mode 100644 Kernel/Builtins/ACPI/compile_flags.txt delete mode 100644 Kernel/Builtins/AHCI/.gitkeep delete mode 100644 Kernel/Builtins/AHCI/AHCI.hxx delete mode 100644 Kernel/Builtins/AHCI/compile_flags.txt delete mode 100644 Kernel/Builtins/APM/.gitkeep delete mode 100644 Kernel/Builtins/ATA/ATA.hxx delete mode 100644 Kernel/Builtins/ATA/compile_flags.txt delete mode 100644 Kernel/Builtins/Flash/Flash.hxx delete mode 100644 Kernel/Builtins/GPRS/.keepme delete mode 100644 Kernel/Builtins/GX/GX delete mode 100644 Kernel/Builtins/GX/Lerp delete mode 100644 Kernel/Builtins/GX/Rsrc/Cursor.rsrc delete mode 100644 Kernel/Builtins/HPET/.gitkeep delete mode 100644 Kernel/Builtins/HPET/Defines.hxx delete mode 100644 Kernel/Builtins/IEEE802/.gitkeep delete mode 100644 Kernel/Builtins/IEEE802/compile_flags.txt delete mode 100644 Kernel/Builtins/LTE/.keepme delete mode 100644 Kernel/Builtins/LTE/IO.hxx delete mode 100644 Kernel/Builtins/MBCI/Interface.hxx delete mode 100644 Kernel/Builtins/MBCI/MBCI.hxx delete mode 100644 Kernel/Builtins/NVME/.gitkeep delete mode 100644 Kernel/Builtins/NVME/compile_flags.txt delete mode 100644 Kernel/Builtins/OHCI/.gitkeep delete mode 100644 Kernel/Builtins/PS2/PS2MouseInterface.hxx delete mode 100644 Kernel/Builtins/ReadMe.txt delete mode 100644 Kernel/Builtins/SCSI/.gitkeep delete mode 100644 Kernel/Builtins/SCSI/SCSI.hxx delete mode 100644 Kernel/Builtins/WiFi/.gitkeep delete mode 100644 Kernel/Builtins/WiFi/compile_flags.txt delete mode 100644 Kernel/Builtins/XHCI/.gitkeep delete mode 100644 Kernel/Builtins/XHCI/Defines.hxx delete mode 100644 Kernel/Builtins/XHCI/compile_flags.txt create mode 100644 Kernel/Modules/.gitkeep create mode 100644 Kernel/Modules/ACPI/.gitkeep create mode 100644 Kernel/Modules/ACPI/ACPI.hxx create mode 100644 Kernel/Modules/ACPI/ACPIFactoryInterface.hxx create mode 100644 Kernel/Modules/ACPI/compile_flags.txt create mode 100644 Kernel/Modules/AHCI/.gitkeep create mode 100644 Kernel/Modules/AHCI/AHCI.hxx create mode 100644 Kernel/Modules/AHCI/compile_flags.txt create mode 100644 Kernel/Modules/APM/.gitkeep create mode 100644 Kernel/Modules/ATA/ATA.hxx create mode 100644 Kernel/Modules/ATA/compile_flags.txt create mode 100644 Kernel/Modules/CoreCG/Accessibility.hxx create mode 100644 Kernel/Modules/CoreCG/CoreCG.hxx create mode 100644 Kernel/Modules/CoreCG/Lerp.hxx create mode 100644 Kernel/Modules/CoreCG/Rsrc/Cursor.rsrc create mode 100644 Kernel/Modules/Flash/Flash.hxx create mode 100644 Kernel/Modules/GPRS/.keepme create mode 100644 Kernel/Modules/HPET/.gitkeep create mode 100644 Kernel/Modules/HPET/Defines.hxx create mode 100644 Kernel/Modules/IEEE802/.gitkeep create mode 100644 Kernel/Modules/IEEE802/compile_flags.txt create mode 100644 Kernel/Modules/LTE/.keepme create mode 100644 Kernel/Modules/LTE/IO.hxx create mode 100644 Kernel/Modules/MBCI/Interface.hxx create mode 100644 Kernel/Modules/MBCI/MBCI.hxx create mode 100644 Kernel/Modules/NVME/.gitkeep create mode 100644 Kernel/Modules/NVME/compile_flags.txt create mode 100644 Kernel/Modules/OHCI/.gitkeep create mode 100644 Kernel/Modules/PS2/PS2MouseInterface.hxx create mode 100644 Kernel/Modules/ReadMe.txt create mode 100644 Kernel/Modules/SCSI/.gitkeep create mode 100644 Kernel/Modules/SCSI/SCSI.hxx create mode 100644 Kernel/Modules/WiFi/.gitkeep create mode 100644 Kernel/Modules/WiFi/compile_flags.txt create mode 100644 Kernel/Modules/XHCI/.gitkeep create mode 100644 Kernel/Modules/XHCI/Defines.hxx create mode 100644 Kernel/Modules/XHCI/compile_flags.txt 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 -#include +#include #include @@ -365,7 +365,7 @@ inline Boolean BDiskFormatFactory::Format(const char* partName, BootBlockType* epmBoot = (BootBlockType*)buf; - constexpr auto cFsName = "NewFS"; + constexpr auto cFsName = "NewFS"; constexpr auto cBlockName = "Zeta:"; CopyMem(reinterpret_cast(const_cast(cFsName)), epmBoot->Fs, StrLen(cFsName)); @@ -385,7 +385,7 @@ inline Boolean BDiskFormatFactory::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 +#include 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 +#include #include 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 -#include +#include 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 #include -#include +#include #include #include 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 #include -#include +#include #include #include #include @@ -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 + +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 #include -#include +#include int __at_enter(void) { diff --git a/Kernel/Builtins/.gitkeep b/Kernel/Builtins/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/Kernel/Builtins/ACPI/.gitkeep b/Kernel/Builtins/ACPI/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/Kernel/Builtins/ACPI/ACPI.hxx b/Kernel/Builtins/ACPI/ACPI.hxx deleted file mode 100644 index 019bcb11..00000000 --- a/Kernel/Builtins/ACPI/ACPI.hxx +++ /dev/null @@ -1,88 +0,0 @@ -/* ------------------------------------------- - - Copyright Zeta Electronics Corporation - -------------------------------------------- */ - -#ifndef __ACPI__ -#define __ACPI__ - -/** - https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html -*/ - -#include - -namespace NewOS -{ - class PACKED SDT - { - public: - Char Signature[4]; - UInt32 Length; - UInt8 Revision; - Char Checksum; - Char OemId[6]; - Char OemTableId[8]; - UInt32 OemRev; - UInt32 CreatorID; - UInt32 CreatorRevision; - }; - - class PACKED RSDP : public SDT - { - public: - UInt32 RsdtAddress; - UIntPtr XsdtAddress; - UInt8 ExtendedChecksum; - UInt8 Reserved0[3]; - }; - - class PACKED ConfigHeader - { - public: - UInt64 BaseAddress; - UInt16 PciSegGroup; - UInt8 StartBus; - UInt8 EndBus; - UInt32 Reserved; - }; - - enum class AddressSpace : UInt8 - { - SystemMemory = 0, - SystemIO = 1, - Pci = 2, - Controller = 3, - SmBus = 4, - Count = 5, - Invalid = 0xFF, - }; - - class PACKED Address - { - public: - AddressSpace AddressSpaceId; - UInt8 RegisterBitWidth; - UInt8 RegisterBitOffset; - UInt8 Reserved; - UIntPtr Address; - }; - - class PACKED RSDT - { - public: - Char Signature[4]; - UInt32 Length; - UInt8 Revision; - Char Checksum; - Char OemId[6]; - Char OemTableId[8]; - UInt32 OemRev; - UInt32 CreatorID; - UInt32 CreatorRevision; - UInt32 AddressArr[]; - }; -} // namespace NewOS - -#endif // !__ACPI__ diff --git a/Kernel/Builtins/ACPI/ACPIFactoryInterface.hxx b/Kernel/Builtins/ACPI/ACPIFactoryInterface.hxx deleted file mode 100644 index 7da42f33..00000000 --- a/Kernel/Builtins/ACPI/ACPIFactoryInterface.hxx +++ /dev/null @@ -1,55 +0,0 @@ -/* ------------------------------------------- - - Copyright Zeta Electronics Corporation - -------------------------------------------- */ - -#ifndef __ACPI_MANAGER__ -#define __ACPI_MANAGER__ - -#include -#include -#include -#include - -namespace NewOS -{ - class ACPIFactoryInterface final - { - public: - explicit ACPIFactoryInterface(voidPtr rsdPtr); - ~ACPIFactoryInterface() = default; - - ACPIFactoryInterface& operator=(const ACPIFactoryInterface&) = default; - ACPIFactoryInterface(const ACPIFactoryInterface&) = default; - - public: - void Shutdown(); // shutdown - void Reboot(); // soft-reboot - - public: - /// @brief Descriptor find factory. - /// @param signature The signature of the descriptor table (MADT, ACPI...) - /// @return the blob inside an ErrorOr object. - ErrorOr Find(const char* signature); - - /// @brief Checksum factory. - /// @param checksum the data to checksum - /// @param len it's size - /// @return if it succeed - bool Checksum(const char* checksum, SSizeT len); // watch for collides! - - public: - ErrorOr operator[](const char* signature) - { - return this->Find(signature); - } - - private: - VoidPtr fRsdp; // pointer to root descriptor. - SSizeT fEntries; // number of entries, -1 tells that no invalid entries were - // found. - }; -} // namespace NewOS - -#endif // !__ACPI_MANAGER__ diff --git a/Kernel/Builtins/ACPI/compile_flags.txt b/Kernel/Builtins/ACPI/compile_flags.txt deleted file mode 100644 index 1bc51142..00000000 --- a/Kernel/Builtins/ACPI/compile_flags.txt +++ /dev/null @@ -1,4 +0,0 @@ --I./ --I../ --I../../ --std=c++20 diff --git a/Kernel/Builtins/AHCI/.gitkeep b/Kernel/Builtins/AHCI/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/Kernel/Builtins/AHCI/AHCI.hxx b/Kernel/Builtins/AHCI/AHCI.hxx deleted file mode 100644 index a62d02cd..00000000 --- a/Kernel/Builtins/AHCI/AHCI.hxx +++ /dev/null @@ -1,368 +0,0 @@ -/* ------------------------------------------- - - Copyright Zeta Electronics Corporation - - File: Defines.hxx - Purpose: AHCI header. - - Revision History: - - 03/02/24: Added file (amlel) - -------------------------------------------- */ - -#pragma once - -#include -#include - -// Forward declarations of structs. - -struct HbaPort; -struct FisData; -struct FisRegD2H; -struct FisRegH2D; - -/// @brief Frame information type. -enum -{ - kFISTypeRegH2D = 0x27, // Register FIS - host to device - kFISTypeRegD2H = 0x34, // Register FIS - device to host - kFISTypeDMAAct = 0x39, // DMA activate FIS - device to host - kFISTypeDMASetup = 0x41, // DMA setup FIS - bidirectional - kFISTypeData = 0x46, // Data FIS - bidirectional - kFISTypeBIST = 0x58, // BIST activate FIS - bidirectional - kFISTypePIOSetup = 0x5F, // PIO setup FIS - device to host - kFISTypeDevBits = 0xA1, // Set device bits FIS - device to host -}; - -enum -{ - kAHCICmdIdentify = 0xEC, - kAHCICmdReadDma = 0xC8, - kAHCICmdReadDmaEx = 0x25, - kAHCICmdWriteDma = 0xCA, - kAHCICmdWriteDmaEx = 0x35 -}; - -typedef struct FisRegH2D final -{ - // DWORD 0 - NewOS::UInt8 FisType; // FIS_TYPE_REG_H2D - - NewOS::UInt8 PortMul : 4; // Port multiplier - NewOS::UInt8 Reserved0 : 3; // Reserved - NewOS::UInt8 CmdOrCtrl : 1; // 1: Command, 0: Control - - NewOS::UInt8 Command; // Command register - NewOS::UInt8 Featurel; // Feature register, 7:0 - - // DWORD 1 - NewOS::UInt8 Lba0; // LBA low register, 7:0 - NewOS::UInt8 Lba1; // LBA mid register, 15:8 - NewOS::UInt8 Lba2; // LBA high register, 23:16 - NewOS::UInt8 Device; // Device register - - // DWORD 2 - NewOS::UInt8 Lba3; // LBA register, 31:24 - NewOS::UInt8 Lba4; // LBA register, 39:32 - NewOS::UInt8 Lba5; // LBA register, 47:40 - NewOS::UInt8 FeatureHigh; // Feature register, 15:8 - - // DWORD 3 - NewOS::UInt8 CountLow; // Count register, 7:0 - NewOS::UInt8 CountHigh; // Count register, 15:8 - NewOS::UInt8 Icc; // Isochronous command completion - NewOS::UInt8 Control; // Control register - - // DWORD 4 - NewOS::UInt8 Reserved1[4]; // Reserved -} FisRegH2D; - -typedef struct FisRegD2H final -{ - // DWORD 0 - NewOS::UInt8 FisType; // FIS_TYPE_REG_D2H - - NewOS::UInt8 PortMul : 4; // Port multiplier - NewOS::UInt8 Reserved0 : 2; // Reserved - NewOS::UInt8 InterruptBit : 1; // Interrupt bit - NewOS::UInt8 Reserved1 : 1; // Reserved - - NewOS::UInt8 Status; // Status register - NewOS::UInt8 Rrror; // Error register - - // DWORD 1 - NewOS::UInt8 Lba0; // LBA low register, 7:0 - NewOS::UInt8 Lba1; // LBA mid register, 15:8 - NewOS::UInt8 Lba2; // LBA high register, 23:16 - NewOS::UInt8 Device; // Device register - - // DWORD 2 - NewOS::UInt8 Lba3; // LBA register, 31:24 - NewOS::UInt8 Lba4; // LBA register, 39:32 - NewOS::UInt8 Lba5; // LBA register, 47:40 - NewOS::UInt8 Rsv2; // Reserved - - // DWORD 3 - NewOS::UInt8 CountLow; // Count register, 7:0 - NewOS::UInt8 CountHigh; // Count register, 15:8 - NewOS::UInt8 Rsv3[2]; // Reserved - - // DWORD 4 - NewOS::UInt8 Rsv4[4]; // Reserved -} FisRegD2H; - -typedef struct FisData final -{ - // DWORD 0 - NewOS::UInt8 FisType; // FIS_TYPE_DATA - - NewOS::UInt8 PortMul : 4; // Port multiplier - NewOS::UInt8 Reserved0 : 4; // Reserved - - NewOS::UInt8 Reserved1[2]; // Reserved - - // DWORD 1 ~ N - NewOS::UInt32 Data[1]; // Payload -} FisData; - -typedef struct FisPioSetup final -{ - // DWORD 0 - NewOS::UInt8 FisType; // FIS_TYPE_PIO_SETUP - - NewOS::UInt8 PortMul : 4; // Port multiplier - NewOS::UInt8 Reserved0 : 1; // Reserved - NewOS::UInt8 DTD : 1; // Data transfer direction, 1 - device to host - NewOS::UInt8 InterruptBit : 1; // Interrupt bit - NewOS::UInt8 Reserved1 : 1; - - NewOS::UInt8 Status; // Status register - NewOS::UInt8 Error; // Error register - - // DWORD 1 - NewOS::UInt8 Lba0; // LBA low register, 7:0 - NewOS::UInt8 Lba1; // LBA mid register, 15:8 - NewOS::UInt8 Lba2; // LBA high register, 23:16 - NewOS::UInt8 Device; // Device register - - // DWORD 2 - NewOS::UInt8 Lba3; // LBA register, 31:24 - NewOS::UInt8 Lba4; // LBA register, 39:32 - NewOS::UInt8 Lba5; // LBA register, 47:40 - NewOS::UInt8 Rsv2; // Reserved - - // DWORD 3 - NewOS::UInt8 CountLow; // Count register, 7:0 - NewOS::UInt8 CountHigh; // Count register, 15:8 - NewOS::UInt8 Rsv3; // Reserved - NewOS::UInt8 EStatus; // New value of status register - - // DWORD 4 - NewOS::UInt16 TranferCount; // Transfer count - NewOS::UInt8 Rsv4[2]; // Reserved -} FisPioSetup; - -typedef struct FisDmaSetup final -{ - // DWORD 0 - NewOS::UInt8 FisType; // FIS_TYPE_DMA_SETUP - - NewOS::UInt8 PortMul : 4; // Port multiplier - NewOS::UInt8 Reserved0 : 1; // Reserved - NewOS::UInt8 DTD : 1; // Data transfer direction, 1 - device to host - NewOS::UInt8 InterruptBit : 1; // Interrupt bit - NewOS::UInt8 AutoEnable : 1; // Auto-activate. Specifies if DMA Activate FIS is needed - - NewOS::UInt8 Reserved1[2]; // Reserved - - // DWORD 1&2 - NewOS::UInt64 DmaBufferId; // DMA Buffer Identifier. Used to Identify DMA buffer in - // host memory. SATA Spec says host specific and not in - // Spec. Trying AHCI spec might work. - - // DWORD 3 - NewOS::UInt32 Rsvd; // More reserved - - // DWORD 4 - NewOS::UInt32 DmabufOffset; // Byte offset into buffer. First 2 bits must be 0 - - // DWORD 5 - NewOS::UInt32 TransferCount; // Number of bytes to transfer. Bit 0 must be 0 - - // DWORD 6 - NewOS::UInt32 Reserved3; // Reserved -} FisDmaSetup; - -typedef struct FisDevBits final -{ - // DWORD 0 - NewOS::UInt8 FisType; // FIS_TYPE_DMA_SETUP (A1h) - - NewOS::UInt8 Reserved0 : 5; // Reserved - NewOS::UInt8 R0 : 1; - NewOS::UInt8 InterruptBit : 1; - NewOS::UInt8 N : 1; - - NewOS::UInt8 StatusLow : 3; - NewOS::UInt8 R1 : 1; - NewOS::UInt8 StatusHigh : 3; - - NewOS::UInt8 R2 : 1; - NewOS::UInt8 Error; - - // DWORD 1 - NewOS::UInt32 Act; -} FisDevBits; - -/// \brief Enable AHCI device bit in GHC register. -#ifndef kAhciGHC_AE -#define kAhciGHC_AE (31) -#endif //! ifndef kAhciGHC_AE - -typedef struct HbaPort final -{ - NewOS::UInt32 Clb; // 0x00, command list base address, 1K-byte aligned - NewOS::UInt32 Clbu; // 0x04, command list base address upper 32 bits - NewOS::UInt32 Fb; // 0x08, FIS base address, 256-byte aligned - NewOS::UInt32 Fbu; // 0x0C, FIS base address upper 32 bits - NewOS::UInt32 Is; // 0x10, interrupt status - NewOS::UInt32 Ie; // 0x14, interrupt enable - NewOS::UInt32 Cmd; // 0x18, command and status - NewOS::UInt32 Reserved0; // 0x1C, Reserved - NewOS::UInt32 Tfd; // 0x20, task file data - NewOS::UInt32 Sig; // 0x24, signature - NewOS::UInt32 Ssts; // 0x28, SATA status (SCR0:SStatus) - NewOS::UInt32 Sctl; // 0x2C, SATA control (SCR2:SControl) - NewOS::UInt32 Serr; // 0x30, SATA error (SCR1:SError) - NewOS::UInt32 Sact; // 0x34, SATA active (SCR3:SActive) - NewOS::UInt32 Ci; // 0x38, command issue - NewOS::UInt32 Sntf; // 0x20, SATA notification (SCR4:SNotification) - NewOS::UInt32 Fbs; // 0x40, FIS-based switch control - NewOS::UInt32 Reserved1[11]; // 0x44 ~ 0x6F, Reserved - NewOS::UInt32 Vendor[4]; // 0x70 ~ 0x7F, vendor specific -} HbaPort; - -typedef struct HbaMem final -{ - // 0x00 - 0x2B, Generic Host Control - NewOS::UInt32 Cap; // 0x00, Host capability - NewOS::UInt32 Ghc; // 0x04, Global host control - NewOS::UInt32 Is; // 0x08, Interrupt status - NewOS::UInt32 Pi; // 0x0C, Port implemented - NewOS::UInt32 Vs; // 0x10, Version - NewOS::UInt32 Ccc_ctl; // 0x14, Command completion coalescing control - NewOS::UInt32 Ccc_pts; // 0x18, Command completion coalescing ports - NewOS::UInt32 Em_loc; // 0x1C, Enclosure management location - NewOS::UInt32 Em_ctl; // 0x20, Enclosure management control - NewOS::UInt32 Cap2; // 0x24, Host capabilities extended - NewOS::UInt32 Bohc; // 0x28, BIOS/OS handoff control and status - - NewOS::UInt16 Resv0; - NewOS::UInt32 Resv2; - - HbaPort Ports[1]; // 1 ~ 32 -} HbaMem; - -typedef struct HbaCmdHeader final -{ - // DW0 - NewOS::UInt8 Cfl : 5; // Command FIS length in DWORDS, 2 ~ 16 - NewOS::UInt8 Atapi : 1; // ATAPI - NewOS::UInt8 Write : 1; // Write, 1: H2D, 0: D2H - NewOS::UInt8 Prefetchable : 1; // Prefetchable - - NewOS::UInt8 Reset : 1; // Reset - NewOS::UInt8 BIST : 1; // BIST - NewOS::UInt8 Clear : 1; // Clear busy upon R_OK - NewOS::UInt8 Reserved0 : 1; // Reserved - NewOS::UInt8 Pmp : 4; // Port multiplier port - - NewOS::UInt16 Prdtl; // Physical region descriptor table length in entries - volatile NewOS::UInt32 Prdbc; // Physical region descriptor byte count transferred - - NewOS::UInt32 Ctba; // Command table descriptor base address - NewOS::UInt32 Ctbau; // Command table descriptor base address upper 32 bits - - NewOS::UInt32 Reserved1[4]; // Reserved -} HbaCmdHeader; - -typedef struct HbaFis final -{ - // 0x00 - FisDmaSetup Dsfis; // DMA Setup FIS - NewOS::UInt8 Pad0[4]; - // 0x20 - FisPioSetup Psfis; // PIO Setup FIS - NewOS::UInt8 Pad1[12]; - // 0x40 - FisRegD2H Rfis; // Register – Device to Host FIS - NewOS::UInt8 Pad2[4]; - // 0x58 - FisDevBits Sdbfis; // Set Device Bit FIS - // 0x60 - NewOS::UInt8 Ufis[64]; - // 0xA0 - NewOS::UInt8 Rsv[0x100 - 0xA0]; -} HbaFis; - -typedef struct HbaPrdtEntry final -{ - NewOS::UInt32 Dba; // Data base address - NewOS::UInt32 Dbau; // Data base address upper 32 bits - NewOS::UInt32 Reserved0; // Reserved - // DW3 - NewOS::UInt32 Dbc : 22; // Byte count, 4M max - NewOS::UInt32 Reserved1 : 9; // Reserved - NewOS::UInt32 InterruptBit : 1; // Interrupt on completion -} HbaPrdtEntry; - -typedef struct HbaCmdTbl final -{ - NewOS::UInt8 Cfis[64]; // Command FIS - NewOS::UInt8 Acmd[16]; // ATAPI command, 12 or 16 bytes - NewOS::UInt8 Rsv[48]; // Reserved - struct HbaPrdtEntry prdtEntries[1]; // Physical region descriptor table entries, 0 ~ 65535 -} HbaCmdTbl; - -/* EOF */ - -#if defined(__AHCI__) - -/// @brief Initializes an AHCI disk. -/// @param PortsImplemented the amount of port that have been detected. -/// @return -NewOS::Boolean drv_std_init(NewOS::UInt16& PortsImplemented); - -NewOS::Boolean drv_std_detected(NewOS::Void); - -/// @brief Read from disk. -/// @param Lba -/// @param Buf -/// @param SectorSz -/// @param Size -/// @return -NewOS::Void drv_std_read(NewOS::UInt64 Lba, NewOS::Char* Buf, NewOS::SizeT SectorSz, NewOS::SizeT Size); - -/// @brief Write to disk. -/// @param Lba -/// @param Buf -/// @param SectorSz -/// @param Size -/// @return -NewOS::Void drv_std_write(NewOS::UInt64 Lba, NewOS::Char* Buf, NewOS::SizeT SectorSz, NewOS::SizeT Size); - -/// @brief get sector count. -NewOS::SizeT drv_std_get_sector_count(); - -/// @brief get device size. -NewOS::SizeT drv_std_get_drv_size(); - -/// @brief get sector count. -NewOS::SizeT drv_std_get_sector_count(); - -/// @brief get device size. -NewOS::SizeT drv_std_get_drv_size(); - -#endif // ifdef __KERNEL__ diff --git a/Kernel/Builtins/AHCI/compile_flags.txt b/Kernel/Builtins/AHCI/compile_flags.txt deleted file mode 100644 index 1bc51142..00000000 --- a/Kernel/Builtins/AHCI/compile_flags.txt +++ /dev/null @@ -1,4 +0,0 @@ --I./ --I../ --I../../ --std=c++20 diff --git a/Kernel/Builtins/APM/.gitkeep b/Kernel/Builtins/APM/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/Kernel/Builtins/ATA/ATA.hxx b/Kernel/Builtins/ATA/ATA.hxx deleted file mode 100644 index 98732c72..00000000 --- a/Kernel/Builtins/ATA/ATA.hxx +++ /dev/null @@ -1,156 +0,0 @@ -/* ------------------------------------------- - - Copyright Zeta Electronics Corporation - - File: Defines.hxx - Purpose: ATA header. - - Revision History: - - 03/02/24: Added file (amlel) - -------------------------------------------- */ - -#pragma once - -#ifndef __AHCI__ - -#include -#include - -///! Status register -#define ATA_SR_BSY 0x80 -#define ATA_SR_DRDY 0x40 -#define ATA_SR_DF 0x20 -#define ATA_SR_DSC 0x10 -#define ATA_SR_DRQ 0x08 -#define ATA_SR_CORR 0x04 -#define ATA_SR_IDX 0x02 -#define ATA_SR_ERR 0x01 - -///! Error register -#define ATA_ER_BBK 0x80 -#define ATA_ER_UNC 0x40 -#define ATA_ER_MC 0x20 -#define ATA_ER_IDNF 0x10 -#define ATA_ER_MCR 0x08 -#define ATA_ER_ABRT 0x04 -#define ATA_ER_TK0NF 0x02 -#define ATA_ER_AMNF 0x01 - -#define ATA_CMD_READ_PIO 0x20 -#define ATA_CMD_READ_PIO_EXT 0x24 -#define ATA_CMD_READ_DMA 0xC8 -#define ATA_CMD_READ_DMA_EXT 0x25 -#define ATA_CMD_WRITE_PIO 0x30 -#define ATA_CMD_WRITE_PIO_EXT 0x34 -#define ATA_CMD_WRITE_DMA 0xCA -#define ATA_CMD_WRITE_DMA_EXT 0x35 -#define ATA_CMD_CACHE_FLUSH 0xE7 -#define ATA_CMD_CACHE_FLUSH_EXT 0xEA -#define ATA_CMD_PACKET 0xA0 -#define ATA_CMD_IDENTIFY_PACKET 0xA1 -#define ATA_CMD_IDENTIFY 0xEC - -///! ident offsets, use with data that we got from ATA_CMD_IDENTIFY. -#define ATA_IDENT_DEVICE_TYPE 0 -#define ATA_IDENT_CYLINDERS 2 -#define ATA_IDENT_HEADS 6 -#define ATA_IDENT_SECTORS 12 -#define ATA_IDENT_SERIAL 20 -#define ATA_IDENT_MODEL 54 -#define ATA_IDENT_CAPABILITIES 98 -#define ATA_IDENT_FIELDVALID 106 -#define ATA_IDENT_MAX_LBA 120 -#define ATA_IDENT_COMMANDSETS 164 -#define ATA_IDENT_MAX_LBA_EXT 200 - -#define ATA_MASTER 0x00 -#define ATA_SLAVE 0x01 - -///! Register -#define ATA_REG_DATA 0x00 -#define ATA_REG_ERROR 0x01 -#define ATA_REG_FEATURES 0x01 -#define ATA_REG_SEC_COUNT0 0x02 -#define ATA_REG_LBA0 0x03 -#define ATA_REG_LBA1 0x04 -#define ATA_REG_LBA2 0x05 -#define ATA_REG_HDDEVSEL 0x06 -#define ATA_REG_COMMAND 0x07 -#define ATA_REG_STATUS 0x07 -#define ATA_REG_SEC_COUNT1 0x08 -#define ATA_REG_LBA3 0x09 -#define ATA_REG_LBA4 0x0A -#define ATA_REG_LBA5 0x0B -#define ATA_REG_CONTROL 0x0C -#define ATA_REG_ALT_STATUS 0x0C -#define ATA_REG_DEV_ADDRESS 0x0D - -#define ATA_REG_NEIN 0x01 - -#define ATA_PRIMARY_IO 0x1F0 -#define ATA_SECONDARY_IO 0x170 -#define ATA_PRIMARY_DCR_AS 0x3F6 -#define ATA_SECONDARY_DCR_AS 0x376 - -///! Irq -#define ATA_PRIMARY_IRQ 14 -#define ATA_SECONDARY_IRQ 15 - -///! Channels -#define ATA_PRIMARY 0x00 -#define ATA_SECONDARY 0x01 - -#define ATA_CYL_LOW 3 -#define ATA_CYL_MID 4 -#define ATA_CYL_HIGH 5 - -///! IO Direction -#define ATA_READ 0x00 -#define ATA_WRITE 0x013 - -#define ATA_PRIMARY_SEL 0xA0 -#define ATA_SECONDARY_SEL 0xB0 - -///! ATA address register. -#define ATA_ADDRESS1(x) (x + 3) -#define ATA_ADDRESS2(x) (x + 4) -#define ATA_ADDRESS3(x) (x + 5) - -///! ATA command register. -#define ATA_COMMAND(x) (x + 7) - -#define kATASectorSize (512U) - -enum -{ - kATADevicePATA, - kATADeviceSATA, - kATADevicePATA_PI, - kATADeviceSATA_PI, - kATADeviceCount, -}; - -#if defined(__ATA_PIO__) || defined(__ATA_DMA__) - -NewOS::Boolean drv_std_init(NewOS::UInt16 Bus, NewOS::UInt8 Drive, NewOS::UInt16& OutBus, NewOS::UInt8& OutMaster); - -NewOS::Boolean drv_std_detected(NewOS::Void); - -NewOS::Void drv_std_select(NewOS::UInt16 Bus); - -NewOS::Boolean drv_std_wait_io(NewOS::UInt16 IO); - -NewOS::Void drv_std_read(NewOS::UInt64 Lba, NewOS::UInt16 IO, NewOS::UInt8 Master, NewOS::Char* Buf, NewOS::SizeT SectorSz, NewOS::SizeT Size); - -NewOS::Void drv_std_write(NewOS::UInt64 Lba, NewOS::UInt16 IO, NewOS::UInt8 Master, NewOS::Char* Buf, NewOS::SizeT SectorSz, NewOS::SizeT Size); - -/// @brief get sector count. -NewOS::SizeT drv_std_get_sector_count(); - -/// @brief get device size. -NewOS::SizeT drv_std_get_drv_size(); - -#endif // ifdef __KERNEL__ -#endif // ifndef __ATA_PIO__ || __AHCI__ diff --git a/Kernel/Builtins/ATA/compile_flags.txt b/Kernel/Builtins/ATA/compile_flags.txt deleted file mode 100644 index 1bc51142..00000000 --- a/Kernel/Builtins/ATA/compile_flags.txt +++ /dev/null @@ -1,4 +0,0 @@ --I./ --I../ --I../../ --std=c++20 diff --git a/Kernel/Builtins/Flash/Flash.hxx b/Kernel/Builtins/Flash/Flash.hxx deleted file mode 100644 index d75539b6..00000000 --- a/Kernel/Builtins/Flash/Flash.hxx +++ /dev/null @@ -1,19 +0,0 @@ -/* ------------------------------------------- - - Copyright Zeta Electronics Corporation - -------------------------------------------- */ - -#pragma once - -#ifdef __FLASH_MEM__ - -/// @brief get sector count. -/// @return drive sector count. -NewOS::SizeT drv_std_get_sector_count(); - -/// @brief get device size. -/// @return drive size -NewOS::SizeT drv_std_get_drv_size(); - -#endif // ifdef __FLASH_MEM__ diff --git a/Kernel/Builtins/GPRS/.keepme b/Kernel/Builtins/GPRS/.keepme deleted file mode 100644 index e69de29b..00000000 diff --git a/Kernel/Builtins/GX/GX b/Kernel/Builtins/GX/GX deleted file mode 100644 index 62fdb006..00000000 --- a/Kernel/Builtins/GX/GX +++ /dev/null @@ -1,91 +0,0 @@ -/* ------------------------------------------- - - Copyright Zeta Electronics Corporation - -------------------------------------------- */ - -#pragma once - -#include - -#define GXInit() NewOS::SizeT __GXCursor = 0 - -#define gxClearClr RGB(00, 00, 00) - -#define GXFini() __GXCursor = 0 - -/// @brief Performs OR drawing on the framebuffer. -#define GXDrawAlphaImg(ImgPtr, _Height, _Width, BaseX, BaseY) \ - __GXCursor = 0; \ - \ - for (NewOS::SizeT i = BaseX; i < (_Height + BaseX); ++i) \ - { \ - for (NewOS::SizeT u = BaseY; u < (_Width + BaseY); ++u) \ - { \ - *(((volatile NewOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ - 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ - i + \ - 4 * u))) |= ImgPtr[__GXCursor]; \ - \ - ++__GXCursor; \ - } \ - } - -/// @brief Draws a resource. -#define GXDrawImg(ImgPtr, _Height, _Width, BaseX, BaseY) \ - __GXCursor = 0; \ - \ - for (NewOS::SizeT i = BaseX; i < (_Height + BaseX); ++i) \ - { \ - for (NewOS::SizeT u = BaseY; u < (_Width + BaseY); ++u) \ - { \ - *(((volatile NewOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ - 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ - i + \ - 4 * u))) = ImgPtr[__GXCursor]; \ - \ - ++__GXCursor; \ - } \ - } - -/// @brief Cleans a resource. -#define GXClear(_Height, _Width, BaseX, BaseY) \ - \ - for (NewOS::SizeT i = BaseX; i < _Height + BaseX; ++i) \ - { \ - for (NewOS::SizeT u = BaseY; u < _Width + BaseY; ++u) \ - { \ - *(((volatile NewOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ - 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ - i + \ - 4 * u))) = gxClearClr; \ - } \ - } - -/// @brief Draws inside a zone. -#define GXDraw(_Clr, _Height, _Width, BaseX, BaseY) \ - \ - for (NewOS::SizeT i = BaseX; i < (_Width + BaseX); ++i) \ - { \ - for (NewOS::SizeT u = BaseY; u < (_Height + BaseY); ++u) \ - { \ - *(((volatile NewOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ - 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ - i + \ - 4 * u))) = _Clr; \ - } \ - } - -/// This is enabled if Cairo is compiled with GX. -#ifdef __CG_USE_GX__ -/// @brief This function creates a new framebuffer for GX. -/// @return -inline cairo_surface_t* GXCreateFramebufferCairo() -{ - cairo_format_t format = CAIRO_FORMAT_ARGB32; - - 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); -} -#endif diff --git a/Kernel/Builtins/GX/Lerp b/Kernel/Builtins/GX/Lerp deleted file mode 100644 index eff198ee..00000000 --- a/Kernel/Builtins/GX/Lerp +++ /dev/null @@ -1,22 +0,0 @@ -/* ------------------------------------------- - - Copyright Zeta Electronics Corporation - -------------------------------------------- */ - -#pragma once - -/// @file Lerp.hxx -/// @brief Linear interpolation implementation. - -typedef float GXReal; - -/// @brief Linear interpolation equation solver. -/// @param from where? -/// @param to to? -/// @param at which state we're at **to**. -inline GXReal GXLerp(GXReal to, GXReal from, GXReal stat) -{ - register GXReal difference = to - from; - return from + (difference * stat); -} diff --git a/Kernel/Builtins/GX/Rsrc/Cursor.rsrc b/Kernel/Builtins/GX/Rsrc/Cursor.rsrc deleted file mode 100644 index 2283cb32..00000000 --- a/Kernel/Builtins/GX/Rsrc/Cursor.rsrc +++ /dev/null @@ -1,64 +0,0 @@ -#define cCurHeight (57) -#define cCurWidth (53) - -#define cCurLength (3021) - -static const unsigned int Cursor[cCurLength] = { - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0x474747, 0x474747, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x363636, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x363636, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xa5a5a5, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x686868, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x585858, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0x585858, 0x222222, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x363636, 0x000000, 0x000000, 0x000000, 0x686868, 0xebebeb, 0xf9f9f9, 0x969696, 0x000000, 0x000000, 0x000000, 0x222222, 0xdedede, 0xf9f9f9, 0xdedede, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x575757, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xdedede, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x000000, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0x575757, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x000000, 0x585858, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x000000, 0x777777, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0x474747, 0x474747, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x777777, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xcfcfcf, 0x000000, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x363636, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0xb3b3b3, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x686868, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x363636, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x222222, 0x222222, 0x363636, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x222222, 0x000000, 0x000000, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x686868, 0x686868, 0xcfcfcf, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xcfcfcf, 0xd0d0d0, 0xdedede, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x222222, 0x000000, 0x000000, 0xa5a5a5, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x000000, 0x686868, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xcfcfcf, 0x000000, 0x000000, 0x585858, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x363636, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x686868, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xd0d0d0, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x585858, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xb3b3b3, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xa5a5a5, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x0e0e0e, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x686868, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xcfcfcf, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xb3b3b3, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x0e0e0e, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x777777, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0xb4b4b4, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x686868, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0xb4b4b4, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xdedede, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xcfcfcf, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0x363636, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x777777, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x343434, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x575757, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xb3b3b3, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x343434, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x686868, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x777777, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x222222, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xcfcfcf, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x585858, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xebebeb, 0x585858, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0x878787, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0x979797, 0x686868, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000 -}; diff --git a/Kernel/Builtins/HPET/.gitkeep b/Kernel/Builtins/HPET/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/Kernel/Builtins/HPET/Defines.hxx b/Kernel/Builtins/HPET/Defines.hxx deleted file mode 100644 index 697eee65..00000000 --- a/Kernel/Builtins/HPET/Defines.hxx +++ /dev/null @@ -1,42 +0,0 @@ -/* ------------------------------------------- - - Copyright Zeta Electronics Corporation - - File: HPET.hxx - Purpose: HPET builtin. - - Revision History: - -------------------------------------------- */ - -#pragma once - -#include -#include - -namespace NewOS -{ - struct PACKED HPETAddressStructure final - { - NewOS::UInt8 AddressSpaceId; // 0 - system memory, 1 - system I/O - NewOS::UInt8 RegisterBitWidth; - NewOS::UInt8 RegisterBitOffset; - NewOS::UInt8 Reserved; - NewOS::UInt64 Address; - }; - - struct PACKED HPETHeader final : public SDT - { - NewOS::UInt8 HardwareRevId; - NewOS::UInt8 ComparatorCount : 5; - NewOS::UInt8 CounterSize : 1; - NewOS::UInt8 Reserved : 1; - NewOS::UInt8 LegacyReplacement : 1; - NewOS::UInt16 PciVendorId; - HPETAddressStructure Address; - NewOS::UInt8 HpetNumber; - NewOS::UInt16 MinimumTick; - NewOS::UInt8 PageProtection; - }; - -} // namespace NewOS \ No newline at end of file diff --git a/Kernel/Builtins/IEEE802/.gitkeep b/Kernel/Builtins/IEEE802/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/Kernel/Builtins/IEEE802/compile_flags.txt b/Kernel/Builtins/IEEE802/compile_flags.txt deleted file mode 100644 index 1fbcad21..00000000 --- a/Kernel/Builtins/IEEE802/compile_flags.txt +++ /dev/null @@ -1,4 +0,0 @@ --I./ --I../ --I../Kernel --std=c++20 diff --git a/Kernel/Builtins/LTE/.keepme b/Kernel/Builtins/LTE/.keepme deleted file mode 100644 index e69de29b..00000000 diff --git a/Kernel/Builtins/LTE/IO.hxx b/Kernel/Builtins/LTE/IO.hxx deleted file mode 100644 index a3f62fa9..00000000 --- a/Kernel/Builtins/LTE/IO.hxx +++ /dev/null @@ -1,29 +0,0 @@ -/* ------------------------------------------- - -Copyright Zeta Electronics Corporation. - -File: LTE\IO.hxx. -Purpose: LTE I/O. - -------------------------------------------- */ - -#ifndef _INC_NETWORK_LTE_IO_HXX_ -#define _INC_NETWORK_LTE_IO_HXX_ - -#include -#include - -/// @brief LTE I/O routines. - -/// @brief Turn on SIM slot. -NewOS::Boolean lte_turn_on_slot(NewOS::Int32 slot); - -/// @brief Turn off SIM slot. -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); - - -#endif // ifndef _INC_NETWORK_LTE_IO_HXX_ diff --git a/Kernel/Builtins/MBCI/Interface.hxx b/Kernel/Builtins/MBCI/Interface.hxx deleted file mode 100644 index 3c504376..00000000 --- a/Kernel/Builtins/MBCI/Interface.hxx +++ /dev/null @@ -1,10 +0,0 @@ -/* ------------------------------------------- - - Copyright Zeta Electronics Corporation - -------------------------------------------- */ - -#pragma once - -#include -#include \ No newline at end of file diff --git a/Kernel/Builtins/MBCI/MBCI.hxx b/Kernel/Builtins/MBCI/MBCI.hxx deleted file mode 100644 index ab5dabf1..00000000 --- a/Kernel/Builtins/MBCI/MBCI.hxx +++ /dev/null @@ -1,55 +0,0 @@ -/* ------------------------------------------- - - Copyright Zeta Electronics Corporation - -------------------------------------------- */ - -#pragma once - -#include -#include - -namespace NewOS -{ - struct MBCIHostInterface; - - /// @brief MBCI Host Interface header. - struct PACKED MBCIHostInterface final - { - UInt32 HostId; - UInt16 VendorId; - UInt16 DeviceId; - UInt8 MemoryType; - UInt16 HostType; - UInt16 HostFlags; - UInt8 Error; - UInt8 Status; - UInt8 InterruptEnable; - UInt64 BaseAddressRegister; - UInt64 BaseAddressRegisterSize; - }; - - /// @brief MBCI host flags. - enum MBCIHostFlags - { - kMBCIHostFlagsSupportsPageProtection, /// Page protected. - kMBCIHostFlagsSupportsAPM, /// Advanced Power Management. - kMBCIHostFlagsSupportsDaisyChain, /// Is daisy chained. - kMBCIHostFlagsSupportsHWInterrupts, /// Has HW interrupts. - kMBCIHostFlagsSupportsDMA, /// Has DMA. - kMBCIHostFlagsExtended = __UINT16_MAX__, // Extended flags table. - }; - - enum MBCIHostKind - { - kMBCIHostKindHardDisk, - kMBCIHostKindOpticalDisk, - kMBCIHostKindKeyboardLow, - kMBCIHostKindMouseLow, - kMBCIHostKindMouseHigh, - kMBCIHostKindKeyboardHigh, - kMBCIHostKindNetworkInterface, - kMBCIHostKindDaisyChain, - kMBCIHostKindStartExtended = __UINT16_MAX__, /// Extended vendor table. - }; -} // namespace NewOS diff --git a/Kernel/Builtins/NVME/.gitkeep b/Kernel/Builtins/NVME/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/Kernel/Builtins/NVME/compile_flags.txt b/Kernel/Builtins/NVME/compile_flags.txt deleted file mode 100644 index 1bc51142..00000000 --- a/Kernel/Builtins/NVME/compile_flags.txt +++ /dev/null @@ -1,4 +0,0 @@ --I./ --I../ --I../../ --std=c++20 diff --git a/Kernel/Builtins/OHCI/.gitkeep b/Kernel/Builtins/OHCI/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/Kernel/Builtins/PS2/PS2MouseInterface.hxx b/Kernel/Builtins/PS2/PS2MouseInterface.hxx deleted file mode 100644 index 124d4380..00000000 --- a/Kernel/Builtins/PS2/PS2MouseInterface.hxx +++ /dev/null @@ -1,112 +0,0 @@ -/* ------------------------------------------- - - Copyright Zeta Electronics Corporation - - File: PS2MouseInterface.hxx - Purpose: PS/2 mouse. - - Revision History: - - 03/02/24: Added file (amlel) - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -namespace NewOS -{ - /// @brief PS/2 Mouse driver interface - class PS2MouseInterface final - { - public: - explicit PS2MouseInterface() = default; - ~PS2MouseInterface() = default; - - NEWOS_COPY_DEFAULT(PS2MouseInterface); - - public: - /// @brief Enables PS2 mouse for kernel. - /// @return - Void Init() noexcept - { - HAL::rt_cli(); - - HAL::Out8(0x64, 0xA8); // enabling the auxiliary device - mouse - - this->Wait(); - HAL::Out8(0x64, 0x20); // tells the keyboard controller that we want to send a command to the mouse - this->WaitInput(); - - UInt8 status = HAL::In8(0x60); - status |= 0b10; - - this->Wait(); - HAL::Out8(0x64, 0x60); - this->Wait(); - HAL::Out8(0x60, status); // setting the correct bit is the "compaq" status byte - - this->Write(0xF6); - this->Read(); - - this->Write(0xF4); - this->Read(); - - HAL::rt_sti(); - } - - public: - Bool WaitInput() noexcept - { - UInt64 timeout = 100000; - - while (timeout) - { - if ((HAL::In8(0x64) & 0x1)) - { - return true; - } - - --timeout; - } // wait until we can read - - // return the ack bit. - return false; - } - - Bool Wait() noexcept - { - UInt64 timeout = 100000; - - while (timeout) - { - if ((HAL::In8(0x64) & 0b10) == 0) - { - return true; - } - - --timeout; - } // wait until we can read - - // return the ack bit. - return false; - } - - Void Write(UInt8 val) - { - HAL::Out8(0x64, 0xD4); - this->Wait(); - HAL::Out8(0x60, val); - this->Wait(); - } - - UInt8 Read() - { - this->WaitInput(); - return HAL::In8(0x60); - } - }; -} // namespace NewOS diff --git a/Kernel/Builtins/ReadMe.txt b/Kernel/Builtins/ReadMe.txt deleted file mode 100644 index df63e0be..00000000 --- a/Kernel/Builtins/ReadMe.txt +++ /dev/null @@ -1,19 +0,0 @@ -============== -NewOS Builtins -============== - -=============== -What are these? -=============== - -These are like modules for the kernel. - -=================== -Maintainers/Authors -=================== - -ACPI: Amlal EL Mahrouss. -AHCI: Amlal EL Mahrouss. -GX: Amlal EL Mahrouss. -PS2: Amlal EL Mahrouss. -ATA: Amlal EL Mahrouss. \ No newline at end of file diff --git a/Kernel/Builtins/SCSI/.gitkeep b/Kernel/Builtins/SCSI/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/Kernel/Builtins/SCSI/SCSI.hxx b/Kernel/Builtins/SCSI/SCSI.hxx deleted file mode 100644 index a0feb649..00000000 --- a/Kernel/Builtins/SCSI/SCSI.hxx +++ /dev/null @@ -1,14 +0,0 @@ -/* ------------------------------------------- - - Copyright Zeta Electronics Corporation - -------------------------------------------- */ - -#pragma once - -#include - -/// @file SCSI.hxx -/// @brief Serial SCSI driver. - -typedef NewOS::UInt16 scsi_packet_type[12]; diff --git a/Kernel/Builtins/WiFi/.gitkeep b/Kernel/Builtins/WiFi/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/Kernel/Builtins/WiFi/compile_flags.txt b/Kernel/Builtins/WiFi/compile_flags.txt deleted file mode 100644 index 1bc51142..00000000 --- a/Kernel/Builtins/WiFi/compile_flags.txt +++ /dev/null @@ -1,4 +0,0 @@ --I./ --I../ --I../../ --std=c++20 diff --git a/Kernel/Builtins/XHCI/.gitkeep b/Kernel/Builtins/XHCI/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/Kernel/Builtins/XHCI/Defines.hxx b/Kernel/Builtins/XHCI/Defines.hxx deleted file mode 100644 index 91147a58..00000000 --- a/Kernel/Builtins/XHCI/Defines.hxx +++ /dev/null @@ -1,70 +0,0 @@ -/* ------------------------------------------- - - Copyright Zeta Electronics Corporation - - File: Defines.hxx - Purpose: XHCI (and backwards) header. - - Revision History: - - 01/02/24: Added file (amlel) - 03/02/24: Update filename to Defines.hxx (amlel) - -------------------------------------------- */ - -#pragma once - -#include - -using namespace NewOS; - -#define kUSBCommand (UInt16)0x0 -#define kUSBStatus (UInt16)0x2 -#define kUSBInterruptEnable (UInt16)0x4 -#define kUSBFrameNum (UInt16)0x6 -#define kUSBFrameListBaseAddress (UInt16)0x8 -#define kUSBFrameModifyStart (UInt16)0xC -#define kUSBPort1StatusCtrl (UInt16)0x10 -#define kUSBPort2StatusCtrl (UInt16)0x12 - -typedef struct USBCommandRegister final -{ - UInt8 mReserved[8]; // Reserved - UInt8 - mMaxPacket; // 0 = Max packet size 32 bits 1 = Max packet size 64 bits - UInt8 mConfigure; - UInt8 mSoftwareDebug; - UInt8 mGlobalResume; - UInt8 mGlobalSuspend; - UInt8 mHostCtrlReset; - UInt8 mRun; // 1 = Controller execute frame list entries -} USBCommandRegister; - -typedef struct USBStatusRegister final -{ - UInt8 mReserved[8]; // Reserved - UInt8 mHalted; // 1 = bit 0 in CMD is zero 0 = bit 0 in CMD is 1 - UInt8 mProcessError; - UInt8 mSystemError; - UInt8 mResumeDetected; - UInt8 mErrorInterrupt; - UInt8 mInterrupt; -} USBStatusRegister; - -typedef struct USBInterruptEnableRegister final -{ - UInt8 mReserved[4]; // Reserved - UInt8 mShortPacket; // 1=Enable interrupt 0=Disable interrupt - UInt8 mComplete; // 1=Enable interrupt 0=Disable interrupt - UInt8 mResume; // 1=Enable interrupt 0=Disable interrupt - UInt8 mTimeoutCRC; // 1=Enable interrupt 0=Disable interrupt -} USBInterruptEnableRegister; - -/* - Some terminology: - - Frame Number: Number of processed entry of the Frame List. - Frame List Base Address: - 32-bit physical adress of Frame List. Remember that first 12 bytes are - always 0. The Frame List must contain 1024 entries. -*/ diff --git a/Kernel/Builtins/XHCI/compile_flags.txt b/Kernel/Builtins/XHCI/compile_flags.txt deleted file mode 100644 index 1bc51142..00000000 --- a/Kernel/Builtins/XHCI/compile_flags.txt +++ /dev/null @@ -1,4 +0,0 @@ --I./ --I../ --I../../ --std=c++20 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 #include #include -#include +#include #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 +#include #include #include #include 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 +#include #include #include #include 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 -#include +#include #include #include #include @@ -14,6 +14,7 @@ #include #include #include +#include #include /// @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(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(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(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(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(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 -#include -#include +#include +#include +#include #include #include 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 +#include #include #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 -#include +#include #include 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 +#include #include #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; typedef UInt64 CursorType; - + /// @brief constructor template FileStream::FileStream(const Encoding* path, @@ -303,7 +309,7 @@ namespace NewOS } /// @brief destructor - template + template FileStream::~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 +#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> fFile; - Ref fPath; - VoidPtr fCachedBlob; - bool fFatBinary; - bool fBad; + Ref 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& process); - static PID& TheCurrentPID(); + static bool Switch(HAL::StackFrame* newStack, const PID& newPid); + static bool CanBeScheduled(Ref& process); + static PID& TheCurrentPID(); static SizeT StartScheduling(); }; diff --git a/Kernel/Modules/.gitkeep b/Kernel/Modules/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Kernel/Modules/ACPI/.gitkeep b/Kernel/Modules/ACPI/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Kernel/Modules/ACPI/ACPI.hxx b/Kernel/Modules/ACPI/ACPI.hxx new file mode 100644 index 00000000..019bcb11 --- /dev/null +++ b/Kernel/Modules/ACPI/ACPI.hxx @@ -0,0 +1,88 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + +------------------------------------------- */ + +#ifndef __ACPI__ +#define __ACPI__ + +/** + https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html +*/ + +#include + +namespace NewOS +{ + class PACKED SDT + { + public: + Char Signature[4]; + UInt32 Length; + UInt8 Revision; + Char Checksum; + Char OemId[6]; + Char OemTableId[8]; + UInt32 OemRev; + UInt32 CreatorID; + UInt32 CreatorRevision; + }; + + class PACKED RSDP : public SDT + { + public: + UInt32 RsdtAddress; + UIntPtr XsdtAddress; + UInt8 ExtendedChecksum; + UInt8 Reserved0[3]; + }; + + class PACKED ConfigHeader + { + public: + UInt64 BaseAddress; + UInt16 PciSegGroup; + UInt8 StartBus; + UInt8 EndBus; + UInt32 Reserved; + }; + + enum class AddressSpace : UInt8 + { + SystemMemory = 0, + SystemIO = 1, + Pci = 2, + Controller = 3, + SmBus = 4, + Count = 5, + Invalid = 0xFF, + }; + + class PACKED Address + { + public: + AddressSpace AddressSpaceId; + UInt8 RegisterBitWidth; + UInt8 RegisterBitOffset; + UInt8 Reserved; + UIntPtr Address; + }; + + class PACKED RSDT + { + public: + Char Signature[4]; + UInt32 Length; + UInt8 Revision; + Char Checksum; + Char OemId[6]; + Char OemTableId[8]; + UInt32 OemRev; + UInt32 CreatorID; + UInt32 CreatorRevision; + UInt32 AddressArr[]; + }; +} // namespace NewOS + +#endif // !__ACPI__ diff --git a/Kernel/Modules/ACPI/ACPIFactoryInterface.hxx b/Kernel/Modules/ACPI/ACPIFactoryInterface.hxx new file mode 100644 index 00000000..7fbe6192 --- /dev/null +++ b/Kernel/Modules/ACPI/ACPIFactoryInterface.hxx @@ -0,0 +1,55 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + +------------------------------------------- */ + +#ifndef __ACPI_MANAGER__ +#define __ACPI_MANAGER__ + +#include +#include +#include +#include + +namespace NewOS +{ + class ACPIFactoryInterface final + { + public: + explicit ACPIFactoryInterface(voidPtr rsdPtr); + ~ACPIFactoryInterface() = default; + + ACPIFactoryInterface& operator=(const ACPIFactoryInterface&) = default; + ACPIFactoryInterface(const ACPIFactoryInterface&) = default; + + public: + void Shutdown(); // shutdown + void Reboot(); // soft-reboot + + public: + /// @brief Descriptor find factory. + /// @param signature The signature of the descriptor table (MADT, ACPI...) + /// @return the blob inside an ErrorOr object. + ErrorOr Find(const char* signature); + + /// @brief Checksum factory. + /// @param checksum the data to checksum + /// @param len it's size + /// @return if it succeed + bool Checksum(const char* checksum, SSizeT len); // watch for collides! + + public: + ErrorOr operator[](const char* signature) + { + return this->Find(signature); + } + + private: + VoidPtr fRsdp; // pointer to root descriptor. + SSizeT fEntries; // number of entries, -1 tells that no invalid entries were + // found. + }; +} // namespace NewOS + +#endif // !__ACPI_MANAGER__ diff --git a/Kernel/Modules/ACPI/compile_flags.txt b/Kernel/Modules/ACPI/compile_flags.txt new file mode 100644 index 00000000..1bc51142 --- /dev/null +++ b/Kernel/Modules/ACPI/compile_flags.txt @@ -0,0 +1,4 @@ +-I./ +-I../ +-I../../ +-std=c++20 diff --git a/Kernel/Modules/AHCI/.gitkeep b/Kernel/Modules/AHCI/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Kernel/Modules/AHCI/AHCI.hxx b/Kernel/Modules/AHCI/AHCI.hxx new file mode 100644 index 00000000..b090c229 --- /dev/null +++ b/Kernel/Modules/AHCI/AHCI.hxx @@ -0,0 +1,368 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + + File: Defines.hxx + Purpose: AHCI header. + + Revision History: + + 03/02/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +#include +#include + +// Forward declarations of structs. + +struct HbaPort; +struct FisData; +struct FisRegD2H; +struct FisRegH2D; + +/// @brief Frame information type. +enum +{ + kFISTypeRegH2D = 0x27, // Register FIS - host to device + kFISTypeRegD2H = 0x34, // Register FIS - device to host + kFISTypeDMAAct = 0x39, // DMA activate FIS - device to host + kFISTypeDMASetup = 0x41, // DMA setup FIS - bidirectional + kFISTypeData = 0x46, // Data FIS - bidirectional + kFISTypeBIST = 0x58, // BIST activate FIS - bidirectional + kFISTypePIOSetup = 0x5F, // PIO setup FIS - device to host + kFISTypeDevBits = 0xA1, // Set device bits FIS - device to host +}; + +enum +{ + kAHCICmdIdentify = 0xEC, + kAHCICmdReadDma = 0xC8, + kAHCICmdReadDmaEx = 0x25, + kAHCICmdWriteDma = 0xCA, + kAHCICmdWriteDmaEx = 0x35 +}; + +typedef struct FisRegH2D final +{ + // DWORD 0 + NewOS::UInt8 FisType; // FIS_TYPE_REG_H2D + + NewOS::UInt8 PortMul : 4; // Port multiplier + NewOS::UInt8 Reserved0 : 3; // Reserved + NewOS::UInt8 CmdOrCtrl : 1; // 1: Command, 0: Control + + NewOS::UInt8 Command; // Command register + NewOS::UInt8 Featurel; // Feature register, 7:0 + + // DWORD 1 + NewOS::UInt8 Lba0; // LBA low register, 7:0 + NewOS::UInt8 Lba1; // LBA mid register, 15:8 + NewOS::UInt8 Lba2; // LBA high register, 23:16 + NewOS::UInt8 Device; // Device register + + // DWORD 2 + NewOS::UInt8 Lba3; // LBA register, 31:24 + NewOS::UInt8 Lba4; // LBA register, 39:32 + NewOS::UInt8 Lba5; // LBA register, 47:40 + NewOS::UInt8 FeatureHigh; // Feature register, 15:8 + + // DWORD 3 + NewOS::UInt8 CountLow; // Count register, 7:0 + NewOS::UInt8 CountHigh; // Count register, 15:8 + NewOS::UInt8 Icc; // Isochronous command completion + NewOS::UInt8 Control; // Control register + + // DWORD 4 + NewOS::UInt8 Reserved1[4]; // Reserved +} FisRegH2D; + +typedef struct FisRegD2H final +{ + // DWORD 0 + NewOS::UInt8 FisType; // FIS_TYPE_REG_D2H + + NewOS::UInt8 PortMul : 4; // Port multiplier + NewOS::UInt8 Reserved0 : 2; // Reserved + NewOS::UInt8 InterruptBit : 1; // Interrupt bit + NewOS::UInt8 Reserved1 : 1; // Reserved + + NewOS::UInt8 Status; // Status register + NewOS::UInt8 Rrror; // Error register + + // DWORD 1 + NewOS::UInt8 Lba0; // LBA low register, 7:0 + NewOS::UInt8 Lba1; // LBA mid register, 15:8 + NewOS::UInt8 Lba2; // LBA high register, 23:16 + NewOS::UInt8 Device; // Device register + + // DWORD 2 + NewOS::UInt8 Lba3; // LBA register, 31:24 + NewOS::UInt8 Lba4; // LBA register, 39:32 + NewOS::UInt8 Lba5; // LBA register, 47:40 + NewOS::UInt8 Rsv2; // Reserved + + // DWORD 3 + NewOS::UInt8 CountLow; // Count register, 7:0 + NewOS::UInt8 CountHigh; // Count register, 15:8 + NewOS::UInt8 Rsv3[2]; // Reserved + + // DWORD 4 + NewOS::UInt8 Rsv4[4]; // Reserved +} FisRegD2H; + +typedef struct FisData final +{ + // DWORD 0 + NewOS::UInt8 FisType; // FIS_TYPE_DATA + + NewOS::UInt8 PortMul : 4; // Port multiplier + NewOS::UInt8 Reserved0 : 4; // Reserved + + NewOS::UInt8 Reserved1[2]; // Reserved + + // DWORD 1 ~ N + NewOS::UInt32 Data[1]; // Payload +} FisData; + +typedef struct FisPioSetup final +{ + // DWORD 0 + NewOS::UInt8 FisType; // FIS_TYPE_PIO_SETUP + + NewOS::UInt8 PortMul : 4; // Port multiplier + NewOS::UInt8 Reserved0 : 1; // Reserved + NewOS::UInt8 DTD : 1; // Data transfer direction, 1 - device to host + NewOS::UInt8 InterruptBit : 1; // Interrupt bit + NewOS::UInt8 Reserved1 : 1; + + NewOS::UInt8 Status; // Status register + NewOS::UInt8 Error; // Error register + + // DWORD 1 + NewOS::UInt8 Lba0; // LBA low register, 7:0 + NewOS::UInt8 Lba1; // LBA mid register, 15:8 + NewOS::UInt8 Lba2; // LBA high register, 23:16 + NewOS::UInt8 Device; // Device register + + // DWORD 2 + NewOS::UInt8 Lba3; // LBA register, 31:24 + NewOS::UInt8 Lba4; // LBA register, 39:32 + NewOS::UInt8 Lba5; // LBA register, 47:40 + NewOS::UInt8 Rsv2; // Reserved + + // DWORD 3 + NewOS::UInt8 CountLow; // Count register, 7:0 + NewOS::UInt8 CountHigh; // Count register, 15:8 + NewOS::UInt8 Rsv3; // Reserved + NewOS::UInt8 EStatus; // New value of status register + + // DWORD 4 + NewOS::UInt16 TranferCount; // Transfer count + NewOS::UInt8 Rsv4[2]; // Reserved +} FisPioSetup; + +typedef struct FisDmaSetup final +{ + // DWORD 0 + NewOS::UInt8 FisType; // FIS_TYPE_DMA_SETUP + + NewOS::UInt8 PortMul : 4; // Port multiplier + NewOS::UInt8 Reserved0 : 1; // Reserved + NewOS::UInt8 DTD : 1; // Data transfer direction, 1 - device to host + NewOS::UInt8 InterruptBit : 1; // Interrupt bit + NewOS::UInt8 AutoEnable : 1; // Auto-activate. Specifies if DMA Activate FIS is needed + + NewOS::UInt8 Reserved1[2]; // Reserved + + // DWORD 1&2 + NewOS::UInt64 DmaBufferId; // DMA Buffer Identifier. Used to Identify DMA buffer in + // host memory. SATA Spec says host specific and not in + // Spec. Trying AHCI spec might work. + + // DWORD 3 + NewOS::UInt32 Rsvd; // More reserved + + // DWORD 4 + NewOS::UInt32 DmabufOffset; // Byte offset into buffer. First 2 bits must be 0 + + // DWORD 5 + NewOS::UInt32 TransferCount; // Number of bytes to transfer. Bit 0 must be 0 + + // DWORD 6 + NewOS::UInt32 Reserved3; // Reserved +} FisDmaSetup; + +typedef struct FisDevBits final +{ + // DWORD 0 + NewOS::UInt8 FisType; // FIS_TYPE_DMA_SETUP (A1h) + + NewOS::UInt8 Reserved0 : 5; // Reserved + NewOS::UInt8 R0 : 1; + NewOS::UInt8 InterruptBit : 1; + NewOS::UInt8 N : 1; + + NewOS::UInt8 StatusLow : 3; + NewOS::UInt8 R1 : 1; + NewOS::UInt8 StatusHigh : 3; + + NewOS::UInt8 R2 : 1; + NewOS::UInt8 Error; + + // DWORD 1 + NewOS::UInt32 Act; +} FisDevBits; + +/// \brief Enable AHCI device bit in GHC register. +#ifndef kAhciGHC_AE +#define kAhciGHC_AE (31) +#endif //! ifndef kAhciGHC_AE + +typedef struct HbaPort final +{ + NewOS::UInt32 Clb; // 0x00, command list base address, 1K-byte aligned + NewOS::UInt32 Clbu; // 0x04, command list base address upper 32 bits + NewOS::UInt32 Fb; // 0x08, FIS base address, 256-byte aligned + NewOS::UInt32 Fbu; // 0x0C, FIS base address upper 32 bits + NewOS::UInt32 Is; // 0x10, interrupt status + NewOS::UInt32 Ie; // 0x14, interrupt enable + NewOS::UInt32 Cmd; // 0x18, command and status + NewOS::UInt32 Reserved0; // 0x1C, Reserved + NewOS::UInt32 Tfd; // 0x20, task file data + NewOS::UInt32 Sig; // 0x24, signature + NewOS::UInt32 Ssts; // 0x28, SATA status (SCR0:SStatus) + NewOS::UInt32 Sctl; // 0x2C, SATA control (SCR2:SControl) + NewOS::UInt32 Serr; // 0x30, SATA error (SCR1:SError) + NewOS::UInt32 Sact; // 0x34, SATA active (SCR3:SActive) + NewOS::UInt32 Ci; // 0x38, command issue + NewOS::UInt32 Sntf; // 0x20, SATA notification (SCR4:SNotification) + NewOS::UInt32 Fbs; // 0x40, FIS-based switch control + NewOS::UInt32 Reserved1[11]; // 0x44 ~ 0x6F, Reserved + NewOS::UInt32 Vendor[4]; // 0x70 ~ 0x7F, vendor specific +} HbaPort; + +typedef struct HbaMem final +{ + // 0x00 - 0x2B, Generic Host Control + NewOS::UInt32 Cap; // 0x00, Host capability + NewOS::UInt32 Ghc; // 0x04, Global host control + NewOS::UInt32 Is; // 0x08, Interrupt status + NewOS::UInt32 Pi; // 0x0C, Port implemented + NewOS::UInt32 Vs; // 0x10, Version + NewOS::UInt32 Ccc_ctl; // 0x14, Command completion coalescing control + NewOS::UInt32 Ccc_pts; // 0x18, Command completion coalescing ports + NewOS::UInt32 Em_loc; // 0x1C, Enclosure management location + NewOS::UInt32 Em_ctl; // 0x20, Enclosure management control + NewOS::UInt32 Cap2; // 0x24, Host capabilities extended + NewOS::UInt32 Bohc; // 0x28, BIOS/OS handoff control and status + + NewOS::UInt16 Resv0; + NewOS::UInt32 Resv2; + + HbaPort Ports[1]; // 1 ~ 32 +} HbaMem; + +typedef struct HbaCmdHeader final +{ + // DW0 + NewOS::UInt8 Cfl : 5; // Command FIS length in DWORDS, 2 ~ 16 + NewOS::UInt8 Atapi : 1; // ATAPI + NewOS::UInt8 Write : 1; // Write, 1: H2D, 0: D2H + NewOS::UInt8 Prefetchable : 1; // Prefetchable + + NewOS::UInt8 Reset : 1; // Reset + NewOS::UInt8 BIST : 1; // BIST + NewOS::UInt8 Clear : 1; // Clear busy upon R_OK + NewOS::UInt8 Reserved0 : 1; // Reserved + NewOS::UInt8 Pmp : 4; // Port multiplier port + + NewOS::UInt16 Prdtl; // Physical region descriptor table length in entries + volatile NewOS::UInt32 Prdbc; // Physical region descriptor byte count transferred + + NewOS::UInt32 Ctba; // Command table descriptor base address + NewOS::UInt32 Ctbau; // Command table descriptor base address upper 32 bits + + NewOS::UInt32 Reserved1[4]; // Reserved +} HbaCmdHeader; + +typedef struct HbaFis final +{ + // 0x00 + FisDmaSetup Dsfis; // DMA Setup FIS + NewOS::UInt8 Pad0[4]; + // 0x20 + FisPioSetup Psfis; // PIO Setup FIS + NewOS::UInt8 Pad1[12]; + // 0x40 + FisRegD2H Rfis; // Register – Device to Host FIS + NewOS::UInt8 Pad2[4]; + // 0x58 + FisDevBits Sdbfis; // Set Device Bit FIS + // 0x60 + NewOS::UInt8 Ufis[64]; + // 0xA0 + NewOS::UInt8 Rsv[0x100 - 0xA0]; +} HbaFis; + +typedef struct HbaPrdtEntry final +{ + NewOS::UInt32 Dba; // Data base address + NewOS::UInt32 Dbau; // Data base address upper 32 bits + NewOS::UInt32 Reserved0; // Reserved + // DW3 + NewOS::UInt32 Dbc : 22; // Byte count, 4M max + NewOS::UInt32 Reserved1 : 9; // Reserved + NewOS::UInt32 InterruptBit : 1; // Interrupt on completion +} HbaPrdtEntry; + +typedef struct HbaCmdTbl final +{ + NewOS::UInt8 Cfis[64]; // Command FIS + NewOS::UInt8 Acmd[16]; // ATAPI command, 12 or 16 bytes + NewOS::UInt8 Rsv[48]; // Reserved + struct HbaPrdtEntry prdtEntries[1]; // Physical region descriptor table entries, 0 ~ 65535 +} HbaCmdTbl; + +/* EOF */ + +#if defined(__AHCI__) + +/// @brief Initializes an AHCI disk. +/// @param PortsImplemented the amount of port that have been detected. +/// @return +NewOS::Boolean drv_std_init(NewOS::UInt16& PortsImplemented); + +NewOS::Boolean drv_std_detected(NewOS::Void); + +/// @brief Read from disk. +/// @param Lba +/// @param Buf +/// @param SectorSz +/// @param Size +/// @return +NewOS::Void drv_std_read(NewOS::UInt64 Lba, NewOS::Char* Buf, NewOS::SizeT SectorSz, NewOS::SizeT Size); + +/// @brief Write to disk. +/// @param Lba +/// @param Buf +/// @param SectorSz +/// @param Size +/// @return +NewOS::Void drv_std_write(NewOS::UInt64 Lba, NewOS::Char* Buf, NewOS::SizeT SectorSz, NewOS::SizeT Size); + +/// @brief get sector count. +NewOS::SizeT drv_std_get_sector_count(); + +/// @brief get device size. +NewOS::SizeT drv_std_get_drv_size(); + +/// @brief get sector count. +NewOS::SizeT drv_std_get_sector_count(); + +/// @brief get device size. +NewOS::SizeT drv_std_get_drv_size(); + +#endif // ifdef __KERNEL__ diff --git a/Kernel/Modules/AHCI/compile_flags.txt b/Kernel/Modules/AHCI/compile_flags.txt new file mode 100644 index 00000000..1bc51142 --- /dev/null +++ b/Kernel/Modules/AHCI/compile_flags.txt @@ -0,0 +1,4 @@ +-I./ +-I../ +-I../../ +-std=c++20 diff --git a/Kernel/Modules/APM/.gitkeep b/Kernel/Modules/APM/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Kernel/Modules/ATA/ATA.hxx b/Kernel/Modules/ATA/ATA.hxx new file mode 100644 index 00000000..98732c72 --- /dev/null +++ b/Kernel/Modules/ATA/ATA.hxx @@ -0,0 +1,156 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + + File: Defines.hxx + Purpose: ATA header. + + Revision History: + + 03/02/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +#ifndef __AHCI__ + +#include +#include + +///! Status register +#define ATA_SR_BSY 0x80 +#define ATA_SR_DRDY 0x40 +#define ATA_SR_DF 0x20 +#define ATA_SR_DSC 0x10 +#define ATA_SR_DRQ 0x08 +#define ATA_SR_CORR 0x04 +#define ATA_SR_IDX 0x02 +#define ATA_SR_ERR 0x01 + +///! Error register +#define ATA_ER_BBK 0x80 +#define ATA_ER_UNC 0x40 +#define ATA_ER_MC 0x20 +#define ATA_ER_IDNF 0x10 +#define ATA_ER_MCR 0x08 +#define ATA_ER_ABRT 0x04 +#define ATA_ER_TK0NF 0x02 +#define ATA_ER_AMNF 0x01 + +#define ATA_CMD_READ_PIO 0x20 +#define ATA_CMD_READ_PIO_EXT 0x24 +#define ATA_CMD_READ_DMA 0xC8 +#define ATA_CMD_READ_DMA_EXT 0x25 +#define ATA_CMD_WRITE_PIO 0x30 +#define ATA_CMD_WRITE_PIO_EXT 0x34 +#define ATA_CMD_WRITE_DMA 0xCA +#define ATA_CMD_WRITE_DMA_EXT 0x35 +#define ATA_CMD_CACHE_FLUSH 0xE7 +#define ATA_CMD_CACHE_FLUSH_EXT 0xEA +#define ATA_CMD_PACKET 0xA0 +#define ATA_CMD_IDENTIFY_PACKET 0xA1 +#define ATA_CMD_IDENTIFY 0xEC + +///! ident offsets, use with data that we got from ATA_CMD_IDENTIFY. +#define ATA_IDENT_DEVICE_TYPE 0 +#define ATA_IDENT_CYLINDERS 2 +#define ATA_IDENT_HEADS 6 +#define ATA_IDENT_SECTORS 12 +#define ATA_IDENT_SERIAL 20 +#define ATA_IDENT_MODEL 54 +#define ATA_IDENT_CAPABILITIES 98 +#define ATA_IDENT_FIELDVALID 106 +#define ATA_IDENT_MAX_LBA 120 +#define ATA_IDENT_COMMANDSETS 164 +#define ATA_IDENT_MAX_LBA_EXT 200 + +#define ATA_MASTER 0x00 +#define ATA_SLAVE 0x01 + +///! Register +#define ATA_REG_DATA 0x00 +#define ATA_REG_ERROR 0x01 +#define ATA_REG_FEATURES 0x01 +#define ATA_REG_SEC_COUNT0 0x02 +#define ATA_REG_LBA0 0x03 +#define ATA_REG_LBA1 0x04 +#define ATA_REG_LBA2 0x05 +#define ATA_REG_HDDEVSEL 0x06 +#define ATA_REG_COMMAND 0x07 +#define ATA_REG_STATUS 0x07 +#define ATA_REG_SEC_COUNT1 0x08 +#define ATA_REG_LBA3 0x09 +#define ATA_REG_LBA4 0x0A +#define ATA_REG_LBA5 0x0B +#define ATA_REG_CONTROL 0x0C +#define ATA_REG_ALT_STATUS 0x0C +#define ATA_REG_DEV_ADDRESS 0x0D + +#define ATA_REG_NEIN 0x01 + +#define ATA_PRIMARY_IO 0x1F0 +#define ATA_SECONDARY_IO 0x170 +#define ATA_PRIMARY_DCR_AS 0x3F6 +#define ATA_SECONDARY_DCR_AS 0x376 + +///! Irq +#define ATA_PRIMARY_IRQ 14 +#define ATA_SECONDARY_IRQ 15 + +///! Channels +#define ATA_PRIMARY 0x00 +#define ATA_SECONDARY 0x01 + +#define ATA_CYL_LOW 3 +#define ATA_CYL_MID 4 +#define ATA_CYL_HIGH 5 + +///! IO Direction +#define ATA_READ 0x00 +#define ATA_WRITE 0x013 + +#define ATA_PRIMARY_SEL 0xA0 +#define ATA_SECONDARY_SEL 0xB0 + +///! ATA address register. +#define ATA_ADDRESS1(x) (x + 3) +#define ATA_ADDRESS2(x) (x + 4) +#define ATA_ADDRESS3(x) (x + 5) + +///! ATA command register. +#define ATA_COMMAND(x) (x + 7) + +#define kATASectorSize (512U) + +enum +{ + kATADevicePATA, + kATADeviceSATA, + kATADevicePATA_PI, + kATADeviceSATA_PI, + kATADeviceCount, +}; + +#if defined(__ATA_PIO__) || defined(__ATA_DMA__) + +NewOS::Boolean drv_std_init(NewOS::UInt16 Bus, NewOS::UInt8 Drive, NewOS::UInt16& OutBus, NewOS::UInt8& OutMaster); + +NewOS::Boolean drv_std_detected(NewOS::Void); + +NewOS::Void drv_std_select(NewOS::UInt16 Bus); + +NewOS::Boolean drv_std_wait_io(NewOS::UInt16 IO); + +NewOS::Void drv_std_read(NewOS::UInt64 Lba, NewOS::UInt16 IO, NewOS::UInt8 Master, NewOS::Char* Buf, NewOS::SizeT SectorSz, NewOS::SizeT Size); + +NewOS::Void drv_std_write(NewOS::UInt64 Lba, NewOS::UInt16 IO, NewOS::UInt8 Master, NewOS::Char* Buf, NewOS::SizeT SectorSz, NewOS::SizeT Size); + +/// @brief get sector count. +NewOS::SizeT drv_std_get_sector_count(); + +/// @brief get device size. +NewOS::SizeT drv_std_get_drv_size(); + +#endif // ifdef __KERNEL__ +#endif // ifndef __ATA_PIO__ || __AHCI__ diff --git a/Kernel/Modules/ATA/compile_flags.txt b/Kernel/Modules/ATA/compile_flags.txt new file mode 100644 index 00000000..1bc51142 --- /dev/null +++ b/Kernel/Modules/ATA/compile_flags.txt @@ -0,0 +1,4 @@ +-I./ +-I../ +-I../../ +-std=c++20 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 +#include +#include +#include +#include + +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/Modules/CoreCG/CoreCG.hxx b/Kernel/Modules/CoreCG/CoreCG.hxx new file mode 100644 index 00000000..5720ef13 --- /dev/null +++ b/Kernel/Modules/CoreCG/CoreCG.hxx @@ -0,0 +1,93 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + +------------------------------------------- */ + +#pragma once + +#include + +#define GXInit() NewOS::SizeT __GXCursor = 0 + +#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; \ + \ + for (NewOS::SizeT i = BaseX; i < (_Height + BaseX); ++i) \ + { \ + for (NewOS::SizeT u = BaseY; u < (_Width + BaseY); ++u) \ + { \ + *(((volatile NewOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ + 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ + i + \ + 4 * u))) |= ImgPtr[__GXCursor]; \ + \ + ++__GXCursor; \ + } \ + } + +/// @brief Draws a resource. +#define GXDrawImg(ImgPtr, _Height, _Width, BaseX, BaseY) \ + __GXCursor = 0; \ + \ + for (NewOS::SizeT i = BaseX; i < (_Height + BaseX); ++i) \ + { \ + for (NewOS::SizeT u = BaseY; u < (_Width + BaseY); ++u) \ + { \ + *(((volatile NewOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ + 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ + i + \ + 4 * u))) = ImgPtr[__GXCursor]; \ + \ + ++__GXCursor; \ + } \ + } + +/// @brief Cleans a resource. +#define GXClear(_Height, _Width, BaseX, BaseY) \ + \ + for (NewOS::SizeT i = BaseX; i < _Height + BaseX; ++i) \ + { \ + for (NewOS::SizeT u = BaseY; u < _Width + BaseY; ++u) \ + { \ + *(((volatile NewOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ + 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ + i + \ + 4 * u))) = gxClearClr; \ + } \ + } + +/// @brief Draws inside a zone. +#define GXDraw(_Clr, _Height, _Width, BaseX, BaseY) \ + \ + for (NewOS::SizeT i = BaseX; i < (_Width + BaseX); ++i) \ + { \ + for (NewOS::SizeT u = BaseY; u < (_Height + BaseY); ++u) \ + { \ + *(((volatile NewOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ + 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ + i + \ + 4 * u))) = _Clr; \ + } \ + } + +/// This is enabled if Cairo is compiled with CoreCG. +#ifdef __CG_USE_GX__ +/// @brief This function creates a new framebuffer for CoreCG. +/// @return +inline cairo_surface_t* GXCreateFramebufferCairo() +{ + cairo_format_t format = CAIRO_FORMAT_ARGB32; + + 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); +} +#endif diff --git a/Kernel/Modules/CoreCG/Lerp.hxx b/Kernel/Modules/CoreCG/Lerp.hxx new file mode 100644 index 00000000..b62a8266 --- /dev/null +++ b/Kernel/Modules/CoreCG/Lerp.hxx @@ -0,0 +1,22 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + +------------------------------------------- */ + +#pragma once + +/// @file Lerp.hxx +/// @brief Linear interpolation implementation. + +typedef float GXReal; + +/// @brief Linear interpolation equation solver. +/// @param from where? +/// @param to to? +/// @param at which state we're at **to**. +inline GXReal GXLerp(GXReal to, GXReal from, GXReal stat) +{ + GXReal difference = to - from; + return from + (difference * stat); +} diff --git a/Kernel/Modules/CoreCG/Rsrc/Cursor.rsrc b/Kernel/Modules/CoreCG/Rsrc/Cursor.rsrc new file mode 100644 index 00000000..2283cb32 --- /dev/null +++ b/Kernel/Modules/CoreCG/Rsrc/Cursor.rsrc @@ -0,0 +1,64 @@ +#define cCurHeight (57) +#define cCurWidth (53) + +#define cCurLength (3021) + +static const unsigned int Cursor[cCurLength] = { + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0x474747, 0x474747, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x363636, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x363636, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xa5a5a5, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x686868, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x585858, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0x585858, 0x222222, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x363636, 0x000000, 0x000000, 0x000000, 0x686868, 0xebebeb, 0xf9f9f9, 0x969696, 0x000000, 0x000000, 0x000000, 0x222222, 0xdedede, 0xf9f9f9, 0xdedede, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x575757, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xdedede, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x000000, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0x575757, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x000000, 0x585858, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x000000, 0x777777, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0x474747, 0x474747, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x777777, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xcfcfcf, 0x000000, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x363636, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0xb3b3b3, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x686868, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x363636, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x222222, 0x222222, 0x363636, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x222222, 0x000000, 0x000000, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x686868, 0x686868, 0xcfcfcf, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xcfcfcf, 0xd0d0d0, 0xdedede, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x222222, 0x000000, 0x000000, 0xa5a5a5, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x000000, 0x686868, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xcfcfcf, 0x000000, 0x000000, 0x585858, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x363636, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x686868, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xd0d0d0, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x585858, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xb3b3b3, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xa5a5a5, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x0e0e0e, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x686868, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xcfcfcf, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xb3b3b3, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x0e0e0e, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x777777, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0xb4b4b4, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x686868, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0xb4b4b4, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xdedede, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xcfcfcf, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0x363636, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x777777, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x343434, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x575757, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xb3b3b3, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x343434, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x686868, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x777777, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x222222, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xcfcfcf, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x585858, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xebebeb, 0x585858, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0x878787, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0x979797, 0x686868, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000 +}; diff --git a/Kernel/Modules/Flash/Flash.hxx b/Kernel/Modules/Flash/Flash.hxx new file mode 100644 index 00000000..d75539b6 --- /dev/null +++ b/Kernel/Modules/Flash/Flash.hxx @@ -0,0 +1,19 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + +------------------------------------------- */ + +#pragma once + +#ifdef __FLASH_MEM__ + +/// @brief get sector count. +/// @return drive sector count. +NewOS::SizeT drv_std_get_sector_count(); + +/// @brief get device size. +/// @return drive size +NewOS::SizeT drv_std_get_drv_size(); + +#endif // ifdef __FLASH_MEM__ diff --git a/Kernel/Modules/GPRS/.keepme b/Kernel/Modules/GPRS/.keepme new file mode 100644 index 00000000..e69de29b diff --git a/Kernel/Modules/HPET/.gitkeep b/Kernel/Modules/HPET/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Kernel/Modules/HPET/Defines.hxx b/Kernel/Modules/HPET/Defines.hxx new file mode 100644 index 00000000..b0366ad2 --- /dev/null +++ b/Kernel/Modules/HPET/Defines.hxx @@ -0,0 +1,42 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + + File: HPET.hxx + Purpose: HPET builtin. + + Revision History: + +------------------------------------------- */ + +#pragma once + +#include +#include + +namespace NewOS +{ + struct PACKED HPETAddressStructure final + { + NewOS::UInt8 AddressSpaceId; // 0 - system memory, 1 - system I/O + NewOS::UInt8 RegisterBitWidth; + NewOS::UInt8 RegisterBitOffset; + NewOS::UInt8 Reserved; + NewOS::UInt64 Address; + }; + + struct PACKED HPETHeader final : public SDT + { + NewOS::UInt8 HardwareRevId; + NewOS::UInt8 ComparatorCount : 5; + NewOS::UInt8 CounterSize : 1; + NewOS::UInt8 Reserved : 1; + NewOS::UInt8 LegacyReplacement : 1; + NewOS::UInt16 PciVendorId; + HPETAddressStructure Address; + NewOS::UInt8 HpetNumber; + NewOS::UInt16 MinimumTick; + NewOS::UInt8 PageProtection; + }; + +} // namespace NewOS diff --git a/Kernel/Modules/IEEE802/.gitkeep b/Kernel/Modules/IEEE802/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Kernel/Modules/IEEE802/compile_flags.txt b/Kernel/Modules/IEEE802/compile_flags.txt new file mode 100644 index 00000000..1fbcad21 --- /dev/null +++ b/Kernel/Modules/IEEE802/compile_flags.txt @@ -0,0 +1,4 @@ +-I./ +-I../ +-I../Kernel +-std=c++20 diff --git a/Kernel/Modules/LTE/.keepme b/Kernel/Modules/LTE/.keepme new file mode 100644 index 00000000..e69de29b diff --git a/Kernel/Modules/LTE/IO.hxx b/Kernel/Modules/LTE/IO.hxx new file mode 100644 index 00000000..7ae256e9 --- /dev/null +++ b/Kernel/Modules/LTE/IO.hxx @@ -0,0 +1,28 @@ +/* ------------------------------------------- + +Copyright Zeta Electronics Corporation. + +File: LTE\IO.hxx. +Purpose: LTE I/O. + +------------------------------------------- */ + +#ifndef _INC_NETWORK_LTE_IO_HXX_ +#define _INC_NETWORK_LTE_IO_HXX_ + +#include +#include + +/// @brief LTE I/O routines. + +/// @brief Turn on SIM slot. +NewOS::Boolean lte_turn_on_slot(NewOS::Int32 slot); + +/// @brief Turn off SIM slot. +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); + +#endif // ifndef _INC_NETWORK_LTE_IO_HXX_ diff --git a/Kernel/Modules/MBCI/Interface.hxx b/Kernel/Modules/MBCI/Interface.hxx new file mode 100644 index 00000000..fa6f479b --- /dev/null +++ b/Kernel/Modules/MBCI/Interface.hxx @@ -0,0 +1,10 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + +------------------------------------------- */ + +#pragma once + +#include +#include diff --git a/Kernel/Modules/MBCI/MBCI.hxx b/Kernel/Modules/MBCI/MBCI.hxx new file mode 100644 index 00000000..473013a2 --- /dev/null +++ b/Kernel/Modules/MBCI/MBCI.hxx @@ -0,0 +1,55 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + +------------------------------------------- */ + +#pragma once + +#include +#include + +namespace NewOS +{ + struct MBCIHostInterface; + + /// @brief MBCI Host Interface header. + struct PACKED MBCIHostInterface final + { + UInt32 HostId; + UInt16 VendorId; + UInt16 DeviceId; + UInt8 MemoryType; + UInt16 HostType; + UInt16 HostFlags; + UInt8 Error; + UInt8 Status; + UInt8 InterruptEnable; + UInt64 BaseAddressRegister; + UInt64 BaseAddressRegisterSize; + }; + + /// @brief MBCI host flags. + enum MBCIHostFlags + { + kMBCIHostFlagsSupportsPageProtection, /// Page protected. + kMBCIHostFlagsSupportsAPM, /// Advanced Power Management. + kMBCIHostFlagsSupportsDaisyChain, /// Is daisy chained. + kMBCIHostFlagsSupportsHWInterrupts, /// Has HW interrupts. + kMBCIHostFlagsSupportsDMA, /// Has DMA. + kMBCIHostFlagsExtended = __UINT16_MAX__, // Extended flags table. + }; + + enum MBCIHostKind + { + kMBCIHostKindHardDisk, + kMBCIHostKindOpticalDisk, + kMBCIHostKindKeyboardLow, + kMBCIHostKindMouseLow, + kMBCIHostKindMouseHigh, + kMBCIHostKindKeyboardHigh, + kMBCIHostKindNetworkInterface, + kMBCIHostKindDaisyChain, + kMBCIHostKindStartExtended = __UINT16_MAX__, /// Extended vendor table. + }; +} // namespace NewOS diff --git a/Kernel/Modules/NVME/.gitkeep b/Kernel/Modules/NVME/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Kernel/Modules/NVME/compile_flags.txt b/Kernel/Modules/NVME/compile_flags.txt new file mode 100644 index 00000000..1bc51142 --- /dev/null +++ b/Kernel/Modules/NVME/compile_flags.txt @@ -0,0 +1,4 @@ +-I./ +-I../ +-I../../ +-std=c++20 diff --git a/Kernel/Modules/OHCI/.gitkeep b/Kernel/Modules/OHCI/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Kernel/Modules/PS2/PS2MouseInterface.hxx b/Kernel/Modules/PS2/PS2MouseInterface.hxx new file mode 100644 index 00000000..124d4380 --- /dev/null +++ b/Kernel/Modules/PS2/PS2MouseInterface.hxx @@ -0,0 +1,112 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + + File: PS2MouseInterface.hxx + Purpose: PS/2 mouse. + + Revision History: + + 03/02/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +namespace NewOS +{ + /// @brief PS/2 Mouse driver interface + class PS2MouseInterface final + { + public: + explicit PS2MouseInterface() = default; + ~PS2MouseInterface() = default; + + NEWOS_COPY_DEFAULT(PS2MouseInterface); + + public: + /// @brief Enables PS2 mouse for kernel. + /// @return + Void Init() noexcept + { + HAL::rt_cli(); + + HAL::Out8(0x64, 0xA8); // enabling the auxiliary device - mouse + + this->Wait(); + HAL::Out8(0x64, 0x20); // tells the keyboard controller that we want to send a command to the mouse + this->WaitInput(); + + UInt8 status = HAL::In8(0x60); + status |= 0b10; + + this->Wait(); + HAL::Out8(0x64, 0x60); + this->Wait(); + HAL::Out8(0x60, status); // setting the correct bit is the "compaq" status byte + + this->Write(0xF6); + this->Read(); + + this->Write(0xF4); + this->Read(); + + HAL::rt_sti(); + } + + public: + Bool WaitInput() noexcept + { + UInt64 timeout = 100000; + + while (timeout) + { + if ((HAL::In8(0x64) & 0x1)) + { + return true; + } + + --timeout; + } // wait until we can read + + // return the ack bit. + return false; + } + + Bool Wait() noexcept + { + UInt64 timeout = 100000; + + while (timeout) + { + if ((HAL::In8(0x64) & 0b10) == 0) + { + return true; + } + + --timeout; + } // wait until we can read + + // return the ack bit. + return false; + } + + Void Write(UInt8 val) + { + HAL::Out8(0x64, 0xD4); + this->Wait(); + HAL::Out8(0x60, val); + this->Wait(); + } + + UInt8 Read() + { + this->WaitInput(); + return HAL::In8(0x60); + } + }; +} // namespace NewOS diff --git a/Kernel/Modules/ReadMe.txt b/Kernel/Modules/ReadMe.txt new file mode 100644 index 00000000..acbc3de7 --- /dev/null +++ b/Kernel/Modules/ReadMe.txt @@ -0,0 +1,19 @@ +============== +NewOS Modules +============== + +=============== +What are these? +=============== + +These are like modules for the kernel. + +=================== +Maintainers/Authors +=================== + +ACPI: Amlal EL Mahrouss. +AHCI: Amlal EL Mahrouss. +CoreCG: Amlal EL Mahrouss. +PS2: Amlal EL Mahrouss. +ATA: Amlal EL Mahrouss. diff --git a/Kernel/Modules/SCSI/.gitkeep b/Kernel/Modules/SCSI/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Kernel/Modules/SCSI/SCSI.hxx b/Kernel/Modules/SCSI/SCSI.hxx new file mode 100644 index 00000000..a0feb649 --- /dev/null +++ b/Kernel/Modules/SCSI/SCSI.hxx @@ -0,0 +1,14 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + +------------------------------------------- */ + +#pragma once + +#include + +/// @file SCSI.hxx +/// @brief Serial SCSI driver. + +typedef NewOS::UInt16 scsi_packet_type[12]; diff --git a/Kernel/Modules/WiFi/.gitkeep b/Kernel/Modules/WiFi/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Kernel/Modules/WiFi/compile_flags.txt b/Kernel/Modules/WiFi/compile_flags.txt new file mode 100644 index 00000000..1bc51142 --- /dev/null +++ b/Kernel/Modules/WiFi/compile_flags.txt @@ -0,0 +1,4 @@ +-I./ +-I../ +-I../../ +-std=c++20 diff --git a/Kernel/Modules/XHCI/.gitkeep b/Kernel/Modules/XHCI/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Kernel/Modules/XHCI/Defines.hxx b/Kernel/Modules/XHCI/Defines.hxx new file mode 100644 index 00000000..91147a58 --- /dev/null +++ b/Kernel/Modules/XHCI/Defines.hxx @@ -0,0 +1,70 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + + File: Defines.hxx + Purpose: XHCI (and backwards) header. + + Revision History: + + 01/02/24: Added file (amlel) + 03/02/24: Update filename to Defines.hxx (amlel) + +------------------------------------------- */ + +#pragma once + +#include + +using namespace NewOS; + +#define kUSBCommand (UInt16)0x0 +#define kUSBStatus (UInt16)0x2 +#define kUSBInterruptEnable (UInt16)0x4 +#define kUSBFrameNum (UInt16)0x6 +#define kUSBFrameListBaseAddress (UInt16)0x8 +#define kUSBFrameModifyStart (UInt16)0xC +#define kUSBPort1StatusCtrl (UInt16)0x10 +#define kUSBPort2StatusCtrl (UInt16)0x12 + +typedef struct USBCommandRegister final +{ + UInt8 mReserved[8]; // Reserved + UInt8 + mMaxPacket; // 0 = Max packet size 32 bits 1 = Max packet size 64 bits + UInt8 mConfigure; + UInt8 mSoftwareDebug; + UInt8 mGlobalResume; + UInt8 mGlobalSuspend; + UInt8 mHostCtrlReset; + UInt8 mRun; // 1 = Controller execute frame list entries +} USBCommandRegister; + +typedef struct USBStatusRegister final +{ + UInt8 mReserved[8]; // Reserved + UInt8 mHalted; // 1 = bit 0 in CMD is zero 0 = bit 0 in CMD is 1 + UInt8 mProcessError; + UInt8 mSystemError; + UInt8 mResumeDetected; + UInt8 mErrorInterrupt; + UInt8 mInterrupt; +} USBStatusRegister; + +typedef struct USBInterruptEnableRegister final +{ + UInt8 mReserved[4]; // Reserved + UInt8 mShortPacket; // 1=Enable interrupt 0=Disable interrupt + UInt8 mComplete; // 1=Enable interrupt 0=Disable interrupt + UInt8 mResume; // 1=Enable interrupt 0=Disable interrupt + UInt8 mTimeoutCRC; // 1=Enable interrupt 0=Disable interrupt +} USBInterruptEnableRegister; + +/* + Some terminology: + + Frame Number: Number of processed entry of the Frame List. + Frame List Base Address: + 32-bit physical adress of Frame List. Remember that first 12 bytes are + always 0. The Frame List must contain 1024 entries. +*/ diff --git a/Kernel/Modules/XHCI/compile_flags.txt b/Kernel/Modules/XHCI/compile_flags.txt new file mode 100644 index 00000000..1bc51142 --- /dev/null +++ b/Kernel/Modules/XHCI/compile_flags.txt @@ -0,0 +1,4 @@ +-I./ +-I../ +-I../../ +-std=c++20 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 #include -#include -#include +#include +#include #include /// @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 -#include -#include +#include +#include +#include #include #include #include @@ -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(const_cast(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 -#include +#include #include #include #include @@ -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 +#include 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./ -- cgit v1.2.3