From a13e1c0911c0627184bc38f18c7fdda64447b3ad Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 23 Mar 2025 19:13:48 +0100 Subject: meta(kernel): Reworked repository's filesystem structure. Removing useless parts of the project too. Signed-off-by: Amlal El Mahrouss --- dev/Boot/BootKit/BitManip.h | 20 - dev/Boot/BootKit/BootKit.h | 403 -------- dev/Boot/BootKit/BootThread.h | 43 - dev/Boot/BootKit/Device.h | 37 - dev/Boot/BootKit/EPM.h | 9 - dev/Boot/BootKit/HW/ATA.h | 58 -- dev/Boot/BootKit/HW/SATA.h | 46 - dev/Boot/BootKit/Platform.h | 32 - dev/Boot/BootKit/Protocol.h | 10 - dev/Boot/BootKit/Qr.h | 973 ------------------ dev/Boot/BootKit/QrPrelude.h | 1 - dev/Boot/BootKit/Rsrc/zka_disk.rsrc | 116 --- dev/Boot/BootKit/Rsrc/zka_has_disk.rsrc | 116 --- dev/Boot/BootKit/Rsrc/zka_no_disk.rsrc | 116 --- dev/Boot/BootKit/Rsrc/zka_swirl.rsrc | 70 -- dev/Boot/BootKit/Shared/base.h | 26 - dev/Boot/BootKit/Shared/bit.h | 247 ----- dev/Boot/BootKit/Support.h | 173 ---- dev/Boot/DownloadOVMF.ps1 | 4 - dev/Boot/Mod/.keep | 0 dev/Boot/Mod/NetBoot/.hgkeep | 0 dev/Boot/Mod/NetBoot/Boot.S | 28 - dev/Boot/Mod/NetBoot/NetBoot.cc | 44 - dev/Boot/Mod/NetBoot/NetBoot.h | 33 - dev/Boot/Mod/NetBoot/build.json | 24 - dev/Boot/Mod/SysChk/.hgkeep | 0 dev/Boot/Mod/SysChk/Boot.S | 22 - dev/Boot/Mod/SysChk/Module.cc | 36 - dev/Boot/Mod/SysChk/amd64.json | 24 - dev/Boot/Mod/SysChk/arm64.json | 26 - dev/Boot/amd64-desktop.make | 154 --- dev/Boot/arm64-desktop.make | 112 -- dev/Boot/arm64-mobile.make | 113 --- dev/Boot/gdbinit | 3 - dev/Boot/src/.gitkeep | 0 dev/Boot/src/BootFileReader.cc | 206 ---- dev/Boot/src/BootString.cc | 92 -- dev/Boot/src/BootSupport.cc | 82 -- dev/Boot/src/BootTextWriter.cc | 169 ---- dev/Boot/src/BootThread.cc | 211 ---- dev/Boot/src/BootloaderRsrc.rsrc | 25 - dev/Boot/src/HEL/64X000/.gitkeep | 0 dev/Boot/src/HEL/64X000/BootCB.S | 35 - dev/Boot/src/HEL/AMD64/BootAPI.S | 60 -- dev/Boot/src/HEL/AMD64/BootATA.cc | 283 ------ dev/Boot/src/HEL/AMD64/BootEFI.cc | 316 ------ dev/Boot/src/HEL/AMD64/BootPlatform.cc | 106 -- dev/Boot/src/HEL/AMD64/BootSATA.cc | 20 - dev/Boot/src/HEL/ARM64/.gitkeep | 0 dev/Boot/src/HEL/ARM64/BootAPI.S | 12 - dev/Boot/src/HEL/ARM64/BootCB.S | 40 - dev/Boot/src/HEL/ARM64/BootEFI.cc | 220 ---- dev/Boot/src/HEL/ARM64/BootPlatform.cc | 37 - dev/Boot/src/HEL/POWER/.gitkeep | 0 dev/Boot/src/HEL/POWER/BootCB.S | 34 - dev/Boot/src/New+Delete.cc | 60 -- dev/Boot/src/Root/EFI/STARTUP.NSH | 2 - dev/Drivers/.keep | 0 dev/Hints/CompilerHint.h | 25 - dev/HintsKit/CompilerHint.h | 25 + dev/Kernel/ArchKit/ArchKit.h | 94 -- dev/Kernel/CFKit/GUIDWizard.h | 24 - dev/Kernel/CFKit/GUIDWrapper.h | 60 -- dev/Kernel/CFKit/Property.h | 56 - dev/Kernel/CFKit/Utils.h | 55 - dev/Kernel/CompilerKit/CompilerKit.h | 13 - dev/Kernel/CompilerKit/Detail.h | 27 - dev/Kernel/CompilerKit/Version.h | 7 - dev/Kernel/FSKit/Defines.h | 12 - dev/Kernel/FSKit/HPFS.h | 59 -- dev/Kernel/FSKit/IndexableProperty.h | 63 -- dev/Kernel/FSKit/NeFS.h | 445 -------- dev/Kernel/FirmwareKit/.gitkeep | 1 - dev/Kernel/FirmwareKit/CoreBoot/CoreBoot.h | 31 - dev/Kernel/FirmwareKit/CoreBoot/NS.h | 10 - dev/Kernel/FirmwareKit/CoreBoot/NetBoot.h | 25 - dev/Kernel/FirmwareKit/EFI.h | 11 - dev/Kernel/FirmwareKit/EFI/API.h | 107 -- dev/Kernel/FirmwareKit/EFI/EFI.h | 936 ----------------- dev/Kernel/FirmwareKit/EFI/NS.h | 20 - dev/Kernel/FirmwareKit/EPM.h | 111 -- dev/Kernel/FirmwareKit/GPT.h | 57 -- dev/Kernel/FirmwareKit/Handover.h | 108 -- dev/Kernel/HALKit/.gitkeep | 0 dev/Kernel/HALKit/AMD64/CPUID.h | 86 -- dev/Kernel/HALKit/AMD64/HalACPIFactoryInterface.cc | 122 --- dev/Kernel/HALKit/AMD64/HalAPICController.cc | 44 - dev/Kernel/HALKit/AMD64/HalApplicationProcessor.cc | 271 ----- .../HALKit/AMD64/HalApplicationProcessorGNU.s | 8 - .../AMD64/HalApplicationProcessorStartup.asm | 77 -- dev/Kernel/HALKit/AMD64/HalBoot.asm | 28 - dev/Kernel/HALKit/AMD64/HalCommonAPI.asm | 82 -- dev/Kernel/HALKit/AMD64/HalControlRegister.s | 45 - .../HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc | 245 ----- dev/Kernel/HALKit/AMD64/HalCoreSystemCalls.cc | 5 - dev/Kernel/HALKit/AMD64/HalDebugOutput.cc | 190 ---- dev/Kernel/HALKit/AMD64/HalDebugPort.cc | 42 - dev/Kernel/HALKit/AMD64/HalDescriptorLoader.cc | 126 --- dev/Kernel/HALKit/AMD64/HalInterruptAPI.asm | 402 -------- dev/Kernel/HALKit/AMD64/HalKernelMain.cc | 117 --- dev/Kernel/HALKit/AMD64/HalKernelPanic.cc | 68 -- dev/Kernel/HALKit/AMD64/HalPagingMgrAMD64.cc | 204 ---- dev/Kernel/HALKit/AMD64/HalProcessorAMD64.cc | 101 -- dev/Kernel/HALKit/AMD64/HalRoutineWait.s | 11 - .../AMD64/HalSchedulerCorePrimitivesAMD64.cc | 52 - dev/Kernel/HALKit/AMD64/HalSystemCallInstall.cc | 7 - dev/Kernel/HALKit/AMD64/HalTimerAMD64.cc | 86 -- dev/Kernel/HALKit/AMD64/HalUtils.asm | 26 - dev/Kernel/HALKit/AMD64/Hypervisor.h | 25 - dev/Kernel/HALKit/AMD64/MBCI/HalMBCI.cc | 7 - dev/Kernel/HALKit/AMD64/PCI/DMA.cc | 87 -- dev/Kernel/HALKit/AMD64/PCI/Database.cc | 11 - dev/Kernel/HALKit/AMD64/PCI/Device.cc | 171 ---- dev/Kernel/HALKit/AMD64/PCI/Express.cc | 11 - dev/Kernel/HALKit/AMD64/PCI/IO.cc | 7 - dev/Kernel/HALKit/AMD64/PCI/Iterator.cc | 39 - dev/Kernel/HALKit/AMD64/PCI/PCI.cc | 7 - dev/Kernel/HALKit/AMD64/Paging.h | 99 -- dev/Kernel/HALKit/AMD64/Processor.h | 326 ------ dev/Kernel/HALKit/AMD64/ReadMe.md | 8 - dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc | 424 -------- dev/Kernel/HALKit/AMD64/Storage/DMA+Generic.cc | 253 ----- dev/Kernel/HALKit/AMD64/Storage/PIO+Generic.cc | 191 ---- dev/Kernel/HALKit/AMD64/make_ap_blob.sh | 3 - dev/Kernel/HALKit/ARM64/APM/APM+IO.cc | 37 - dev/Kernel/HALKit/ARM64/ApplicationProcessor.h | 19 - dev/Kernel/HALKit/ARM64/HalACPIFactoryInterface.cc | 32 - dev/Kernel/HALKit/ARM64/HalApplicationProcessor.cc | 145 --- dev/Kernel/HALKit/ARM64/HalDebugOutput.cc | 83 -- dev/Kernel/HALKit/ARM64/HalFlushTLB.S | 5 - dev/Kernel/HALKit/ARM64/HalKernelMain.cc | 54 - dev/Kernel/HALKit/ARM64/HalKernelPanic.cc | 80 -- dev/Kernel/HALKit/ARM64/HalPagingMgrARM64.cc | 86 -- dev/Kernel/HALKit/ARM64/HalSchedulerCoreARM64.cc | 24 - .../ARM64/HalSchedulerCorePrimitivesARM64.cc | 35 - dev/Kernel/HALKit/ARM64/HalTimerARM64.cc | 14 - dev/Kernel/HALKit/ARM64/MBCI/MBCI.cc | 7 - dev/Kernel/HALKit/ARM64/Paging.h | 120 --- dev/Kernel/HALKit/ARM64/Processor.h | 91 -- dev/Kernel/HALKit/ARM64/ReadMe.md | 3 - .../HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc | 119 --- dev/Kernel/HALKit/ARM64/Storage/UFS+Generic.cc | 11 - dev/Kernel/HALKit/AXP/CR.s | 11 - dev/Kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp | 0 dev/Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp | 24 - dev/Kernel/HALKit/AXP/HAL.s | 13 - dev/Kernel/HALKit/AXP/Processor.h | 7 - dev/Kernel/HALKit/AXP/SYSCALL.s | 10 - dev/Kernel/HALKit/AXP/VM.s | 5 - dev/Kernel/HALKit/POWER/.gitkeep | 0 dev/Kernel/HALKit/POWER/AP.h | 39 - dev/Kernel/HALKit/POWER/APM/.gitkeep | 0 dev/Kernel/HALKit/POWER/HalAP.cc | 40 - dev/Kernel/HALKit/POWER/HalDebugOutput.cc | 27 - dev/Kernel/HALKit/POWER/HalStartSequence.s | 14 - dev/Kernel/HALKit/POWER/HalThread.cc | 8 - dev/Kernel/HALKit/POWER/HalVirtualMemory.cc | 49 - dev/Kernel/HALKit/POWER/MBCI/.gitkeep | 0 dev/Kernel/HALKit/POWER/MBCI/HalMBCIHost.cc | 8 - dev/Kernel/HALKit/POWER/Processor.h | 62 -- dev/Kernel/HALKit/POWER/ReadMe.md | 4 - dev/Kernel/HALKit/RISCV/.keep | 0 dev/Kernel/HALKit/RISCV/AP.h | 35 - dev/Kernel/HALKit/RISCV/APM/.gitkeep | 0 dev/Kernel/HALKit/RISCV/HalAP.cc | 40 - dev/Kernel/HALKit/RISCV/ReadMe.md | 4 - dev/Kernel/HALKit/RISCV/Storage/.gitkeep | 0 dev/Kernel/HALKit/X86S/.gitkeep | 0 dev/Kernel/HALKit/X86S/ACPI/.gitkeep | 0 dev/Kernel/HALKit/X86S/Storage/.gitkeep | 0 dev/Kernel/KernelKit/BinaryMutex.h | 43 - dev/Kernel/KernelKit/CodeMgr.h | 37 - dev/Kernel/KernelKit/DebugOutput.h | 213 ---- dev/Kernel/KernelKit/Defines.h | 15 - dev/Kernel/KernelKit/DeviceMgr.h | 140 --- dev/Kernel/KernelKit/DriveMgr.h | 191 ---- dev/Kernel/KernelKit/FileMgr.h | 392 ------- dev/Kernel/KernelKit/HardwareThreadScheduler.h | 149 --- dev/Kernel/KernelKit/IDylibObject.h | 48 - dev/Kernel/KernelKit/IPEFDylibObject.h | 106 -- dev/Kernel/KernelKit/LPC.h | 70 -- dev/Kernel/KernelKit/LoaderInterface.h | 34 - dev/Kernel/KernelKit/LockDelegate.h | 69 -- dev/Kernel/KernelKit/MBCI/.keep | 0 dev/Kernel/KernelKit/MSDOS.h | 52 - dev/Kernel/KernelKit/MemoryMgr.h | 87 -- dev/Kernel/KernelKit/PCI/DMA.h | 81 -- dev/Kernel/KernelKit/PCI/DMA.inl | 20 - dev/Kernel/KernelKit/PCI/Database.h | 58 -- dev/Kernel/KernelKit/PCI/Device.h | 81 -- dev/Kernel/KernelKit/PCI/Express.h | 12 - dev/Kernel/KernelKit/PCI/IO.h | 75 -- dev/Kernel/KernelKit/PCI/IOArray+AMD64.inl | 54 - dev/Kernel/KernelKit/PCI/Iterator.h | 43 - dev/Kernel/KernelKit/PCI/PCI.h | 59 -- dev/Kernel/KernelKit/PE.h | 143 --- dev/Kernel/KernelKit/PECodeMgr.h | 24 - dev/Kernel/KernelKit/PEF.h | 117 --- dev/Kernel/KernelKit/PEFCodeMgr.h | 72 -- dev/Kernel/KernelKit/Semaphore.h | 16 - dev/Kernel/KernelKit/ThreadLocalStorage.h | 69 -- dev/Kernel/KernelKit/ThreadLocalStorage.inl | 99 -- dev/Kernel/KernelKit/Timer.h | 83 -- dev/Kernel/KernelKit/User.h | 95 -- dev/Kernel/KernelKit/UserProcessScheduler.h | 343 ------- dev/Kernel/KernelKit/UserProcessScheduler.inl | 62 -- dev/Kernel/KernelKit/XCOFF.h | 51 - dev/Kernel/KernelRsrc.rsrc | 25 - dev/Kernel/MoveAll.ARM64.sh | 7 - dev/Kernel/MoveAll.X64.sh | 7 - dev/Kernel/NetworkKit/IP.h | 83 -- dev/Kernel/NetworkKit/IPC.h | 91 -- dev/Kernel/NetworkKit/LTE.h | 16 - dev/Kernel/NetworkKit/MAC.h | 36 - dev/Kernel/NetworkKit/NetworkDevice.h | 83 -- dev/Kernel/NetworkKit/NetworkDevice.inl | 32 - dev/Kernel/NewKit/Array.h | 65 -- dev/Kernel/NewKit/ArrayList.h | 63 -- dev/Kernel/NewKit/Atom.h | 47 - dev/Kernel/NewKit/Crc32.h | 23 - dev/Kernel/NewKit/CxxAbi.h | 28 - dev/Kernel/NewKit/Defines.h | 200 ---- dev/Kernel/NewKit/ErrorOr.h | 82 -- dev/Kernel/NewKit/Function.h | 53 - dev/Kernel/NewKit/Json.h | 151 --- dev/Kernel/NewKit/KString.h | 94 -- dev/Kernel/NewKit/KernelPanic.h | 74 -- dev/Kernel/NewKit/Macros.h | 149 --- dev/Kernel/NewKit/MutableArray.h | 239 ----- dev/Kernel/NewKit/New.h | 20 - dev/Kernel/NewKit/NewKit.h | 20 - dev/Kernel/NewKit/OwnPtr.h | 94 -- dev/Kernel/NewKit/PageMgr.h | 81 -- dev/Kernel/NewKit/Pair.h | 14 - dev/Kernel/NewKit/Pmm.h | 44 - dev/Kernel/NewKit/Ref.h | 108 -- dev/Kernel/NewKit/Stream.h | 58 -- dev/Kernel/NewKit/Utils.h | 30 - dev/Kernel/NewKit/Variant.h | 72 -- dev/Kernel/SignalKit/Signals.h | 22 - dev/Kernel/StorageKit/AHCI.h | 60 -- dev/Kernel/StorageKit/ATA.h | 39 - dev/Kernel/StorageKit/NVME.h | 34 - dev/Kernel/StorageKit/PRDT.h | 36 - dev/Kernel/StorageKit/SCSI.h | 11 - dev/Kernel/StorageKit/StorageKit.h | 22 - dev/Kernel/SystemKit/SwapDisk.h | 46 - dev/Kernel/amd64-ci.make | 79 -- dev/Kernel/amd64-desktop.make | 79 -- dev/Kernel/arm64-desktop.make | 64 -- dev/Kernel/arm64-mobile.make | 64 -- dev/Kernel/doc/EPM.pdf | Bin 12364 -> 0 bytes dev/Kernel/doc/Specs.md | 63 -- dev/Kernel/doc/TodoList.md | 25 - dev/Kernel/obj/.hgkeep | 0 dev/Kernel/power64-cb.make | 4 - dev/Kernel/riscv64-cb.make | 0 dev/Kernel/src/ACPIFactoryInterface.cc | 101 -- dev/Kernel/src/Array.cc | 7 - dev/Kernel/src/ArrayList.cc | 7 - dev/Kernel/src/Atom.cc | 10 - dev/Kernel/src/BinaryMutex.cc | 74 -- dev/Kernel/src/BitMapMgr.cc | 195 ---- dev/Kernel/src/CodeMgr.cc | 28 - dev/Kernel/src/Crc32.cc | 82 -- dev/Kernel/src/CxxAbi-AMD64.cc | 90 -- dev/Kernel/src/CxxAbi-ARM64.cc | 107 -- dev/Kernel/src/Defines.cc | 7 - dev/Kernel/src/DeviceMgr.cc | 7 - dev/Kernel/src/DriveMgr+IO.cc | 96 -- dev/Kernel/src/DriveMgr.cc | 235 ----- dev/Kernel/src/ErrorOr.cc | 12 - dev/Kernel/src/FS/HPFS.cc | 22 - dev/Kernel/src/FS/NeFS+FileMgr.cc | 245 ----- dev/Kernel/src/FS/NeFS.cc | 1065 -------------------- dev/Kernel/src/FileMgr.cc | 52 - dev/Kernel/src/GUIDWizard.cc | 72 -- dev/Kernel/src/GUIDWrapper.cc | 11 - dev/Kernel/src/HardwareThreadScheduler.cc | 225 ----- dev/Kernel/src/IDylibObject.cc | 15 - dev/Kernel/src/IPEFDylibObject.cc | 111 -- dev/Kernel/src/IndexableProperty.cc | 57 -- dev/Kernel/src/Json.cc | 10 - dev/Kernel/src/KString.cc | 218 ---- dev/Kernel/src/LPC.cc | 34 - dev/Kernel/src/LockDelegate.cc | 12 - dev/Kernel/src/MemoryMgr.cc | 289 ------ dev/Kernel/src/MutableArray.cc | 7 - dev/Kernel/src/Network/IPAddr.cc | 129 --- dev/Kernel/src/Network/IPCAddr.cc | 32 - dev/Kernel/src/Network/IPCMsg.cc | 125 --- dev/Kernel/src/Network/MACAddressGetter.cc | 15 - dev/Kernel/src/Network/NetworkDevice.cc | 35 - dev/Kernel/src/New+Delete.cc | 50 - dev/Kernel/src/OwnPtr.cc | 7 - dev/Kernel/src/PEFCodeMgr.cc | 268 ----- dev/Kernel/src/PRDT.cc | 24 - dev/Kernel/src/PageMgr.cc | 110 -- dev/Kernel/src/Pmm.cc | 98 -- dev/Kernel/src/Property.cc | 45 - dev/Kernel/src/Ref.cc | 7 - dev/Kernel/src/SoftwareTimer.cc | 39 - dev/Kernel/src/Storage/AHCIDeviceInterface.cc | 36 - dev/Kernel/src/Storage/ATADeviceInterface.cc | 88 -- dev/Kernel/src/Storage/NVMEDeviceInterface.cc | 28 - dev/Kernel/src/Storage/SCSIDeviceInterface.cc | 11 - dev/Kernel/src/Stream.cc | 12 - dev/Kernel/src/System/SwapDisk.cc | 47 - dev/Kernel/src/ThreadLocalStorage.cc | 67 -- dev/Kernel/src/Timer.cc | 19 - dev/Kernel/src/User.cc | 195 ---- dev/Kernel/src/UserProcessScheduler.cc | 621 ------------ dev/Kernel/src/UserProcessTeam.cc | 59 -- dev/Kernel/src/Utils.cc | 224 ---- dev/Kernel/src/Variant.cc | 41 - dev/LibSCI/CompilerHint.h | 25 - dev/LibSCI/FileMgr.h | 10 - dev/LibSCI/GPU.h | 78 -- dev/LibSCI/LPC.h | 56 - dev/LibSCI/Macros.h | 93 -- dev/LibSCI/SCI.h | 352 ------- dev/LibSCI/doc/LibSCI.drawio | 28 - dev/LibSCI/libsci.json | 20 - dev/LibSCI/src/GPU.cc | 10 - dev/LibSCI/src/LPC.cc | 10 - dev/LibSCI/src/LibSCI+IO.asm | 50 - dev/LibSCI/src/Makefile | 16 - dev/LibSCI/src/SCI.cc | 45 - dev/Mod/ACPI/ACPI.h | 90 -- dev/Mod/ACPI/ACPIFactoryInterface.h | 59 -- dev/Mod/AHCI/.gitkeep | 0 dev/Mod/AHCI/AHCI.h | 370 ------- dev/Mod/APM/APM.h | 37 - dev/Mod/ATA/ATA.h | 155 --- dev/Mod/CoreGfx/AccessibilityMgr.h | 41 - dev/Mod/CoreGfx/FBMgr.h | 150 --- dev/Mod/CoreGfx/MathMgr.h | 29 - dev/Mod/CoreGfx/TextMgr.h | 178 ---- dev/Mod/GPRS/.keepme | 0 dev/Mod/HPET/.gitkeep | 0 dev/Mod/HPET/Defines.h | 42 - dev/Mod/IEEE802/.gitkeep | 0 dev/Mod/LTE/LTE.h | 40 - dev/Mod/MBCI/MBCI.h | 100 -- dev/Mod/MFlash/MFlash.h | 25 - dev/Mod/NVME/NVME.h | 113 --- dev/Mod/OHCI/.gitkeep | 0 dev/Mod/Pwr/PowerFactory.h | 37 - dev/Mod/ReadMe.md | 12 - dev/Mod/SCSI/.gitkeep | 0 dev/Mod/SCSI/SCSI.h | 15 - dev/Mod/WiFi/.gitkeep | 0 dev/Mod/XHCI/.gitkeep | 0 dev/Mod/XHCI/Defines.h | 70 -- dev/SCIKit/CompilerHint.h | 12 + dev/SCIKit/LPC.h | 56 + dev/SCIKit/Macros.h | 93 ++ dev/SCIKit/SCI.h | 339 +++++++ dev/SCIKit/doc/LibSCI.drawio | 28 + dev/SCIKit/libsci.json | 20 + dev/SCIKit/src/LPC.cc | 10 + dev/SCIKit/src/LibSCI+IO.asm | 50 + dev/SCIKit/src/Makefile | 16 + dev/SCIKit/src/SCI.cc | 45 + dev/Tools/.keepme | 0 dev/Usr/.keepme | 0 dev/Usr/LibCF/Array.h | 71 -- dev/Usr/LibCF/Atom.h | 47 - dev/Usr/LibCF/Foundation.cc | 48 - dev/Usr/LibCF/Foundation.h | 78 -- dev/Usr/LibCF/Object.h | 26 - dev/Usr/LibCF/Property.h | 53 - dev/Usr/LibCF/Ref.h | 110 -- dev/Usr/LibCF/String.h | 20 - dev/Usr/LibFont/.keep | 0 dev/Usr/LibFont/Font.h | 55 - dev/Usr/LibGUI/.keep | 0 dev/Usr/LibLocale/.keep | 0 dev/Usr/LibWM/WindowConnection.h | 31 - dev/boot/BootKit/BitManip.h | 20 + dev/boot/BootKit/BootKit.h | 403 ++++++++ dev/boot/BootKit/BootThread.h | 43 + dev/boot/BootKit/Device.h | 37 + dev/boot/BootKit/EPM.h | 9 + dev/boot/BootKit/HW/ATA.h | 58 ++ dev/boot/BootKit/HW/SATA.h | 46 + dev/boot/BootKit/Platform.h | 32 + dev/boot/BootKit/Protocol.h | 10 + dev/boot/BootKit/Qr.h | 973 ++++++++++++++++++ dev/boot/BootKit/QrPrelude.h | 1 + dev/boot/BootKit/Rsrc/zka_disk.rsrc | 116 +++ dev/boot/BootKit/Rsrc/zka_has_disk.rsrc | 116 +++ dev/boot/BootKit/Rsrc/zka_no_disk.rsrc | 116 +++ dev/boot/BootKit/Rsrc/zka_swirl.rsrc | 70 ++ dev/boot/BootKit/Shared/base.h | 26 + dev/boot/BootKit/Shared/bit.h | 247 +++++ dev/boot/BootKit/Support.h | 173 ++++ dev/boot/DownloadOVMF.ps1 | 4 + dev/boot/Mod/.keep | 0 dev/boot/Mod/NetBoot/.hgkeep | 0 dev/boot/Mod/NetBoot/Boot.S | 28 + dev/boot/Mod/NetBoot/NetBoot.cc | 44 + dev/boot/Mod/NetBoot/NetBoot.h | 33 + dev/boot/Mod/NetBoot/build.json | 24 + dev/boot/Mod/SysChk/.hgkeep | 0 dev/boot/Mod/SysChk/Boot.S | 22 + dev/boot/Mod/SysChk/Module.cc | 36 + dev/boot/Mod/SysChk/amd64.json | 24 + dev/boot/Mod/SysChk/arm64.json | 26 + dev/boot/amd64-desktop.make | 154 +++ dev/boot/arm64-desktop.make | 112 ++ dev/boot/arm64-mobile.make | 113 +++ dev/boot/gdbinit | 3 + dev/boot/src/.gitkeep | 0 dev/boot/src/BootFileReader.cc | 206 ++++ dev/boot/src/BootString.cc | 92 ++ dev/boot/src/BootSupport.cc | 82 ++ dev/boot/src/BootTextWriter.cc | 169 ++++ dev/boot/src/BootThread.cc | 211 ++++ dev/boot/src/BootloaderRsrc.rsrc | 25 + dev/boot/src/HEL/64X000/.gitkeep | 0 dev/boot/src/HEL/64X000/BootCB.S | 35 + dev/boot/src/HEL/AMD64/BootAPI.S | 60 ++ dev/boot/src/HEL/AMD64/BootATA.cc | 283 ++++++ dev/boot/src/HEL/AMD64/BootEFI.cc | 316 ++++++ dev/boot/src/HEL/AMD64/BootPlatform.cc | 106 ++ dev/boot/src/HEL/AMD64/BootSATA.cc | 20 + dev/boot/src/HEL/ARM64/.gitkeep | 0 dev/boot/src/HEL/ARM64/BootAPI.S | 12 + dev/boot/src/HEL/ARM64/BootCB.S | 40 + dev/boot/src/HEL/ARM64/BootEFI.cc | 220 ++++ dev/boot/src/HEL/ARM64/BootPlatform.cc | 37 + dev/boot/src/HEL/POWER/.gitkeep | 0 dev/boot/src/HEL/POWER/BootCB.S | 34 + dev/boot/src/New+Delete.cc | 60 ++ dev/boot/src/Root/EFI/STARTUP.NSH | 2 + dev/kernel/ArchKit/ArchKit.h | 94 ++ dev/kernel/CFKit/GUIDWizard.h | 24 + dev/kernel/CFKit/GUIDWrapper.h | 60 ++ dev/kernel/CFKit/Property.h | 56 + dev/kernel/CFKit/Utils.h | 55 + dev/kernel/CompilerKit/CompilerKit.h | 13 + dev/kernel/CompilerKit/Detail.h | 27 + dev/kernel/CompilerKit/Version.h | 7 + dev/kernel/FSKit/Defines.h | 12 + dev/kernel/FSKit/HeFS.h | 59 ++ dev/kernel/FSKit/IndexableProperty.h | 63 ++ dev/kernel/FSKit/NeFS.h | 445 ++++++++ dev/kernel/FirmwareKit/.gitkeep | 1 + dev/kernel/FirmwareKit/CoreBoot/CoreBoot.h | 31 + dev/kernel/FirmwareKit/CoreBoot/NS.h | 10 + dev/kernel/FirmwareKit/CoreBoot/NetBoot.h | 25 + dev/kernel/FirmwareKit/EFI.h | 11 + dev/kernel/FirmwareKit/EFI/API.h | 107 ++ dev/kernel/FirmwareKit/EFI/EFI.h | 936 +++++++++++++++++ dev/kernel/FirmwareKit/EFI/NS.h | 20 + dev/kernel/FirmwareKit/EPM.h | 111 ++ dev/kernel/FirmwareKit/GPT.h | 57 ++ dev/kernel/FirmwareKit/Handover.h | 108 ++ dev/kernel/HALKit/.gitkeep | 0 dev/kernel/HALKit/AMD64/CPUID.h | 86 ++ dev/kernel/HALKit/AMD64/HalACPIFactoryInterface.cc | 122 +++ dev/kernel/HALKit/AMD64/HalAPICController.cc | 44 + dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc | 271 +++++ .../HALKit/AMD64/HalApplicationProcessorGNU.s | 8 + .../AMD64/HalApplicationProcessorStartup.asm | 77 ++ dev/kernel/HALKit/AMD64/HalBoot.asm | 28 + dev/kernel/HALKit/AMD64/HalCommonAPI.asm | 82 ++ dev/kernel/HALKit/AMD64/HalControlRegister.s | 45 + .../HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc | 245 +++++ dev/kernel/HALKit/AMD64/HalCoreSystemCalls.cc | 5 + dev/kernel/HALKit/AMD64/HalDebugOutput.cc | 190 ++++ dev/kernel/HALKit/AMD64/HalDebugPort.cc | 42 + dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc | 126 +++ dev/kernel/HALKit/AMD64/HalInterruptAPI.asm | 402 ++++++++ dev/kernel/HALKit/AMD64/HalKernelMain.cc | 117 +++ dev/kernel/HALKit/AMD64/HalKernelPanic.cc | 68 ++ dev/kernel/HALKit/AMD64/HalPagingMgrAMD64.cc | 204 ++++ dev/kernel/HALKit/AMD64/HalProcessorAMD64.cc | 101 ++ dev/kernel/HALKit/AMD64/HalRoutineWait.s | 11 + .../AMD64/HalSchedulerCorePrimitivesAMD64.cc | 52 + dev/kernel/HALKit/AMD64/HalSystemCallInstall.cc | 7 + dev/kernel/HALKit/AMD64/HalTimerAMD64.cc | 86 ++ dev/kernel/HALKit/AMD64/HalUtils.asm | 26 + dev/kernel/HALKit/AMD64/Hypervisor.h | 25 + dev/kernel/HALKit/AMD64/MBCI/HalMBCI.cc | 7 + dev/kernel/HALKit/AMD64/PCI/DMA.cc | 87 ++ dev/kernel/HALKit/AMD64/PCI/Database.cc | 11 + dev/kernel/HALKit/AMD64/PCI/Device.cc | 171 ++++ dev/kernel/HALKit/AMD64/PCI/Express.cc | 11 + dev/kernel/HALKit/AMD64/PCI/IO.cc | 7 + dev/kernel/HALKit/AMD64/PCI/Iterator.cc | 39 + dev/kernel/HALKit/AMD64/PCI/PCI.cc | 7 + dev/kernel/HALKit/AMD64/Paging.h | 99 ++ dev/kernel/HALKit/AMD64/Processor.h | 326 ++++++ dev/kernel/HALKit/AMD64/ReadMe.md | 8 + dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc | 424 ++++++++ dev/kernel/HALKit/AMD64/Storage/DMA+Generic.cc | 253 +++++ dev/kernel/HALKit/AMD64/Storage/PIO+Generic.cc | 191 ++++ dev/kernel/HALKit/AMD64/make_ap_blob.sh | 3 + dev/kernel/HALKit/ARM64/APM/APM+IO.cc | 37 + dev/kernel/HALKit/ARM64/ApplicationProcessor.h | 19 + dev/kernel/HALKit/ARM64/HalACPIFactoryInterface.cc | 32 + dev/kernel/HALKit/ARM64/HalApplicationProcessor.cc | 145 +++ dev/kernel/HALKit/ARM64/HalDebugOutput.cc | 83 ++ dev/kernel/HALKit/ARM64/HalFlushTLB.S | 5 + dev/kernel/HALKit/ARM64/HalKernelMain.cc | 54 + dev/kernel/HALKit/ARM64/HalKernelPanic.cc | 80 ++ dev/kernel/HALKit/ARM64/HalPagingMgrARM64.cc | 86 ++ dev/kernel/HALKit/ARM64/HalSchedulerCoreARM64.cc | 24 + .../ARM64/HalSchedulerCorePrimitivesARM64.cc | 35 + dev/kernel/HALKit/ARM64/HalTimerARM64.cc | 14 + dev/kernel/HALKit/ARM64/MBCI/MBCI.cc | 7 + dev/kernel/HALKit/ARM64/Paging.h | 120 +++ dev/kernel/HALKit/ARM64/Processor.h | 91 ++ dev/kernel/HALKit/ARM64/ReadMe.md | 3 + .../HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc | 119 +++ dev/kernel/HALKit/ARM64/Storage/UFS+Generic.cc | 11 + dev/kernel/HALKit/AXP/CR.s | 11 + dev/kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp | 0 dev/kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp | 24 + dev/kernel/HALKit/AXP/HAL.s | 13 + dev/kernel/HALKit/AXP/Processor.h | 7 + dev/kernel/HALKit/AXP/SYSCALL.s | 10 + dev/kernel/HALKit/AXP/VM.s | 5 + dev/kernel/HALKit/POWER/.gitkeep | 0 dev/kernel/HALKit/POWER/AP.h | 39 + dev/kernel/HALKit/POWER/APM/.gitkeep | 0 dev/kernel/HALKit/POWER/HalAP.cc | 40 + dev/kernel/HALKit/POWER/HalDebugOutput.cc | 27 + dev/kernel/HALKit/POWER/HalStartSequence.s | 14 + dev/kernel/HALKit/POWER/HalThread.cc | 8 + dev/kernel/HALKit/POWER/HalVirtualMemory.cc | 49 + dev/kernel/HALKit/POWER/MBCI/.gitkeep | 0 dev/kernel/HALKit/POWER/MBCI/HalMBCIHost.cc | 8 + dev/kernel/HALKit/POWER/Processor.h | 62 ++ dev/kernel/HALKit/POWER/ReadMe.md | 4 + dev/kernel/HALKit/RISCV/.keep | 0 dev/kernel/HALKit/RISCV/AP.h | 35 + dev/kernel/HALKit/RISCV/APM/.gitkeep | 0 dev/kernel/HALKit/RISCV/HalAP.cc | 40 + dev/kernel/HALKit/RISCV/ReadMe.md | 4 + dev/kernel/HALKit/RISCV/Storage/.gitkeep | 0 dev/kernel/HALKit/X86S/.gitkeep | 0 dev/kernel/HALKit/X86S/ACPI/.gitkeep | 0 dev/kernel/HALKit/X86S/Storage/.gitkeep | 0 dev/kernel/KernelKit/BinaryMutex.h | 43 + dev/kernel/KernelKit/CodeMgr.h | 37 + dev/kernel/KernelKit/DebugOutput.h | 213 ++++ dev/kernel/KernelKit/Defines.h | 15 + dev/kernel/KernelKit/DeviceMgr.h | 140 +++ dev/kernel/KernelKit/DriveMgr.h | 191 ++++ dev/kernel/KernelKit/FileMgr.h | 392 +++++++ dev/kernel/KernelKit/HardwareThreadScheduler.h | 149 +++ dev/kernel/KernelKit/IDylibObject.h | 48 + dev/kernel/KernelKit/IPEFDylibObject.h | 106 ++ dev/kernel/KernelKit/LPC.h | 70 ++ dev/kernel/KernelKit/LoaderInterface.h | 34 + dev/kernel/KernelKit/LockDelegate.h | 69 ++ dev/kernel/KernelKit/MBCI/.keep | 0 dev/kernel/KernelKit/MSDOS.h | 52 + dev/kernel/KernelKit/MemoryMgr.h | 87 ++ dev/kernel/KernelKit/PCI/DMA.h | 81 ++ dev/kernel/KernelKit/PCI/DMA.inl | 20 + dev/kernel/KernelKit/PCI/Database.h | 58 ++ dev/kernel/KernelKit/PCI/Device.h | 81 ++ dev/kernel/KernelKit/PCI/Express.h | 12 + dev/kernel/KernelKit/PCI/IO.h | 75 ++ dev/kernel/KernelKit/PCI/IOArray+AMD64.inl | 54 + dev/kernel/KernelKit/PCI/Iterator.h | 43 + dev/kernel/KernelKit/PCI/PCI.h | 59 ++ dev/kernel/KernelKit/PE.h | 143 +++ dev/kernel/KernelKit/PECodeMgr.h | 24 + dev/kernel/KernelKit/PEF.h | 117 +++ dev/kernel/KernelKit/PEFCodeMgr.h | 72 ++ dev/kernel/KernelKit/Semaphore.h | 16 + dev/kernel/KernelKit/ThreadLocalStorage.h | 69 ++ dev/kernel/KernelKit/ThreadLocalStorage.inl | 99 ++ dev/kernel/KernelKit/Timer.h | 83 ++ dev/kernel/KernelKit/User.h | 95 ++ dev/kernel/KernelKit/UserProcessScheduler.h | 343 +++++++ dev/kernel/KernelKit/UserProcessScheduler.inl | 62 ++ dev/kernel/KernelKit/XCOFF.h | 51 + dev/kernel/KernelRsrc.rsrc | 25 + dev/kernel/MoveAll.ARM64.sh | 7 + dev/kernel/MoveAll.X64.sh | 7 + dev/kernel/NetworkKit/IP.h | 83 ++ dev/kernel/NetworkKit/IPC.h | 91 ++ dev/kernel/NetworkKit/LTE.h | 16 + dev/kernel/NetworkKit/MAC.h | 36 + dev/kernel/NetworkKit/NetworkDevice.h | 83 ++ dev/kernel/NetworkKit/NetworkDevice.inl | 32 + dev/kernel/NewKit/Array.h | 65 ++ dev/kernel/NewKit/ArrayList.h | 63 ++ dev/kernel/NewKit/Atom.h | 47 + dev/kernel/NewKit/Crc32.h | 23 + dev/kernel/NewKit/CxxAbi.h | 28 + dev/kernel/NewKit/Defines.h | 200 ++++ dev/kernel/NewKit/ErrorOr.h | 82 ++ dev/kernel/NewKit/Function.h | 53 + dev/kernel/NewKit/Json.h | 151 +++ dev/kernel/NewKit/KString.h | 94 ++ dev/kernel/NewKit/KernelPanic.h | 74 ++ dev/kernel/NewKit/Macros.h | 149 +++ dev/kernel/NewKit/MutableArray.h | 239 +++++ dev/kernel/NewKit/New.h | 20 + dev/kernel/NewKit/NewKit.h | 20 + dev/kernel/NewKit/OwnPtr.h | 94 ++ dev/kernel/NewKit/PageMgr.h | 81 ++ dev/kernel/NewKit/Pair.h | 14 + dev/kernel/NewKit/Pmm.h | 44 + dev/kernel/NewKit/Ref.h | 108 ++ dev/kernel/NewKit/Stream.h | 58 ++ dev/kernel/NewKit/Utils.h | 30 + dev/kernel/NewKit/Variant.h | 72 ++ dev/kernel/SignalKit/Signals.h | 22 + dev/kernel/StorageKit/AHCI.h | 60 ++ dev/kernel/StorageKit/ATA.h | 39 + dev/kernel/StorageKit/NVME.h | 34 + dev/kernel/StorageKit/PRDT.h | 36 + dev/kernel/StorageKit/SCSI.h | 11 + dev/kernel/StorageKit/StorageKit.h | 22 + dev/kernel/SystemKit/SwapDisk.h | 46 + dev/kernel/amd64-ci.make | 79 ++ dev/kernel/amd64-desktop.make | 79 ++ dev/kernel/arm64-desktop.make | 64 ++ dev/kernel/arm64-mobile.make | 64 ++ dev/kernel/obj/.hgkeep | 0 dev/kernel/power64-cb.make | 4 + dev/kernel/riscv64-cb.make | 0 dev/kernel/src/ACPIFactoryInterface.cc | 101 ++ dev/kernel/src/Array.cc | 7 + dev/kernel/src/ArrayList.cc | 7 + dev/kernel/src/Atom.cc | 10 + dev/kernel/src/BinaryMutex.cc | 74 ++ dev/kernel/src/BitMapMgr.cc | 195 ++++ dev/kernel/src/CodeMgr.cc | 28 + dev/kernel/src/Crc32.cc | 82 ++ dev/kernel/src/CxxAbi-AMD64.cc | 90 ++ dev/kernel/src/CxxAbi-ARM64.cc | 107 ++ dev/kernel/src/Defines.cc | 7 + dev/kernel/src/DeviceMgr.cc | 7 + dev/kernel/src/DriveMgr+IO.cc | 96 ++ dev/kernel/src/DriveMgr.cc | 235 +++++ dev/kernel/src/ErrorOr.cc | 12 + dev/kernel/src/FS/HeFS.cc | 22 + dev/kernel/src/FS/NeFS+FileMgr.cc | 245 +++++ dev/kernel/src/FS/NeFS.cc | 1065 ++++++++++++++++++++ dev/kernel/src/FileMgr.cc | 52 + dev/kernel/src/GUIDWizard.cc | 72 ++ dev/kernel/src/GUIDWrapper.cc | 11 + dev/kernel/src/HardwareThreadScheduler.cc | 225 +++++ dev/kernel/src/IDylibObject.cc | 15 + dev/kernel/src/IPEFDylibObject.cc | 111 ++ dev/kernel/src/IndexableProperty.cc | 57 ++ dev/kernel/src/Json.cc | 10 + dev/kernel/src/KString.cc | 218 ++++ dev/kernel/src/LPC.cc | 34 + dev/kernel/src/LockDelegate.cc | 12 + dev/kernel/src/MemoryMgr.cc | 289 ++++++ dev/kernel/src/MutableArray.cc | 7 + dev/kernel/src/Network/IPAddr.cc | 129 +++ dev/kernel/src/Network/IPCAddr.cc | 32 + dev/kernel/src/Network/IPCMsg.cc | 125 +++ dev/kernel/src/Network/MACAddressGetter.cc | 15 + dev/kernel/src/Network/NetworkDevice.cc | 35 + dev/kernel/src/New+Delete.cc | 50 + dev/kernel/src/OwnPtr.cc | 7 + dev/kernel/src/PEFCodeMgr.cc | 268 +++++ dev/kernel/src/PRDT.cc | 24 + dev/kernel/src/PageMgr.cc | 110 ++ dev/kernel/src/Pmm.cc | 98 ++ dev/kernel/src/Property.cc | 45 + dev/kernel/src/Ref.cc | 7 + dev/kernel/src/SoftwareTimer.cc | 39 + dev/kernel/src/Storage/AHCIDeviceInterface.cc | 36 + dev/kernel/src/Storage/ATADeviceInterface.cc | 88 ++ dev/kernel/src/Storage/NVMEDeviceInterface.cc | 28 + dev/kernel/src/Storage/SCSIDeviceInterface.cc | 11 + dev/kernel/src/Stream.cc | 12 + dev/kernel/src/System/SwapDisk.cc | 47 + dev/kernel/src/ThreadLocalStorage.cc | 67 ++ dev/kernel/src/Timer.cc | 19 + dev/kernel/src/User.cc | 195 ++++ dev/kernel/src/UserProcessScheduler.cc | 621 ++++++++++++ dev/kernel/src/UserProcessTeam.cc | 59 ++ dev/kernel/src/Utils.cc | 224 ++++ dev/kernel/src/Variant.cc | 41 + dev/modules/ACPI/ACPI.h | 90 ++ dev/modules/ACPI/ACPIFactoryInterface.h | 59 ++ dev/modules/AHCI/.gitkeep | 0 dev/modules/AHCI/AHCI.h | 370 +++++++ dev/modules/APM/APM.h | 37 + dev/modules/ATA/ATA.h | 155 +++ dev/modules/CoreGfx/AccessibilityMgr.h | 41 + dev/modules/CoreGfx/FBMgr.h | 150 +++ dev/modules/CoreGfx/MathMgr.h | 29 + dev/modules/CoreGfx/TextMgr.h | 178 ++++ dev/modules/GPRS/.keepme | 0 dev/modules/HPET/.gitkeep | 0 dev/modules/HPET/Defines.h | 42 + dev/modules/IEEE802/.gitkeep | 0 dev/modules/LTE/LTE.h | 40 + dev/modules/MBCI/MBCI.h | 100 ++ dev/modules/MFlash/MFlash.h | 25 + dev/modules/NVME/NVME.h | 113 +++ dev/modules/OHCI/.gitkeep | 0 dev/modules/Pwr/PowerFactory.h | 37 + dev/modules/ReadMe.md | 12 + dev/modules/SCSI/.gitkeep | 0 dev/modules/SCSI/SCSI.h | 15 + dev/modules/WiFi/.gitkeep | 0 dev/modules/XHCI/.gitkeep | 0 dev/modules/XHCI/Defines.h | 70 ++ 714 files changed, 27184 insertions(+), 27935 deletions(-) delete mode 100644 dev/Boot/BootKit/BitManip.h delete mode 100644 dev/Boot/BootKit/BootKit.h delete mode 100644 dev/Boot/BootKit/BootThread.h delete mode 100644 dev/Boot/BootKit/Device.h delete mode 100644 dev/Boot/BootKit/EPM.h delete mode 100644 dev/Boot/BootKit/HW/ATA.h delete mode 100644 dev/Boot/BootKit/HW/SATA.h delete mode 100644 dev/Boot/BootKit/Platform.h delete mode 100644 dev/Boot/BootKit/Protocol.h delete mode 100644 dev/Boot/BootKit/Qr.h delete mode 100644 dev/Boot/BootKit/QrPrelude.h delete mode 100644 dev/Boot/BootKit/Rsrc/zka_disk.rsrc delete mode 100644 dev/Boot/BootKit/Rsrc/zka_has_disk.rsrc delete mode 100644 dev/Boot/BootKit/Rsrc/zka_no_disk.rsrc delete mode 100644 dev/Boot/BootKit/Rsrc/zka_swirl.rsrc delete mode 100644 dev/Boot/BootKit/Shared/base.h delete mode 100644 dev/Boot/BootKit/Shared/bit.h delete mode 100644 dev/Boot/BootKit/Support.h delete mode 100644 dev/Boot/DownloadOVMF.ps1 delete mode 100644 dev/Boot/Mod/.keep delete mode 100644 dev/Boot/Mod/NetBoot/.hgkeep delete mode 100644 dev/Boot/Mod/NetBoot/Boot.S delete mode 100644 dev/Boot/Mod/NetBoot/NetBoot.cc delete mode 100644 dev/Boot/Mod/NetBoot/NetBoot.h delete mode 100644 dev/Boot/Mod/NetBoot/build.json delete mode 100644 dev/Boot/Mod/SysChk/.hgkeep delete mode 100644 dev/Boot/Mod/SysChk/Boot.S delete mode 100644 dev/Boot/Mod/SysChk/Module.cc delete mode 100644 dev/Boot/Mod/SysChk/amd64.json delete mode 100644 dev/Boot/Mod/SysChk/arm64.json delete mode 100644 dev/Boot/amd64-desktop.make delete mode 100644 dev/Boot/arm64-desktop.make delete mode 100644 dev/Boot/arm64-mobile.make delete mode 100644 dev/Boot/gdbinit delete mode 100644 dev/Boot/src/.gitkeep delete mode 100644 dev/Boot/src/BootFileReader.cc delete mode 100644 dev/Boot/src/BootString.cc delete mode 100644 dev/Boot/src/BootSupport.cc delete mode 100644 dev/Boot/src/BootTextWriter.cc delete mode 100644 dev/Boot/src/BootThread.cc delete mode 100644 dev/Boot/src/BootloaderRsrc.rsrc delete mode 100644 dev/Boot/src/HEL/64X000/.gitkeep delete mode 100644 dev/Boot/src/HEL/64X000/BootCB.S delete mode 100644 dev/Boot/src/HEL/AMD64/BootAPI.S delete mode 100644 dev/Boot/src/HEL/AMD64/BootATA.cc delete mode 100644 dev/Boot/src/HEL/AMD64/BootEFI.cc delete mode 100644 dev/Boot/src/HEL/AMD64/BootPlatform.cc delete mode 100644 dev/Boot/src/HEL/AMD64/BootSATA.cc delete mode 100644 dev/Boot/src/HEL/ARM64/.gitkeep delete mode 100644 dev/Boot/src/HEL/ARM64/BootAPI.S delete mode 100644 dev/Boot/src/HEL/ARM64/BootCB.S delete mode 100644 dev/Boot/src/HEL/ARM64/BootEFI.cc delete mode 100644 dev/Boot/src/HEL/ARM64/BootPlatform.cc delete mode 100644 dev/Boot/src/HEL/POWER/.gitkeep delete mode 100644 dev/Boot/src/HEL/POWER/BootCB.S delete mode 100644 dev/Boot/src/New+Delete.cc delete mode 100644 dev/Boot/src/Root/EFI/STARTUP.NSH delete mode 100644 dev/Drivers/.keep delete mode 100644 dev/Hints/CompilerHint.h create mode 100644 dev/HintsKit/CompilerHint.h delete mode 100644 dev/Kernel/ArchKit/ArchKit.h delete mode 100644 dev/Kernel/CFKit/GUIDWizard.h delete mode 100644 dev/Kernel/CFKit/GUIDWrapper.h delete mode 100644 dev/Kernel/CFKit/Property.h delete mode 100644 dev/Kernel/CFKit/Utils.h delete mode 100644 dev/Kernel/CompilerKit/CompilerKit.h delete mode 100644 dev/Kernel/CompilerKit/Detail.h delete mode 100644 dev/Kernel/CompilerKit/Version.h delete mode 100644 dev/Kernel/FSKit/Defines.h delete mode 100644 dev/Kernel/FSKit/HPFS.h delete mode 100644 dev/Kernel/FSKit/IndexableProperty.h delete mode 100644 dev/Kernel/FSKit/NeFS.h delete mode 100644 dev/Kernel/FirmwareKit/.gitkeep delete mode 100644 dev/Kernel/FirmwareKit/CoreBoot/CoreBoot.h delete mode 100644 dev/Kernel/FirmwareKit/CoreBoot/NS.h delete mode 100644 dev/Kernel/FirmwareKit/CoreBoot/NetBoot.h delete mode 100644 dev/Kernel/FirmwareKit/EFI.h delete mode 100644 dev/Kernel/FirmwareKit/EFI/API.h delete mode 100644 dev/Kernel/FirmwareKit/EFI/EFI.h delete mode 100644 dev/Kernel/FirmwareKit/EFI/NS.h delete mode 100644 dev/Kernel/FirmwareKit/EPM.h delete mode 100644 dev/Kernel/FirmwareKit/GPT.h delete mode 100644 dev/Kernel/FirmwareKit/Handover.h delete mode 100644 dev/Kernel/HALKit/.gitkeep delete mode 100644 dev/Kernel/HALKit/AMD64/CPUID.h delete mode 100644 dev/Kernel/HALKit/AMD64/HalACPIFactoryInterface.cc delete mode 100644 dev/Kernel/HALKit/AMD64/HalAPICController.cc delete mode 100644 dev/Kernel/HALKit/AMD64/HalApplicationProcessor.cc delete mode 100644 dev/Kernel/HALKit/AMD64/HalApplicationProcessorGNU.s delete mode 100644 dev/Kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm delete mode 100644 dev/Kernel/HALKit/AMD64/HalBoot.asm delete mode 100644 dev/Kernel/HALKit/AMD64/HalCommonAPI.asm delete mode 100644 dev/Kernel/HALKit/AMD64/HalControlRegister.s delete mode 100644 dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc delete mode 100644 dev/Kernel/HALKit/AMD64/HalCoreSystemCalls.cc delete mode 100644 dev/Kernel/HALKit/AMD64/HalDebugOutput.cc delete mode 100644 dev/Kernel/HALKit/AMD64/HalDebugPort.cc delete mode 100644 dev/Kernel/HALKit/AMD64/HalDescriptorLoader.cc delete mode 100644 dev/Kernel/HALKit/AMD64/HalInterruptAPI.asm delete mode 100644 dev/Kernel/HALKit/AMD64/HalKernelMain.cc delete mode 100644 dev/Kernel/HALKit/AMD64/HalKernelPanic.cc delete mode 100644 dev/Kernel/HALKit/AMD64/HalPagingMgrAMD64.cc delete mode 100644 dev/Kernel/HALKit/AMD64/HalProcessorAMD64.cc delete mode 100644 dev/Kernel/HALKit/AMD64/HalRoutineWait.s delete mode 100644 dev/Kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc delete mode 100644 dev/Kernel/HALKit/AMD64/HalSystemCallInstall.cc delete mode 100644 dev/Kernel/HALKit/AMD64/HalTimerAMD64.cc delete mode 100644 dev/Kernel/HALKit/AMD64/HalUtils.asm delete mode 100644 dev/Kernel/HALKit/AMD64/Hypervisor.h delete mode 100644 dev/Kernel/HALKit/AMD64/MBCI/HalMBCI.cc delete mode 100644 dev/Kernel/HALKit/AMD64/PCI/DMA.cc delete mode 100644 dev/Kernel/HALKit/AMD64/PCI/Database.cc delete mode 100644 dev/Kernel/HALKit/AMD64/PCI/Device.cc delete mode 100644 dev/Kernel/HALKit/AMD64/PCI/Express.cc delete mode 100644 dev/Kernel/HALKit/AMD64/PCI/IO.cc delete mode 100644 dev/Kernel/HALKit/AMD64/PCI/Iterator.cc delete mode 100644 dev/Kernel/HALKit/AMD64/PCI/PCI.cc delete mode 100644 dev/Kernel/HALKit/AMD64/Paging.h delete mode 100644 dev/Kernel/HALKit/AMD64/Processor.h delete mode 100644 dev/Kernel/HALKit/AMD64/ReadMe.md delete mode 100644 dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc delete mode 100644 dev/Kernel/HALKit/AMD64/Storage/DMA+Generic.cc delete mode 100644 dev/Kernel/HALKit/AMD64/Storage/PIO+Generic.cc delete mode 100755 dev/Kernel/HALKit/AMD64/make_ap_blob.sh delete mode 100644 dev/Kernel/HALKit/ARM64/APM/APM+IO.cc delete mode 100644 dev/Kernel/HALKit/ARM64/ApplicationProcessor.h delete mode 100644 dev/Kernel/HALKit/ARM64/HalACPIFactoryInterface.cc delete mode 100644 dev/Kernel/HALKit/ARM64/HalApplicationProcessor.cc delete mode 100644 dev/Kernel/HALKit/ARM64/HalDebugOutput.cc delete mode 100644 dev/Kernel/HALKit/ARM64/HalFlushTLB.S delete mode 100644 dev/Kernel/HALKit/ARM64/HalKernelMain.cc delete mode 100644 dev/Kernel/HALKit/ARM64/HalKernelPanic.cc delete mode 100644 dev/Kernel/HALKit/ARM64/HalPagingMgrARM64.cc delete mode 100644 dev/Kernel/HALKit/ARM64/HalSchedulerCoreARM64.cc delete mode 100644 dev/Kernel/HALKit/ARM64/HalSchedulerCorePrimitivesARM64.cc delete mode 100644 dev/Kernel/HALKit/ARM64/HalTimerARM64.cc delete mode 100644 dev/Kernel/HALKit/ARM64/MBCI/MBCI.cc delete mode 100644 dev/Kernel/HALKit/ARM64/Paging.h delete mode 100644 dev/Kernel/HALKit/ARM64/Processor.h delete mode 100644 dev/Kernel/HALKit/ARM64/ReadMe.md delete mode 100644 dev/Kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc delete mode 100644 dev/Kernel/HALKit/ARM64/Storage/UFS+Generic.cc delete mode 100644 dev/Kernel/HALKit/AXP/CR.s delete mode 100644 dev/Kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp delete mode 100644 dev/Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp delete mode 100644 dev/Kernel/HALKit/AXP/HAL.s delete mode 100644 dev/Kernel/HALKit/AXP/Processor.h delete mode 100644 dev/Kernel/HALKit/AXP/SYSCALL.s delete mode 100644 dev/Kernel/HALKit/AXP/VM.s delete mode 100644 dev/Kernel/HALKit/POWER/.gitkeep delete mode 100644 dev/Kernel/HALKit/POWER/AP.h delete mode 100644 dev/Kernel/HALKit/POWER/APM/.gitkeep delete mode 100644 dev/Kernel/HALKit/POWER/HalAP.cc delete mode 100644 dev/Kernel/HALKit/POWER/HalDebugOutput.cc delete mode 100644 dev/Kernel/HALKit/POWER/HalStartSequence.s delete mode 100644 dev/Kernel/HALKit/POWER/HalThread.cc delete mode 100644 dev/Kernel/HALKit/POWER/HalVirtualMemory.cc delete mode 100644 dev/Kernel/HALKit/POWER/MBCI/.gitkeep delete mode 100644 dev/Kernel/HALKit/POWER/MBCI/HalMBCIHost.cc delete mode 100644 dev/Kernel/HALKit/POWER/Processor.h delete mode 100644 dev/Kernel/HALKit/POWER/ReadMe.md delete mode 100644 dev/Kernel/HALKit/RISCV/.keep delete mode 100644 dev/Kernel/HALKit/RISCV/AP.h delete mode 100644 dev/Kernel/HALKit/RISCV/APM/.gitkeep delete mode 100644 dev/Kernel/HALKit/RISCV/HalAP.cc delete mode 100644 dev/Kernel/HALKit/RISCV/ReadMe.md delete mode 100644 dev/Kernel/HALKit/RISCV/Storage/.gitkeep delete mode 100644 dev/Kernel/HALKit/X86S/.gitkeep delete mode 100644 dev/Kernel/HALKit/X86S/ACPI/.gitkeep delete mode 100644 dev/Kernel/HALKit/X86S/Storage/.gitkeep delete mode 100644 dev/Kernel/KernelKit/BinaryMutex.h delete mode 100644 dev/Kernel/KernelKit/CodeMgr.h delete mode 100644 dev/Kernel/KernelKit/DebugOutput.h delete mode 100644 dev/Kernel/KernelKit/Defines.h delete mode 100644 dev/Kernel/KernelKit/DeviceMgr.h delete mode 100644 dev/Kernel/KernelKit/DriveMgr.h delete mode 100644 dev/Kernel/KernelKit/FileMgr.h delete mode 100644 dev/Kernel/KernelKit/HardwareThreadScheduler.h delete mode 100644 dev/Kernel/KernelKit/IDylibObject.h delete mode 100644 dev/Kernel/KernelKit/IPEFDylibObject.h delete mode 100644 dev/Kernel/KernelKit/LPC.h delete mode 100644 dev/Kernel/KernelKit/LoaderInterface.h delete mode 100644 dev/Kernel/KernelKit/LockDelegate.h delete mode 100644 dev/Kernel/KernelKit/MBCI/.keep delete mode 100644 dev/Kernel/KernelKit/MSDOS.h delete mode 100644 dev/Kernel/KernelKit/MemoryMgr.h delete mode 100644 dev/Kernel/KernelKit/PCI/DMA.h delete mode 100644 dev/Kernel/KernelKit/PCI/DMA.inl delete mode 100644 dev/Kernel/KernelKit/PCI/Database.h delete mode 100644 dev/Kernel/KernelKit/PCI/Device.h delete mode 100644 dev/Kernel/KernelKit/PCI/Express.h delete mode 100644 dev/Kernel/KernelKit/PCI/IO.h delete mode 100644 dev/Kernel/KernelKit/PCI/IOArray+AMD64.inl delete mode 100644 dev/Kernel/KernelKit/PCI/Iterator.h delete mode 100644 dev/Kernel/KernelKit/PCI/PCI.h delete mode 100644 dev/Kernel/KernelKit/PE.h delete mode 100644 dev/Kernel/KernelKit/PECodeMgr.h delete mode 100644 dev/Kernel/KernelKit/PEF.h delete mode 100644 dev/Kernel/KernelKit/PEFCodeMgr.h delete mode 100644 dev/Kernel/KernelKit/Semaphore.h delete mode 100644 dev/Kernel/KernelKit/ThreadLocalStorage.h delete mode 100644 dev/Kernel/KernelKit/ThreadLocalStorage.inl delete mode 100644 dev/Kernel/KernelKit/Timer.h delete mode 100644 dev/Kernel/KernelKit/User.h delete mode 100644 dev/Kernel/KernelKit/UserProcessScheduler.h delete mode 100644 dev/Kernel/KernelKit/UserProcessScheduler.inl delete mode 100644 dev/Kernel/KernelKit/XCOFF.h delete mode 100644 dev/Kernel/KernelRsrc.rsrc delete mode 100755 dev/Kernel/MoveAll.ARM64.sh delete mode 100755 dev/Kernel/MoveAll.X64.sh delete mode 100644 dev/Kernel/NetworkKit/IP.h delete mode 100644 dev/Kernel/NetworkKit/IPC.h delete mode 100644 dev/Kernel/NetworkKit/LTE.h delete mode 100644 dev/Kernel/NetworkKit/MAC.h delete mode 100644 dev/Kernel/NetworkKit/NetworkDevice.h delete mode 100644 dev/Kernel/NetworkKit/NetworkDevice.inl delete mode 100644 dev/Kernel/NewKit/Array.h delete mode 100644 dev/Kernel/NewKit/ArrayList.h delete mode 100644 dev/Kernel/NewKit/Atom.h delete mode 100644 dev/Kernel/NewKit/Crc32.h delete mode 100644 dev/Kernel/NewKit/CxxAbi.h delete mode 100644 dev/Kernel/NewKit/Defines.h delete mode 100644 dev/Kernel/NewKit/ErrorOr.h delete mode 100644 dev/Kernel/NewKit/Function.h delete mode 100644 dev/Kernel/NewKit/Json.h delete mode 100644 dev/Kernel/NewKit/KString.h delete mode 100644 dev/Kernel/NewKit/KernelPanic.h delete mode 100644 dev/Kernel/NewKit/Macros.h delete mode 100644 dev/Kernel/NewKit/MutableArray.h delete mode 100644 dev/Kernel/NewKit/New.h delete mode 100644 dev/Kernel/NewKit/NewKit.h delete mode 100644 dev/Kernel/NewKit/OwnPtr.h delete mode 100644 dev/Kernel/NewKit/PageMgr.h delete mode 100644 dev/Kernel/NewKit/Pair.h delete mode 100644 dev/Kernel/NewKit/Pmm.h delete mode 100644 dev/Kernel/NewKit/Ref.h delete mode 100644 dev/Kernel/NewKit/Stream.h delete mode 100644 dev/Kernel/NewKit/Utils.h delete mode 100644 dev/Kernel/NewKit/Variant.h delete mode 100644 dev/Kernel/SignalKit/Signals.h delete mode 100644 dev/Kernel/StorageKit/AHCI.h delete mode 100644 dev/Kernel/StorageKit/ATA.h delete mode 100644 dev/Kernel/StorageKit/NVME.h delete mode 100644 dev/Kernel/StorageKit/PRDT.h delete mode 100644 dev/Kernel/StorageKit/SCSI.h delete mode 100644 dev/Kernel/StorageKit/StorageKit.h delete mode 100644 dev/Kernel/SystemKit/SwapDisk.h delete mode 100644 dev/Kernel/amd64-ci.make delete mode 100644 dev/Kernel/amd64-desktop.make delete mode 100644 dev/Kernel/arm64-desktop.make delete mode 100644 dev/Kernel/arm64-mobile.make delete mode 100644 dev/Kernel/doc/EPM.pdf delete mode 100644 dev/Kernel/doc/Specs.md delete mode 100644 dev/Kernel/doc/TodoList.md delete mode 100644 dev/Kernel/obj/.hgkeep delete mode 100644 dev/Kernel/power64-cb.make delete mode 100644 dev/Kernel/riscv64-cb.make delete mode 100644 dev/Kernel/src/ACPIFactoryInterface.cc delete mode 100644 dev/Kernel/src/Array.cc delete mode 100644 dev/Kernel/src/ArrayList.cc delete mode 100644 dev/Kernel/src/Atom.cc delete mode 100644 dev/Kernel/src/BinaryMutex.cc delete mode 100644 dev/Kernel/src/BitMapMgr.cc delete mode 100644 dev/Kernel/src/CodeMgr.cc delete mode 100644 dev/Kernel/src/Crc32.cc delete mode 100644 dev/Kernel/src/CxxAbi-AMD64.cc delete mode 100644 dev/Kernel/src/CxxAbi-ARM64.cc delete mode 100644 dev/Kernel/src/Defines.cc delete mode 100644 dev/Kernel/src/DeviceMgr.cc delete mode 100644 dev/Kernel/src/DriveMgr+IO.cc delete mode 100644 dev/Kernel/src/DriveMgr.cc delete mode 100644 dev/Kernel/src/ErrorOr.cc delete mode 100644 dev/Kernel/src/FS/HPFS.cc delete mode 100644 dev/Kernel/src/FS/NeFS+FileMgr.cc delete mode 100644 dev/Kernel/src/FS/NeFS.cc delete mode 100644 dev/Kernel/src/FileMgr.cc delete mode 100644 dev/Kernel/src/GUIDWizard.cc delete mode 100644 dev/Kernel/src/GUIDWrapper.cc delete mode 100644 dev/Kernel/src/HardwareThreadScheduler.cc delete mode 100644 dev/Kernel/src/IDylibObject.cc delete mode 100644 dev/Kernel/src/IPEFDylibObject.cc delete mode 100644 dev/Kernel/src/IndexableProperty.cc delete mode 100644 dev/Kernel/src/Json.cc delete mode 100644 dev/Kernel/src/KString.cc delete mode 100644 dev/Kernel/src/LPC.cc delete mode 100644 dev/Kernel/src/LockDelegate.cc delete mode 100644 dev/Kernel/src/MemoryMgr.cc delete mode 100644 dev/Kernel/src/MutableArray.cc delete mode 100644 dev/Kernel/src/Network/IPAddr.cc delete mode 100644 dev/Kernel/src/Network/IPCAddr.cc delete mode 100644 dev/Kernel/src/Network/IPCMsg.cc delete mode 100644 dev/Kernel/src/Network/MACAddressGetter.cc delete mode 100644 dev/Kernel/src/Network/NetworkDevice.cc delete mode 100644 dev/Kernel/src/New+Delete.cc delete mode 100644 dev/Kernel/src/OwnPtr.cc delete mode 100644 dev/Kernel/src/PEFCodeMgr.cc delete mode 100644 dev/Kernel/src/PRDT.cc delete mode 100644 dev/Kernel/src/PageMgr.cc delete mode 100644 dev/Kernel/src/Pmm.cc delete mode 100644 dev/Kernel/src/Property.cc delete mode 100644 dev/Kernel/src/Ref.cc delete mode 100644 dev/Kernel/src/SoftwareTimer.cc delete mode 100644 dev/Kernel/src/Storage/AHCIDeviceInterface.cc delete mode 100644 dev/Kernel/src/Storage/ATADeviceInterface.cc delete mode 100644 dev/Kernel/src/Storage/NVMEDeviceInterface.cc delete mode 100644 dev/Kernel/src/Storage/SCSIDeviceInterface.cc delete mode 100644 dev/Kernel/src/Stream.cc delete mode 100644 dev/Kernel/src/System/SwapDisk.cc delete mode 100644 dev/Kernel/src/ThreadLocalStorage.cc delete mode 100644 dev/Kernel/src/Timer.cc delete mode 100644 dev/Kernel/src/User.cc delete mode 100644 dev/Kernel/src/UserProcessScheduler.cc delete mode 100644 dev/Kernel/src/UserProcessTeam.cc delete mode 100644 dev/Kernel/src/Utils.cc delete mode 100644 dev/Kernel/src/Variant.cc delete mode 100644 dev/LibSCI/CompilerHint.h delete mode 100644 dev/LibSCI/FileMgr.h delete mode 100644 dev/LibSCI/GPU.h delete mode 100644 dev/LibSCI/LPC.h delete mode 100644 dev/LibSCI/Macros.h delete mode 100644 dev/LibSCI/SCI.h delete mode 100644 dev/LibSCI/doc/LibSCI.drawio delete mode 100644 dev/LibSCI/libsci.json delete mode 100644 dev/LibSCI/src/GPU.cc delete mode 100644 dev/LibSCI/src/LPC.cc delete mode 100644 dev/LibSCI/src/LibSCI+IO.asm delete mode 100644 dev/LibSCI/src/Makefile delete mode 100644 dev/LibSCI/src/SCI.cc delete mode 100644 dev/Mod/ACPI/ACPI.h delete mode 100644 dev/Mod/ACPI/ACPIFactoryInterface.h delete mode 100644 dev/Mod/AHCI/.gitkeep delete mode 100644 dev/Mod/AHCI/AHCI.h delete mode 100644 dev/Mod/APM/APM.h delete mode 100644 dev/Mod/ATA/ATA.h delete mode 100644 dev/Mod/CoreGfx/AccessibilityMgr.h delete mode 100644 dev/Mod/CoreGfx/FBMgr.h delete mode 100644 dev/Mod/CoreGfx/MathMgr.h delete mode 100644 dev/Mod/CoreGfx/TextMgr.h delete mode 100644 dev/Mod/GPRS/.keepme delete mode 100644 dev/Mod/HPET/.gitkeep delete mode 100644 dev/Mod/HPET/Defines.h delete mode 100644 dev/Mod/IEEE802/.gitkeep delete mode 100644 dev/Mod/LTE/LTE.h delete mode 100644 dev/Mod/MBCI/MBCI.h delete mode 100644 dev/Mod/MFlash/MFlash.h delete mode 100644 dev/Mod/NVME/NVME.h delete mode 100644 dev/Mod/OHCI/.gitkeep delete mode 100644 dev/Mod/Pwr/PowerFactory.h delete mode 100644 dev/Mod/ReadMe.md delete mode 100644 dev/Mod/SCSI/.gitkeep delete mode 100644 dev/Mod/SCSI/SCSI.h delete mode 100644 dev/Mod/WiFi/.gitkeep delete mode 100644 dev/Mod/XHCI/.gitkeep delete mode 100644 dev/Mod/XHCI/Defines.h create mode 100644 dev/SCIKit/CompilerHint.h create mode 100644 dev/SCIKit/LPC.h create mode 100644 dev/SCIKit/Macros.h create mode 100644 dev/SCIKit/SCI.h create mode 100644 dev/SCIKit/doc/LibSCI.drawio create mode 100644 dev/SCIKit/libsci.json create mode 100644 dev/SCIKit/src/LPC.cc create mode 100644 dev/SCIKit/src/LibSCI+IO.asm create mode 100644 dev/SCIKit/src/Makefile create mode 100644 dev/SCIKit/src/SCI.cc delete mode 100644 dev/Tools/.keepme delete mode 100644 dev/Usr/.keepme delete mode 100644 dev/Usr/LibCF/Array.h delete mode 100644 dev/Usr/LibCF/Atom.h delete mode 100644 dev/Usr/LibCF/Foundation.cc delete mode 100644 dev/Usr/LibCF/Foundation.h delete mode 100644 dev/Usr/LibCF/Object.h delete mode 100644 dev/Usr/LibCF/Property.h delete mode 100644 dev/Usr/LibCF/Ref.h delete mode 100644 dev/Usr/LibCF/String.h delete mode 100644 dev/Usr/LibFont/.keep delete mode 100644 dev/Usr/LibFont/Font.h delete mode 100644 dev/Usr/LibGUI/.keep delete mode 100644 dev/Usr/LibLocale/.keep delete mode 100644 dev/Usr/LibWM/WindowConnection.h create mode 100644 dev/boot/BootKit/BitManip.h create mode 100644 dev/boot/BootKit/BootKit.h create mode 100644 dev/boot/BootKit/BootThread.h create mode 100644 dev/boot/BootKit/Device.h create mode 100644 dev/boot/BootKit/EPM.h create mode 100644 dev/boot/BootKit/HW/ATA.h create mode 100644 dev/boot/BootKit/HW/SATA.h create mode 100644 dev/boot/BootKit/Platform.h create mode 100644 dev/boot/BootKit/Protocol.h create mode 100644 dev/boot/BootKit/Qr.h create mode 100644 dev/boot/BootKit/QrPrelude.h create mode 100644 dev/boot/BootKit/Rsrc/zka_disk.rsrc create mode 100644 dev/boot/BootKit/Rsrc/zka_has_disk.rsrc create mode 100644 dev/boot/BootKit/Rsrc/zka_no_disk.rsrc create mode 100644 dev/boot/BootKit/Rsrc/zka_swirl.rsrc create mode 100644 dev/boot/BootKit/Shared/base.h create mode 100644 dev/boot/BootKit/Shared/bit.h create mode 100644 dev/boot/BootKit/Support.h create mode 100644 dev/boot/DownloadOVMF.ps1 create mode 100644 dev/boot/Mod/.keep create mode 100644 dev/boot/Mod/NetBoot/.hgkeep create mode 100644 dev/boot/Mod/NetBoot/Boot.S create mode 100644 dev/boot/Mod/NetBoot/NetBoot.cc create mode 100644 dev/boot/Mod/NetBoot/NetBoot.h create mode 100644 dev/boot/Mod/NetBoot/build.json create mode 100644 dev/boot/Mod/SysChk/.hgkeep create mode 100644 dev/boot/Mod/SysChk/Boot.S create mode 100644 dev/boot/Mod/SysChk/Module.cc create mode 100644 dev/boot/Mod/SysChk/amd64.json create mode 100644 dev/boot/Mod/SysChk/arm64.json create mode 100644 dev/boot/amd64-desktop.make create mode 100644 dev/boot/arm64-desktop.make create mode 100644 dev/boot/arm64-mobile.make create mode 100644 dev/boot/gdbinit create mode 100644 dev/boot/src/.gitkeep create mode 100644 dev/boot/src/BootFileReader.cc create mode 100644 dev/boot/src/BootString.cc create mode 100644 dev/boot/src/BootSupport.cc create mode 100644 dev/boot/src/BootTextWriter.cc create mode 100644 dev/boot/src/BootThread.cc create mode 100644 dev/boot/src/BootloaderRsrc.rsrc create mode 100644 dev/boot/src/HEL/64X000/.gitkeep create mode 100644 dev/boot/src/HEL/64X000/BootCB.S create mode 100644 dev/boot/src/HEL/AMD64/BootAPI.S create mode 100644 dev/boot/src/HEL/AMD64/BootATA.cc create mode 100644 dev/boot/src/HEL/AMD64/BootEFI.cc create mode 100644 dev/boot/src/HEL/AMD64/BootPlatform.cc create mode 100644 dev/boot/src/HEL/AMD64/BootSATA.cc create mode 100644 dev/boot/src/HEL/ARM64/.gitkeep create mode 100644 dev/boot/src/HEL/ARM64/BootAPI.S create mode 100644 dev/boot/src/HEL/ARM64/BootCB.S create mode 100644 dev/boot/src/HEL/ARM64/BootEFI.cc create mode 100644 dev/boot/src/HEL/ARM64/BootPlatform.cc create mode 100644 dev/boot/src/HEL/POWER/.gitkeep create mode 100644 dev/boot/src/HEL/POWER/BootCB.S create mode 100644 dev/boot/src/New+Delete.cc create mode 100644 dev/boot/src/Root/EFI/STARTUP.NSH create mode 100644 dev/kernel/ArchKit/ArchKit.h create mode 100644 dev/kernel/CFKit/GUIDWizard.h create mode 100644 dev/kernel/CFKit/GUIDWrapper.h create mode 100644 dev/kernel/CFKit/Property.h create mode 100644 dev/kernel/CFKit/Utils.h create mode 100644 dev/kernel/CompilerKit/CompilerKit.h create mode 100644 dev/kernel/CompilerKit/Detail.h create mode 100644 dev/kernel/CompilerKit/Version.h create mode 100644 dev/kernel/FSKit/Defines.h create mode 100644 dev/kernel/FSKit/HeFS.h create mode 100644 dev/kernel/FSKit/IndexableProperty.h create mode 100644 dev/kernel/FSKit/NeFS.h create mode 100644 dev/kernel/FirmwareKit/.gitkeep create mode 100644 dev/kernel/FirmwareKit/CoreBoot/CoreBoot.h create mode 100644 dev/kernel/FirmwareKit/CoreBoot/NS.h create mode 100644 dev/kernel/FirmwareKit/CoreBoot/NetBoot.h create mode 100644 dev/kernel/FirmwareKit/EFI.h create mode 100644 dev/kernel/FirmwareKit/EFI/API.h create mode 100644 dev/kernel/FirmwareKit/EFI/EFI.h create mode 100644 dev/kernel/FirmwareKit/EFI/NS.h create mode 100644 dev/kernel/FirmwareKit/EPM.h create mode 100644 dev/kernel/FirmwareKit/GPT.h create mode 100644 dev/kernel/FirmwareKit/Handover.h create mode 100644 dev/kernel/HALKit/.gitkeep create mode 100644 dev/kernel/HALKit/AMD64/CPUID.h create mode 100644 dev/kernel/HALKit/AMD64/HalACPIFactoryInterface.cc create mode 100644 dev/kernel/HALKit/AMD64/HalAPICController.cc create mode 100644 dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc create mode 100644 dev/kernel/HALKit/AMD64/HalApplicationProcessorGNU.s create mode 100644 dev/kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm create mode 100644 dev/kernel/HALKit/AMD64/HalBoot.asm create mode 100644 dev/kernel/HALKit/AMD64/HalCommonAPI.asm create mode 100644 dev/kernel/HALKit/AMD64/HalControlRegister.s create mode 100644 dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc create mode 100644 dev/kernel/HALKit/AMD64/HalCoreSystemCalls.cc create mode 100644 dev/kernel/HALKit/AMD64/HalDebugOutput.cc create mode 100644 dev/kernel/HALKit/AMD64/HalDebugPort.cc create mode 100644 dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc create mode 100644 dev/kernel/HALKit/AMD64/HalInterruptAPI.asm create mode 100644 dev/kernel/HALKit/AMD64/HalKernelMain.cc create mode 100644 dev/kernel/HALKit/AMD64/HalKernelPanic.cc create mode 100644 dev/kernel/HALKit/AMD64/HalPagingMgrAMD64.cc create mode 100644 dev/kernel/HALKit/AMD64/HalProcessorAMD64.cc create mode 100644 dev/kernel/HALKit/AMD64/HalRoutineWait.s create mode 100644 dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc create mode 100644 dev/kernel/HALKit/AMD64/HalSystemCallInstall.cc create mode 100644 dev/kernel/HALKit/AMD64/HalTimerAMD64.cc create mode 100644 dev/kernel/HALKit/AMD64/HalUtils.asm create mode 100644 dev/kernel/HALKit/AMD64/Hypervisor.h create mode 100644 dev/kernel/HALKit/AMD64/MBCI/HalMBCI.cc create mode 100644 dev/kernel/HALKit/AMD64/PCI/DMA.cc create mode 100644 dev/kernel/HALKit/AMD64/PCI/Database.cc create mode 100644 dev/kernel/HALKit/AMD64/PCI/Device.cc create mode 100644 dev/kernel/HALKit/AMD64/PCI/Express.cc create mode 100644 dev/kernel/HALKit/AMD64/PCI/IO.cc create mode 100644 dev/kernel/HALKit/AMD64/PCI/Iterator.cc create mode 100644 dev/kernel/HALKit/AMD64/PCI/PCI.cc create mode 100644 dev/kernel/HALKit/AMD64/Paging.h create mode 100644 dev/kernel/HALKit/AMD64/Processor.h create mode 100644 dev/kernel/HALKit/AMD64/ReadMe.md create mode 100644 dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc create mode 100644 dev/kernel/HALKit/AMD64/Storage/DMA+Generic.cc create mode 100644 dev/kernel/HALKit/AMD64/Storage/PIO+Generic.cc create mode 100755 dev/kernel/HALKit/AMD64/make_ap_blob.sh create mode 100644 dev/kernel/HALKit/ARM64/APM/APM+IO.cc create mode 100644 dev/kernel/HALKit/ARM64/ApplicationProcessor.h create mode 100644 dev/kernel/HALKit/ARM64/HalACPIFactoryInterface.cc create mode 100644 dev/kernel/HALKit/ARM64/HalApplicationProcessor.cc create mode 100644 dev/kernel/HALKit/ARM64/HalDebugOutput.cc create mode 100644 dev/kernel/HALKit/ARM64/HalFlushTLB.S create mode 100644 dev/kernel/HALKit/ARM64/HalKernelMain.cc create mode 100644 dev/kernel/HALKit/ARM64/HalKernelPanic.cc create mode 100644 dev/kernel/HALKit/ARM64/HalPagingMgrARM64.cc create mode 100644 dev/kernel/HALKit/ARM64/HalSchedulerCoreARM64.cc create mode 100644 dev/kernel/HALKit/ARM64/HalSchedulerCorePrimitivesARM64.cc create mode 100644 dev/kernel/HALKit/ARM64/HalTimerARM64.cc create mode 100644 dev/kernel/HALKit/ARM64/MBCI/MBCI.cc create mode 100644 dev/kernel/HALKit/ARM64/Paging.h create mode 100644 dev/kernel/HALKit/ARM64/Processor.h create mode 100644 dev/kernel/HALKit/ARM64/ReadMe.md create mode 100644 dev/kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc create mode 100644 dev/kernel/HALKit/ARM64/Storage/UFS+Generic.cc create mode 100644 dev/kernel/HALKit/AXP/CR.s create mode 100644 dev/kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp create mode 100644 dev/kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp create mode 100644 dev/kernel/HALKit/AXP/HAL.s create mode 100644 dev/kernel/HALKit/AXP/Processor.h create mode 100644 dev/kernel/HALKit/AXP/SYSCALL.s create mode 100644 dev/kernel/HALKit/AXP/VM.s create mode 100644 dev/kernel/HALKit/POWER/.gitkeep create mode 100644 dev/kernel/HALKit/POWER/AP.h create mode 100644 dev/kernel/HALKit/POWER/APM/.gitkeep create mode 100644 dev/kernel/HALKit/POWER/HalAP.cc create mode 100644 dev/kernel/HALKit/POWER/HalDebugOutput.cc create mode 100644 dev/kernel/HALKit/POWER/HalStartSequence.s create mode 100644 dev/kernel/HALKit/POWER/HalThread.cc create mode 100644 dev/kernel/HALKit/POWER/HalVirtualMemory.cc create mode 100644 dev/kernel/HALKit/POWER/MBCI/.gitkeep create mode 100644 dev/kernel/HALKit/POWER/MBCI/HalMBCIHost.cc create mode 100644 dev/kernel/HALKit/POWER/Processor.h create mode 100644 dev/kernel/HALKit/POWER/ReadMe.md create mode 100644 dev/kernel/HALKit/RISCV/.keep create mode 100644 dev/kernel/HALKit/RISCV/AP.h create mode 100644 dev/kernel/HALKit/RISCV/APM/.gitkeep create mode 100644 dev/kernel/HALKit/RISCV/HalAP.cc create mode 100644 dev/kernel/HALKit/RISCV/ReadMe.md create mode 100644 dev/kernel/HALKit/RISCV/Storage/.gitkeep create mode 100644 dev/kernel/HALKit/X86S/.gitkeep create mode 100644 dev/kernel/HALKit/X86S/ACPI/.gitkeep create mode 100644 dev/kernel/HALKit/X86S/Storage/.gitkeep create mode 100644 dev/kernel/KernelKit/BinaryMutex.h create mode 100644 dev/kernel/KernelKit/CodeMgr.h create mode 100644 dev/kernel/KernelKit/DebugOutput.h create mode 100644 dev/kernel/KernelKit/Defines.h create mode 100644 dev/kernel/KernelKit/DeviceMgr.h create mode 100644 dev/kernel/KernelKit/DriveMgr.h create mode 100644 dev/kernel/KernelKit/FileMgr.h create mode 100644 dev/kernel/KernelKit/HardwareThreadScheduler.h create mode 100644 dev/kernel/KernelKit/IDylibObject.h create mode 100644 dev/kernel/KernelKit/IPEFDylibObject.h create mode 100644 dev/kernel/KernelKit/LPC.h create mode 100644 dev/kernel/KernelKit/LoaderInterface.h create mode 100644 dev/kernel/KernelKit/LockDelegate.h create mode 100644 dev/kernel/KernelKit/MBCI/.keep create mode 100644 dev/kernel/KernelKit/MSDOS.h create mode 100644 dev/kernel/KernelKit/MemoryMgr.h create mode 100644 dev/kernel/KernelKit/PCI/DMA.h create mode 100644 dev/kernel/KernelKit/PCI/DMA.inl create mode 100644 dev/kernel/KernelKit/PCI/Database.h create mode 100644 dev/kernel/KernelKit/PCI/Device.h create mode 100644 dev/kernel/KernelKit/PCI/Express.h create mode 100644 dev/kernel/KernelKit/PCI/IO.h create mode 100644 dev/kernel/KernelKit/PCI/IOArray+AMD64.inl create mode 100644 dev/kernel/KernelKit/PCI/Iterator.h create mode 100644 dev/kernel/KernelKit/PCI/PCI.h create mode 100644 dev/kernel/KernelKit/PE.h create mode 100644 dev/kernel/KernelKit/PECodeMgr.h create mode 100644 dev/kernel/KernelKit/PEF.h create mode 100644 dev/kernel/KernelKit/PEFCodeMgr.h create mode 100644 dev/kernel/KernelKit/Semaphore.h create mode 100644 dev/kernel/KernelKit/ThreadLocalStorage.h create mode 100644 dev/kernel/KernelKit/ThreadLocalStorage.inl create mode 100644 dev/kernel/KernelKit/Timer.h create mode 100644 dev/kernel/KernelKit/User.h create mode 100644 dev/kernel/KernelKit/UserProcessScheduler.h create mode 100644 dev/kernel/KernelKit/UserProcessScheduler.inl create mode 100644 dev/kernel/KernelKit/XCOFF.h create mode 100644 dev/kernel/KernelRsrc.rsrc create mode 100755 dev/kernel/MoveAll.ARM64.sh create mode 100755 dev/kernel/MoveAll.X64.sh create mode 100644 dev/kernel/NetworkKit/IP.h create mode 100644 dev/kernel/NetworkKit/IPC.h create mode 100644 dev/kernel/NetworkKit/LTE.h create mode 100644 dev/kernel/NetworkKit/MAC.h create mode 100644 dev/kernel/NetworkKit/NetworkDevice.h create mode 100644 dev/kernel/NetworkKit/NetworkDevice.inl create mode 100644 dev/kernel/NewKit/Array.h create mode 100644 dev/kernel/NewKit/ArrayList.h create mode 100644 dev/kernel/NewKit/Atom.h create mode 100644 dev/kernel/NewKit/Crc32.h create mode 100644 dev/kernel/NewKit/CxxAbi.h create mode 100644 dev/kernel/NewKit/Defines.h create mode 100644 dev/kernel/NewKit/ErrorOr.h create mode 100644 dev/kernel/NewKit/Function.h create mode 100644 dev/kernel/NewKit/Json.h create mode 100644 dev/kernel/NewKit/KString.h create mode 100644 dev/kernel/NewKit/KernelPanic.h create mode 100644 dev/kernel/NewKit/Macros.h create mode 100644 dev/kernel/NewKit/MutableArray.h create mode 100644 dev/kernel/NewKit/New.h create mode 100644 dev/kernel/NewKit/NewKit.h create mode 100644 dev/kernel/NewKit/OwnPtr.h create mode 100644 dev/kernel/NewKit/PageMgr.h create mode 100644 dev/kernel/NewKit/Pair.h create mode 100644 dev/kernel/NewKit/Pmm.h create mode 100644 dev/kernel/NewKit/Ref.h create mode 100644 dev/kernel/NewKit/Stream.h create mode 100644 dev/kernel/NewKit/Utils.h create mode 100644 dev/kernel/NewKit/Variant.h create mode 100644 dev/kernel/SignalKit/Signals.h create mode 100644 dev/kernel/StorageKit/AHCI.h create mode 100644 dev/kernel/StorageKit/ATA.h create mode 100644 dev/kernel/StorageKit/NVME.h create mode 100644 dev/kernel/StorageKit/PRDT.h create mode 100644 dev/kernel/StorageKit/SCSI.h create mode 100644 dev/kernel/StorageKit/StorageKit.h create mode 100644 dev/kernel/SystemKit/SwapDisk.h create mode 100644 dev/kernel/amd64-ci.make create mode 100644 dev/kernel/amd64-desktop.make create mode 100644 dev/kernel/arm64-desktop.make create mode 100644 dev/kernel/arm64-mobile.make create mode 100644 dev/kernel/obj/.hgkeep create mode 100644 dev/kernel/power64-cb.make create mode 100644 dev/kernel/riscv64-cb.make create mode 100644 dev/kernel/src/ACPIFactoryInterface.cc create mode 100644 dev/kernel/src/Array.cc create mode 100644 dev/kernel/src/ArrayList.cc create mode 100644 dev/kernel/src/Atom.cc create mode 100644 dev/kernel/src/BinaryMutex.cc create mode 100644 dev/kernel/src/BitMapMgr.cc create mode 100644 dev/kernel/src/CodeMgr.cc create mode 100644 dev/kernel/src/Crc32.cc create mode 100644 dev/kernel/src/CxxAbi-AMD64.cc create mode 100644 dev/kernel/src/CxxAbi-ARM64.cc create mode 100644 dev/kernel/src/Defines.cc create mode 100644 dev/kernel/src/DeviceMgr.cc create mode 100644 dev/kernel/src/DriveMgr+IO.cc create mode 100644 dev/kernel/src/DriveMgr.cc create mode 100644 dev/kernel/src/ErrorOr.cc create mode 100644 dev/kernel/src/FS/HeFS.cc create mode 100644 dev/kernel/src/FS/NeFS+FileMgr.cc create mode 100644 dev/kernel/src/FS/NeFS.cc create mode 100644 dev/kernel/src/FileMgr.cc create mode 100644 dev/kernel/src/GUIDWizard.cc create mode 100644 dev/kernel/src/GUIDWrapper.cc create mode 100644 dev/kernel/src/HardwareThreadScheduler.cc create mode 100644 dev/kernel/src/IDylibObject.cc create mode 100644 dev/kernel/src/IPEFDylibObject.cc create mode 100644 dev/kernel/src/IndexableProperty.cc create mode 100644 dev/kernel/src/Json.cc create mode 100644 dev/kernel/src/KString.cc create mode 100644 dev/kernel/src/LPC.cc create mode 100644 dev/kernel/src/LockDelegate.cc create mode 100644 dev/kernel/src/MemoryMgr.cc create mode 100644 dev/kernel/src/MutableArray.cc create mode 100644 dev/kernel/src/Network/IPAddr.cc create mode 100644 dev/kernel/src/Network/IPCAddr.cc create mode 100644 dev/kernel/src/Network/IPCMsg.cc create mode 100644 dev/kernel/src/Network/MACAddressGetter.cc create mode 100644 dev/kernel/src/Network/NetworkDevice.cc create mode 100644 dev/kernel/src/New+Delete.cc create mode 100644 dev/kernel/src/OwnPtr.cc create mode 100644 dev/kernel/src/PEFCodeMgr.cc create mode 100644 dev/kernel/src/PRDT.cc create mode 100644 dev/kernel/src/PageMgr.cc create mode 100644 dev/kernel/src/Pmm.cc create mode 100644 dev/kernel/src/Property.cc create mode 100644 dev/kernel/src/Ref.cc create mode 100644 dev/kernel/src/SoftwareTimer.cc create mode 100644 dev/kernel/src/Storage/AHCIDeviceInterface.cc create mode 100644 dev/kernel/src/Storage/ATADeviceInterface.cc create mode 100644 dev/kernel/src/Storage/NVMEDeviceInterface.cc create mode 100644 dev/kernel/src/Storage/SCSIDeviceInterface.cc create mode 100644 dev/kernel/src/Stream.cc create mode 100644 dev/kernel/src/System/SwapDisk.cc create mode 100644 dev/kernel/src/ThreadLocalStorage.cc create mode 100644 dev/kernel/src/Timer.cc create mode 100644 dev/kernel/src/User.cc create mode 100644 dev/kernel/src/UserProcessScheduler.cc create mode 100644 dev/kernel/src/UserProcessTeam.cc create mode 100644 dev/kernel/src/Utils.cc create mode 100644 dev/kernel/src/Variant.cc create mode 100644 dev/modules/ACPI/ACPI.h create mode 100644 dev/modules/ACPI/ACPIFactoryInterface.h create mode 100644 dev/modules/AHCI/.gitkeep create mode 100644 dev/modules/AHCI/AHCI.h create mode 100644 dev/modules/APM/APM.h create mode 100644 dev/modules/ATA/ATA.h create mode 100644 dev/modules/CoreGfx/AccessibilityMgr.h create mode 100644 dev/modules/CoreGfx/FBMgr.h create mode 100644 dev/modules/CoreGfx/MathMgr.h create mode 100644 dev/modules/CoreGfx/TextMgr.h create mode 100644 dev/modules/GPRS/.keepme create mode 100644 dev/modules/HPET/.gitkeep create mode 100644 dev/modules/HPET/Defines.h create mode 100644 dev/modules/IEEE802/.gitkeep create mode 100644 dev/modules/LTE/LTE.h create mode 100644 dev/modules/MBCI/MBCI.h create mode 100644 dev/modules/MFlash/MFlash.h create mode 100644 dev/modules/NVME/NVME.h create mode 100644 dev/modules/OHCI/.gitkeep create mode 100644 dev/modules/Pwr/PowerFactory.h create mode 100644 dev/modules/ReadMe.md create mode 100644 dev/modules/SCSI/.gitkeep create mode 100644 dev/modules/SCSI/SCSI.h create mode 100644 dev/modules/WiFi/.gitkeep create mode 100644 dev/modules/XHCI/.gitkeep create mode 100644 dev/modules/XHCI/Defines.h (limited to 'dev') diff --git a/dev/Boot/BootKit/BitManip.h b/dev/Boot/BootKit/BitManip.h deleted file mode 100644 index 475d44ed..00000000 --- a/dev/Boot/BootKit/BitManip.h +++ /dev/null @@ -1,20 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef __BITMANIP_H__ -#define __BITMANIP_H__ - -/// File: BitManip.h -/// Purpose: Bit manipulation helpers, based on coreboot-dev. - -#define bk_set_bit(X, O) X = (1 << O) | X -#define bk_clear_bit(X, O) X = ~(1 << O) & X -#define bk_toogle(X, O) X = (1 << O) ^ X -#define bk_lsb(X) X = X & -X -#define bk_msb(X) X = -(mp_lsb(X)) & X -#define bk_look_for_bit(X, O) (1 << O) | X - -#endif // ifndef __BITMANIP_H__ diff --git a/dev/Boot/BootKit/BootKit.h b/dev/Boot/BootKit/BootKit.h deleted file mode 100644 index 847a7e83..00000000 --- a/dev/Boot/BootKit/BootKit.h +++ /dev/null @@ -1,403 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -/***********************************************************************************/ -/// @file BootKit.h -/// @brief Bootloader Application Programming Interface. -/***********************************************************************************/ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include - -/// include NeFS header and Support header as well. - -#include -#include - -/***********************************************************************************/ -/// Include other APIs. -/***********************************************************************************/ - -#include -#include - -#include - -/***********************************************************************************/ -/// Framebuffer helpers. -/***********************************************************************************/ - -namespace EFI -{ - EXTERN void ThrowError(const WideChar* errorCode, - const WideChar* reason) noexcept; -} // namespace EFI - -namespace Boot -{ - class BootTextWriter; - class BootFileReader; - class BootThread; - class BVersionString; - - typedef Char* PEFImagePtr; - typedef Char* PEImagePtr; - - typedef WideChar CharacterTypeUTF16; - typedef Char CharacterTypeUTF8; - - using namespace NeOS; - - /** - * @brief BootKit Text Writer class - * Writes to UEFI StdOut. - */ - class BootTextWriter final - { - BootTextWriter& _Write(const Long& num); - - public: - BootTextWriter& Write(const Long& num); - BootTextWriter& Write(const Char* str); - BootTextWriter& Write(const CharacterTypeUTF16* str); - BootTextWriter& WriteCharacter(CharacterTypeUTF16 c); - BootTextWriter& Write(const UChar* str); - - template - BootTextWriter& operator<<(T elem) - { - this->Write(elem); - return *this; - } - - public: - explicit BootTextWriter() = default; - ~BootTextWriter() = default; - - public: - BootTextWriter& operator=(const BootTextWriter&) = default; - BootTextWriter(const BootTextWriter&) = default; - }; - - NeOS::SizeT BCopyMem(CharacterTypeUTF16* dest, CharacterTypeUTF16* src, const NeOS::SizeT len); - - NeOS::SizeT BSetMem(CharacterTypeUTF8* src, const CharacterTypeUTF8 byte, const NeOS::SizeT len); - - /// String length functions. - - /// @brief get string length. - NeOS::SizeT BStrLen(const CharacterTypeUTF16* ptr); - - /// @brief set memory with custom value. - NeOS::SizeT BSetMem(CharacterTypeUTF16* src, const CharacterTypeUTF16 byte, const NeOS::SizeT len); - - /** - * @brief BootKit File Reader class - * Reads the Firmware Boot partition and filesystem. - */ - class BootFileReader final - { - public: - explicit BootFileReader(const CharacterTypeUTF16* path, - EfiHandlePtr ImageHandle); - ~BootFileReader(); - - public: - Void ReadAll(SizeT until, SizeT chunk = kib_cast(4), UIntPtr out_address = 0UL); - - enum - { - kOperationOkay, - kNotSupported, - kEmptyDirectory, - kNoSuchEntry, - kIsDirectory, - kTooSmall, - kCount, - }; - - /// @brief error code getter. - /// @return the error code. - Int32& Error(); - - /// @brief blob getter. - /// @return the blob. - VoidPtr Blob(); - - /// @breif Size getter. - /// @return the size of the file. - UInt64& Size(); - - public: - BootFileReader& operator=(const BootFileReader&) = default; - BootFileReader(const BootFileReader&) = default; - - private: - Int32 mErrorCode{kOperationOkay}; - VoidPtr mBlob{nullptr}; - CharacterTypeUTF16 mPath[kPathLen]; - BootTextWriter mWriter; - EfiFileProtocol* mFile{nullptr}; - UInt64 mSizeFile{0}; - EfiFileProtocol* mRootFs; - }; - - typedef UInt8* BlobType; - - class BVersionString final - { - public: - static const CharacterTypeUTF8* The() - { - return BOOTLOADER_VERSION; - } - }; - - /***********************************************************************************/ - /// Provide some useful processor features. - /***********************************************************************************/ - -#ifdef __EFI_x86_64__ - - /*** - * Common processor instructions. - */ - - EXTERN_C void rt_out8(UInt16 port, UInt8 value); - EXTERN_C void rt_out16(UInt16 port, UInt16 value); - EXTERN_C void rt_out32(UInt16 port, UInt32 value); - EXTERN_C UInt8 rt_in8(UInt16 port); - EXTERN_C UInt16 In16(UInt16 port); - EXTERN_C UInt32 rt_in32(UInt16 port); - - EXTERN_C void rt_hlt(); - EXTERN_C void rt_cli(); - EXTERN_C void rt_sti(); - EXTERN_C void rt_cld(); - EXTERN_C void rt_std(); - -#endif // __EFI_x86_64__ - - static inline const UInt32 kRgbRed = 0x000000FF; - static inline const UInt32 kRgbGreen = 0x0000FF00; - static inline const UInt32 kRgbBlue = 0x00FF0000; - static inline const UInt32 kRgbBlack = 0x00000000; - static inline const UInt32 kRgbWhite = 0x00FFFFFF; - -#define kBKBootFileMime "boot-x/file" -#define kBKBootDirMime "boot-x/dir" - - /// @brief BootKit Drive Formatter. - template - class BDiskFormatFactory final - { - public: - /// @brief File entry for **BDiskFormatFactory**. - struct BFileDescriptor final - { - Char fFileName[kNeFSCatalogNameLen]; - Int32 fKind; - }; - - public: - explicit BDiskFormatFactory() = default; - explicit BDiskFormatFactory(BootDev dev) - : fDiskDev(dev) - { - } - - ~BDiskFormatFactory() = default; - - NE_COPY_DELETE(BDiskFormatFactory); - - /// @brief Format disk using partition name and blob. - /// @param Partition part_name the target partition name. - /// @param blob blobs array. - /// @param blob_sz blobs array count. - /// @retval True disk has been formatted. - /// @retval False failed to format. - Boolean Format(const Char* part_name, BFileDescriptor* blob, SizeT blob_sz); - - /// @brief check if partition is good. - Bool IsPartitionValid() noexcept - { - fDiskDev.Leak().mBase = (kNeFSRootCatalogStartAddress); - fDiskDev.Leak().mSize = BootDev::kSectorSize; - - Char buf[BootDev::kSectorSize] = {0}; - - fDiskDev.Read(buf, BootDev::kSectorSize); - - NEFS_ROOT_PARTITION_BLOCK* blockPart = reinterpret_cast(buf); - - BootTextWriter writer; - - for (SizeT indexMag = 0UL; indexMag < kNeFSIdentLen; ++indexMag) - { - if (blockPart->Ident[indexMag] != kNeFSIdent[indexMag]) - return false; - } - - if (blockPart->DiskSize != this->fDiskDev.GetDiskSize() || - blockPart->DiskSize < 1 || - blockPart->SectorSize != BootDev::kSectorSize || - blockPart->Version != kNeFSVersionInteger || - blockPart->StartCatalog == 0) - { - return false; - } - else if (blockPart->PartitionName[0] == 0) - { - return false; - } - - writer.Write(L"BootZ: Partition: ").Write(blockPart->PartitionName).Write(L" is healthy.\r"); - - return true; - } - - private: - /// @brief Write all of the requested catalogs into the filesystem. - /// @param blob the blobs. - /// @param blob_sz the number of blobs to write (n * sizeof(blob_struct)). - /// @param part the NeFS partition block. - Boolean WriteCatalogList(BFileDescriptor* blob, SizeT blob_sz, NEFS_ROOT_PARTITION_BLOCK& part) - { - if (blob_sz < sizeof(NEFS_CATALOG_STRUCT)) - return NO; - - if (!blob) - return NO; - - Lba startLba = part.StartCatalog; - BootTextWriter writer; - - NEFS_CATALOG_STRUCT catalogKind{0}; - - constexpr auto cNeFSCatalogPadding = 4; - - catalogKind.PrevSibling = startLba; - catalogKind.NextSibling = (startLba + sizeof(NEFS_CATALOG_STRUCT) * cNeFSCatalogPadding); - - /// Fill catalog kind. - catalogKind.Kind = blob->fKind; - catalogKind.Flags |= kNeFSFlagCreated; - catalogKind.CatalogFlags = kNeFSStatusUnlocked; - - --part.FreeCatalog; - --part.FreeSectors; - - CopyMem(catalogKind.Name, blob->fFileName, StrLen(blob->fFileName)); - - fDiskDev.Leak().mBase = startLba; - fDiskDev.Leak().mSize = sizeof(NEFS_CATALOG_STRUCT); - - fDiskDev.Write((Char*)&catalogKind, sizeof(NEFS_CATALOG_STRUCT)); - - writer.Write(L"BootZ: Wrote directory: ").Write(blob->fFileName).Write(L"\r"); - - return true; - } - - private: - BootDev fDiskDev; - }; - - /// @brief Format disk. - /// @param part_name partition Name - /// @param blob blos. - /// @param blob_sz n blobs (n * sizeof(blob_struct)). - /// @retval True disk has been formatted. - /// @retval False failed to format. - template - inline Boolean BDiskFormatFactory::Format(const Char* part_name, - BDiskFormatFactory::BFileDescriptor* blob, - SizeT blob_sz) - { - if (!blob || !blob_sz) - return false; /// sanity check - - /// @note A catalog roughly equal to a sector. - - constexpr auto kMinimumDiskSize = kNeFSMinimumDiskSize; // at minimum. - - /// @note also look at EPM headers, for free part blocks. - - if (fDiskDev.GetDiskSize() < kMinimumDiskSize) - { - fb_init(); - - FBDrawBitMapInRegion(zka_no_disk, NE_NO_DISK_WIDTH, NE_NO_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - NE_NO_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - NE_NO_DISK_HEIGHT) / 2); - EFI::ThrowError(L"Drive-Too-Tiny", L"Can't format a NeFS partition here."); - return false; - } - - NEFS_ROOT_PARTITION_BLOCK part{0}; - - CopyMem(part.Ident, kNeFSIdent, kNeFSIdentLen - 1); - CopyMem(part.PartitionName, part_name, StrLen(part_name)); - - part.Version = kNeFSVersionInteger; - part.CatalogCount = blob_sz / sizeof(NEFS_CATALOG_STRUCT); - part.Kind = BootDev::kSectorSize; - part.SectorSize = kATASectorSize; - part.FreeCatalog = fDiskDev.GetSectorsCount() / sizeof(NEFS_CATALOG_STRUCT); - part.SectorCount = fDiskDev.GetSectorsCount(); - part.FreeSectors = fDiskDev.GetSectorsCount(); - part.StartCatalog = kNeFSCatalogStartAddress; - part.DiskSize = fDiskDev.GetDiskSize(); - part.Flags = kNeFSPartitionTypeBoot | kNeFSPartitionTypeStandard; - - fDiskDev.Leak().mBase = kNeFSRootCatalogStartAddress; - fDiskDev.Leak().mSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); - - fDiskDev.Write((Char*)&part, sizeof(NEFS_ROOT_PARTITION_BLOCK)); - - BootTextWriter writer; - - writer << "BootZ: Partition name: " << part.PartitionName << "\r"; - writer << "BootZ: Start: " << part.StartCatalog << "\r"; - writer << "BootZ: Number of catalogs: " << part.CatalogCount << "\r"; - writer << "BootZ: Free catalog: " << part.FreeCatalog << "\r"; - writer << "BootZ: Free sectors: " << part.FreeSectors << "\r"; - writer << "BootZ: Sector size: " << part.SectorSize << "\r"; - -#ifdef BOOTZ_EPM_SUPPORT - EPM_PART_BLOCK epm_boot{0}; - - const auto kFsName = "NeFS"; - const auto kBlockName = "OS"; - - CopyMem(epm_boot.Fs, reinterpret_cast(const_cast(kFsName)), StrLen(kFsName)); - - epm_boot.FsVersion = kNeFSVersionInteger; - epm_boot.LbaStart = kNeFSRootCatalogStartAddress; - epm_boot.LbaEnd = fDiskDev.GetDiskSize(); - epm_boot.SectorSz = part.SectorSize; - epm_boot.Kind = kEPMNeOS; - epm_boot.NumBlocks = part.CatalogCount; - - CopyMem(epm_boot.Name, reinterpret_cast(const_cast(kBlockName)), StrLen(kBlockName)); - CopyMem(epm_boot.Magic, reinterpret_cast(const_cast(kEPMMagic)), StrLen(kEPMMagic)); - - fDiskDev.Leak().mBase = kEPMBootBlockLba; // always always resies at zero block. - fDiskDev.Leak().mSize = sizeof(EPM_PART_BLOCK); - - fDiskDev.Write((Char*)&epm_boot, sizeof(EPM_PART_BLOCK)); - - writer.Write(L"BootZ: Drive has been formatted Successfully.\r"); -#endif - - return YES; - } -} // namespace Boot diff --git a/dev/Boot/BootKit/BootThread.h b/dev/Boot/BootKit/BootThread.h deleted file mode 100644 index 6e48d190..00000000 --- a/dev/Boot/BootKit/BootThread.h +++ /dev/null @@ -1,43 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -namespace Boot -{ - using namespace NeOS; - - class BootThread; - - /// @brief Bootloader Thread class. - class BootThread final - { - public: - explicit BootThread() = delete; - ~BootThread() = default; - - explicit BootThread(NeOS::VoidPtr blob); - - BootThread& operator=(const BootThread&) = default; - BootThread(const BootThread&) = default; - - Int32 Start(HEL::BootInfoHeader* handover, BOOL is_own_stack); - void SetName(const char* name); - const char* GetName(); - bool IsValid(); - - private: - Char fBlobName[256U] = {"BootThread"}; - VoidPtr fStartAddress{nullptr}; - VoidPtr fBlob{nullptr}; - UInt8* fStack{nullptr}; - HEL::BootInfoHeader* fHandover{nullptr}; - }; -} // namespace Boot diff --git a/dev/Boot/BootKit/Device.h b/dev/Boot/BootKit/Device.h deleted file mode 100644 index 78e9aa3f..00000000 --- a/dev/Boot/BootKit/Device.h +++ /dev/null @@ -1,37 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include - -using namespace NeOS; - -/// @brief Device type. -class Device -{ -public: - explicit Device() = default; - virtual ~Device() = default; - - NE_MOVE_DEFAULT(Device); - - struct Trait - { - SizeT mBase{1024}; - SizeT mSize{1024}; - }; - - virtual Trait& Leak() = 0; - - virtual Device& Read(Char* Buf, const SizeT& SecCount) = 0; - virtual Device& Write(Char* Buf, const SizeT& SecCount) = 0; -}; - -typedef Device BootDevice; -typedef Device NetworkDevice; -typedef Device DiskDevice; diff --git a/dev/Boot/BootKit/EPM.h b/dev/Boot/BootKit/EPM.h deleted file mode 100644 index cbadd597..00000000 --- a/dev/Boot/BootKit/EPM.h +++ /dev/null @@ -1,9 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include diff --git a/dev/Boot/BootKit/HW/ATA.h b/dev/Boot/BootKit/HW/ATA.h deleted file mode 100644 index d8cd00eb..00000000 --- a/dev/Boot/BootKit/HW/ATA.h +++ /dev/null @@ -1,58 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include - -using namespace NeOS; - -class BootDeviceATA final : public Device -{ -public: - enum - { - kPrimary = ATA_PRIMARY_IO, - kSecondary = ATA_SECONDARY_IO, - }; - - explicit BootDeviceATA() noexcept; - ~BootDeviceATA() = default; - - NE_COPY_DELETE(BootDeviceATA); - - enum - { - kSectorSize = kATASectorSize - }; - - struct ATATrait final : public Device::Trait - { - UInt16 mBus{kPrimary}; - UInt8 mMaster{0}; - Boolean mErr{false}; - - operator bool() - { - return !mErr; - } - }; - -public: - operator bool(); - - SizeT GetSectorsCount() noexcept; - SizeT GetDiskSize() noexcept; - - BootDeviceATA& Read(Char* Buf, const SizeT& SecCount) override; - BootDeviceATA& Write(Char* Buf, const SizeT& SecCount) override; - - ATATrait& Leak() override; - -private: - ATATrait mTrait; -}; diff --git a/dev/Boot/BootKit/HW/SATA.h b/dev/Boot/BootKit/HW/SATA.h deleted file mode 100644 index a58107b2..00000000 --- a/dev/Boot/BootKit/HW/SATA.h +++ /dev/null @@ -1,46 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include - -class BootDeviceSATA final -{ -public: - explicit BootDeviceSATA() noexcept; - ~BootDeviceSATA() = default; - - NE_COPY_DEFAULT(BootDeviceSATA); - - struct SATATrait final - { - NeOS::SizeT mBase{1024}; - NeOS::Boolean mErr{false}; - NeOS::Boolean mDetected{false}; - - operator bool() - { - return !this->mErr; - } - }; - - operator bool() - { - return this->Leak().mDetected; - } - - BootDeviceSATA& Read(NeOS::WideChar* Buf, const NeOS::SizeT& SecCount); - BootDeviceSATA& Write(NeOS::WideChar* Buf, const NeOS::SizeT& SecCount); - - SATATrait& Leak(); - -private: - SATATrait mTrait; -}; - -#define kAHCISectorSz 4096 diff --git a/dev/Boot/BootKit/Platform.h b/dev/Boot/BootKit/Platform.h deleted file mode 100644 index e9bcfb2f..00000000 --- a/dev/Boot/BootKit/Platform.h +++ /dev/null @@ -1,32 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -/** - @file Platform.h - @brief Platform specific code. -*/ - -#ifdef __x86_64__ - -#ifdef __cplusplus -#ifndef EXTERN_C -#define EXTERN_C extern "C" -#endif -#else -#ifndef EXTERN_C -#define EXTERN_C extern -#endif -#endif // __cplusplus - -EXTERN_C void rt_halt(); -EXTERN_C void rt_cli(); -EXTERN_C void rt_sti(); -EXTERN_C void rt_cld(); -EXTERN_C void rt_std(); - -#endif /* ifdef __x86_64__ */ diff --git a/dev/Boot/BootKit/Protocol.h b/dev/Boot/BootKit/Protocol.h deleted file mode 100644 index 3be42e74..00000000 --- a/dev/Boot/BootKit/Protocol.h +++ /dev/null @@ -1,10 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include diff --git a/dev/Boot/BootKit/Qr.h b/dev/Boot/BootKit/Qr.h deleted file mode 100644 index f0476bc2..00000000 --- a/dev/Boot/BootKit/Qr.h +++ /dev/null @@ -1,973 +0,0 @@ -#ifndef QR_H -#define QR_H - -#include -#include - -#include -#include -#include -#include - -/// @note the QR code is still code 128, it utilizes the same concept of having it's own character set. - -namespace qr -{ - inline uint8_t min_poly = - 0b11101, /* Minimal polynomial x^8 + x^4 + x^3 + x^2 + 1 */ - generator = 0b10; /* Generator of Galois field */ - - /// @brief galois finite field multiplication. - inline uint8_t gf_mul(uint8_t a, uint8_t b) - { - uint8_t res = 0; - - for (; b; b >>= 1) - { - if (b & 1) - res ^= a; - if (a & 0x80) - a = (a << 1) ^ min_poly; - else - a <<= 1; - } - - return res; - } - - // Size of Ecc block with respect to level and version. 0 version is for - // padding. - constexpr int ECC_CODEWORDS_PER_BLOCK[4][41] = { - {0, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, - 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, - {0, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, - 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28}, - {0, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, - 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, - {0, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, - 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, - }; - - // Number of Ecc blocks with respect to level and version. 0 version is for - // padding. - constexpr int N_ECC_BLOCKS[4][41] = { - {0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, - 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, - 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25}, - {0, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, - 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, - 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49}, - {0, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, - 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, - 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68}, - {0, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, - 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, - 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81}, - }; - - // Positions of central modules of alignment patterns according to version. 0 - // version is for padding. - constexpr int ALIGN_POS[41][7] = { - {}, - {0}, - {6, 18}, - {6, 22}, - {6, 26}, - {6, 30}, - {6, 34}, - {6, 22, 38}, - {6, 24, 42}, - {6, 26, 46}, - {6, 28, 50}, - {6, 30, 54}, - {6, 32, 58}, - {6, 34, 62}, - {6, 26, 46, 66}, - {6, 26, 48, 70}, - {6, 26, 50, 74}, - {6, 30, 54, 78}, - {6, 30, 56, 82}, - {6, 30, 58, 86}, - {6, 34, 62, 90}, - {6, 28, 50, 72, 94}, - {6, 26, 50, 74, 98}, - {6, 30, 54, 78, 102}, - {6, 28, 54, 80, 106}, - {6, 32, 58, 84, 110}, - {6, 30, 58, 86, 114}, - {6, 34, 62, 90, 118}, - {6, 26, 50, 74, 98, 122}, - {6, 30, 54, 78, 102, 126}, - {6, 26, 52, 78, 104, 130}, - {6, 30, 56, 82, 108, 134}, - {6, 34, 60, 86, 112, 138}, - {6, 30, 58, 86, 114, 142}, - {6, 34, 62, 90, 118, 146}, - {6, 30, 54, 78, 102, 126, 150}, - {6, 24, 50, 76, 102, 128, 154}, - {6, 28, 54, 80, 106, 132, 158}, - {6, 32, 58, 84, 110, 136, 162}, - {6, 26, 54, 82, 110, 138, 166}, - {6, 30, 58, 86, 114, 142, 170}, - }; - - // Return n-th bit of arr starting from MSB. - constexpr uint8_t get_bit_r(uint8_t* arr, int n) - { - return (arr[n >> 3] >> (7 - (n & 7))) & 1; - } - - // Add up to 16 bits to arr. Data starts from MSB as well as each byte of an - // array. - constexpr void add_bits(uint16_t data, int n, uint8_t* arr, size_t& pos) - { - while (n--) - { - arr[pos >> 3] |= ((data >> n) & 1) << (7 - (pos & 7)); - ++pos; - } - } - - // Translate char to alphanumeric encoding value, - constexpr int alphanumeric(char c) - { - if (c >= '0' && c <= '9') - return c - '0'; - - if (c >= 'A' && c <= 'Z') - return c - 'A' + 10; - - switch (c) - { - case ' ': - return 36; - case '$': - return 37; - case '%': - return 38; - case '*': - return 39; - case '+': - return 40; - case '-': - return 41; - case '.': - return 42; - case '/': - return 43; - case ':': - return 44; - } - return -1; - } - - // Check if string can be encoded in alphanumeric mode. - constexpr bool is_alphanumeric(const char* str, size_t len) - { - for (size_t i = 0; i < len; ++i) - if (alphanumeric(str[i]) == -1) - return false; - return true; - } - - // Check if string can be encoded in numeric mode. - constexpr bool is_numeric(const char* str, size_t len) - { - for (size_t i = 0; i < len; ++i) - if (str[i] < '0' || str[i] > '9') - return false; - return true; - } - - // Check if string can be encoded in kanji mode. - constexpr bool is_kanji(const char* str, size_t len) - { - for (size_t i = 0; i < len; i += 2) - { - uint16_t val = uint16_t(str[i]) | (uint16_t(str[i + 1]) << 8); - if (val < 0x8140 || val > 0xebbf || (val > 0x9ffc && val < 0xe040)) - return false; - } - return true; - } - - // Reed-Solomon Ecc generator polynomial for the given degree. - constexpr void gf_gen_poly(int degree, uint8_t* poly) - { - SetMem(poly, 0, degree); - - uint8_t root = poly[degree - 1] = 1; - - for (int i = 0; i < degree; ++i) - { - for (int j = 0; j < degree - 1; ++j) - poly[j] = gf_mul(poly[j], root) ^ poly[j + 1]; - poly[degree - 1] = gf_mul(poly[degree - 1], root); - root = (root << 1) ^ ((root >> 7) * 0x11d); - } - } - - // Polynomial division if Galois Field. - constexpr void gf_poly_div(uint8_t* dividend, size_t len, uint8_t* divisor, int degree, uint8_t* result) - { - SetMem(result, 0, degree); - - for (size_t i = 0; i < len; ++i) - { - uint8_t factor = dividend[i] ^ result[0]; - MoveMem(&result[0], &result[1], degree - 1); - result[degree - 1] = 0; - for (int j = 0; j < degree; ++j) - result[j] ^= gf_mul(divisor[j], factor); - } - } - - enum Ecc - { - L, - M, - Q, - H, - }; - - enum Mode - { - M_NUMERIC, - M_ALPHANUMERIC, - M_BYTE, - M_KANJI, - }; - - // Select appropriate encoding mode for string. - constexpr Mode select_mode(const char* str, size_t len) - { - if (is_numeric(str, len)) - return M_NUMERIC; - if (is_alphanumeric(str, len)) - return M_ALPHANUMERIC; - if (is_kanji(str, len)) - return M_KANJI; - return M_BYTE; - } - - // Return size of Character Control Indicator in bits for given version and - // mode. - constexpr int cci(int ver, Mode mode) - { - constexpr int cnt[4][3] = { - {10, 12, 14}, - {9, 11, 13}, - {8, 16, 16}, - {8, 10, 12}, - }; - if (ver < 10) - return cnt[mode][0]; - if (ver < 27) - return cnt[mode][1]; - return cnt[mode][2]; - } - - template - struct Qr - { - private: - friend class QrDelegate; - bool draw(int x, int y) noexcept; - - public: - constexpr auto side_size() const - { - return SIDE; - } - - bool module(int x, int y); - bool encode(const char* str, size_t len, Ecc ecc, int mask = -1); - - private: - bool encode_data(const char* data, size_t len, Ecc ecc, uint8_t* out); - void encode_ecc(uint8_t* data, Ecc ecc, uint8_t* out); - - void add_data(uint8_t* data, uint8_t* patterns); - void add_patterns(); - void add_version(); - void add_format(Ecc ecc, int mask); - void reserve_patterns(uint8_t* out); - - template - void draw_rect(int y, int x, int height, int width, uint8_t* out); - template - void draw_bound(int y, int x, int height, int width, uint8_t* out); - - template - int rule_1_3_score(); - int penalty_score(); - int select_mask(Ecc ecc, uint8_t* patterns); - void apply_mask(int mask, uint8_t* patterns); - - private: - static_assert(V >= 1 && V <= 40, "invalid version"); - static constexpr int SIDE = 17 + V * 4; - static constexpr int N_BITS = SIDE * SIDE; - static constexpr int N_ALIGN = V == 1 ? 0 : V / 7 + 2; - static constexpr int N_ALIGN_BITS = V > 1 ? (N_ALIGN* N_ALIGN - 3) * 25 : 0; - static constexpr int N_TIMING_BITS = - (SIDE - 16) * 2 - (10 * (V > 1 ? N_ALIGN - 2 : 0)); - static constexpr int N_VER_BITS = V > 6 ? 36 : 0; - static constexpr int N_DAT_BITS = - N_BITS - (192 + N_ALIGN_BITS + N_TIMING_BITS + 31 + N_VER_BITS); - static constexpr int N_BYTES = utl::bytes_in_bits(N_BITS); // Actual number of bytes_in_bits - // required to store whole Qr code - static constexpr int N_DAT_BYTES = utl::bytes_in_bits(N_DAT_BITS); // Actual number of bytes_in_bits required to store - // [data + ecc] - static constexpr int N_DAT_CAPACITY = - N_DAT_BITS >> 3; // Capacity of [data + ecc] without remainder bits - private: - /// @brief internal function to retrieve bit from a bitset. - uint8_t get_arr_bit(uint8_t* arr, unsigned bit) const - { - return utl::get_arr_bit(arr, bit); - } - - /// @brief internal function to set bit from a bitset. - void set_arr_bit(uint8_t* arr, unsigned bit) - { - utl::set_arr_bit(arr, bit); - } - - /// @brief internal function to clear bit from a bitset. - void clr_arr_bit(uint8_t* arr, unsigned bit) - { - utl::clr_arr_bit(arr, bit); - } - - uint8_t code[N_BYTES] = {}; - - bool status = false; - }; - - // Get color of a module from left-to-right and top-to-bottom. Black is true. - template - bool Qr::module(int x, int y) - { - return get_arr_bit(code, y * SIDE + x); - } - - /// @brief draw a new QR code. - template - bool Qr::draw(int whereX, int whereY) noexcept - { - if (!this->status) - return false; // it may be invalid. - - fb_init(); - - for (int y = 0; y < (this->side_size()); ++y) - { - for (int x = 0; x < (this->side_size()); ++x) - { - FBDrawInRegion( - (this->module(x, y) ? RGB(00, 00, 00) : RGB(0xFF, 0xFF, 0xFF)), - 1, 1, - x + whereX, y + whereY); - } - } - - fb_clear(); - - return false; - } - - // Create Qr code with given error correction level. If mask == -1, - // then best mask selected automatically. NOTE: Automatic mask is the - // most expensive operation. Takes about 95 % of all computation time. - template - bool Qr::encode(const char* str, size_t len, Ecc ecc, int mask) - { - uint8_t data[N_DAT_BYTES] = {}; - uint8_t data_with_ecc[N_DAT_BYTES] = {}; - uint8_t patterns[N_BYTES] = {}; - - if (!encode_data(str, len, ecc, data)) - { - return status = false; - } - - encode_ecc(data, ecc, data_with_ecc); - - reserve_patterns(patterns); - CopyMem(code, patterns, N_BYTES); - - add_data(data_with_ecc, patterns); - add_patterns(); - add_version(); - - mask = mask != -1 ? mask & 7 : select_mask(ecc, patterns); - - add_format(ecc, mask); - apply_mask(mask, patterns); - - return status = true; - } - - template - bool Qr::encode_data(const char* data, size_t len, Ecc ecc, uint8_t* out) - { - Mode mode = select_mode(data, len); - - size_t n_bits = - (N_DAT_CAPACITY - ECC_CODEWORDS_PER_BLOCK[ecc][V] * N_ECC_BLOCKS[ecc][V]) - << 3; - size_t pos = 0; - - add_bits(1 << mode, 4, out, pos); - add_bits(len, cci(V, mode), out, pos); - - if (mode == M_NUMERIC) - { - const size_t triplets = len / 3; - const size_t triplets_size = triplets * 3; - const size_t rem = len % 3; - const size_t rem_bits = rem == 2 ? 7 : rem == 1 ? 4 - : 0; - const size_t total_size = 10 * triplets + rem_bits; - - if (pos + total_size > n_bits) - return false; - - char buf[4] = {}; - - for (size_t i = 0; i < triplets_size; i += 3) - { - buf[0] = data[i]; - buf[1] = data[i + 1]; - buf[2] = data[i + 2]; - - uint16_t num = StringToLong(buf, NULL, 10); - add_bits(num, 10, out, pos); - } - - if (rem) - { - buf[0] = data[triplets_size]; - buf[1] = data[triplets_size + 1]; - buf[rem] = 0; - - uint16_t num = StringToLong(buf, NULL, 10); - add_bits(num, rem_bits, out, pos); - } - } - else if (mode == M_ALPHANUMERIC) - { - if (pos + 11 * (int(len & ~1ul) / 2) > n_bits) - return false; - - for (int i = 0; i < int(len & ~1ul); i += 2) - { - uint16_t num = alphanumeric(data[i]) * 45 + alphanumeric(data[i + 1]); - add_bits(num, 11, out, pos); - } - if (len & 1) - { - if (pos + 6 > n_bits) - return false; - - add_bits(alphanumeric(data[len - 1]), 6, out, pos); - } - } - else if (mode == M_BYTE) - { - if (pos + len * 8 > n_bits) - return false; - - for (size_t i = 0; i < len; ++i) - add_bits(data[i], 8, out, pos); - } - else - { - if (pos + 13 * (len / 2) > n_bits) - return false; - - for (size_t i = 0; i < len; i += 2) - { - uint16_t val = ((uint8_t)data[i]) | (((uint8_t)data[i + 1]) << 8); - uint16_t res = 0; - val -= val < 0x9FFC ? 0x8140 : 0xC140; - res += val & 0xff; - res += (val >> 8) * 0xc0; - add_bits(res, 13, out, pos); - } - } - - size_t padding = n_bits - pos; - size_t i = 0; - - add_bits(0, padding > 4 ? 4 : padding, out, pos); - - if (pos & 7) - add_bits(0, (8 - pos) & 7, out, pos); - - while (pos < n_bits) - add_bits(++i & 1 ? 0xec : 0x11, 8, out, pos); - - return true; - } - - template - void Qr::encode_ecc(uint8_t* data, Ecc ecc, uint8_t* out) - { - int n_blocks = N_ECC_BLOCKS[ecc][V]; - int ecc_len = ECC_CODEWORDS_PER_BLOCK[ecc][V]; - - int n_data_bytes = N_DAT_CAPACITY - ecc_len * n_blocks; - - int n_short_blocks = n_blocks - N_DAT_CAPACITY % n_blocks; - int short_len = N_DAT_CAPACITY / n_blocks - ecc_len; - - uint8_t gen_poly[30]; - uint8_t ecc_buf[30]; - - gf_gen_poly(ecc_len, gen_poly); - - uint8_t* data_ptr = data; - - for (int i = 0; i < n_blocks; ++i) - { - int data_len = short_len; - - if (i >= n_short_blocks) - ++data_len; - - gf_poly_div(data_ptr, data_len, gen_poly, ecc_len, ecc_buf); - - for (int j = 0, k = i; j < data_len; ++j, k += n_blocks) - { - if (j == short_len) - k -= n_short_blocks; - out[k] = data_ptr[j]; - } - for (int j = 0, k = n_data_bytes + i; j < ecc_len; ++j, k += n_blocks) - out[k] = ecc_buf[j]; - - data_ptr += data_len; - } - } - - template - void Qr::add_data(uint8_t* data, uint8_t* patterns) - { - int data_pos = 0; - - for (int x = SIDE - 1; x >= 1; x -= 2) - { - if (x == 6) - x = 5; - - for (int i = 0; i < SIDE; ++i) - { - int y = !((x + 1) & 2) ? SIDE - 1 - i : i; - int coord = y * SIDE + x; - - if (!get_arr_bit(patterns, coord)) - { - if (get_bit_r(data, data_pos)) - set_arr_bit(code, coord); - - ++data_pos; - } - - if (!get_arr_bit(patterns, coord - 1)) - { - if (get_bit_r(data, data_pos)) - set_arr_bit(code, coord - 1); - - ++data_pos; - } - } - } - } - - template - void Qr::add_patterns() - { - // White bounds inside finders - draw_bound(1, 1, 5, 5, code); - draw_bound(1, SIDE - 6, 5, 5, code); - draw_bound(SIDE - 6, 1, 5, 5, code); - - // Finish alignment patterns - for (int i = 0; i < N_ALIGN; ++i) - { - for (int j = 0; j < N_ALIGN; ++j) - { - if ((!i && !j) || (!i && j == N_ALIGN - 1) || (!j && i == N_ALIGN - 1)) - continue; - draw_bound(ALIGN_POS[V][i] - 1, ALIGN_POS[V][j] - 1, 3, 3, code); - } - } - - // Draw white separators - draw_rect(7, 0, 1, 8, code); - draw_rect(0, 7, 8, 1, code); - draw_rect(SIDE - 8, 0, 1, 8, code); - draw_rect(SIDE - 8, 7, 8, 1, code); - draw_rect(7, SIDE - 8, 1, 8, code); - draw_rect(0, SIDE - 8, 8, 1, code); - - // Perforate timing patterns - for (int i = 7; i < SIDE - 7; i += 2) - { - clr_arr_bit(code, 6 * SIDE + i); - clr_arr_bit(code, i * SIDE + 6); - } - } - - template - void Qr::add_version() - { - if (V < 7) - return; - - uint32_t rem = V; - - for (uint8_t i = 0; i < 12; ++i) - rem = (rem << 1) ^ ((rem >> 11) * 0x1F25); - - uint32_t data = V << 12 | rem; - - for (int x = 0; x < 6; ++x) - { - for (int j = 0; j < 3; ++j) - { - int y = SIDE - 11 + j; - - bool black = (data >> (x * 3 + j)) & 1; - - if (!black) - { - clr_arr_bit(code, y * SIDE + x); - clr_arr_bit(code, y + SIDE * x); - } - } - } - } - - template - void Qr::add_format(Ecc ecc, int mask) - { - int data = (ecc ^ 1) << 3 | mask; - int rem = data; - - for (int i = 0; i < 10; i++) - rem = (rem << 1) ^ ((rem >> 9) * 0b10100110111); - - int res = (data << 10 | rem) ^ 0b101010000010010; - - for (int i = 0; i < 6; ++i) - { - if ((res >> i) & 1) - { - set_arr_bit(code, SIDE * 8 + SIDE - 1 - i); - set_arr_bit(code, SIDE * i + 8); - } - else - { - clr_arr_bit(code, SIDE * 8 + SIDE - 1 - i); - clr_arr_bit(code, SIDE * i + 8); - } - } - - for (int i = 6; i < 8; ++i) - { - if ((res >> i) & 1) - { - set_arr_bit(code, SIDE * 8 + SIDE - 1 - i); - set_arr_bit(code, SIDE * (i + 1) + 8); - } - else - { - clr_arr_bit(code, SIDE * 8 + SIDE - 1 - i); - clr_arr_bit(code, SIDE * (i + 1) + 8); - } - } - - if ((res >> 8) & 1) - { - set_arr_bit(code, SIDE * 8 + 7); - set_arr_bit(code, SIDE * (SIDE - 7) + 8); - } - else - { - clr_arr_bit(code, SIDE * 8 + 7); - clr_arr_bit(code, SIDE * (SIDE - 7) + 8); - } - - for (int i = 9, j = 5; i < 15; ++i, --j) - { - if ((res >> i) & 1) - { - set_arr_bit(code, SIDE * 8 + j); - set_arr_bit(code, SIDE * (SIDE - 1 - j) + 8); - } - else - { - clr_arr_bit(code, SIDE * 8 + j); - clr_arr_bit(code, SIDE * (SIDE - 1 - j) + 8); - } - } - } - - template - template - void Qr::draw_rect(int y, int x, int height, int width, uint8_t* out) - { - if (B) - { - for (int dy = y * SIDE; dy < (y + height) * SIDE; dy += SIDE) - for (int dx = x; dx < x + width; ++dx) - set_arr_bit(out, dy + dx); - } - else - { - for (int dy = y * SIDE; dy < (y + height) * SIDE; dy += SIDE) - for (int dx = x; dx < x + width; ++dx) - clr_arr_bit(out, dy + dx); - } - } - - template - template - void Qr::draw_bound(int y, int x, int height, int width, uint8_t* out) - { - if (B) - { - for (int i = y * SIDE + x; i < y * SIDE + x + width; ++i) - set_arr_bit(out, i); - for (int i = (y + height - 1) * SIDE + x; - i < (y + height - 1) * SIDE + x + width; ++i) - set_arr_bit(out, i); - for (int i = (y + 1) * SIDE + x; i < (y + height - 1) * SIDE + x; i += SIDE) - set_arr_bit(out, i); - for (int i = (y + 1) * SIDE + x + width - 1; - i < (y + height - 1) * SIDE + x + width - 1; i += SIDE) - set_arr_bit(out, i); - } - else - { - for (int i = y * SIDE + x; i < y * SIDE + x + width; ++i) - clr_arr_bit(out, i); - for (int i = (y + height - 1) * SIDE + x; - i < (y + height - 1) * SIDE + x + width; ++i) - clr_arr_bit(out, i); - for (int i = (y + 1) * SIDE + x; i < (y + height - 1) * SIDE + x; i += SIDE) - clr_arr_bit(out, i); - for (int i = (y + 1) * SIDE + x + width - 1; - i < (y + height - 1) * SIDE + x + width - 1; i += SIDE) - clr_arr_bit(out, i); - } - } - - template - void Qr::reserve_patterns(uint8_t* out) - { - draw_rect(0, 6, SIDE, 1, out); - draw_rect(6, 0, 1, SIDE, out); - - draw_rect(0, 0, 9, 9, out); - draw_rect(SIDE - 8, 0, 8, 9, out); - draw_rect(0, SIDE - 8, 9, 8, out); - - for (int i = 0; i < N_ALIGN; ++i) - { - for (int j = 0; j < N_ALIGN; ++j) - { - if ((!i && !j) || (!i && j == N_ALIGN - 1) || (!j && i == N_ALIGN - 1)) - continue; - draw_rect(ALIGN_POS[V][i] - 2, ALIGN_POS[V][j] - 2, 5, 5, out); - } - } - - if (V >= 7) - { - draw_rect(SIDE - 11, 0, 3, 6, out); - draw_rect(0, SIDE - 11, 6, 3, out); - } - } - - template - template - int Qr::rule_1_3_score() - { - constexpr int y_max = H ? N_BITS : SIDE; - constexpr int x_max = H ? SIDE : N_BITS; - constexpr int y_step = H ? SIDE : 1; - constexpr int x_step = H ? 1 : SIDE; - - int res = 0; - - for (int y = 0; y < y_max; y += y_step) - { - bool color = get_arr_bit(code, y); - int finder = color; - int cnt = 1; - for (int x = 1; x < x_max; x += x_step) - { - if (get_arr_bit(code, y + x) == color) - { - ++cnt; - if (cnt == 5) - res += 3; - if (cnt > 5) - ++res; - } - else - { - color = !color; - cnt = 1; - } - // Finder-like - finder = ((finder << 1) & 0x7ff) | color; - if (x >= x_step * 10) - { - if (finder == 0x05d || finder == 0x5d0) - res += 40; - } - } - } - return res; - } - - template - int Qr::penalty_score() - { - int res = 0; - - res += rule_1_3_score(); - res += rule_1_3_score(); - - for (int y = 0; y < N_BITS - SIDE; y += SIDE) - { - for (int x = 0; x < SIDE - 1; ++x) - { - bool c = get_arr_bit(code, y + x); - - if (c == get_arr_bit(code, y + x + 1) && - c == get_arr_bit(code, y + x + SIDE) && - c == get_arr_bit(code, y + x + SIDE + 1)) - res += 3; - } - } - - int black = 0; - for (int y = 0; y < N_BITS; y += SIDE) - { - for (int x = 0; x < SIDE; ++x) - black += get_arr_bit(code, y + x); - } - res += abs((black * 100) / N_BITS - 50) / 5 * 10; - - return res; - } - - template - int Qr::select_mask(Ecc ecc, uint8_t* patterns) - { - unsigned min_score = -1; - unsigned score = 0; - uint8_t mask = 0; - - for (int i = 0; i < 8; ++i) - { - add_format(ecc, i); - apply_mask(i, patterns); - score = penalty_score(); - if (score < min_score) - { - mask = i; - min_score = score; - } - apply_mask(i, patterns); - } - return mask; - } - - template - void Qr::apply_mask(int mask, uint8_t* patterns) - { - for (int y = 0, dy = 0; y < SIDE; ++y, dy += SIDE) - { - for (int x = 0; x < SIDE; ++x) - { - int coord = dy + x; - - if (get_arr_bit(patterns, coord)) - continue; - - bool keep = true; - - switch (mask) - { - case 0: - keep = (x + y) & 1; - break; - case 1: - keep = y & 1; - break; - case 2: - keep = x % 3; - break; - case 3: - keep = (x + y) % 3; - break; - case 4: - keep = (y / 2 + x / 3) & 1; - break; - case 5: - keep = x * y % 2 + x * y % 3; - break; - case 6: - keep = (x * y % 2 + x * y % 3) & 1; - break; - case 7: - keep = ((x + y) % 2 + x * y % 3) & 1; - break; - } - - if (!keep) - { - if (get_arr_bit(code, coord)) - clr_arr_bit(code, coord); - else - set_arr_bit(code, coord); - } - } - } - } - - /// @brief QR code encoder class. - class QrDelegate final - { - public: - explicit QrDelegate() = default; - ~QrDelegate() = default; - - NE_COPY_DEFAULT(QrDelegate); - - /// @brief Draw method delegate. - template - bool draw(Qr& subject, int x, int y) noexcept - { - return subject.draw(x, y); - } - }; -} // namespace qr - -namespace NeOS::Qr -{ - using namespace qr; -} // namespace NeOS::Qr - -#endif // QR_H \ No newline at end of file diff --git a/dev/Boot/BootKit/QrPrelude.h b/dev/Boot/BootKit/QrPrelude.h deleted file mode 100644 index e89fad7a..00000000 --- a/dev/Boot/BootKit/QrPrelude.h +++ /dev/null @@ -1 +0,0 @@ -#include \ No newline at end of file diff --git a/dev/Boot/BootKit/Rsrc/zka_disk.rsrc b/dev/Boot/BootKit/Rsrc/zka_disk.rsrc deleted file mode 100644 index 61fd48dd..00000000 --- a/dev/Boot/BootKit/Rsrc/zka_disk.rsrc +++ /dev/null @@ -1,116 +0,0 @@ -#define NE_DISK_HEIGHT 110 -#define NE_DISK_WIDTH 110 - -// array size is 36300 -static const unsigned int zka_disk[] = { - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x333333, 0x565656, 0x636363, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6a6a6a, 0x5f5f5f, 0x4d4d4d, 0x2b2b2b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x464646, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x6a6a6a, 0x3b3b3b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x3d3d3d, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x252525, 0x676767, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x606060, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x3d3d3d, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x616161, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x525252, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x242424, 0x767676, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x393939, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7e7e7e, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4e4e4e, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x3f3f3f, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x666666, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x555555, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x222222, 0x7c7c7c, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x6d6d6d, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x393939, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x868686, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x515151, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x404040, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x6a6a6a, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x828282, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x727272, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x383838, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x8e8e8e, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x525252, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x414141, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x6e6e6e, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x5c5c5c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x868686, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x787878, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x373737, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x959595, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0x444444, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x707070, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0x5e5e5e, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x8b8b8b, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0x7c7c7c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x363636, 0xa7a7a7, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0x9c9c9c, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x717171, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0x636363, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x8e8e8e, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0x818181, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x343434, 0xacacac, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xa3a3a3, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0x484848, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x727272, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x909090, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0x868686, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x313131, 0xb0b0b0, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xa9a9a9, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x525252, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0x494949, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x727272, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0x6a6a6a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x929292, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0x8c8c8c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x2e2e2e, 0xb4b4b4, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xafafaf, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x505050, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0x4b4b4b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x717171, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0x6e6e6e, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x939393, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0x929292, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x2a2a2a, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x4c4c4c, 0x4c4c4c, 0x4c4c4c, 0x4b4b4b, 0x4b4b4b, 0x4b4b4b, 0x4b4b4b, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x494949, 0x494949, 0x494949, 0x494949, 0x484848, 0x484848, 0x484848, 0x484848, 0x474747, 0x474747, 0x474747, 0x464646, 0x464646, 0x464646, 0x464646, 0x454545, 0x454545, 0x454545, 0x454545, 0x444444, 0x444444, 0x444444, 0x444444, 0x434343, 0x434343, 0x434343, 0x434343, 0x424242, 0x424242, 0x424242, 0x414141, 0x414141, 0x414141, 0x414141, 0x404040, 0x404040, 0x404040, 0x404040, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3b3b3b, 0x3b3b3b, 0x3b3b3b, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x393939, 0x393939, 0x393939, 0x393939, 0x383838, 0x383838, 0x383838, 0x383838, 0x373737, 0x373737, 0x373737, 0x373737, 0x363636, 0x363636, 0x363636, 0x353535, 0x353535, 0x353535, 0x353535, 0x343434, 0x343434, 0x343434, 0x343434, 0x333333, 0x333333, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x949494, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0x9f9f9f, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x868686, 0x868686, 0x848484, 0x848484, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa3a3a3, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x999999, 0x979797, 0x979797, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x949494, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0x9f9f9f, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa3a3a3, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x999999, 0x979797, 0x979797, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x949494, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0x9f9f9f, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xc6c6c6, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x868686, 0x868686, 0x848484, 0x848484, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x565656, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x9a9a9a, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa3a3a3, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x797979, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x999999, 0x979797, 0x979797, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x353535, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xbfbfbf, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x949494, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x464646, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0x9f9f9f, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x7f7f7f, 0xbababa, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x626262, 0x484848, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x3a3a3a, 0x4b4b4b, 0x4b4b4b, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x494949, 0x494949, 0x494949, 0x494949, 0x484848, 0x484848, 0x484848, 0x484848, 0x474747, 0x474747, 0x474747, 0x464646, 0x464646, 0x464646, 0x464646, 0x454545, 0x454545, 0x454545, 0x454545, 0x444444, 0x444444, 0x444444, 0x444444, 0x434343, 0x434343, 0x434343, 0x424242, 0x424242, 0x424242, 0x424242, 0x414141, 0x414141, 0x414141, 0x414141, 0x404040, 0x404040, 0x404040, 0x404040, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3b3b3b, 0x3b3b3b, 0x3b3b3b, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x393939, 0x393939, 0x393939, 0x393939, 0x383838, 0x383838, 0x383838, 0x383838, 0x373737, 0x373737, 0x373737, 0x373737, 0x363636, 0x363636, 0x363636, 0x353535, 0x353535, 0x353535, 0x353535, 0x272727, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020 -}; \ No newline at end of file diff --git a/dev/Boot/BootKit/Rsrc/zka_has_disk.rsrc b/dev/Boot/BootKit/Rsrc/zka_has_disk.rsrc deleted file mode 100644 index 4ede8a65..00000000 --- a/dev/Boot/BootKit/Rsrc/zka_has_disk.rsrc +++ /dev/null @@ -1,116 +0,0 @@ -#define NE_HAS_DISK_HEIGHT 110 -#define NE_HAS_DISK_WIDTH 110 - -// array size is 36300 -static const unsigned int zka_has_disk[] = { - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x333333, 0x565656, 0x636363, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6a6a6a, 0x5f5f5f, 0x4d4d4d, 0x2b2b2b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x464646, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x6a6a6a, 0x3b3b3b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x3d3d3d, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x252525, 0x676767, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x606060, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x3d3d3d, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x616161, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x525252, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x242424, 0x767676, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x393939, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7e7e7e, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4e4e4e, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x3f3f3f, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x666666, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x555555, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x222222, 0x7c7c7c, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x6d6d6d, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x393939, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x868686, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x515151, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x404040, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x6a6a6a, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x89948e, 0x7ba08a, 0x6eaa87, 0x6cab87, 0x6cab87, 0x6caa87, 0x6caa87, 0x6da888, 0x799f8a, 0x89938e, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x828282, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x8c9590, 0x72ab88, 0x61b883, 0x52c37f, 0x4bc87e, 0x4ac77e, 0x4ac67e, 0x49c57e, 0x48c47f, 0x47c37f, 0x47c37f, 0x46c17f, 0x46c180, 0x45c07f, 0x4cba82, 0x5cb085, 0x6fa58a, 0x8c9490, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x727272, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x383838, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x899d90, 0x69b686, 0x4ecb7e, 0x4dca7e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x4ac67f, 0x49c57f, 0x48c47f, 0x47c37f, 0x47c280, 0x46c180, 0x46c080, 0x45bf80, 0x44bf81, 0x43be81, 0x43bd81, 0x42bc81, 0x62ac89, 0x869a91, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x8e8e8e, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x525252, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x86a390, 0x61be83, 0x4ecb7d, 0x4dca7d, 0x4cca7e, 0x4bc87e, 0x4bc87e, 0x4ac77e, 0x4ac67e, 0x49c57e, 0x48c47f, 0x48c37f, 0x47c37f, 0x46c17f, 0x46c180, 0x45c080, 0x45bf80, 0x44be80, 0x43bd80, 0x42bc80, 0x42bc81, 0x41ba81, 0x41ba81, 0x40b981, 0x57af87, 0x839d92, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x414141, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x6e6e6e, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x929e96, 0x68bb87, 0x4fcd7e, 0x4ecc7d, 0x4ecb7e, 0x4dca7e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x4ac67f, 0x49c57f, 0x48c480, 0x47c380, 0x47c280, 0x46c180, 0x46c080, 0x45bf80, 0x44bf81, 0x43be81, 0x43bd81, 0x42bc81, 0x42bb82, 0x41ba82, 0x40b982, 0x40b882, 0x3fb882, 0x3eb782, 0x5fab8b, 0x919b97, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x5c5c5c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x868686, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x88a893, 0x55c97f, 0x4ecc7d, 0x4ecb7d, 0x4dca7d, 0x4cc97e, 0x4bc87e, 0x4bc87e, 0x4ac77e, 0x4ac67e, 0x49c57e, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x46c180, 0x45c080, 0x44bf80, 0x44be80, 0x43bd80, 0x42bc80, 0x42bb81, 0x41ba81, 0x41ba81, 0x40b981, 0x3fb882, 0x3eb782, 0x3eb682, 0x3db582, 0x3db482, 0x45b185, 0x83a195, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x787878, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x373737, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x7bb48f, 0x4fcd7d, 0x4fcc7d, 0x4ecb7d, 0x4dcb7e, 0x4cca7e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x49c57f, 0x49c47f, 0x48c480, 0x47c37f, 0x47c280, 0x46c180, 0x46c080, 0x45bf80, 0x44bf81, 0x43bd81, 0x43bd81, 0x42bc81, 0x42bb82, 0x41ba82, 0x40b982, 0x3fb882, 0x3fb882, 0x3eb682, 0x3eb683, 0x3db583, 0x3cb483, 0x3cb383, 0x3bb284, 0x74a693, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x959595, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0x76b88e, 0x4fcd7d, 0x4ecc7d, 0x4ecb7d, 0x4dca7d, 0x4cca7e, 0x4bc87e, 0x4bc87e, 0x4ac77e, 0x4ac67f, 0x49c57e, 0x48c47f, 0x48c37f, 0x47c37f, 0x46c17f, 0x46c180, 0x45c080, 0x45bf80, 0x44be80, 0x43bd81, 0x42bc81, 0x42bc81, 0x41ba81, 0x41ba81, 0x40b981, 0x3fb882, 0x3eb782, 0x3eb682, 0x3db582, 0x3db583, 0x3cb383, 0x3bb383, 0x3ab283, 0x3ab183, 0x39b083, 0x6fa893, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0x444444, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x707070, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0x79ba90, 0x4fcd7d, 0x4fcd7e, 0x4ecb7e, 0x4dcb7e, 0x4dca7e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x4ac67f, 0x49c47f, 0x48c480, 0x47c380, 0x47c280, 0x46c180, 0x46c080, 0x45bf80, 0x44bf81, 0x43bd81, 0x43bd81, 0x42bc81, 0x42bb82, 0x41ba82, 0x40b982, 0x40b882, 0x3fb883, 0x3eb682, 0x3eb683, 0x3db583, 0x3cb483, 0x3cb383, 0x3bb284, 0x3ab184, 0x3ab184, 0x39af84, 0x38af85, 0x6da894, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0x5e5e5e, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x8b8b8b, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0x7db892, 0x4fcd7d, 0x4ecc7d, 0x4ecb7d, 0x4dca7d, 0x4cc97e, 0x4bc87e, 0x4bc87e, 0x4ac67e, 0x4ac67e, 0x49c57e, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x46c180, 0x45bf80, 0x44bf80, 0x43be80, 0x43bd80, 0x42bc80, 0x42bb81, 0x41ba81, 0x40ba81, 0x3fb881, 0x3fb882, 0x3eb782, 0x3eb682, 0x3db582, 0x3cb482, 0x3cb382, 0x3bb383, 0x3ab183, 0x3ab183, 0x39b083, 0x39af84, 0x38ae84, 0x37ad84, 0x36ac84, 0x74a897, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0x7c7c7c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x363636, 0xa7a7a7, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0x90b39d, 0x4fcd7d, 0x4fcc7d, 0x4ecb7d, 0x4dcb7e, 0x4cc97e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x49c57f, 0x48c47f, 0x48c480, 0x47c27f, 0x47c280, 0x46c180, 0x45c080, 0x44bf80, 0x44be81, 0x43bd81, 0x43bd81, 0x42bb81, 0x41bb82, 0x41ba82, 0x40b982, 0x3fb882, 0x3fb782, 0x3eb682, 0x3eb683, 0x3db483, 0x3cb483, 0x3bb383, 0x3bb284, 0x3ab184, 0x3ab084, 0x39af84, 0x38af84, 0x37ad84, 0x37ad85, 0x36ac85, 0x36ab85, 0x8aa99f, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0x9c9c9c, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xa2afa6, 0x56ca80, 0x4ecc7d, 0x4ecb7d, 0x4dca7d, 0x4cc97e, 0x4bc87e, 0x4bc87e, 0x4ac67e, 0x4ac67f, 0x49c57e, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x46c180, 0x45bf80, 0x44bf80, 0x43be80, 0x43bd81, 0x42bc81, 0x42bb81, 0x41ba81, 0x40ba81, 0x40b881, 0x3fb882, 0x3eb782, 0x3eb682, 0x3db582, 0x3db483, 0x3cb383, 0x3bb383, 0x3ab183, 0x3ab183, 0x39b083, 0x39af84, 0x38ae84, 0x37ad84, 0x36ac84, 0x36ac85, 0x35ab85, 0x35aa85, 0x3ea988, 0xa2aba8, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x717171, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0x70c28e, 0x4fcc7e, 0x4ecb7e, 0x4dcb7e, 0x4cca7e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x49c57f, 0x48c47f, 0x48c480, 0x47c380, 0x47c280, 0x46c180, 0x45c080, 0x45bf80, 0x44be81, 0x43bd81, 0x43bd81, 0x42bc81, 0x42bb82, 0x41ba82, 0x40b982, 0x3fb882, 0x3fb783, 0x3eb682, 0x3eb683, 0x3db583, 0x3cb483, 0x3bb383, 0x3bb284, 0x3ab184, 0x3ab084, 0x39af84, 0x38af85, 0x38ae85, 0x37ad85, 0x36ac85, 0x36ab85, 0x35aa85, 0x34a986, 0x34a886, 0x63aa96, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0x636363, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x8e8e8e, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0x9bb6a5, 0x4ecc7d, 0x4dcb7d, 0x4cca7d, 0x4cc97e, 0x4bc87e, 0x4bc77e, 0x4ac67e, 0x49c67e, 0x49c57e, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x46c080, 0x45bf80, 0x44bf80, 0x43be80, 0x43bd81, 0x42bc80, 0x42bb81, 0x41ba81, 0x40b981, 0x3fb881, 0x3fb882, 0x3eb782, 0x3eb682, 0x3db582, 0x3cb483, 0x3bb383, 0x3bb283, 0x3ab183, 0x3ab183, 0x39b083, 0x38af84, 0x37ae84, 0x37ad84, 0x36ac84, 0x36ab85, 0x35aa85, 0x34aa85, 0x34a985, 0x33a885, 0x32a785, 0x32a686, 0x9baea9, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0x818181, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x343434, 0xacacac, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0x68c68b, 0x4ecb7d, 0x4dcb7e, 0x4cc97e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x49c57f, 0x48c47f, 0x48c480, 0x47c27f, 0x47c280, 0x46c180, 0x45c080, 0x44bf80, 0x44be81, 0x43bd81, 0x43bd81, 0x42bb81, 0x41bb82, 0x41ba82, 0x40b982, 0x3fb882, 0x3fb782, 0x3eb682, 0x3eb683, 0x3db483, 0x3cb483, 0x3bb383, 0x3bb284, 0x3ab184, 0x3ab084, 0x39af84, 0x38af85, 0x37ad84, 0x37ad85, 0x36ac85, 0x36ab85, 0x35aa85, 0x34a986, 0x33a886, 0x33a886, 0x32a686, 0x32a687, 0x57a993, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xa3a3a3, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xa0baaa, 0x4dcb7d, 0x4dca7d, 0x4cc97e, 0x4bc87e, 0x4bc77e, 0x4ac67e, 0x4ac67f, 0x49c57e, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x46c080, 0x45bf80, 0x44bf80, 0x43be80, 0x43bd81, 0x42bc81, 0x42bb81, 0x41ba81, 0x40b981, 0x3fb881, 0x3fb882, 0x3eb782, 0x3eb682, 0x3db582, 0x3cb483, 0x3bb383, 0x3bb283, 0x3ab183, 0x3ab184, 0x39b083, 0x38af84, 0x38ae84, 0x37ad84, 0x36ac84, 0x36ab85, 0x35aa85, 0x35aa85, 0x34a985, 0x33a886, 0x32a786, 0x32a686, 0x31a586, 0x31a486, 0x30a386, 0x9eb2ad, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0x484848, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x727272, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0x72c592, 0x4dcb7e, 0x4cc97e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x49c57f, 0x48c47f, 0x48c480, 0x47c280, 0x47c280, 0x46c180, 0x45c080, 0x45bf81, 0x44be81, 0x43bd81, 0x43bd81, 0x42bb81, 0x42bb82, 0x41ba82, 0x40b982, 0x3fb882, 0x3fb783, 0x3eb682, 0x3eb683, 0x3db483, 0x3cb483, 0x3bb383, 0x3bb284, 0x3ab184, 0x3ab084, 0x39af84, 0x38af85, 0x37ad85, 0x37ad85, 0x36ac85, 0x36ab85, 0x35aa85, 0x34a986, 0x33a886, 0x33a886, 0x32a686, 0x32a687, 0x31a587, 0x30a487, 0x30a387, 0x60aa99, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x909090, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xb3bbb6, 0x50c97f, 0x4cc97e, 0x4bc87e, 0x4bc77e, 0x4ac67e, 0x49c57e, 0x48c47e, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x45c080, 0x44bf80, 0x44be80, 0x43bd80, 0x43bd81, 0x42bc80, 0x41bb81, 0x41ba81, 0x40b981, 0x3fb881, 0x3fb782, 0x3eb682, 0x3eb682, 0x3db582, 0x3cb482, 0x3bb383, 0x3bb283, 0x3ab183, 0x3ab083, 0x39af83, 0x38af84, 0x37ae84, 0x51b894, 0x8ed1b9, 0x50b694, 0x35aa85, 0x34a985, 0x33a885, 0x33a885, 0x32a785, 0x32a686, 0x31a586, 0x30a486, 0x2fa386, 0x2fa387, 0x2ea187, 0x32a289, 0xb4b9b8, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0x868686, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x313131, 0xb0b0b0, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0x92c2a5, 0x4cc97e, 0x4cc97e, 0x4bc77e, 0x4ac77f, 0x4ac67f, 0x49c57f, 0x48c47f, 0x48c380, 0x47c27f, 0x46c280, 0x46c080, 0x45c080, 0x44bf80, 0x44be81, 0x43bd81, 0x43bc81, 0x42bb81, 0x41bb82, 0x40ba82, 0x40b982, 0x3fb882, 0x3fb782, 0x3eb682, 0x3db583, 0x3cb483, 0x3cb483, 0x3bb383, 0x3bb284, 0x3ab184, 0x39b084, 0x39af84, 0x38ae85, 0x6bc3a4, 0xf4fcf6, 0xfbfffa, 0xf3fbf5, 0x54b797, 0x34a986, 0x33a886, 0x33a786, 0x32a686, 0x31a686, 0x31a587, 0x30a487, 0x2fa387, 0x2fa287, 0x2ea187, 0x2ea088, 0x86b2a9, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xa9a9a9, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x525252, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0x74c695, 0x4bc87e, 0x4bc77e, 0x4ac67e, 0x49c67f, 0x48c47f, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x45c080, 0x45bf80, 0x44bf80, 0x43bd80, 0x43bd81, 0x42bc81, 0x42bb81, 0x41ba81, 0x40b981, 0x3fb881, 0x3fb882, 0x3eb682, 0x3eb682, 0x3db582, 0x3cb483, 0x3bb383, 0x3bb283, 0x3ab183, 0x3ab184, 0x39af83, 0x38af84, 0x37ae84, 0x6ac3a3, 0xf4fcf5, 0xfafff8, 0xfafff8, 0xfafff8, 0x9ed7c3, 0x33a886, 0x32a786, 0x32a686, 0x31a586, 0x30a486, 0x30a386, 0x2fa387, 0x2ea187, 0x2ea187, 0x2da087, 0x2d9f88, 0x61aa9c, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0x494949, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x727272, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0x57c885, 0x4bc77e, 0x4ac77f, 0x4ac67f, 0x49c57f, 0x48c47f, 0x48c380, 0x47c280, 0x47c280, 0x46c080, 0x45c080, 0x44bf80, 0x44be81, 0x43bd81, 0x43bc81, 0x42bb81, 0x41bb82, 0x40b982, 0x40b982, 0x3fb882, 0x3fb783, 0x3eb683, 0x3db583, 0x3db483, 0x3cb483, 0x3bb383, 0x3bb284, 0x3ab184, 0x3ab084, 0x39af84, 0x38ae85, 0x6ac3a3, 0xf5fdf5, 0xf9fff7, 0xf9fff7, 0xf9fff7, 0xf9fff6, 0x83cbb4, 0x33a786, 0x32a686, 0x32a687, 0x31a587, 0x30a487, 0x2fa387, 0x2fa288, 0x2ea187, 0x2ea088, 0x2d9f88, 0x2c9f88, 0x3ea28f, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0x6a6a6a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x929292, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xb9c4be, 0x4bc77e, 0x4ac67e, 0x49c57e, 0x48c47e, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x45c080, 0x44bf80, 0x44be80, 0x43bd80, 0x43bd81, 0x42bc80, 0x41bb81, 0x41ba81, 0x40b981, 0x3fb881, 0x3fb782, 0x3eb682, 0x3db682, 0x3db582, 0x3cb483, 0x3bb383, 0x3bb283, 0x3ab183, 0x39b083, 0x39af83, 0x38af84, 0x37ae84, 0x6ac2a2, 0xf1fcf2, 0xf8fff5, 0xf7fff5, 0xf7fff5, 0xf7fff4, 0xc3e8d7, 0x36a987, 0x32a686, 0x31a586, 0x30a486, 0x2fa386, 0x2fa287, 0x2ea187, 0x2ea187, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2a9c88, 0xbcc2c1, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0x8c8c8c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x2e2e2e, 0xb4b4b4, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xa9c7b6, 0x4ac77f, 0x49c67f, 0x49c57f, 0x48c47f, 0x48c380, 0x47c280, 0x46c180, 0x46c080, 0x45c080, 0x44bf80, 0x44be81, 0x43bd81, 0x43bc81, 0x42bb81, 0x41ba82, 0x40b982, 0x40b982, 0x3fb882, 0x3fb782, 0x3eb682, 0x3db583, 0x3cb483, 0x3cb383, 0x3bb283, 0x3bb284, 0x3ab184, 0x39b084, 0x38af84, 0x38ae85, 0x69c2a1, 0xf2fcf1, 0xf7fff4, 0xf7fff4, 0xf7fff3, 0xf7fff3, 0xc4e8d7, 0x39aa89, 0x32a686, 0x31a587, 0x31a487, 0x30a487, 0x2fa387, 0x2fa287, 0x2ea187, 0x2ea088, 0x2d9f88, 0x2c9e88, 0x2b9d88, 0x2b9d89, 0x2a9c89, 0xa6beba, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xafafaf, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x505050, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0x99c8ad, 0x49c57f, 0x48c47f, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x45c080, 0x45bf80, 0x44bf80, 0x43bd80, 0x43bd81, 0x42bc81, 0x41bb81, 0x4cbe88, 0x6dca9e, 0x40b882, 0x3fb882, 0x3eb682, 0x3db682, 0x3db582, 0x3cb483, 0x3bb383, 0x3bb283, 0x3ab183, 0x3ab184, 0x39af83, 0x38af84, 0x37ae84, 0x69c2a1, 0xeffcef, 0xf6fff3, 0xf5fff2, 0xf5fff2, 0xf5fff1, 0xc3e8d5, 0x39aa8a, 0x32a686, 0x31a586, 0x30a486, 0x30a386, 0x2fa387, 0x2ea187, 0x2ea187, 0x2da087, 0x2d9f88, 0x2c9e88, 0x2b9d88, 0x2a9c88, 0x2a9c89, 0x299a88, 0x93bab4, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0x4b4b4b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x717171, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0x93caab, 0x49c57f, 0x48c47f, 0x48c380, 0x47c280, 0x47c280, 0x46c080, 0x45c081, 0x44bf81, 0x44be81, 0x43bd81, 0x43bc81, 0x42bb81, 0x63c898, 0xe7f8ec, 0xf9fff7, 0xcdeedb, 0x4bbc8b, 0x3eb683, 0x3db583, 0x3cb483, 0x3cb483, 0x3bb283, 0x3bb284, 0x3ab184, 0x39b084, 0x38af84, 0x38ae85, 0x65c1a0, 0xeffcee, 0xf5fff1, 0xf5fff1, 0xf5fff1, 0xf5fff1, 0xc2e8d5, 0x3aaa8a, 0x32a686, 0x32a687, 0x31a487, 0x30a487, 0x2fa387, 0x2fa288, 0x2ea187, 0x2ea088, 0x2d9f88, 0x2c9f88, 0x2b9d88, 0x2b9d89, 0x2a9c89, 0x2a9b89, 0x299a89, 0x89b8b1, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0x6e6e6e, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x939393, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0x8cc9a7, 0x48c47f, 0x47c27f, 0x46c27f, 0x46c17f, 0x45c080, 0x44bf80, 0x44be80, 0x43bd80, 0x43bd81, 0x42bb80, 0x41bb81, 0x40ba81, 0xb8e6cd, 0xf7fff5, 0xf7fff5, 0xf7fff4, 0xd2f1de, 0x48b989, 0x3cb483, 0x3bb383, 0x3bb283, 0x3ab183, 0x39b083, 0x39af83, 0x38af84, 0x37ad84, 0x64c19e, 0xecfbec, 0xf4fff0, 0xf3ffef, 0xf3ffef, 0xf3ffee, 0xc5ead5, 0x3aa989, 0x31a686, 0x31a586, 0x30a486, 0x2fa386, 0x2fa287, 0x2ea187, 0x2ea187, 0x2d9f87, 0x2c9f87, 0x2b9e87, 0x2b9d88, 0x2a9c88, 0x2a9b88, 0x299a88, 0x289a89, 0x279889, 0x81b5ae, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0x929292, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x2a2a2a, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0x79b493, 0x48c380, 0x47c280, 0x46c180, 0x45c080, 0x45c080, 0x44be80, 0x44be81, 0x43bd81, 0x42bc81, 0x41bb81, 0x41ba82, 0x40b982, 0xb9e7cd, 0xf7fff3, 0xf7fff3, 0xf6fff3, 0xf6fff3, 0xd0f0db, 0x47b78a, 0x3bb283, 0x3bb284, 0x3ab084, 0x39b084, 0x38af84, 0x38ae85, 0x65c19e, 0xedfceb, 0xf3ffee, 0xf3ffee, 0xf2ffee, 0xf2ffee, 0xc3ead4, 0x3aaa8a, 0x32a686, 0x31a587, 0x30a487, 0x30a487, 0x2fa287, 0x2fa287, 0x2ea187, 0x2da088, 0x2c9f88, 0x2c9e88, 0x2b9d88, 0x2b9d89, 0x2a9b89, 0x299b89, 0x299a89, 0x289989, 0x279889, 0x699f98, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x316749, 0x47c280, 0x46c17f, 0x45c080, 0x44bf80, 0x44be80, 0x43bd80, 0x43bd81, 0x42bb81, 0x41bb81, 0x40ba81, 0x40b981, 0x3fb881, 0x59c192, 0xebfbeb, 0xf5fff1, 0xf4fff1, 0xf4fff1, 0xf4fff0, 0xcceed8, 0x43b588, 0x39b084, 0x39af83, 0x38af84, 0x37ad84, 0x65c19e, 0xebfce9, 0xf2ffed, 0xf1ffec, 0xf1ffec, 0xf1ffec, 0xc2ead3, 0x39a98a, 0x32a686, 0x31a586, 0x30a486, 0x2fa386, 0x2fa287, 0x2ea187, 0x2ea187, 0x2d9f87, 0x2c9f88, 0x2b9e88, 0x2b9d88, 0x2a9c88, 0x2a9b89, 0x299a88, 0x289a89, 0x289889, 0x279889, 0x269789, 0x22524d, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x2f5d44, 0x46c180, 0x45c080, 0x45c081, 0x44bf81, 0x44be81, 0x43bd81, 0x42bc81, 0x42bb81, 0x41ba82, 0x40b982, 0x40b982, 0x3fb882, 0x3fb783, 0x62c498, 0xe9fbe9, 0xf4ffef, 0xf3ffef, 0xf3ffef, 0xf3ffee, 0xcbeed7, 0x42b489, 0x38af84, 0x38ae85, 0x63c09d, 0xeafce8, 0xf1ffec, 0xf1ffec, 0xf0ffeb, 0xf0ffeb, 0xc3ebd3, 0x3aaa8a, 0x32a686, 0x31a587, 0x30a487, 0x30a487, 0x2fa387, 0x2fa288, 0x2ea187, 0x2da088, 0x2d9f88, 0x2c9e88, 0x2b9d88, 0x2b9d89, 0x2a9c89, 0x2a9b89, 0x299a89, 0x28998a, 0x27988a, 0x27978a, 0x26968a, 0x224a46, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x294838, 0x45c080, 0x44bf80, 0x44be80, 0x43bd80, 0x43bc81, 0x42bb81, 0x41bb81, 0x40ba81, 0x40b981, 0x3fb881, 0x3fb782, 0x3eb682, 0x3db582, 0x3cb482, 0x60c398, 0xe7fae7, 0xf2ffed, 0xf1ffec, 0xf1ffec, 0xf1ffeb, 0xc9edd5, 0x3eb088, 0x63c09c, 0xe8fbe6, 0xefffea, 0xefffe9, 0xefffe9, 0xeeffe9, 0xc2ead1, 0x39a989, 0x31a686, 0x31a586, 0x30a486, 0x2fa386, 0x2fa287, 0x2ea187, 0x2ea087, 0x2d9f87, 0x2c9f88, 0x2b9e88, 0x2b9d88, 0x2a9c88, 0x2a9b88, 0x299a88, 0x289989, 0x279889, 0x279889, 0x269789, 0x26968a, 0x25958a, 0x213a38, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x24302a, 0x45c081, 0x44be80, 0x44be81, 0x43bd81, 0x42bc81, 0x41bb81, 0x41ba82, 0x40b982, 0x40b982, 0x3fb782, 0x3eb783, 0x3db683, 0x3db583, 0x3cb483, 0x3cb383, 0x61c299, 0xe9fce7, 0xf0ffeb, 0xf0ffeb, 0xf0ffea, 0xf0ffea, 0xc9eed5, 0xe9fce6, 0xefffe9, 0xefffe9, 0xeeffe8, 0xeeffe8, 0xc1ead0, 0x3aaa8a, 0x32a686, 0x31a587, 0x30a487, 0x30a487, 0x2fa287, 0x2fa287, 0x2ea187, 0x2da088, 0x2c9f88, 0x2c9e88, 0x2b9d88, 0x2b9d89, 0x2a9b89, 0x299b89, 0x299a89, 0x28998a, 0x279889, 0x27978a, 0x26968a, 0x25968a, 0x25948a, 0x202928, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x41b279, 0x43bd80, 0x43bc81, 0x42bb81, 0x41bb81, 0x40ba81, 0x40b982, 0x3fb882, 0x3fb782, 0x3eb682, 0x3db582, 0x3cb482, 0x3cb483, 0x3bb383, 0x3bb283, 0x3ab183, 0x60c19a, 0xe6fbe4, 0xeeffe9, 0xeeffe8, 0xeeffe8, 0xedffe7, 0xedffe7, 0xedffe7, 0xedffe6, 0xecffe6, 0xc1eacf, 0x39a98a, 0x32a686, 0x31a586, 0x30a486, 0x2fa386, 0x2fa287, 0x2ea187, 0x2ea087, 0x2d9f87, 0x2c9f88, 0x2b9e88, 0x2b9d88, 0x2a9c88, 0x2a9b89, 0x299a88, 0x289989, 0x279889, 0x279889, 0x269789, 0x26968a, 0x25958a, 0x24948a, 0x238880, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x4c4c4c, 0x4c4c4c, 0x4c4c4c, 0x4b4b4b, 0x4b4b4b, 0x4b4b4b, 0x4b4b4b, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x494949, 0x494949, 0x494949, 0x494949, 0x484848, 0x484848, 0x484848, 0x484848, 0x474747, 0x474747, 0x474747, 0x464646, 0x464646, 0x44976e, 0x43bd81, 0x42bc81, 0x42bb81, 0x41ba82, 0x40b982, 0x40b982, 0x3fb782, 0x3eb783, 0x3eb683, 0x3db583, 0x3cb483, 0x3cb384, 0x3bb283, 0x3ab284, 0x3ab084, 0x39b084, 0x5fc099, 0xe5fbe3, 0xedffe7, 0xedffe7, 0xedffe6, 0xedffe6, 0xecffe5, 0xecffe5, 0xc0ebce, 0x3aaa8a, 0x32a686, 0x31a587, 0x30a487, 0x30a487, 0x2fa287, 0x2fa288, 0x2ea188, 0x2da088, 0x2d9f88, 0x2c9e88, 0x2b9d88, 0x2b9d89, 0x2a9b89, 0x2a9b89, 0x299a89, 0x28998a, 0x27988a, 0x27978a, 0x26968a, 0x26968a, 0x25948a, 0x24948b, 0x2b726d, 0x393939, 0x393939, 0x383838, 0x383838, 0x383838, 0x383838, 0x373737, 0x373737, 0x373737, 0x373737, 0x363636, 0x363636, 0x363636, 0x353535, 0x353535, 0x353535, 0x353535, 0x343434, 0x343434, 0x343434, 0x343434, 0x333333, 0x333333, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0x86b9a0, 0x41bb81, 0x41ba81, 0x40b981, 0x40b981, 0x3fb881, 0x3eb782, 0x3eb682, 0x3db582, 0x3cb482, 0x3cb383, 0x3bb283, 0x3bb283, 0x3ab183, 0x39b083, 0x38af83, 0x38ae84, 0x37ad84, 0x5ebe99, 0xe3fbe0, 0xebffe4, 0xebffe3, 0xebffe3, 0xeaffe3, 0xc3eccf, 0x39a989, 0x31a586, 0x30a486, 0x30a486, 0x2fa386, 0x2fa287, 0x2ea187, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2b9d88, 0x2a9c88, 0x299b88, 0x299a88, 0x289989, 0x279889, 0x279789, 0x269689, 0x26968a, 0x25958a, 0x24948a, 0x23938a, 0x23928a, 0x5f8986, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xaeb8b3, 0x43bb82, 0x41ba82, 0x40b982, 0x40b882, 0x3fb782, 0x3eb783, 0x3db583, 0x3db583, 0x3cb483, 0x3cb383, 0x3bb283, 0x3ab184, 0x39b084, 0x39b084, 0x38ae84, 0x38ae85, 0x37ad85, 0x36ac85, 0x5cbd99, 0xe3fcdf, 0xeaffe2, 0xeaffe2, 0xc2ecce, 0x3bab8a, 0x31a686, 0x31a587, 0x30a487, 0x30a387, 0x2fa287, 0x2ea287, 0x2ea087, 0x2da088, 0x2c9f88, 0x2c9e88, 0x2b9d88, 0x2b9c89, 0x2a9b89, 0x299b89, 0x289989, 0x28998a, 0x279889, 0x27978a, 0x26968a, 0x25958a, 0x24948a, 0x24948b, 0x23928b, 0x26928b, 0x808584, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0x64b891, 0x40b982, 0x3fb882, 0x3fb782, 0x3eb682, 0x3db582, 0x3cb482, 0x3cb483, 0x3bb283, 0x3bb283, 0x3ab183, 0x39b084, 0x38af84, 0x38ae84, 0x37ad84, 0x37ad84, 0x36ab84, 0x35ab85, 0x34aa85, 0x55b996, 0x8ed3b3, 0x85cfaf, 0x38a989, 0x31a686, 0x30a486, 0x30a486, 0x2fa386, 0x2fa287, 0x2ea187, 0x2da087, 0x2d9f87, 0x2c9f88, 0x2b9d88, 0x2b9d88, 0x2a9c88, 0x2a9b89, 0x299a88, 0x289989, 0x279889, 0x279889, 0x269689, 0x26968a, 0x25958a, 0x24948a, 0x23938a, 0x23928b, 0x22918b, 0x468d89, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0x98b7a9, 0x40b882, 0x3fb782, 0x3eb783, 0x3db583, 0x3db583, 0x3cb483, 0x3cb384, 0x3bb283, 0x3ab184, 0x3ab084, 0x39b084, 0x38ae84, 0x38ae85, 0x37ad85, 0x36ac85, 0x36ab85, 0x35aa86, 0x34a986, 0x34a986, 0x33a786, 0x32a786, 0x32a686, 0x31a587, 0x30a487, 0x30a387, 0x2fa287, 0x2fa288, 0x2ea088, 0x2da088, 0x2c9f88, 0x2c9e88, 0x2b9d88, 0x2b9c89, 0x2a9b89, 0x299b89, 0x289989, 0x28998a, 0x27988a, 0x27978a, 0x26968a, 0x25958a, 0x25948a, 0x24948b, 0x23928b, 0x23928b, 0x22918b, 0x758887, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0x57b68c, 0x3db682, 0x3db582, 0x3cb482, 0x3cb383, 0x3bb283, 0x3ab283, 0x39b083, 0x39b084, 0x38af84, 0x38ae84, 0x37ad84, 0x36ac84, 0x36ab84, 0x35ab85, 0x34a985, 0x34a985, 0x33a885, 0x33a786, 0x32a686, 0x31a586, 0x30a486, 0x30a486, 0x2fa286, 0x2fa287, 0x2ea187, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2b9d88, 0x2a9b88, 0x299b88, 0x289a88, 0x289989, 0x279889, 0x279789, 0x269689, 0x25968a, 0x24948a, 0x24948a, 0x23938a, 0x23928b, 0x22918a, 0x22918b, 0x3f8e89, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0x98b6a9, 0x3db583, 0x3db583, 0x3cb483, 0x3cb383, 0x3bb283, 0x3ab184, 0x39b084, 0x39af84, 0x38ae84, 0x38ae85, 0x37ad85, 0x36ac85, 0x35ab85, 0x35aa86, 0x34a985, 0x34a886, 0x33a786, 0x32a786, 0x31a686, 0x31a587, 0x30a487, 0x30a387, 0x2fa287, 0x2ea187, 0x2ea088, 0x2da088, 0x2c9f88, 0x2c9e88, 0x2b9d88, 0x2b9c89, 0x2a9b89, 0x299a89, 0x289989, 0x28998a, 0x27988a, 0x27978a, 0x26968a, 0x25958a, 0x24948a, 0x24938b, 0x23928b, 0x23928b, 0x22918b, 0x23918b, 0x738887, 0x868686, 0x848484, 0x848484, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0x5fb491, 0x3cb383, 0x3bb283, 0x3ab283, 0x3ab183, 0x39b084, 0x38af84, 0x38ae84, 0x37ad84, 0x37ac85, 0x36ab84, 0x35ab85, 0x34aa85, 0x34a985, 0x33a885, 0x33a786, 0x32a686, 0x31a586, 0x30a486, 0x30a487, 0x2fa387, 0x2fa287, 0x2ea187, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2b9d88, 0x2a9c88, 0x299b89, 0x299a89, 0x289989, 0x279889, 0x279789, 0x269689, 0x25968a, 0x25958a, 0x24948a, 0x23938a, 0x23928b, 0x22918b, 0x22918b, 0x22918b, 0x498d89, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xa4b4ad, 0x40b385, 0x3bb284, 0x3ab184, 0x39b084, 0x39b084, 0x38ae84, 0x38ae85, 0x37ad85, 0x36ac85, 0x35ab85, 0x35aa86, 0x34a986, 0x34a986, 0x33a786, 0x32a786, 0x32a686, 0x31a587, 0x30a487, 0x30a387, 0x2fa287, 0x2fa288, 0x2ea088, 0x2da088, 0x2c9f88, 0x2c9e89, 0x2b9d88, 0x2b9c89, 0x2a9b89, 0x299b89, 0x289989, 0x28998a, 0x27988a, 0x27978a, 0x26968a, 0x25958b, 0x24948b, 0x24948b, 0x23928b, 0x23928b, 0x22918b, 0x22918b, 0x29918b, 0x7f8988, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0x89b2a2, 0x39b083, 0x39b084, 0x38af84, 0x38ae84, 0x37ad84, 0x36ac84, 0x35ab84, 0x35aa85, 0x34a985, 0x34a985, 0x33a885, 0x32a786, 0x31a686, 0x31a586, 0x30a486, 0x30a386, 0x2fa286, 0x2ea287, 0x2ea187, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2b9c88, 0x2a9b88, 0x299b88, 0x289a88, 0x289989, 0x279889, 0x279789, 0x269689, 0x25958a, 0x24948a, 0x24948a, 0x23938a, 0x23928b, 0x22918a, 0x22918b, 0x22918b, 0x22918b, 0x6e8a89, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0x72b19a, 0x39af84, 0x38ae84, 0x38ae85, 0x37ac85, 0x36ac85, 0x35ab85, 0x35aa86, 0x34a985, 0x34a886, 0x33a786, 0x32a786, 0x31a586, 0x31a587, 0x30a487, 0x30a387, 0x2fa287, 0x2ea188, 0x2da088, 0x2da088, 0x2c9e88, 0x2c9e88, 0x2b9d88, 0x2a9c89, 0x299b89, 0x299a89, 0x289989, 0x28998a, 0x27978a, 0x26978a, 0x26968a, 0x25958a, 0x24948a, 0x24938b, 0x23928b, 0x23928b, 0x22918b, 0x22918b, 0x22918b, 0x5d8d8b, 0x888888, 0x888888, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0x6daf98, 0x37ad84, 0x36ac85, 0x35ab84, 0x35aa85, 0x34a985, 0x34a985, 0x33a885, 0x32a786, 0x32a686, 0x31a586, 0x30a486, 0x30a387, 0x2fa287, 0x2fa287, 0x2ea187, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2b9c88, 0x2a9b88, 0x299b89, 0x289a89, 0x289989, 0x279889, 0x279789, 0x269689, 0x25958a, 0x24948a, 0x24948a, 0x23938a, 0x23928b, 0x22918b, 0x22918b, 0x22918b, 0x22918b, 0x568d8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0x73ae9a, 0x36ac85, 0x35ab85, 0x35aa86, 0x34a986, 0x34a886, 0x33a786, 0x32a786, 0x31a686, 0x31a587, 0x30a487, 0x30a387, 0x2fa287, 0x2ea188, 0x2da088, 0x2da088, 0x2c9f88, 0x2c9e89, 0x2b9d88, 0x2a9c89, 0x2a9b89, 0x299a89, 0x289989, 0x28998a, 0x27988a, 0x27978a, 0x26968a, 0x25958b, 0x24948b, 0x24938b, 0x23928b, 0x23928b, 0x22918b, 0x22918b, 0x22918b, 0x588f8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0x7aad9d, 0x34a985, 0x34a985, 0x33a785, 0x32a786, 0x31a686, 0x31a586, 0x30a486, 0x30a387, 0x2fa286, 0x2ea287, 0x2ea187, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2b9c88, 0x2a9b88, 0x299b88, 0x289a89, 0x289989, 0x279889, 0x279789, 0x269689, 0x25958a, 0x24948a, 0x24948a, 0x23938a, 0x23928b, 0x22918b, 0x22918b, 0x22918b, 0x22918b, 0x608e8b, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0x90ada4, 0x3da989, 0x33a786, 0x32a686, 0x31a586, 0x31a587, 0x30a487, 0x30a387, 0x2fa287, 0x2ea188, 0x2da088, 0x2d9f88, 0x2c9e88, 0x2c9e88, 0x2b9d88, 0x2a9c89, 0x299b89, 0x299a89, 0x289989, 0x28988a, 0x27978a, 0x26978a, 0x25968a, 0x25958b, 0x24948a, 0x24938b, 0x23928b, 0x22918b, 0x22918b, 0x22918b, 0x2c918b, 0x758f8d, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xa2acaa, 0x5fa894, 0x31a586, 0x30a486, 0x30a387, 0x2fa287, 0x2fa287, 0x2ea087, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2b9c88, 0x2a9b88, 0x299b89, 0x289a89, 0x289989, 0x279889, 0x27978a, 0x269689, 0x25958a, 0x24948a, 0x24948a, 0x23938a, 0x23928b, 0x22918b, 0x22918b, 0x22918b, 0x4c918d, 0x868e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0x8eaaa3, 0x4fa590, 0x30a387, 0x2fa287, 0x2ea188, 0x2da088, 0x2d9f88, 0x2c9e88, 0x2c9e89, 0x2b9d88, 0x2a9c89, 0x2a9b89, 0x299a89, 0x289989, 0x28988a, 0x27978a, 0x26978a, 0x26968a, 0x25958b, 0x24948b, 0x24938b, 0x23928b, 0x22918b, 0x22918b, 0x43928d, 0x7b9190, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0x93a8a3, 0x5ea394, 0x36a08a, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2a9c88, 0x299b88, 0x299a89, 0x289989, 0x289989, 0x279889, 0x269789, 0x269689, 0x25958a, 0x24948a, 0x24938a, 0x23928a, 0x23928b, 0x2d918b, 0x53928f, 0x819291, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0x89a49f, 0x62a195, 0x389d8b, 0x2a9c89, 0x299b89, 0x299a89, 0x289989, 0x28988a, 0x27978a, 0x26968a, 0x25958a, 0x25958a, 0x24948a, 0x36948d, 0x599491, 0x7d9594, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0x9ba2a1, 0x8ea09d, 0x809e9a, 0x749c97, 0x689b95, 0x679a94, 0x729a96, 0x7e9997, 0x889998, 0x949998, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xc6c6c6, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x868686, 0x868686, 0x848484, 0x848484, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x565656, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x9a9a9a, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa3a3a3, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x797979, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x999999, 0x979797, 0x979797, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x353535, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xbfbfbf, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x949494, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x464646, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0x9f9f9f, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x7f7f7f, 0xbababa, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x626262, 0x484848, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x3a3a3a, 0x4b4b4b, 0x4b4b4b, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x494949, 0x494949, 0x494949, 0x494949, 0x484848, 0x484848, 0x484848, 0x484848, 0x474747, 0x474747, 0x474747, 0x464646, 0x464646, 0x464646, 0x464646, 0x454545, 0x454545, 0x454545, 0x454545, 0x444444, 0x444444, 0x444444, 0x444444, 0x434343, 0x434343, 0x434343, 0x424242, 0x424242, 0x424242, 0x424242, 0x414141, 0x414141, 0x414141, 0x414141, 0x404040, 0x404040, 0x404040, 0x404040, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3b3b3b, 0x3b3b3b, 0x3b3b3b, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x393939, 0x393939, 0x393939, 0x393939, 0x383838, 0x383838, 0x383838, 0x383838, 0x373737, 0x373737, 0x373737, 0x373737, 0x363636, 0x363636, 0x363636, 0x353535, 0x353535, 0x353535, 0x353535, 0x272727, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020 -}; \ No newline at end of file diff --git a/dev/Boot/BootKit/Rsrc/zka_no_disk.rsrc b/dev/Boot/BootKit/Rsrc/zka_no_disk.rsrc deleted file mode 100644 index f89abad0..00000000 --- a/dev/Boot/BootKit/Rsrc/zka_no_disk.rsrc +++ /dev/null @@ -1,116 +0,0 @@ -#define NE_NO_DISK_HEIGHT 110 -#define NE_NO_DISK_WIDTH 110 - -// array size is 36300 -static const unsigned int zka_no_disk[] = { - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x333333, 0x565656, 0x636363, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6a6a6a, 0x5f5f5f, 0x4d4d4d, 0x2b2b2b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x464646, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x6a6a6a, 0x3b3b3b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x3d3d3d, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x252525, 0x676767, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x606060, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x3d3d3d, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x616161, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x525252, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x242424, 0x767676, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x393939, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7e7e7e, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4e4e4e, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x3f3f3f, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x666666, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x555555, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x222222, 0x7c7c7c, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x6d6d6d, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x393939, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x868686, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x515151, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x404040, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x6a6a6a, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x828282, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0xa69a77, 0xbea35a, 0xc0a458, 0xa69a77, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x727272, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x383838, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0xab9d77, 0xebb626, 0xffbe0c, 0xffbd0c, 0xffbd0c, 0xffbc0c, 0xecb524, 0xaa9c78, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x8e8e8e, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x525252, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0xa49b83, 0xfcbc0f, 0xfebc0c, 0xffbc0c, 0xfebc0b, 0xffbb0c, 0xfebb0b, 0xffba0b, 0xfcb90e, 0xa49b83, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x414141, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x6e6e6e, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0xe8b52c, 0xffbd0c, 0xffbc0c, 0xffbc0c, 0xffbb0c, 0xffbb0c, 0xffba0b, 0xffba0c, 0xffb90b, 0xe8b22c, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x5c5c5c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x868686, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0xbca66b, 0xfebb0b, 0xffbb0b, 0xfeba0b, 0xffba0b, 0xfeba0b, 0xffb90b, 0xfeb80b, 0xffb80b, 0xfeb80b, 0xffb70b, 0xbda46a, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x787878, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x373737, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0xa09f9b, 0xf3b81e, 0xffbb0c, 0xffbb0c, 0xffba0b, 0xffba0c, 0xffb90b, 0xffb90b, 0xffb80b, 0xffb80b, 0xffb70b, 0xffb70b, 0xf3b31d, 0xa09e9b, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x959595, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xcbac5c, 0xffba0b, 0xfeba0b, 0xffb90b, 0xfeb90b, 0xffb80b, 0xfeb80b, 0xffb70b, 0xfeb70a, 0xffb60b, 0xfeb60a, 0xffb60a, 0xfeb50a, 0xccaa5b, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0x444444, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x707070, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xaaa699, 0xfab914, 0xffba0c, 0xffb90b, 0xffb90c, 0xffb80b, 0xffb80b, 0xffb70b, 0xffb70b, 0xffb60b, 0xffb60b, 0xffb50b, 0xffb50b, 0xffb40a, 0xfab313, 0xa9a498, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0x5e5e5e, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x8b8b8b, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xd9b14c, 0xfeb80b, 0xfeb80b, 0xfeb70b, 0xffb70b, 0xfeb60a, 0xfeb60a, 0xfeb60a, 0xffb50a, 0xfeb50a, 0xfeb40a, 0xfeb40a, 0xfeb30a, 0xfeb30a, 0xfeb20a, 0xd9ac4a, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0x7c7c7c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x363636, 0xa7a7a7, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xb5aa91, 0xfeb80d, 0xffb80b, 0xffb80b, 0xffb70b, 0xffb70b, 0xffb60b, 0xffb60b, 0xffb50a, 0xffb50b, 0xffb40a, 0xffb40a, 0xffb30a, 0xffb30a, 0xffb20a, 0xffb20a, 0xfeb10c, 0xb5aa92, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0x9c9c9c, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xe6b43a, 0xffb70b, 0xfeb60a, 0xffb60b, 0xfeb60a, 0xffb50a, 0xfeb50a, 0xffb40a, 0xfeb40a, 0xffb40a, 0xfeb30a, 0xffb20a, 0xfeb20a, 0xffb20a, 0xfeb109, 0xffb109, 0xfeb009, 0xe6ae39, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x717171, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xc2b085, 0xffb70b, 0xffb70b, 0xffb60b, 0xffb60b, 0xffb50b, 0xffb50b, 0xffb40a, 0xffb40b, 0xffb30a, 0xffb30a, 0xffb20a, 0xffb20a, 0xffb10a, 0xffb10a, 0xffb00a, 0xffb00a, 0xffaf0a, 0xffaf0a, 0xc2ae85, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0x636363, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x8e8e8e, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb1b0af, 0xf1b526, 0xfeb50a, 0xffb50a, 0xfeb40a, 0xfeb40a, 0xfeb40a, 0xffb30a, 0xfeb30a, 0xfeb20a, 0xfeb209, 0xfeb10a, 0xfeb109, 0xfeb009, 0xfeb009, 0xfeb009, 0xfeaf09, 0xfeaf09, 0xfeae09, 0xfeae09, 0xf1ad25, 0xb1b0af, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0x818181, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x343434, 0xacacac, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xd0b472, 0xffb60b, 0xffb50a, 0xffb50b, 0xffb40a, 0xffb40a, 0xffb30a, 0xffb30a, 0xffb20a, 0xdc9e15, 0x90712e, 0x91712e, 0xdd9c15, 0xffb00a, 0xffaf09, 0xffaf0a, 0xffae09, 0xffae09, 0xffad09, 0xffad09, 0xffac09, 0xd0b071, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xa3a3a3, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb8b5ae, 0xf8b519, 0xffb40a, 0xfeb40a, 0xffb30a, 0xfeb30a, 0xffb20a, 0xfeb20a, 0xffb10a, 0xfeb109, 0x564f40, 0x444444, 0x444444, 0x564e3e, 0xfeaf09, 0xfeae09, 0xffae09, 0xfead09, 0xfead09, 0xfeac08, 0xffac09, 0xfeab08, 0xf8ac17, 0xb8b5ae, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0x484848, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x727272, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xdcb660, 0xffb40a, 0xffb40b, 0xffb30a, 0xffb30a, 0xffb20a, 0xffb20a, 0xffb10a, 0xffb10a, 0xeba510, 0x444444, 0x434343, 0x434343, 0x424242, 0xeca30f, 0xffad09, 0xffad09, 0xffac09, 0xffac09, 0xffac09, 0xffab09, 0xffab09, 0xffaa09, 0xdcb15e, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x909090, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xc1b9a8, 0xfcb30f, 0xfeb20a, 0xfeb20a, 0xfeb109, 0xfeb10a, 0xfeb009, 0xfeb009, 0xfeb009, 0xfeaf09, 0xe6a110, 0x424242, 0x424242, 0x414141, 0x414141, 0xe69e10, 0xfeac08, 0xfeac08, 0xfeab08, 0xfeab08, 0xfeaa08, 0xfeaa08, 0xfea908, 0xfea908, 0xfca90d, 0xc1b8a8, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0x868686, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x313131, 0xb0b0b0, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xe6b74c, 0xffb30a, 0xffb20a, 0xffb20a, 0xffb10a, 0xffb10a, 0xffb009, 0xffb00a, 0xffaf09, 0xffaf09, 0xe7a010, 0x414141, 0x414141, 0x414141, 0x404040, 0xe79e10, 0xffab09, 0xffab09, 0xffaa08, 0xffaa09, 0xffa908, 0xffa908, 0xffa808, 0xffa808, 0xffa808, 0xe7af4b, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xa9a9a9, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x525252, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xcbbc9b, 0xfeb209, 0xffb10a, 0xfeb109, 0xffb009, 0xfeb009, 0xffaf09, 0xfeaf09, 0xfeae09, 0xfeae09, 0xffae09, 0xe69f10, 0x404040, 0x3f3f3f, 0x3f3f3f, 0x3e3e3e, 0xe69d0f, 0xfeaa08, 0xfeaa08, 0xfea908, 0xfea908, 0xfea808, 0xfea808, 0xfea707, 0xfea708, 0xfea607, 0xfea607, 0xcbba9b, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0x494949, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x727272, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xf1b533, 0xffb10a, 0xffb10a, 0xffb00a, 0xffb00a, 0xffaf09, 0xffaf0a, 0xffae09, 0xffae09, 0xffad09, 0xffad09, 0xe79e10, 0x3f3f3f, 0x3e3e3e, 0x3e3e3e, 0x3d3d3d, 0xe79c10, 0xffaa08, 0xffa909, 0xffa908, 0xffa808, 0xffa808, 0xffa708, 0xffa708, 0xffa608, 0xffa608, 0xffa608, 0xf1ab31, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0x6a6a6a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x929292, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xd6be89, 0xfeb009, 0xfeaf09, 0xfeaf09, 0xfeae09, 0xfeae09, 0xfeae09, 0xfead09, 0xfead08, 0xfeac09, 0xfeac08, 0xfeab08, 0xe69d0f, 0x3d3d3d, 0x3c3c3c, 0x3c3c3c, 0x3b3b3b, 0xe69b0e, 0xfea808, 0xfea808, 0xfea707, 0xfea708, 0xfea607, 0xfea607, 0xfea507, 0xfea507, 0xfea407, 0xfea407, 0xfea307, 0xd6ba89, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0x8c8c8c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x2e2e2e, 0xb4b4b4, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc9c8c6, 0xf8b321, 0xffb00a, 0xffaf09, 0xffaf09, 0xffae09, 0xffae09, 0xffad09, 0xffad09, 0xffac09, 0xffac09, 0xffab09, 0xffab09, 0xe79c0f, 0x3c3c3c, 0x3c3c3c, 0x3b3b3b, 0x3b3b3b, 0xe69a0e, 0xffa708, 0xffa708, 0xffa608, 0xffa608, 0xffa608, 0xffa508, 0xfea507, 0xffa407, 0xffa407, 0xffa307, 0xfea307, 0xf8a71f, 0xc8c7c5, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xafafaf, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x505050, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xe1be76, 0xfeaf09, 0xfeae09, 0xfeae09, 0xffad09, 0xfead09, 0xfeac09, 0xfeac08, 0xffac09, 0xfeab08, 0xfeab08, 0xfeaa08, 0xfeaa08, 0xe69b0e, 0x3b3b3b, 0x3a3a3a, 0x3a3a3a, 0x393939, 0xe5990e, 0xfea607, 0xfea607, 0xfea507, 0xfea507, 0xfea407, 0xfea407, 0xfea307, 0xfea307, 0xfea207, 0xfea207, 0xfea106, 0xfea107, 0xe0b774, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0x4b4b4b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x717171, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xd0cbc2, 0xfbb117, 0xffae09, 0xffae09, 0xffad09, 0xffad09, 0xffac09, 0xffac09, 0xffab09, 0xffab09, 0xffaa08, 0xffaa09, 0xffa908, 0xffa909, 0xe69a0e, 0x3a3a3a, 0x393939, 0x393939, 0x383838, 0xe6980e, 0xffa608, 0xffa508, 0xffa507, 0xffa408, 0xffa407, 0xffa407, 0xffa307, 0xffa307, 0xffa207, 0xffa207, 0xffa107, 0xffa107, 0xfba315, 0xd0cbc2, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0x6e6e6e, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x939393, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xe9bc60, 0xfead09, 0xfeac08, 0xfeac09, 0xfeac08, 0xfeab08, 0xfeab08, 0xfeaa08, 0xfeaa08, 0xfea908, 0xfea908, 0xfea808, 0xfea808, 0xfea808, 0xe5990d, 0x383838, 0x373737, 0x373737, 0x363636, 0xe5970d, 0xfea407, 0xfea407, 0xfea307, 0xfea307, 0xfea206, 0xfea207, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xe9b45f, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0x929292, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x2a2a2a, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xb0a691, 0xfdad0c, 0xffad09, 0xffac09, 0xffac09, 0xffab09, 0xffab09, 0xffaa08, 0xffaa08, 0xffa908, 0xffa908, 0xfea808, 0xffa808, 0xffa708, 0xffa708, 0xe5980e, 0x373737, 0x363636, 0x363636, 0x353535, 0xe6960d, 0xfea407, 0xffa307, 0xfea307, 0xffa207, 0xfea207, 0xffa107, 0xfea106, 0xffa007, 0xfea006, 0xffa007, 0xfe9f06, 0xff9f06, 0xfe9e06, 0xfd9e09, 0xb0a491, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xb88010, 0xfeac08, 0xffab09, 0xfeab08, 0xfeaa08, 0xfeaa08, 0xfea908, 0xfea908, 0xfea808, 0xfea808, 0xfea808, 0xfea707, 0xfea708, 0xfea607, 0xfea607, 0xf8a208, 0x3a3834, 0x353535, 0x353535, 0x393733, 0xf89f08, 0xfea207, 0xfea207, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xfe9e06, 0xfe9d06, 0xfe9d06, 0xfe9d05, 0xfe9c06, 0xb7740e, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x523f1b, 0xffac09, 0xffab09, 0xffab09, 0xffaa08, 0xffaa09, 0xffa908, 0xffa908, 0xffa808, 0xffa808, 0xffa708, 0xffa708, 0xffa608, 0xffa608, 0xffa508, 0xffa508, 0xffa407, 0xa9751b, 0x353434, 0x353533, 0xab7519, 0xffa207, 0xffa207, 0xffa107, 0xffa107, 0xffa007, 0xffa007, 0xffa007, 0xfe9f06, 0xff9f06, 0xff9e06, 0xff9e06, 0xfe9d06, 0xff9d06, 0xff9c06, 0xff9c06, 0xfe9b06, 0x523b1a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd38f0d, 0xfeaa08, 0xfeaa08, 0xfea908, 0xfea908, 0xfea808, 0xfea808, 0xfea708, 0xfea707, 0xfea607, 0xfea607, 0xfea607, 0xfea507, 0xfea507, 0xfea407, 0xfea407, 0xfea307, 0xfea307, 0xe9970a, 0xea970b, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xfe9e06, 0xfe9d05, 0xfe9d06, 0xfe9c05, 0xfe9c06, 0xfe9b05, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xd3810a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x715318, 0xffaa08, 0xffaa08, 0xffa908, 0xffa908, 0xffa808, 0xffa808, 0xffa708, 0xffa708, 0xffa608, 0xffa608, 0xffa507, 0xffa508, 0xfea407, 0xffa407, 0xffa307, 0xffa307, 0xfea207, 0xffa207, 0xffa207, 0xffa107, 0xfea106, 0xffa007, 0xfea006, 0xff9f07, 0xfe9f06, 0xff9e06, 0xfe9e06, 0xff9e06, 0xfe9d06, 0xff9d06, 0xfe9c06, 0xff9c06, 0xfe9b05, 0xff9b06, 0xfe9a05, 0xff9a05, 0xfe9905, 0xff9905, 0x704b16, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x27241f, 0xe89b0b, 0xfea908, 0xfea808, 0xfea808, 0xfea708, 0xfea707, 0xfea608, 0xfea607, 0xfea607, 0xfea507, 0xfea507, 0xfea407, 0xfea407, 0xfea307, 0xfea307, 0xfea207, 0xfea207, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xfe9e06, 0xfe9d06, 0xfe9d06, 0xfe9c05, 0xfe9c06, 0xfe9b05, 0xfe9b05, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xfe9905, 0xfe9805, 0xfe9804, 0xfe9705, 0xe78b07, 0x27241f, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x4c4c4c, 0x4c4c4c, 0x4c4c4c, 0x4b4b4b, 0x4b4b4b, 0x4b4b4b, 0x4b4b4b, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x494949, 0x494949, 0x494949, 0x494949, 0x484848, 0x484848, 0x484848, 0x484848, 0x474747, 0x474747, 0x474747, 0x464646, 0x464646, 0x464646, 0x464646, 0x454545, 0x9f7627, 0xffa908, 0xffa808, 0xffa808, 0xffa708, 0xffa708, 0xffa608, 0xffa608, 0xffa508, 0xffa508, 0xffa407, 0xffa408, 0xffa307, 0xffa307, 0xffa207, 0xffa207, 0xffa207, 0xffa107, 0xffa107, 0xffa007, 0xffa007, 0xff9f07, 0xff9f06, 0xff9e06, 0xff9e06, 0xff9e06, 0xff9d06, 0xff9d06, 0xff9c06, 0xff9c06, 0xfe9b06, 0xff9b06, 0xff9a05, 0xff9a06, 0xfe9905, 0xff9905, 0xff9805, 0xff9805, 0xfe9705, 0xff9705, 0xfe9605, 0x996620, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x393939, 0x393939, 0x393939, 0x393939, 0x383838, 0x383838, 0x383838, 0x383838, 0x373737, 0x373737, 0x373737, 0x373737, 0x363636, 0x363636, 0x363636, 0x353535, 0x353535, 0x353535, 0x353535, 0x343434, 0x343434, 0x343434, 0x343434, 0x333333, 0x333333, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xbbb4a6, 0xfba80e, 0xfea708, 0xfea607, 0xfea607, 0xfea607, 0xfea507, 0xfea507, 0xfea407, 0xfea407, 0xfea307, 0xfea307, 0xfea207, 0xfea206, 0xfea207, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xe4910b, 0xa97016, 0xa97016, 0xe69009, 0xfe9d06, 0xfe9c05, 0xfe9c05, 0xfe9b05, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xfe9905, 0xfe9805, 0xfe9805, 0xfe9704, 0xfe9704, 0xfe9704, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xf99409, 0x92897d, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xe2ad4c, 0xffa708, 0xffa708, 0xfea608, 0xffa608, 0xffa507, 0xffa508, 0xfea407, 0xffa407, 0xfea307, 0xffa307, 0xfea207, 0xffa207, 0xfea107, 0xffa107, 0xfea006, 0xffa007, 0xfe9f06, 0xff9f06, 0xab7115, 0x2f2e2d, 0x2c2c2c, 0x2c2c2c, 0x2d2c2b, 0xac7014, 0xfe9c06, 0xff9b06, 0xfe9b05, 0xff9a06, 0xfe9a05, 0xff9a05, 0xfe9905, 0xff9905, 0xfe9805, 0xff9805, 0xfe9705, 0xff9705, 0xfe9605, 0xff9605, 0xfe9504, 0xfe9504, 0xfe9404, 0xff9404, 0xcf8f38, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xc2b399, 0xfea609, 0xfea607, 0xfea507, 0xfea507, 0xfea407, 0xfea407, 0xfea407, 0xfea307, 0xfea307, 0xfea206, 0xfea207, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xf99b07, 0x322f2a, 0x2b2b2b, 0x2b2b2b, 0x2a2a2a, 0x292929, 0x332f28, 0xfc9905, 0xfe9a05, 0xfe9905, 0xfe9905, 0xfe9805, 0xfe9805, 0xfe9704, 0xfe9705, 0xfe9704, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xfe9404, 0xfe9404, 0xfe9304, 0xfe9304, 0xfe9304, 0xfd9204, 0x9b8971, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xecaa33, 0xffa608, 0xffa508, 0xffa508, 0xffa407, 0xffa407, 0xffa307, 0xffa307, 0xffa207, 0xffa207, 0xffa107, 0xffa107, 0xffa007, 0xffa007, 0xffa006, 0xff9f07, 0xfe9e06, 0xff9e06, 0xff9e06, 0xe18d0b, 0x2b2b2b, 0x2a2a2a, 0x2a2a2a, 0x292929, 0x292929, 0x282828, 0xe18b0a, 0xff9a06, 0xfe9905, 0xff9905, 0xfe9805, 0xff9805, 0xfe9705, 0xff9705, 0xfe9605, 0xff9605, 0xfe9504, 0xff9505, 0xfe9404, 0xff9404, 0xfe9304, 0xff9304, 0xfe9204, 0xff9204, 0xfe9104, 0xe18f25, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xccb284, 0xfea407, 0xfea407, 0xfea407, 0xfea307, 0xfea307, 0xfea207, 0xfea206, 0xfea107, 0xfea106, 0xfea006, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xfe9e06, 0xfe9d05, 0xfe9d06, 0xfe9c05, 0xfb9a06, 0x2f2c28, 0x292929, 0x282828, 0x282828, 0x272727, 0x302c25, 0xfb9705, 0xfe9805, 0xfe9704, 0xfe9704, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xfe9504, 0xfe9404, 0xfe9404, 0xfe9304, 0xfe9303, 0xfe9204, 0xfe9203, 0xfe9103, 0xfe9103, 0xfe9103, 0xfe9003, 0xfe9003, 0xa88960, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xbab9b7, 0xf5a821, 0xfea407, 0xffa407, 0xffa307, 0xffa307, 0xfea207, 0xffa207, 0xffa107, 0xffa107, 0xfea006, 0xffa007, 0xfe9f06, 0xff9f06, 0xfe9e06, 0xff9e06, 0xfe9d06, 0xff9d06, 0xfe9c06, 0xff9c06, 0xfe9c06, 0xff9b06, 0xa66c13, 0x282828, 0x272727, 0x272727, 0x262626, 0xa96b12, 0xfe9805, 0xff9805, 0xfe9705, 0xff9705, 0xfe9605, 0xff9605, 0xfe9504, 0xff9504, 0xfe9404, 0xff9404, 0xfe9304, 0xff9304, 0xfe9204, 0xff9204, 0xfe9104, 0xfe9104, 0xfe9003, 0xff9004, 0xfe8f03, 0xfe8f03, 0xed8d16, 0x878684, 0x848484, 0x848484, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xd5b06e, 0xfea307, 0xfea307, 0xfea207, 0xfea206, 0xfea207, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xfe9e06, 0xfe9d06, 0xfe9d06, 0xfe9c05, 0xfe9c06, 0xfe9b05, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xc0780e, 0x6e4c1b, 0x714d1a, 0xc2780d, 0xfe9705, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xfe9504, 0xfe9404, 0xfe9404, 0xfe9304, 0xfe9304, 0xfe9204, 0xfe9203, 0xfe9104, 0xfe9103, 0xfe9103, 0xfe9003, 0xfe9003, 0xfe8f03, 0xfe8f03, 0xfe8e03, 0xfe8e03, 0xfe8d03, 0xb68850, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xf8a517, 0xffa307, 0xffa207, 0xffa207, 0xffa107, 0xffa107, 0xffa007, 0xffa007, 0xff9f06, 0xff9f07, 0xff9e06, 0xff9e06, 0xff9d06, 0xff9d06, 0xff9d06, 0xff9c06, 0xff9c06, 0xff9b06, 0xfe9b05, 0xff9a06, 0xff9a05, 0xff9a06, 0xfe9905, 0xff9905, 0xff9805, 0xff9805, 0xfe9705, 0xff9705, 0xfe9605, 0xff9605, 0xfe9504, 0xff9505, 0xfe9404, 0xff9404, 0xfe9304, 0xff9304, 0xfe9204, 0xff9204, 0xfe9104, 0xff9104, 0xfe9004, 0xff9004, 0xfe8f03, 0xff8f03, 0xfe8e03, 0xff8e03, 0xfe8d03, 0xff8d03, 0xfe8d03, 0xf38c0f, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xceb282, 0xfea206, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xfe9e06, 0xfe9e06, 0xfe9d05, 0xfe9d06, 0xfe9c05, 0xfe9c05, 0xfe9b05, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xfe9905, 0xfe9805, 0xfe9805, 0xfe9704, 0xfe9704, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xfe9404, 0xfe9404, 0xfe9304, 0xfe9304, 0xfe9203, 0xfe9204, 0xfe9103, 0xfe9103, 0xfe9103, 0xfe9003, 0xfe9003, 0xfe8f03, 0xfe8f03, 0xfe8e03, 0xfe8e02, 0xfe8d03, 0xfe8d02, 0xfe8d02, 0xfe8c02, 0xfe8c02, 0xfe8b02, 0xfe8b02, 0xa7865e, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xd9af69, 0xfea107, 0xffa107, 0xfea006, 0xffa007, 0xfe9f06, 0xff9f06, 0xfe9e06, 0xff9e06, 0xfe9d06, 0xff9d06, 0xfe9c06, 0xff9c06, 0xfe9b06, 0xff9b06, 0xfe9a05, 0xff9a05, 0xfe9a05, 0xff9905, 0xfe9805, 0xff9805, 0xfe9805, 0xff9705, 0xfe9705, 0xff9605, 0xfe9604, 0xff9605, 0xfe9504, 0xfe9504, 0xfe9404, 0xff9404, 0xfe9304, 0xfe9304, 0xfe9204, 0xff9204, 0xfe9103, 0xfe9104, 0xfe9003, 0xfe9004, 0xfe8f03, 0xfe8f03, 0xfe8e03, 0xfe8e03, 0xfe8d03, 0xfe8d03, 0xfe8c03, 0xfe8c03, 0xfe8b02, 0xfe8b03, 0xfe8a02, 0xfe8a02, 0x824f13, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xd7ae6c, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xfe9e06, 0xfe9e06, 0xfe9d05, 0xfe9d06, 0xfe9c05, 0xfe9c06, 0xfe9b05, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xfe9905, 0xfe9805, 0xfe9805, 0xfe9704, 0xfe9705, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xfe9404, 0xfe9404, 0xfe9304, 0xfe9304, 0xfe9204, 0xfe9204, 0xfe9203, 0xfe9103, 0xfe9103, 0xfe9003, 0xfe9003, 0xfe8f03, 0xfe8f03, 0xfe8f03, 0xfe8e03, 0xfe8e03, 0xfe8d02, 0xfe8d03, 0xfe8c02, 0xfe8c02, 0xfe8b02, 0xfe8b02, 0xfe8a02, 0xfe8a02, 0xfe8902, 0xfe8902, 0x7e4c13, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xc8b596, 0xff9f06, 0xff9f07, 0xfe9e06, 0xff9e06, 0xff9d06, 0xff9d06, 0xfe9c06, 0xff9c06, 0xff9b06, 0xff9b06, 0xfe9a05, 0xff9a06, 0xfe9a05, 0xff9905, 0xfe9905, 0xff9805, 0xfe9805, 0xff9705, 0xfe9705, 0xff9605, 0xfe9605, 0xff9605, 0xfe9504, 0xff9504, 0xfe9404, 0xff9404, 0xfe9304, 0xff9304, 0xfe9204, 0xff9204, 0xfe9104, 0xff9104, 0xfe9003, 0xff9004, 0xfe8f03, 0xff8f03, 0xfe8e03, 0xff8e03, 0xfe8d03, 0xff8d03, 0xfe8c03, 0xff8c03, 0xfe8b03, 0xfe8b03, 0xfe8a02, 0xff8a03, 0xfe8902, 0xfe8902, 0xfe8902, 0xff8802, 0x4c351a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xeca433, 0xfe9d06, 0xfe9d05, 0xfe9c06, 0xfe9c05, 0xfe9c05, 0xfe9b05, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xfe9905, 0xfe9805, 0xfe9805, 0xfe9704, 0xfe9704, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xfe9404, 0xfe9404, 0xfe9304, 0xfe9304, 0xfe9203, 0xfe9204, 0xfe9103, 0xfe9103, 0xfe9003, 0xfe9003, 0xfe8f03, 0xfe8f03, 0xfe8f03, 0xfe8e03, 0xfe8e02, 0xfe8d03, 0xfe8d02, 0xfe8c03, 0xfe8c02, 0xfe8b02, 0xfe8b02, 0xfe8b02, 0xfe8a02, 0xfe8a02, 0xfe8902, 0xfe8902, 0xfe8801, 0xfe8802, 0xfe8701, 0xe17b0a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xbeb7ad, 0xf3a224, 0xfe9c06, 0xff9c06, 0xfe9b06, 0xff9b06, 0xfe9a05, 0xff9a05, 0xfe9905, 0xff9905, 0xfe9805, 0xff9805, 0xfe9705, 0xff9705, 0xfe9705, 0xff9605, 0xfe9604, 0xff9505, 0xfe9504, 0xff9404, 0xfe9404, 0xff9404, 0xfe9304, 0xfe9304, 0xfe9204, 0xff9204, 0xfe9103, 0xfe9104, 0xfe9003, 0xff9004, 0xfe8f03, 0xfe8f03, 0xfe8e03, 0xfe8e03, 0xfe8d03, 0xfe8d03, 0xfe8c03, 0xfe8c03, 0xfe8b02, 0xfe8b03, 0xfe8a02, 0xfe8a02, 0xfe8902, 0xfe8902, 0xfe8802, 0xfe8802, 0xfe8702, 0xfe8702, 0xf6870a, 0x5d472f, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xbbb5ac, 0xe2a549, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xfe9905, 0xfe9805, 0xfe9805, 0xfe9704, 0xfe9705, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xfe9404, 0xfe9404, 0xfe9304, 0xfe9304, 0xfe9204, 0xfe9204, 0xfe9103, 0xfe9103, 0xfe9103, 0xfe9003, 0xfe8f03, 0xfe8f03, 0xfe8f03, 0xfe8e03, 0xfe8e03, 0xfe8d03, 0xfe8d02, 0xfe8d03, 0xfe8c02, 0xfe8b02, 0xfe8b02, 0xfe8b02, 0xfe8a02, 0xfe8a02, 0xfe8902, 0xfe8902, 0xfe8801, 0xfe8802, 0xfe8701, 0xfe8702, 0xfa8605, 0xd08635, 0x91867a, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xc3af90, 0xc7ad88, 0xc5ac87, 0xc5ac87, 0xc4aa85, 0xc4aa85, 0xc2a884, 0xc1a783, 0xc1a682, 0xc0a681, 0xbfa580, 0xbea480, 0xbea37f, 0xbda27e, 0xbca17d, 0xbba07d, 0xbb9f7c, 0xba9f7b, 0xb99e7a, 0xb89d7a, 0xb89c79, 0xb79b78, 0xb59976, 0xb59976, 0xb49875, 0xb49875, 0xb29673, 0xb29673, 0xb19472, 0xb19472, 0xaf9370, 0xaf9270, 0xae916f, 0xad906e, 0xac8f6d, 0xac8e6c, 0xab8d6c, 0xaa8d6b, 0xa98c6a, 0xa98b69, 0xa88a69, 0xa2896e, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x949494, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0x9f9f9f, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xc6c6c6, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x868686, 0x868686, 0x848484, 0x848484, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x565656, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x9a9a9a, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa3a3a3, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x797979, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x999999, 0x979797, 0x979797, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x353535, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xbfbfbf, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x949494, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x464646, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0x9f9f9f, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x7f7f7f, 0xbababa, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x626262, 0x484848, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x3a3a3a, 0x4b4b4b, 0x4b4b4b, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x494949, 0x494949, 0x494949, 0x494949, 0x484848, 0x484848, 0x484848, 0x484848, 0x474747, 0x474747, 0x474747, 0x464646, 0x464646, 0x464646, 0x464646, 0x454545, 0x454545, 0x454545, 0x454545, 0x444444, 0x444444, 0x444444, 0x444444, 0x434343, 0x434343, 0x434343, 0x424242, 0x424242, 0x424242, 0x424242, 0x414141, 0x414141, 0x414141, 0x414141, 0x404040, 0x404040, 0x404040, 0x404040, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3b3b3b, 0x3b3b3b, 0x3b3b3b, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x393939, 0x393939, 0x393939, 0x393939, 0x383838, 0x383838, 0x383838, 0x383838, 0x373737, 0x373737, 0x373737, 0x373737, 0x363636, 0x363636, 0x363636, 0x353535, 0x353535, 0x353535, 0x353535, 0x272727, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, - 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020 -}; \ No newline at end of file diff --git a/dev/Boot/BootKit/Rsrc/zka_swirl.rsrc b/dev/Boot/BootKit/Rsrc/zka_swirl.rsrc deleted file mode 100644 index 0cb11bde..00000000 --- a/dev/Boot/BootKit/Rsrc/zka_swirl.rsrc +++ /dev/null @@ -1,70 +0,0 @@ -#define ZKA_SWIRL_HEIGHT 64 -#define ZKA_SWIRL_WIDTH 64 - -// array size is 12288 (32x32) -const unsigned int zka_swirl[] = { - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xf5f5f5, 0x7b7893, 0x020039, 0x020239, 0x01013a, 0x01013b, 0x00013b, 0x00013b, 0x01033f, 0x8587a0, 0xf7f7f7, 0xf7f7f7, 0xf8f8f8, 0xf7f7f7, 0xf5f5f5, 0xf7f7f7, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xf7f7f7, 0xf6f6f6, 0xf6f6f6, 0xd4d2da, 0x1e174b, 0x030138, 0x020139, 0x010139, 0x01013a, 0x00013a, 0x1a1e53, 0xcbccd5, 0xf6f6f6, 0xf6f6f6, 0xf6f6f6, 0xf6f6f6, 0xf6f6f6, 0xf6f6f6, 0xf5f5f6, 0xf6f6f6, 0xcdcbd6, 0x2b2453, 0x2a2a55, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xf6f6f6, 0xf6f6f6, 0xf5f5f5, 0xf5f5f5, 0xe9e9ec, 0x302856, 0x050137, 0x040138, 0x020139, 0x010139, 0x01013a, 0x4a4c74, 0xe0e0e5, 0xf5f5f5, 0xf5f5f5, 0xf6f6f6, 0xf5f5f5, 0xf5f5f5, 0xf5f5f5, 0xebebee, 0xb8b6c4, 0x554e74, 0x140940, 0x0b0135, 0x0d0134, 0x100235, 0x0a0033, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xbfbfbf, 0xf6f6f6, 0xf4f4f4, 0xf5f5f5, 0xf5f5f5, 0xf5f5f5, 0xf5f5f5, 0x756e8c, 0x070136, 0x060137, 0x040138, 0x030138, 0x020139, 0x6a6a8b, 0xecedef, 0xf5f5f5, 0xf5f5f5, 0xf5f5f5, 0xf5f5f5, 0xf5f5f5, 0xeeeef0, 0x908ea6, 0x272152, 0x060137, 0x060136, 0x0a0135, 0x0b0135, 0x0d0134, 0x100134, 0x120133, 0x130032, 0x1c0039, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x1d0031, 0x746583, 0xf4f4f4, 0xf4f4f4, 0xf4f4f4, 0xf4f4f4, 0xf4f4f4, 0xb6b3c0, 0x0a0135, 0x070136, 0x060137, 0x040137, 0x030138, 0x7a7994, 0xf4f4f4, 0xf5f5f5, 0xf4f4f4, 0xf4f4f4, 0xf4f4f4, 0xf3f3f3, 0x9999af, 0x131147, 0x030138, 0x040137, 0x060137, 0x090136, 0x0a0135, 0x0c0135, 0x0e0135, 0x110133, 0x120133, 0x140133, 0x160132, 0x180031, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x200030, 0x1d012e, 0x1b0130, 0xcdc8d1, 0xf4f4f4, 0xf4f4f4, 0xf4f4f4, 0xf4f4f4, 0xe6e6e9, 0x241549, 0x0b0135, 0x090136, 0x060137, 0x050137, 0x656183, 0xf4f4f4, 0xf3f3f4, 0xf4f4f4, 0xf4f4f4, 0xf3f3f3, 0xc9cad3, 0x3d3e6a, 0x010139, 0x020139, 0x030138, 0x050137, 0x060136, 0x090136, 0x0b0135, 0x0d0135, 0x100134, 0x120134, 0x3e2b56, 0x645476, 0x7d708a, 0x9a8fa3, 0xcfcbd3, 0xf7f7f7, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x220031, 0x20012e, 0x1e012e, 0x5b4567, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0x837993, 0x0d0134, 0x0c0135, 0x0a0136, 0x060137, 0x5d587c, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0x82849f, 0x010340, 0x01013a, 0x010139, 0x020139, 0x030138, 0x060137, 0x070137, 0x0a0136, 0x392d5a, 0x8b849b, 0xbfbac6, 0xeaeaec, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf4f4f4, 0xf4f4f4, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x550055, 0x24002d, 0x22012d, 0x21012e, 0x20012e, 0xa99eb0, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xdcdadf, 0x1f0b3f, 0x0e0134, 0x0c0135, 0x0a0136, 0x2d2353, 0xe0dee3, 0xf2f2f2, 0xf3f3f3, 0xf3f3f3, 0xe9e9eb, 0x5c5f83, 0x00013c, 0x00013c, 0x01013a, 0x010139, 0x030138, 0x040138, 0x251e50, 0x86829b, 0xceccd5, 0xf2f2f3, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf2f2f2, 0xf2f2f2, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf2f2f2, 0xf2f2f3, 0xf4f4f4, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0x320937, 0x25012c, 0x23012c, 0x23012e, 0x240232, 0xe2dfe3, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0x6a5c7c, 0x120133, 0x100134, 0x0d0134, 0x1b0d42, 0xd0cfd7, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xd6d6dc, 0x333463, 0x00013c, 0x00013d, 0x00013c, 0x01013a, 0x020139, 0x363360, 0xa4a2b5, 0xececee, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf3f3f3, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xeae9ea, 0x2a012c, 0x27012c, 0x25012c, 0x23012d, 0x52365b, 0xf1f1f1, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xdedce0, 0x1a0235, 0x130133, 0x110133, 0x0d0134, 0x9791a6, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xd5d5db, 0x282758, 0x00013a, 0x00013c, 0x00013c, 0x00013c, 0x1b1e52, 0x9f9eb3, 0xf1f1f1, 0xf2f2f2, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf2f2f2, 0xf1f1f1, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf1f1f1, 0xf1f1f1, 0xf2f2f2, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf2f2f2, 0xf1f1f1, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xf1f1f1, 0xd9d4d9, 0x2a012b, 0x28012b, 0x27012c, 0x25012c, 0x8b7990, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0x897c94, 0x170131, 0x140132, 0x120133, 0x473962, 0xf0f0f0, 0xf1f1f1, 0xf1f1f1, 0xe4e3e7, 0x2e2b5b, 0x010139, 0x01013a, 0x00013c, 0x00013d, 0x6c6e8e, 0xe9e9eb, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf0f0f0, 0xdad6dc, 0xbdb6c2, 0xb1a9b6, 0xaea2b3, 0xaea2b2, 0xb2a7b5, 0xb9afba, 0xc4bac4, 0xdfdadf, 0xf1f1f1, 0xf1f1f1, 0xeaeaea, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xf0f0f0, 0xf0f0f0, 0xbfb4be, 0x2b012a, 0x2a012b, 0x29012b, 0x27012c, 0xbcb3bd, 0xf0f0f0, 0xf0f0f0, 0xf0f0f0, 0xeff0f0, 0x452d56, 0x180131, 0x150132, 0x130133, 0xc2bec9, 0xf0f0f0, 0xf1f1f1, 0xeff0f0, 0x423c65, 0x030138, 0x020139, 0x01013b, 0x0a0e49, 0x9fa1b5, 0xf1f1f1, 0xf0f0f0, 0xf0f0f0, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xe7e6e8, 0xa9a2b4, 0x756885, 0x3f2a54, 0x1f0536, 0x1a0131, 0x1c0130, 0x1f012e, 0x21012e, 0x22012d, 0x24012d, 0x25012c, 0x28012b, 0x29012b, 0x330634, 0x563255, 0x5f375b, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xf2f2f2, 0xf0f0f0, 0xf0f0f0, 0xaa98a9, 0x2d012a, 0x2b012a, 0x2a012a, 0x29012c, 0xd6d1d7, 0xf0f0f0, 0xf0f0f0, 0xf0f0f0, 0xc6bfc9, 0x1c0130, 0x1a0130, 0x180132, 0x615273, 0xf0f0f0, 0xf0f0f0, 0xeff0f0, 0x7f7993, 0x060137, 0x030138, 0x020139, 0x242657, 0xd4d4da, 0xeff0f0, 0xf0f0f0, 0xeff0f0, 0xf0f0f0, 0xf0f0f0, 0xe2e1e4, 0x9793a9, 0x4d4168, 0x140338, 0x120133, 0x140132, 0x180132, 0x1a0131, 0x1c0130, 0x1f012e, 0x20012e, 0x22012d, 0x24012d, 0x25012c, 0x28012b, 0x29002a, 0x2b012a, 0x2c012a, 0x2d012a, 0x2e0129, 0x2f0028, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xf0f0f0, 0xeef0f0, 0xeff0f0, 0xeff0f0, 0xa08d9e, 0x2e0029, 0x2d012a, 0x2b012a, 0x411841, 0xedeced, 0xeff0f0, 0xeff0f0, 0xeff0f0, 0x8f8196, 0x1e012e, 0x1b0130, 0x190131, 0xc6c2cb, 0xeff0f0, 0xeff0f0, 0xbfbbc7, 0x10033a, 0x060136, 0x040138, 0x353360, 0xd9d8de, 0xeff0f0, 0xeff0f0, 0xeff0f0, 0xeff0f0, 0xd8d7dd, 0x807c96, 0x1b1045, 0x0b0135, 0x0d0135, 0x100133, 0x130132, 0x150132, 0x190131, 0x1b0130, 0x1e0130, 0x20012e, 0x22012d, 0x24012d, 0x25012c, 0x28012b, 0x29012b, 0x2b012a, 0x2c012a, 0x2d012a, 0x300129, 0x310128, 0x320129, 0x320027, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xc4b9c3, 0xefeff0, 0xeff0f0, 0xeff0f0, 0x9e899a, 0x310129, 0x2e0129, 0x2d012a, 0x5e3c5d, 0xefeff0, 0xefefef, 0xeff0f0, 0xeff0f0, 0x5e4466, 0x20012e, 0x1c0130, 0x452e57, 0xeff0f0, 0xefefef, 0xe7e6e9, 0x312150, 0x0b0135, 0x070137, 0x272051, 0xd7d6dc, 0xefeff0, 0xeff0f0, 0xefefef, 0xebebec, 0x9595ab, 0x151046, 0x050137, 0x070136, 0x0b0135, 0x0e0134, 0x120133, 0x140133, 0x250b3d, 0x371e49, 0x4f375c, 0x5c4366, 0x5e4465, 0x55385c, 0x45244c, 0x370e3a, 0x2b012c, 0x2b012b, 0x2c012a, 0x2e012a, 0x300129, 0x310128, 0x320128, 0x340128, 0x350027, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x3a0025, 0x8a6a80, 0xefefef, 0xefefef, 0xefefef, 0x9f899a, 0x320028, 0x310028, 0x300129, 0x795c76, 0xefefef, 0xefefef, 0xefefef, 0xe3e0e3, 0x2c0635, 0x22012e, 0x20012e, 0x9d92a5, 0xefefef, 0xefefef, 0x877d95, 0x100134, 0x0c0135, 0x1b1044, 0xd1d1d7, 0xefefef, 0xefefef, 0xefefef, 0xcccdd5, 0x333462, 0x010139, 0x030138, 0x060137, 0x0a0137, 0x3f335d, 0x7e748e, 0xaca6b5, 0xe0dde2, 0xefefef, 0xefefef, 0xefefef, 0xefefef, 0xefefef, 0xefefef, 0xefefef, 0xefefef, 0xe7e6e7, 0xc5bcc5, 0xa796a7, 0x755571, 0x4c1e44, 0x320028, 0x340127, 0x350127, 0x360127, 0x390027, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x2a002a, 0x3a0024, 0x7c5670, 0xeeeeee, 0xefefef, 0xefefef, 0xa48e9e, 0x340127, 0x330028, 0x310129, 0x81667e, 0xeeeeee, 0xeeeeee, 0xefefef, 0xc6bdc7, 0x26012c, 0x23012d, 0x21012d, 0xd7d3d9, 0xeeeeee, 0xe1e0e3, 0x2c1747, 0x110133, 0x0d0135, 0xaaa6b6, 0xefefef, 0xefefef, 0xeeeeee, 0xa2a3b5, 0x0a104a, 0x00013b, 0x020139, 0x130d44, 0x78748f, 0xc9c7cf, 0xefefef, 0xefefef, 0xeeeeef, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xefeeef, 0xefefef, 0xefeeef, 0xeeeded, 0xc3b7c1, 0x84657d, 0x4c193f, 0x370125, 0x370026, 0x400033, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x3e0027, 0x3d0024, 0x6a3d5b, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xad99a8, 0x360027, 0x350027, 0x330128, 0x876b81, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xb0a2b1, 0x28012b, 0x25012c, 0x4e3156, 0xeeeeee, 0xeeeeee, 0xa097a9, 0x170132, 0x120133, 0x756a87, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0x8c8ca3, 0x020340, 0x00013c, 0x0e1149, 0x8f8ea6, 0xe0e0e3, 0xeeeeee, 0xeeeeee, 0xe8e7e9, 0xd2cfd5, 0xb2acb8, 0x908398, 0x817089, 0x7d6983, 0x7c6783, 0x826c85, 0x907c91, 0xab9cac, 0xc2b9c2, 0xddd9dd, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xedecec, 0xb7a6b2, 0x714662, 0x3e0228, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x40152a, 0x3f0025, 0x3e0023, 0x4b0d34, 0xededed, 0xededed, 0xededed, 0xc1b5be, 0x380025, 0x360025, 0x350027, 0x866980, 0xededed, 0xededed, 0xededed, 0x958295, 0x2a012a, 0x28012c, 0x88758b, 0xededed, 0xededee, 0x4a3157, 0x180131, 0x220a3d, 0xd7d4d9, 0xededee, 0xededed, 0x8d8ba2, 0x04033d, 0x00013c, 0x4d5178, 0xd0d1d7, 0xededed, 0xe9e9eb, 0xbfbcc7, 0x756b89, 0x362552, 0x180134, 0x190131, 0x1c0130, 0x1f012e, 0x22012d, 0x24012c, 0x28012c, 0x2a012b, 0x2c012a, 0x2d012a, 0x350430, 0x633e5d, 0x998394, 0xc6bbc3, 0xececec, 0xeeeeee, 0xededed, 0xededed, 0xededed, 0xededed, 0xededed, 0xc8bbc2, 0xefefef, 0x000000, 0x000000, - 0x000000, 0x000000, 0x400023, 0x410022, 0x400022, 0x3f0023, 0xdbd5d9, 0xededed, 0xededed, 0xd9d3d7, 0x3a0025, 0x380125, 0x370025, 0x83627a, 0xededed, 0xededed, 0xededed, 0x897086, 0x2c012a, 0x2a012b, 0xb5abb6, 0xededed, 0xd2ced4, 0x1f012e, 0x1a0130, 0x8a7f95, 0xededed, 0xededed, 0xb5b3c0, 0x0b053d, 0x03023a, 0x8889a0, 0xe6e6e8, 0xe9e9eb, 0x9f9eb1, 0x36305c, 0x0a0137, 0x0e0134, 0x130133, 0x170132, 0x1a0130, 0x1f012e, 0x21012d, 0x24012c, 0x27012b, 0x2a012b, 0x2c012a, 0x2d0129, 0x310129, 0x320128, 0x330028, 0x350127, 0x360027, 0x5c2c4e, 0x94798b, 0xdbd6da, 0xededed, 0xededed, 0xededed, 0xededed, 0xededed, 0xeaeaea, 0x000000, 0x000000, - 0x000000, 0x7f0000, 0x430022, 0x430022, 0x420022, 0x410022, 0xb5a0ad, 0xededed, 0xededed, 0xe9e8e8, 0x3f0228, 0x3c0124, 0x390024, 0x77516b, 0xececec, 0xececec, 0xececec, 0x856a81, 0x300029, 0x2d012a, 0xcac3ca, 0xececec, 0x918195, 0x21012d, 0x2a0a3a, 0xe2e2e4, 0xececec, 0xd5d3d8, 0x1f1144, 0x120940, 0xacabb9, 0xececec, 0xc2c3cd, 0x2d2c5d, 0x030138, 0x060136, 0x2a1c4d, 0x6e6481, 0xa199ab, 0xb4aeba, 0xcdc8d0, 0xd6d3d8, 0xd4cfd4, 0xc6bec7, 0xb8aeb9, 0xa292a1, 0x745571, 0x400e38, 0x330128, 0x340027, 0x360027, 0x380127, 0x390125, 0x390025, 0x3c0124, 0x44062d, 0x856177, 0xdfdbde, 0xececec, 0xececec, 0xececec, 0xebecec, 0xffffff, 0x000000, - 0x000000, 0x8b6574, 0x460122, 0x450021, 0x440021, 0x430021, 0x967586, 0xececec, 0xecebeb, 0xececec, 0x693957, 0x3e0023, 0x3d0024, 0x602e4f, 0xececec, 0xececec, 0xececec, 0x866980, 0x330128, 0x300129, 0xe5e4e5, 0xececec, 0x6a4f6d, 0x24012d, 0x786580, 0xececec, 0xececec, 0x5c4e71, 0x100236, 0xb4b2be, 0xececec, 0x7b7d97, 0x020541, 0x111249, 0x716d8c, 0xc0bec8, 0xbcb9c4, 0xa49dae, 0x998fa1, 0x918498, 0x97899c, 0xa89bac, 0xbab1bb, 0xd8d3d8, 0xebebeb, 0xececec, 0xececec, 0xececec, 0xccc2c9, 0x937a8d, 0x542245, 0x3a0125, 0x3c0124, 0x3d0024, 0x3e0023, 0x3f0023, 0x400023, 0x4f1034, 0x9a7b8c, 0xe4e1e2, 0xececec, 0xececec, 0xeaeaea, 0x000000, - 0x000000, 0xe8e6e6, 0x672b49, 0x460021, 0x460021, 0x450021, 0x551436, 0xeaeaea, 0xececec, 0xebebeb, 0x8e6a7f, 0x400023, 0x3f0023, 0x4a0b32, 0xdedadd, 0xebebeb, 0xebebeb, 0x8d7084, 0x350027, 0x38032d, 0xebebeb, 0xebebeb, 0x421942, 0x28012b, 0xb9b1bb, 0xebebeb, 0xafa9b5, 0x150132, 0x878096, 0xebebeb, 0x625f81, 0x03033f, 0x757793, 0x737390, 0x423d66, 0x13063d, 0x100134, 0x150132, 0x1a0130, 0x1f012e, 0x23012d, 0x27012c, 0x2a012b, 0x2d012a, 0x471a41, 0x7f6078, 0xbaadb6, 0xebebeb, 0xebebeb, 0xebebeb, 0xebebeb, 0xbdafb8, 0x6c3d5a, 0x3f0023, 0x400023, 0x410022, 0x410022, 0x420022, 0x430021, 0x5a1b3d, 0xc7b8c0, 0xebebeb, 0xececec, 0x000000, - 0x000000, 0xebebeb, 0xa07f8f, 0x490020, 0x490020, 0x470020, 0x460020, 0xcabcc3, 0xebebeb, 0xeaeaea, 0xb9a7b1, 0x420022, 0x410122, 0x400023, 0xcec3c9, 0xebebeb, 0xebebeb, 0x9b8292, 0x380025, 0x3f0731, 0xebeaea, 0xeaeaea, 0x32032e, 0x350935, 0xdddadd, 0xebebeb, 0x4c3358, 0x554165, 0xebebeb, 0x615a7b, 0x3c3762, 0xc9c9d1, 0xeaeaea, 0xd7d7db, 0xb8b6c2, 0xc8c6ce, 0xd7d5da, 0xd3d1d6, 0xd4d0d5, 0xc4bdc6, 0xa598a8, 0x816a82, 0x5a3557, 0x34022d, 0x330128, 0x350027, 0x370125, 0x511b40, 0xa58d9b, 0xddd9dc, 0xeaeaea, 0xeaeaea, 0xeaeaea, 0xb6a3af, 0x5b1f41, 0x430022, 0x440021, 0x440021, 0x450021, 0x460021, 0x470121, 0x9d7d8c, 0xe5e3e4, 0x000000, - 0xe7e7e7, 0xeaeaea, 0xdbd4d8, 0x520629, 0x4a001f, 0x4a0020, 0x490020, 0x977284, 0xeaeaea, 0xeaeaea, 0xe7e6e7, 0x4f072d, 0x440021, 0x430022, 0xa28695, 0xeaeaea, 0xeaeaea, 0xbbabb6, 0x3c0024, 0x3e022a, 0xeaeaea, 0xe1dfe0, 0x320128, 0x5a3456, 0xeaeaea, 0xc7bfc8, 0x33103e, 0xd4d0d6, 0xe3e2e4, 0x938da1, 0xdedde0, 0xeaeaea, 0xeaeaea, 0xeaeaea, 0xeaeaea, 0xeaeaea, 0xeaeaea, 0x8f8196, 0x42224c, 0x674c6a, 0xa292a2, 0xe2e0e2, 0xeaeaea, 0xcec6cb, 0x988092, 0x4b143b, 0x3a0024, 0x3d0024, 0x3e0023, 0x571c3f, 0xa48897, 0xeaeaea, 0xeaeaea, 0xeaeaea, 0xe8e8e8, 0x9f8190, 0x470123, 0x460020, 0x470020, 0x470020, 0x490020, 0x490020, 0x6d314d, 0xad8fa3, - 0xe8e8e8, 0xe9e9e9, 0xeaeaea, 0x865369, 0x4c001f, 0x4c001f, 0x4c001f, 0x5c1636, 0xe4e2e3, 0xeaeaea, 0xeaeaea, 0x895c72, 0x460020, 0x450021, 0x794a62, 0xeaeaea, 0xeaeaea, 0xd2c9cd, 0x400124, 0x3d0023, 0xe2dfe1, 0xdad6d9, 0x360027, 0x75536d, 0xe9e9e9, 0x826b83, 0x857188, 0xeaeaea, 0xeaeaea, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9ea, 0xe9e9e9, 0xe9e9e9, 0xeaeaea, 0xe9e9e9, 0xeae9ea, 0xd6d2d7, 0x887389, 0x380633, 0x3c0632, 0x83647b, 0xd8d3d6, 0xe9e9e9, 0xe2dfe1, 0x96798a, 0x46062c, 0x410022, 0x420022, 0x430021, 0x6a3350, 0xd7cfd3, 0xeaeaea, 0xeae9ea, 0xeaeaea, 0xcec3c8, 0x5e1a3a, 0x4a0020, 0x4a001f, 0x4b001f, 0x4b001f, 0x4c001f, 0x4d0021, - 0xe8e8e8, 0xe9e9e9, 0xe9e9e9, 0xcec0c6, 0x4e001e, 0x4e001e, 0x4d001e, 0x4d001e, 0xb096a2, 0xe9e8e8, 0xe9e9e9, 0xc9bbc1, 0x4b0121, 0x490020, 0x4f072a, 0xe4e1e2, 0xe9e9e9, 0xe4e2e3, 0x5b1f40, 0x410022, 0xc6b9c1, 0xe3e2e2, 0x3a0024, 0x8e7185, 0xe9e9e9, 0x4f2347, 0xd0cbd0, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e8e9, 0xe9e9e9, 0xd6d0d5, 0x83637b, 0x3c0127, 0x44062d, 0x967789, 0xe2e0e2, 0xe9e9e9, 0xd4ccd1, 0x76445e, 0x450021, 0x460020, 0x470020, 0x550f31, 0xb69ea9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xdad4d7, 0x784058, 0x4c001f, 0x4d001f, 0x4d001e, 0x4d001e, 0x4d001e, - 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe9e9e9, 0x844f64, 0x50001c, 0x50001c, 0x4f001e, 0x6f2e4a, 0xe9e9e9, 0xe8e8e8, 0xe8e8e8, 0x6f324e, 0x4b001f, 0x4b001f, 0xa98c99, 0xe8e8e8, 0xe8e8e8, 0x8a6176, 0x450021, 0xab93a0, 0xe8e8e8, 0x47052b, 0x997c8e, 0xe8e8e8, 0xe2e0e1, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe7e7e7, 0xe8e8e8, 0xbdaeb7, 0x521337, 0x430022, 0x642947, 0xd9d3d6, 0xe8e8e8, 0xe8e8e8, 0x9b7888, 0x4e0325, 0x4a001f, 0x4b001f, 0x4c001f, 0xa07e8c, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0x88566b, 0x4f001e, 0x4f001e, 0x50001e, 0x50001c, - 0xe9e9e9, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xd4cacd, 0x560324, 0x52001c, 0x51001c, 0x51001c, 0xb296a0, 0xe8e8e8, 0xe8e8e8, 0xbba5af, 0x4f001e, 0x4e001e, 0x71314c, 0xe8e8e8, 0xe8e8e8, 0xc1b0b8, 0x4a001f, 0x835269, 0xe8e8e8, 0x5e2141, 0x9b7b8c, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0x9e8393, 0x855d73, 0xe8e8e8, 0xd4cdd1, 0x5f1f3e, 0x490020, 0x5c1738, 0xc8bac0, 0xe8e8e8, 0xe8e8e8, 0xb196a2, 0x570a2b, 0x4e001e, 0x4e001e, 0x4f001e, 0x94687b, 0xe7e7e7, 0xe8e8e8, 0xe8e8e8, 0xe8e7e7, 0x996e7f, 0x51001c, 0x51001c, 0x51001d, - 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xa27c8a, 0x54001b, 0x53001b, 0x53001b, 0x661936, 0xe2e0e0, 0xe7e7e7, 0xe6e6e6, 0x80465c, 0x51001c, 0x51001c, 0xb296a0, 0xe8e8e8, 0xe2e0e1, 0x682441, 0x5a0d2d, 0xe6e6e6, 0x84556a, 0x946d7f, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe8e8e8, 0xe8e7e8, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xd8d2d5, 0x642744, 0x8e6578, 0xe7e7e7, 0xd8d0d4, 0x6a2a45, 0x4e001e, 0x5b0d2e, 0xc4b3b9, 0xe7e7e7, 0xe7e7e7, 0xc6b6bc, 0x52011f, 0x51001c, 0x51001c, 0x51001c, 0x9e7887, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe5e4e5, 0x8d5a6d, 0x53001b, 0x53001b, - 0xdcd6d8, 0xe6e6e6, 0xe7e7e7, 0xe6e6e6, 0xe7e6e6, 0xe5e3e3, 0x712541, 0x56001a, 0x55001a, 0x56001b, 0x996b7b, 0xe7e6e7, 0xe7e7e7, 0xcfc3c7, 0x5d0727, 0x54001b, 0x6e2741, 0xe3e1e2, 0xe7e7e7, 0xae8f9a, 0x52001c, 0xbba3ad, 0xa88894, 0x80475f, 0xe6e6e6, 0xe7e7e7, 0xe7e7e7, 0xe6e6e6, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e6e7, 0xe7e7e7, 0xe6e6e6, 0xe7e7e7, 0xe7e6e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xc7b8bd, 0x4f001e, 0xad909b, 0xe7e7e7, 0xd3c8cd, 0x601030, 0x52001c, 0x641735, 0xd4c9cd, 0xe7e7e7, 0xe6e6e6, 0xb499a4, 0x54001b, 0x54001b, 0x54001b, 0x54001b, 0xa98592, 0xe7e6e6, 0xe6e6e6, 0xe7e7e7, 0xddd8da, 0x82465d, 0x55001a, - 0x8c5164, 0xe5e5e5, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xd3c8cc, 0x630d2b, 0x580019, 0x58001a, 0x5a001a, 0xbda5ad, 0xe6e6e6, 0xe6e6e6, 0xab8693, 0x590019, 0x58001a, 0xa07683, 0xe6e6e6, 0xdfdcdd, 0x681935, 0x804156, 0xe0ddde, 0x762e47, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0x915f72, 0x5c0524, 0xd6cacf, 0xe6e6e6, 0xc4b2b8, 0x57001b, 0x56001a, 0x6e223e, 0xdcd4d7, 0xe6e6e6, 0xe6e6e6, 0xa17887, 0x56001a, 0x57001a, 0x57001a, 0x5c0220, 0xc2adb4, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xd9d2d4, 0x691935, - 0x5b0019, 0xae8b96, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e5e5, 0xe6e6e6, 0xae8a96, 0x5e011b, 0x5c0019, 0x5c0019, 0x670d2a, 0xd6cbcf, 0xe6e6e6, 0xe5e3e4, 0x8c5164, 0x5c0018, 0x640624, 0xbfa6ae, 0xe6e6e6, 0xba9ea8, 0x5d0018, 0xcab7bd, 0xd3c6ca, 0xe5e5e5, 0xe6e5e5, 0xe6e5e6, 0xe6e6e6, 0xe6e5e5, 0xe6e6e6, 0xe6e5e5, 0xe6e6e6, 0xe6e5e5, 0xe6e5e5, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe5e5e5, 0xccbbc0, 0xcebfc4, 0x5d011c, 0x905669, 0xe6e6e6, 0xe6e6e6, 0x9a6a7a, 0x5a0019, 0x5a0019, 0x976676, 0xe5e5e5, 0xe6e6e6, 0xe5e4e4, 0x7c374e, 0x580019, 0x5a0019, 0x5a0019, 0x691431, 0xdbd4d6, 0xe6e6e6, 0xe5e5e5, 0xe6e6e6, 0xc3afb5, - 0x5e0018, 0x630622, 0xc9b6bc, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xa27482, 0x5e0017, 0x5e0017, 0x5f0017, 0x7d3046, 0xdad4d5, 0xe5e5e5, 0xe3e2e2, 0x80364c, 0x600017, 0x690a25, 0xd0c0c4, 0xe5e4e4, 0xa16d7b, 0x813246, 0xe1dede, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e4e4, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe4e2e3, 0x761f36, 0xe5e5e5, 0x863f54, 0x61011a, 0xcab7bd, 0xe5e5e5, 0xdfdcdd, 0x721e37, 0x5e0018, 0x5e011a, 0xc2adb4, 0xe5e5e5, 0xe5e5e5, 0xdad2d5, 0x6b1631, 0x5c0018, 0x5c0019, 0x5c0019, 0x88495d, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, - 0x600018, 0x5f0018, 0x6c122d, 0xd4c7cb, 0xe5e5e5, 0xe5e5e5, 0xe4e4e4, 0xe5e5e5, 0xe4e4e4, 0x986372, 0x610017, 0x610016, 0x620016, 0x884254, 0xdbd4d6, 0xe4e4e4, 0xdedadb, 0x7d2940, 0x650016, 0x761931, 0xd1c1c5, 0xe4e3e3, 0x832e41, 0xa87580, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe5e4e4, 0xe4e4e4, 0xe4e4e4, 0xe5e5e5, 0xe5e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0x812a3e, 0xcdbbbf, 0xba9aa4, 0x640014, 0x955767, 0xe4e4e4, 0xe5e4e4, 0xaa818c, 0x610017, 0x600017, 0x7f3349, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xae8994, 0x5e0018, 0x5e0018, 0x5e0018, 0x5e0018, 0xc0a7ae, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, - 0x610016, 0x610017, 0x610017, 0x741c35, 0xdad2d4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0x9b6473, 0x640016, 0x640014, 0x650014, 0x7b2238, 0xdad0d3, 0xe4e4e4, 0xdcd6d8, 0x9e6370, 0x690013, 0x7b182e, 0xc7aeb4, 0xdfdbdc, 0x934352, 0xc19fa5, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0x944b5b, 0xb48b94, 0xded9db, 0x6b0118, 0x6f0922, 0xd9cfd1, 0xe4e4e4, 0xe0ddde, 0x6e0c28, 0x630016, 0x630016, 0xc2aab0, 0xe4e4e4, 0xe4e4e4, 0xdedadb, 0x79273e, 0x610017, 0x600017, 0x600017, 0x78273e, 0xe0ddde, 0xe4e4e4, 0xe5e4e4, - 0x620016, 0x630016, 0x630014, 0x630016, 0x781f37, 0xd6cccf, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xaa7c87, 0x670013, 0x680013, 0x690013, 0x791930, 0xcfbdc1, 0xe3e3e3, 0xe3e3e3, 0xb78e97, 0x740318, 0x730112, 0xaa6e7a, 0xdcd5d6, 0xd4c2c6, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe4e4e4, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0x9d5664, 0xa2616d, 0xe4e4e4, 0x83283c, 0x6c0012, 0xb58c95, 0xe3e3e3, 0xe4e4e4, 0x9b606e, 0x660014, 0x660014, 0x802d42, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xb796a0, 0x630016, 0x620016, 0x620016, 0x620016, 0xb08c96, 0xe3e3e3, 0xe5e5e5, - 0x640018, 0x650014, 0x650014, 0x650014, 0x650014, 0x771931, 0xd4c7ca, 0xe3e2e2, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xbc9aa1, 0x740b22, 0x6b0012, 0x6c0011, 0x710218, 0xaa757f, 0xded8d9, 0xe3e3e3, 0xd5c6c9, 0xa05765, 0x7a0112, 0x8c2233, 0xc8a7ab, 0xe3e3e3, 0xe3e3e3, 0xe2e2e2, 0xe3e2e2, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e2e2, 0xe3e3e3, 0xe3e3e3, 0xc9aaad, 0xbe8e94, 0xe3e2e2, 0x9e505d, 0x9b4d5c, 0xe3e3e3, 0x9c5765, 0x6f0011, 0x9a5564, 0xe3e3e3, 0xe3e3e3, 0xcab5b9, 0x690013, 0x690013, 0x680013, 0xccb9be, 0xe3e3e3, 0xe2e2e2, 0xdfdbdc, 0x71112a, 0x650016, 0x640016, 0x640016, 0x782138, 0xdcd6d7, 0xe2e2e2, - 0x6a031a, 0x670014, 0x670014, 0x670014, 0x680013, 0x680013, 0x6d031b, 0xc0a5ab, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xd5c8ca, 0x98505f, 0x710011, 0x720010, 0x730010, 0x841c30, 0xbf99a0, 0xe2e2e2, 0xe2e2e2, 0xd9ced0, 0xb1737b, 0x8e1727, 0x941e2b, 0xbf888d, 0xdbcfd0, 0xe2e2e2, 0xe3e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe1ddde, 0x9b303c, 0xbc868c, 0xe2e2e2, 0x963846, 0x994250, 0xe2e2e2, 0xa86b77, 0x730010, 0x821e32, 0xe2e2e2, 0xe2e2e2, 0xdedbdc, 0x7b182d, 0x6b0012, 0x6a0013, 0xa26977, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xae848f, 0x660014, 0x660014, 0x660014, 0x650014, 0xb5919b, 0xe1e1e1, - 0xe0e0e0, 0xaa7a85, 0x6a0117, 0x690013, 0x690013, 0x6a0013, 0x6b0012, 0x6b0012, 0xa8757f, 0xe0e0e0, 0xe2e1e1, 0xe2e1e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xc09ea5, 0x8e3545, 0x76000e, 0x78000d, 0x7a000c, 0x8b1f30, 0xb9878d, 0xd4c2c5, 0xe2e2e2, 0xe2e1e1, 0xd5c2c4, 0xc18b8f, 0xc2878c, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e1e1, 0xe2e2e2, 0xe2e1e1, 0xdcd0d1, 0xc18085, 0xcdacae, 0x8c010a, 0xd9cacb, 0xe2e1e2, 0x8a1122, 0x9a414e, 0xe2e2e2, 0xb17c85, 0x77000e, 0x770113, 0xe0dfdf, 0xe2e1e1, 0xe2e2e2, 0x9a5563, 0x6d0011, 0x6d0012, 0x7e1f34, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xd5cbcd, 0x690014, 0x680013, 0x670014, 0x670014, 0x85354a, 0xdfdfdf, - 0x000000, 0xe2e0e2, 0xbb9ba2, 0x760e25, 0x6b0012, 0x6c0012, 0x6c0011, 0x6e0012, 0x6e0011, 0x811b31, 0xc8b1b6, 0xe1e1e1, 0xe1e1e1, 0xe1e1e1, 0xe1e1e1, 0xe1e1e1, 0xe1e1e1, 0xc4a2a8, 0x9e4d5a, 0x7f0111, 0x7f000b, 0x810009, 0x85000b, 0x9a2c38, 0xac545e, 0xbc7c82, 0xc48c91, 0xca9b9e, 0xcb9a9c, 0xca8d8e, 0xc87c7d, 0xc66666, 0xd29b9c, 0xded5d5, 0xd7bfbf, 0xb13f44, 0xdcd1d2, 0xa22731, 0xa9454f, 0xe1e1e1, 0xdacecf, 0x830009, 0xa04953, 0xe1e1e1, 0xb7868e, 0x7a000d, 0x78000d, 0xd2c2c4, 0xe1e1e1, 0xe1e1e1, 0xb1838c, 0x710010, 0x6f0011, 0x6e0011, 0xd1c2c5, 0xe1e1e1, 0xe1e1e1, 0xe1e0e1, 0x8c4051, 0x6a0013, 0x690013, 0x690013, 0x680014, 0x000000, - 0x000000, 0xe0e0e0, 0xe0e0e0, 0xd2c5c8, 0x883345, 0x6e0012, 0x6f0011, 0x710011, 0x710011, 0x720010, 0x730010, 0x994c5a, 0xd4c7ca, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe1e1e1, 0xdbd3d4, 0xc0949a, 0xa95c64, 0x972432, 0x8f0614, 0x8d0005, 0x910004, 0x950004, 0x9d040c, 0xa81c22, 0xb94e51, 0xc87e7f, 0xded5d6, 0xdfdada, 0xc98283, 0xae191c, 0xd9c3c4, 0xbb6a6e, 0x960003, 0xceacaf, 0xe1e1e1, 0xc3979b, 0x870008, 0xab5f67, 0xe0e0e0, 0xb57f86, 0x7d000b, 0x7b000c, 0xc7aaaf, 0xe1e0e1, 0xe1e1e1, 0xcab3b6, 0x74000e, 0x730010, 0x710011, 0xb58c94, 0xe1e0e0, 0xe1e1e1, 0xe0e0e0, 0xb0848d, 0x6c0012, 0x6b0012, 0x6a0012, 0x6a0012, 0x000000, - 0x000000, 0xe1e1e1, 0xe0e0e0, 0xe0e0e0, 0xdfdede, 0xb48991, 0x7c1228, 0x720010, 0x730010, 0x74000f, 0x75000e, 0x76000e, 0x7b0316, 0x9c4d5a, 0xc7aaae, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xdfddde, 0xded9da, 0xdfddde, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xce8b8b, 0xb92323, 0xb72d2e, 0xdac7c7, 0xcc989a, 0x9d0002, 0xad3f45, 0xe0e0e0, 0xe0e0e0, 0xa94e56, 0x8b0007, 0xbf8d92, 0xe0e0e0, 0xb06e78, 0x80000b, 0x7e000b, 0xc4a2a7, 0xe0e0e0, 0xe0e0e0, 0xd2c4c7, 0x770010, 0x75000e, 0x74000f, 0xa56874, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xd0c1c4, 0x6e0012, 0x6d0012, 0x6c0012, 0x6c0012, 0x000000, - 0x000000, 0xdbdbdb, 0xdfdfdf, 0xdfdfdf, 0xdfdfdf, 0xdfdfdf, 0xdbd5d6, 0xa2616c, 0x790318, 0x76000e, 0x77000d, 0x79000d, 0x7a000c, 0x7b000c, 0x7c000c, 0x881323, 0xb0727a, 0xcbb1b4, 0xdedbdb, 0xdfdfdf, 0xe0e0e0, 0xdfdfdf, 0xdfdfdf, 0xdfdfdf, 0xdfdfdf, 0xe0e0e0, 0xe0e0e0, 0xdfdfdf, 0xd4b5b6, 0xc26a6c, 0xb21819, 0xb10000, 0xc86d6d, 0xdfdddd, 0xd2acad, 0xa7090f, 0x9f0002, 0xd5bdbe, 0xdfdfdf, 0xdbd2d3, 0x960d19, 0x8c0006, 0xceb4b6, 0xe0e0e0, 0xaa5f68, 0x82000a, 0x80000a, 0xc5a3a9, 0xdfdfdf, 0xe0dfdf, 0xd9d0d1, 0x7e061b, 0x77000d, 0x76000f, 0x8e3443, 0xdfdfdf, 0xe0e0e0, 0xdfdfdf, 0xdfdfdf, 0x7a0f24, 0x6e0011, 0x6e0012, 0x55002a, 0x000000, - 0x000000, 0x000000, 0xdcdcdc, 0xdfdfdf, 0xdedede, 0xdfdfdf, 0xdfdfdf, 0xdfdfdf, 0xd3c6c7, 0xa25d68, 0x841123, 0x7b000c, 0x7c000c, 0x7d000b, 0x7f000b, 0x81000a, 0x820009, 0x840009, 0x87010c, 0x992a35, 0xaa535c, 0xb2656c, 0xb66b72, 0xb86c72, 0xb8686c, 0xb55a5f, 0xad383e, 0xa60a11, 0xa40001, 0xa90001, 0xba3a3c, 0xd6b5b5, 0xdfdfdf, 0xcd9293, 0xac060b, 0xa40001, 0xc68788, 0xdfdfdf, 0xdfdfdf, 0xc1898c, 0x910004, 0x940914, 0xdedcdd, 0xdfdede, 0x9c3541, 0x850009, 0x820009, 0xc8aaae, 0xdfdfdf, 0xdfdfdf, 0xdbd6d7, 0x830e21, 0x79000c, 0x78000d, 0x7c0519, 0xdfdedf, 0xdfdede, 0xdfdfdf, 0xdfdfdf, 0x924352, 0x710010, 0x6e0012, 0x000000, 0x000000, - 0x000000, 0x000000, 0xdfdfdf, 0xdddcdc, 0xdedede, 0xdedede, 0xdedede, 0xdedede, 0xdedede, 0xdedede, 0xdad4d4, 0xbf999f, 0x9d4955, 0x830414, 0x81000a, 0x82000a, 0x840009, 0x850007, 0x880006, 0x8a0006, 0x8c0006, 0x8e0005, 0x910004, 0x940003, 0x970003, 0x9a0002, 0x9e0002, 0xa5070d, 0xba5154, 0xd3b0b0, 0xdedddd, 0xdcd4d4, 0xc87071, 0xad0000, 0xa90000, 0xc0686b, 0xdedede, 0xdedede, 0xdbd4d4, 0x9f141e, 0x930004, 0xae535b, 0xdedede, 0xdddddd, 0x8d0311, 0x860007, 0x840009, 0xd1bec0, 0xdedede, 0xdedede, 0xdddbdb, 0x881326, 0x7b000c, 0x7a000c, 0x78000d, 0xdad4d5, 0xdedede, 0xdedede, 0xdedede, 0xae7a84, 0x730010, 0x70000a, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x923747, 0xb4858c, 0xdcd9d9, 0xdedede, 0xdedede, 0xdedede, 0xdedede, 0xdedede, 0xdedede, 0xdedede, 0xd6cbcc, 0xc6a7ab, 0xb17078, 0xa5515b, 0x962230, 0x900b19, 0x8d020d, 0x8f0109, 0x92010a, 0x980612, 0x9f1922, 0xad4047, 0xb96569, 0xcda1a4, 0xdacece, 0xdedede, 0xdedede, 0xd4b0b0, 0xbb2b2b, 0xb10000, 0xae0000, 0xbc4b4d, 0xdcd7d7, 0xdedede, 0xdedddd, 0xba676a, 0x980003, 0x950003, 0xcba8ab, 0xdedede, 0xcfb5b7, 0x8a0006, 0x880006, 0x87010b, 0xdcdada, 0xdedddd, 0xdedede, 0xdcd9d9, 0x881222, 0x7d000b, 0x7c000c, 0x7a000c, 0xd5cbcd, 0xdedede, 0xdedede, 0xdedede, 0xba939a, 0x730011, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x80000d, 0x78000d, 0x830d21, 0xa5606b, 0xcdb7bb, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdedddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xd1acad, 0xba3d3e, 0xaf0000, 0xb20000, 0xb10000, 0xc26061, 0xdddddd, 0xdddddd, 0xdddddd, 0xd2b6b7, 0x9d0002, 0x990002, 0xa62d35, 0xdddddd, 0xdddddd, 0xb8757b, 0x8d0006, 0x8a0006, 0x921422, 0xdddddd, 0xdddddd, 0xdddddd, 0xd9d3d4, 0x86071a, 0x7f000b, 0x7d000b, 0x7c000c, 0xd2c4c6, 0xdddddd, 0xdddddd, 0xdddddd, 0xccb8bc, 0x71001c, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x7a000e, 0x7b000c, 0x7c000c, 0x7e000d, 0x932c3a, 0xb27a82, 0xcab1b5, 0xdcdbdb, 0xdddcdc, 0xdddcdc, 0xdddddd, 0xdddddd, 0xdddcdc, 0xdddcdc, 0xdddcdc, 0xdddcdc, 0xdcdcdc, 0xdcdcdc, 0xdddddd, 0xdcdcdc, 0xdddddd, 0xd6c2c3, 0xc37a7d, 0xb23336, 0xa90000, 0xab0000, 0xaf0000, 0xb30101, 0xc87272, 0xdddddd, 0xdddddd, 0xdddddd, 0xdcd8d8, 0xaa2025, 0x9e0002, 0x9b0002, 0xc79799, 0xdddddd, 0xdddcdc, 0x99141f, 0x8e0005, 0x8c0006, 0xa64c55, 0xdcdcdc, 0xdcdcdc, 0xdddcdc, 0xd4c8c9, 0x83010d, 0x80000a, 0x7f000b, 0x7e000b, 0xd2c3c5, 0xdcdcdc, 0xdcdcdc, 0xdddddd, 0xdddddd, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x7d000b, 0x7e000b, 0x7f000b, 0x80000a, 0x82000a, 0x820009, 0x870412, 0x9b3643, 0xac6169, 0xb67a81, 0xc39a9e, 0xc8a9ac, 0xccb0b2, 0xceb4b6, 0xcdb1b3, 0xcaa6a8, 0xc28b8f, 0xb9696e, 0xb14a4f, 0xa5131b, 0xa00001, 0xa30001, 0xa50001, 0xa90000, 0xac0000, 0xba3334, 0xd6bcbc, 0xdcdcdc, 0xdcdcdc, 0xdcdcdc, 0xdbd8d9, 0xb23235, 0xa10001, 0x9f0002, 0xae363d, 0xdbdada, 0xdcdcdc, 0xcba8ab, 0x920004, 0x900005, 0x8e0006, 0xb97e83, 0xdcdcdc, 0xdcdcdc, 0xdcdcdc, 0xccb4b6, 0x830009, 0x82000a, 0x80000a, 0x80000b, 0xd2c6c8, 0xdcdcdc, 0xdcdcdc, 0xdcdcdc, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x7f0011, 0x7f000a, 0x80000a, 0x81000a, 0x820009, 0x840009, 0x840007, 0x860007, 0x880007, 0x890006, 0x8b0006, 0x8d0006, 0x8e0005, 0x900004, 0x920004, 0x940003, 0x960003, 0x990003, 0x9d0002, 0x9e0002, 0xa10001, 0xa40001, 0xa70000, 0xae0a0d, 0xc98686, 0xdad3d3, 0xdbdbdb, 0xdcdbdb, 0xdcdbdb, 0xdbd9d9, 0xbf6163, 0xa50001, 0xa20001, 0xa10206, 0xd1b6b7, 0xdbdbdb, 0xdbdbdb, 0xae4b52, 0x930003, 0x910004, 0x8f0005, 0xccb1b4, 0xdcdcdc, 0xdcdbdb, 0xdcdcdc, 0xc29ca0, 0x840007, 0x830009, 0x820009, 0x81000a, 0xd5cbcd, 0xdcdbdb, 0xdbdbdb, 0xd9d9d9, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x7f000a, 0x82000a, 0x830009, 0x840009, 0x850007, 0x860007, 0x880007, 0x890006, 0x8b0006, 0x8c0006, 0x8e0005, 0x900005, 0x910004, 0x950003, 0x960003, 0x980003, 0x9a0002, 0x9c0002, 0x9f0001, 0xa20001, 0xae2227, 0xc47e7f, 0xd8cece, 0xdbdbdb, 0xdbdbdb, 0xdbdbdb, 0xdbdbdb, 0xd8cccc, 0xbe5354, 0xa80000, 0xa60001, 0xa30001, 0xc1797b, 0xdbdbdb, 0xdbdbdb, 0xd2bfc0, 0x9a0209, 0x940003, 0x920004, 0x9e242e, 0xdbdada, 0xdbdbdb, 0xdbdadb, 0xdbdbdb, 0xb27178, 0x860007, 0x840009, 0x830009, 0x83000b, 0xdad7d7, 0xdbdbdb, 0xd8d8d8, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x850009, 0x840009, 0x860008, 0x860007, 0x880006, 0x890006, 0x8b0006, 0x8c0006, 0x8e0006, 0x900005, 0x910004, 0x940003, 0x960003, 0x980003, 0x990002, 0x9c0003, 0xa61a20, 0xbc686c, 0xd0b2b3, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xd6c5c5, 0xb72829, 0xad0000, 0xaa0000, 0xa60001, 0xb13135, 0xdbdbdb, 0xdadada, 0xdadada, 0xaf464d, 0x980003, 0x960003, 0x940003, 0xbb7e82, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xa34650, 0x880008, 0x860007, 0x850007, 0x8f1424, 0xdadada, 0xd9d9d9, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xd4d4d4, 0xc9adb0, 0xc19b9f, 0xb3767c, 0xa64f59, 0xa13d46, 0x9e323d, 0x9b2430, 0x9b1e29, 0x9d1f2a, 0xa23038, 0xa94047, 0xaf5156, 0xbb7377, 0xc59294, 0xd5c9ca, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xcd9393, 0xb50d0d, 0xae0000, 0xad0000, 0xa90000, 0xaf191e, 0xd6c6c7, 0xdadada, 0xdadada, 0xca9ea0, 0x9c0002, 0x990002, 0x970003, 0x980109, 0xd2c0c2, 0xdadada, 0xdadada, 0xdadada, 0xd7d1d1, 0x8f0917, 0x890007, 0x880007, 0x860007, 0x9c3c46, 0xdbdbdb, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xd4d4d4, 0xdbdbdb, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xdad9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd6c9c9, 0xbf494a, 0xb30000, 0xb10000, 0xaf0000, 0xac0000, 0xb01618, 0xd3c0c0, 0xd9d9d9, 0xd9d9d9, 0xd7d2d2, 0xa7181e, 0x9c0002, 0x9a0002, 0x980003, 0xad4c52, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xc5a0a4, 0x8c0006, 0x8a0006, 0x890007, 0x870007, 0x9e3945, 0xd4d4d4, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xd4d4d4, 0xdadada, 0xd9d9d9, 0xd8d8d8, 0xd9d9d9, 0xd8d8d8, 0xd8d8d8, 0xd9d8d8, 0xd9d8d8, 0xd9d9d9, 0xd9d9d9, 0xd8d8d8, 0xd9d9d9, 0xd8d8d8, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd5caca, 0xc16566, 0xb30c0d, 0xb10000, 0xb30000, 0xb10000, 0xaf0000, 0xb21618, 0xd3bcbc, 0xd9d9d9, 0xd9d8d8, 0xd9d9d9, 0xbb6669, 0x9f0001, 0x9d0002, 0x9b0002, 0x9a0003, 0xceb5b6, 0xd9d8d8, 0xd9d9d9, 0xd8d8d8, 0xd9d9d9, 0xb1656b, 0x8d0006, 0x8b0006, 0x8a0006, 0x8a0006, 0x7f0000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xd9d9d9, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xcfb2b3, 0xbe6365, 0xad0609, 0xac0000, 0xae0000, 0xb10000, 0xb30000, 0xb10000, 0xb72324, 0xd4c3c4, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xc5888a, 0xa20001, 0x9f0001, 0x9e0002, 0x9b0002, 0xaf454c, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd7d7d7, 0x97141f, 0x8e0005, 0x8c0006, 0x8d0005, 0x950015, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xd5d5d5, 0xd8d8d8, 0xd8d7d7, 0xd8d8d8, 0xd7d7d7, 0xd8d8d8, 0xd8d7d7, 0xd8d8d8, 0xd8d7d7, 0xd7d6d6, 0xd0bcbc, 0xc28183, 0xae252a, 0xa60001, 0xa80000, 0xaa0000, 0xad0000, 0xb00000, 0xb10000, 0xb20000, 0xc05051, 0xd7d7d7, 0xd8d8d8, 0xd8d7d7, 0xd8d8d8, 0xd0b8b9, 0xa50001, 0xa20001, 0xa10001, 0x9e0001, 0xa0060e, 0xd2c4c5, 0xd8d8d8, 0xd8d8d8, 0xd8d7d7, 0xd8d7d7, 0xc8a8aa, 0x910004, 0x8f0004, 0x8e0005, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xd9d9d9, 0xd8d8d8, 0xd7d7d7, 0xd4cdcd, 0xcbafb0, 0xc39093, 0xbb7276, 0xb2494f, 0xa40e14, 0xa10001, 0xa40001, 0xa50001, 0xa70000, 0xa90000, 0xab0000, 0xad0000, 0xaf0000, 0xb30505, 0xc98485, 0xd7d7d7, 0xd7d7d7, 0xd7d7d7, 0xd7d7d7, 0xd0b6b7, 0xab0d11, 0xa40001, 0xa30001, 0xa10001, 0xa00001, 0xbc7578, 0xd7d7d7, 0xd7d7d7, 0xd7d7d7, 0xd7d7d7, 0xd7d7d7, 0xa8414a, 0x920005, 0x900006, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x990411, 0x970002, 0x990002, 0x9a0002, 0x9c0002, 0x9e0002, 0xa10001, 0xa10001, 0xa30001, 0xa60001, 0xa70001, 0xa90000, 0xab0000, 0xad0000, 0xbc4445, 0xd2bdbd, 0xd7d6d6, 0xd6d6d6, 0xd6d6d6, 0xd6d6d6, 0xd0b5b6, 0xad0e12, 0xa70001, 0xa50001, 0xa30001, 0xa20001, 0xab252b, 0xd5d1d2, 0xd6d6d6, 0xd6d6d6, 0xd6d6d6, 0xd7d6d6, 0xcfbcbe, 0x990510, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x8e0000, 0x9b0002, 0x9b0001, 0x9d0002, 0xa00002, 0xa00001, 0xa30001, 0xa40001, 0xa60001, 0xa80000, 0xab0001, 0xb53031, 0xcba1a2, 0xd6d6d6, 0xd6d6d6, 0xd6d6d6, 0xd6d6d6, 0xd6d6d6, 0xceaeae, 0xb11417, 0xa90000, 0xa70000, 0xa50001, 0xa40001, 0xa60a10, 0xcfbabc, 0xd6d6d6, 0xd6d5d5, 0xd6d6d6, 0xd6d6d6, 0xd7d7d7, 0xd9d9d9, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x990000, 0x9f0002, 0xa00001, 0xa10001, 0xa30001, 0xa40001, 0xa80103, 0xb74446, 0xcca7a7, 0xd5d5d5, 0xd5d5d5, 0xd5d5d5, 0xd6d5d5, 0xd5d5d5, 0xd6d6d6, 0xc78282, 0xb00305, 0xab0000, 0xa90000, 0xa90000, 0xa60001, 0xa50102, 0xc69294, 0xd5d5d5, 0xd5d5d5, 0xd6d6d6, 0xd5d3d3, 0xdfdfdf, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xaa0000, 0xa20000, 0xa40002, 0xb85659, 0xceb7b7, 0xd5d5d5, 0xd5d5d5, 0xd5d5d5, 0xd5d5d5, 0xd5d5d5, 0xd5d4d4, 0xd3c9c9, 0xc36767, 0xb00000, 0xad0000, 0xac0000, 0xaa0000, 0xa80000, 0xa70001, 0xbf7476, 0xd6d5d5, 0xd4d4d4, 0xd5d5d5, 0xdbdbdb, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xd7d7d7, 0xd4d4d4, 0xd6d6d6, 0xd6d5d5, 0xd5d5d5, 0xd4d4d4, 0xcfabab, 0xb81e1e, 0xb20000, 0xaf0000, 0xae0000, 0xac0000, 0xab0000, 0xaa0000, 0xa70303, 0xd6d6d6, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000 -}; \ No newline at end of file diff --git a/dev/Boot/BootKit/Shared/base.h b/dev/Boot/BootKit/Shared/base.h deleted file mode 100644 index 88459ec3..00000000 --- a/dev/Boot/BootKit/Shared/base.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef UTL_BASE_H -#define UTL_BASE_H - -#include -#include -#include - -namespace utl -{ - - /** - * @brief Helper to get number of elements in array. - * - * @tparam T Auto-deduced element type - * @tparam N Auto-deduced number of elements - * @return Array size - */ - template - constexpr size_t countof(T (&)[N]) - { - return N; - } - -} // namespace utl - -#endif \ No newline at end of file diff --git a/dev/Boot/BootKit/Shared/bit.h b/dev/Boot/BootKit/Shared/bit.h deleted file mode 100644 index fa0fab82..00000000 --- a/dev/Boot/BootKit/Shared/bit.h +++ /dev/null @@ -1,247 +0,0 @@ -#ifndef UTL_BIT_H -#define UTL_BIT_H - -#include - -namespace utl -{ - - /** - * @brief Size of object in terms of bits. - * - * @tparam T Object type - * @return Number of bits - */ - template - constexpr auto bit_size() - { - return sizeof(T) * 8; - } - - /** - * @brief Integer with all bits set to 1. - * - * @tparam T Integer type - * @return All set integer - */ - template - constexpr T bit_full() - { - return T(-1); - } - - /** - * @brief Wrap around mask for power of two number of bits - * within given integer type. For example: - * [ bit_wrap = 8 - 1 = 0b111 ] - * [ bit_wrap = 16 - 1 = 0b1111 ] - * [ bit_wrap = 32 - 1 = 0b11111 ] - * - * @tparam T Integer type - * @return Wrap around mask for number of bits - */ - template - constexpr T bit_wrap() - { - return bit_size() - 1; - } - - /** - * @brief Number of bits to fit bit_wrap result, in other words - * bit width of (sizeof(T) * 8 - 1). For example: - * [ bit_shft = bit_width(0b111) = 3 ] - * [ bit_shft = bit_width(0b1111) = 4 ] - * [ bit_shft = bit_width(0b11111) = 5 ] - * - * @tparam T Integer type - * @return Number of bits to shift to divide by sizeof(T) * 8 - */ - template - constexpr auto bit_shft() - { - return std::bit_width(bit_wrap()); - } - - /** - * @brief Round up division by number of bits within given integer type, - * which sizeof(T) * 8 is power of two. - * - * @tparam T Inetegr type - * @param x Dividend - * @return Quotient - */ - template - constexpr auto bit_ceil(auto x) - { - return (x + bit_wrap()) >> bit_shft(); - } - - /** - * @brief Count leading zeros. - * - * @param x Unsigned integer argument - * @return Number of leading zeros - */ - constexpr unsigned cntlz(auto x) - { - if constexpr (std::is_same_v) - return std::countl_zero(unsigned(x)); - else - return std::countl_zero(x); - } - - /** - * @brief Count trailing zeros. - * - * @param x Unsigned integer argument - * @return Number of trailing zeros - */ - constexpr unsigned cnttz(auto x) - { - if constexpr (std::is_same_v) - return std::countr_zero(unsigned(x)); - else - return std::countr_zero(x); - } - - /** - * @brief Get number of words (integers) required to store N bits. - * - * @tparam T Word integer type - * @param n Number of bits to store - * @return Number of words - */ - template - constexpr size_t words_in_bits(size_t n) - { - return (n >> bit_shft()) + !!(n & bit_wrap()); - } - - /** - * @brief Get number of bytes required to store N bits. - * - * @param n Number of bits to store - * @return Number of bytes - */ - constexpr size_t bytes_in_bits(size_t n) - { - return words_in_bits(n); - } - - /** - * @brief Make integer with bit at given position. - * - * @tparam T Inetegr type - * @param n Bit position - * @return Integer with set bit - */ - template - constexpr T bit(int n) - { - return T(1) << n; - } - - /** - * @brief Get n-th bit of an integer. - * - * @tparam T Integer type - * @param x Integer - * @param n Bit position from LSB - * @return true if set - */ - template - constexpr bool get_bit(T x, int n) - { - return (x >> n) & 1; - } - - /** - * @brief Set n-th bit of an integer. - * - * @tparam T Integer type - * @param x Integer - * @param n Bit position from LSB - */ - template - constexpr void set_bit(T& x, int n) - { - x |= 1 << n; - } - - /** - * @brief Clear n-th bit of an integer. - * - * @tparam T Integer type - * @param x Integer - * @param n Bit position from LSB - */ - template - constexpr void clr_bit(T& x, int n) - { - x &= ~(1 << n); - } - - /** - * @brief Get n-th bit in array of words (starting from LSB). - * - * @tparam T Word type - * @param p Array of words - * @param n Index of bit to get - * @return true if set - */ - template - constexpr bool get_arr_bit(const T* p, unsigned n) - { - return get_bit(p[n >> bit_shft()], n & bit_wrap()); - } - - /** - * @brief Set n-th bit in array of words (starting from LSB). - * - * @tparam T Word type - * @param p Array of words - * @param n Index of bit to set - */ - template - constexpr void set_arr_bit(T* p, unsigned n) - { - set_bit(p[n >> bit_shft()], n & bit_wrap()); - } - - /** - * @brief Clear n-th bit in array of words (starting from LSB). - * - * @tparam T Word type - * @param p Array of words - * @param n Index of bit to clear - */ - template - constexpr void clr_arr_bit(T* p, unsigned n) - { - clr_bit(p[n >> bit_shft()], n & bit_wrap()); - } - - /** - * @brief Shift bits left in array of integer elements from least significant bit - * and considering 0-th byte as the right most. - * uint16_t example: 0b10000000'11100001 ==> 0b00000001'11000010. - * - * @tparam T Integer type - * @tparam L Length of array - * @param x Array of integers, nullptr not acceptable! - * @param len Number of elements - */ - template - constexpr void shift_left(T (&x)[L]) - { - for (int i = L - 1; i > 0; --i) - { - x[i] <<= 1; - x[i] |= x[i - 1] >> bit_wrap(); - } - x[0] <<= 1; - } - -} // namespace utl - -#endif \ No newline at end of file diff --git a/dev/Boot/BootKit/Support.h b/dev/Boot/BootKit/Support.h deleted file mode 100644 index 3c79262b..00000000 --- a/dev/Boot/BootKit/Support.h +++ /dev/null @@ -1,173 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -/// @file Support.h -/// @brief Purpose of this file is to help port libs into the bootloader. - -#ifndef __aarch64__ -#include -#endif - -#define kLongMax ((long)(~0UL >> 1)) -#define kLongMin (~kLongMax) - -#ifdef __BOOTZ__ - -/// @brief memset definition in C++. -/// @param dst destination pointer. -/// @param byte value to fill in. -/// @param len length of of src. -EXTERN_C void* memset(void* dst, int byte, long long unsigned int len); - -/// @brief memcpy definition in C++. -/// @param dst destination pointer. -/// @param src source pointer. -/// @param len length of of src. -EXTERN_C void* memcpy(void* dst, const void* src, long long unsigned int len); - -/// @brief strlen definition in C++. -EXTERN_C size_t strlen(const char* whatToCheck); - -/// @brief strcmp definition in C++. -EXTERN_C int strcmp(const char* whatToCheck, const char* whatToCheckRight); - -#else - -#include - -#endif // __BOOTZ__ - -#define SetMem(dst, c, sz) memset(dst, c, sz) -#define MoveMem(dst, src, sz) memcpy(dst, src, sz) -#define CopyMem(dst, src, sz) memcpy(dst, src, sz) -#define StrLen(src) strlen(src) -#define StrCmp(dst, src) strcmp(dst, src) - -inline int IsSpace(int c) -{ - return c == ' '; -} - -inline int StringNCompare(const char* destination, const char* source, long length) -{ - long err = 0; - - for (long i = 0UL; i < length; ++i) - { - if (source[i] != destination[i]) - ++err; - } - - return err; -} - -inline long StringToLong(const char* nptr, char** endptr, int base) -{ - const char *p = nptr, *endp; - bool is_neg = 0, overflow = 0; - - /* Need unsigned so (-kLongMin) can fit in these: */ - unsigned long n = 0UL, cutoff; - int cutlim; - - if (base < 0 || base == 1 || base > 36) - { - return 0L; - } - - endp = nptr; - - while (IsSpace(*p)) - p++; - - if (*p == '+') - { - p++; - } - else if (*p == '-') - { - is_neg = 1, p++; - } - if (*p == '0') - { - p++; - /* For strtol(" 0xZ", &endptr, 16), endptr should point to 'x'; - * pointing to ' ' or '0' is non-compliant. - * (Many implementations do this wrong.) */ - endp = p; - if (base == 16 && (*p == 'X' || *p == 'x')) - { - p++; - } - else if (base == 2 && (*p == 'B' || *p == 'b')) - { - /* C23 standard supports "0B" and "0b" prefixes. */ - p++; - } - else if (base == 0) - { - if (*p == 'X' || *p == 'x') - { - base = 16, p++; - } - else if (*p == 'B' || *p == 'b') - { - base = 2, p++; - } - else - { - base = 8; - } - } - } - else if (base == 0) - { - base = 10; - } - - cutoff = (is_neg) ? -(kLongMin / base) : kLongMax / base; - cutlim = (is_neg) ? -(kLongMin % base) : kLongMax % base; - - while (1) - { - int c; - if (*p >= 'A') - c = ((*p - 'A') & (~('a' ^ 'A'))) + 10; - else if (*p <= '9') - c = *p - '0'; - else - break; - if (c < 0 || c >= base) - break; - endp = ++p; - if (overflow) - { - /* endptr should go forward and point to the non-digit character - * (of the given base); required by ANSI standard. */ - if (endptr) - continue; - break; - } - if (n > cutoff || (n == cutoff && c > cutlim)) - { - overflow = 1; - continue; - } - n = n * base + c; - } - - if (endptr) - *endptr = (char*)endp; - - if (overflow) - { - return ((is_neg) ? kLongMin : kLongMax); - } - - return (long)((is_neg) ? -n : n); -} diff --git a/dev/Boot/DownloadOVMF.ps1 b/dev/Boot/DownloadOVMF.ps1 deleted file mode 100644 index 5a2c5f0e..00000000 --- a/dev/Boot/DownloadOVMF.ps1 +++ /dev/null @@ -1,4 +0,0 @@ -$client = new-object System.Net.WebClient -$output = "$PSScriptRoot\OVMF.fd" - -$client.DownloadFile("https://retrage.github.io/edk2-nightly/bin/DEBUGX64_OVMF.fd", $output) diff --git a/dev/Boot/Mod/.keep b/dev/Boot/Mod/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Boot/Mod/NetBoot/.hgkeep b/dev/Boot/Mod/NetBoot/.hgkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Boot/Mod/NetBoot/Boot.S b/dev/Boot/Mod/NetBoot/Boot.S deleted file mode 100644 index 2095b91d..00000000 --- a/dev/Boot/Mod/NetBoot/Boot.S +++ /dev/null @@ -1,28 +0,0 @@ -;; /* -;; * ======================================================== -;; * -;; * BootZ -;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. -;; * -;; * ======================================================== -;; */ - -.code64 -.intel_syntax noprefix - -#define kTypeDriver 101 -#define kArchAmd64 122 -#define kHandoverMagic 0xBADCC - -.section .ldr - -.quad kHandoverMagic -.word kTypeDriver - -.text - -.extern main -.global __main - -__main: - ret diff --git a/dev/Boot/Mod/NetBoot/NetBoot.cc b/dev/Boot/Mod/NetBoot/NetBoot.cc deleted file mode 100644 index 59610262..00000000 --- a/dev/Boot/Mod/NetBoot/NetBoot.cc +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ======================================================== - * - * NetBoot - * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - * - * ======================================================== - */ - -#include -#include -#include - -EXTERN_C Int32 ModuleMain(NeOS::HEL::BootInfoHeader* handover) -{ - NETBOOT_INTERNET_HEADER inet{}; - - /// TODO: Read Packet from localhost - - if (inet.PatchLength < 0) - { - Boot::BootTextWriter writer; - writer.Write("NetBootLauncher: No Patch attached to packet.\r"); - - return kEfiFail; - } - - if (!inet.EEPROM) - { - Boot::BootThread thread(inet.Data); - - if (thread.IsValid()) - return thread.Start(handover, YES); - } - else - { - Boot::BootTextWriter writer; - writer.Write("NetBootLauncher: EEPROM flash not available for now.\r"); - - return kEfiFail; // TODO: Add support for EEPROM firmware update. - } - - return kEfiFail; -} diff --git a/dev/Boot/Mod/NetBoot/NetBoot.h b/dev/Boot/Mod/NetBoot/NetBoot.h deleted file mode 100644 index aeeaf18b..00000000 --- a/dev/Boot/Mod/NetBoot/NetBoot.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * ======================================================== - * - * NetBoot - * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - * - * ======================================================== - */ - -#pragma once - -#include - -#define kNetBootINetMagic "NETB" -#define kNetBootINetMagicLength (4) - -#define kNetBootNameLen (256U) - -/// @brief the internet header is used to download updates OTA. -typedef struct NETBOOT_INTERNET_HEADER -{ - NeOS::Char NB1; /// magic char 1 'N' - NeOS::Char NB2; /// magic char 2 'E' - NeOS::Char NB3; /// magic char 3 'T' - NeOS::Char NB4; /// magic char 4 'B' - - NeOS::Char PatchName[kNetBootNameLen]; /// example: Modjo - NeOS::Int32 PatchLength; /// the patch length. - NeOS::Char PatchTarget[kNetBootNameLen]; /// the target file. - NeOS::Boolean EEPROM : 1; /// does it imply an EEPROM reprogram? - NeOS::Boolean Preflight : 1; /// is it a preflight packet. - NeOS::Char Data[]; /// non preflight packet has a patch blob for a **PatchTarget** -} ATTRIBUTE(packed) NETBOOT_INTERNET_HEADER; diff --git a/dev/Boot/Mod/NetBoot/build.json b/dev/Boot/Mod/NetBoot/build.json deleted file mode 100644 index 6f6d575f..00000000 --- a/dev/Boot/Mod/NetBoot/build.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compiler_path": "x86_64-w64-mingw32-g++", - "compiler_std": "c++20", - "headers_path": ["../", "../../", "../../../Kernel", "../../../", "./"], - "sources_path": [".cc", "*.S"], - "output_name": "netboot.sys", - "compiler_flags": [ - "-ffreestanding", - "-nostdlib", - "-std=c++20", - "-fPIC", - "-fno-rtti", - "-fno-exceptions", - "-Wl,--subsystem=17,--image-base,0x10000000,-e,ModuleMain" - ], - "cpp_macros": [ - "__NEOSKRNL__", - "__BOOTZ__", - "__NE_AMD64__", - "kNetBootVersionHighest=0x0100", - "kNetBootVersionLowest=0x0100", - "kNetBootVersion=0x0100" - ] -} diff --git a/dev/Boot/Mod/SysChk/.hgkeep b/dev/Boot/Mod/SysChk/.hgkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Boot/Mod/SysChk/Boot.S b/dev/Boot/Mod/SysChk/Boot.S deleted file mode 100644 index 8ebfb352..00000000 --- a/dev/Boot/Mod/SysChk/Boot.S +++ /dev/null @@ -1,22 +0,0 @@ -;; /* -;; * ======================================================== -;; * -;; * BootZ -;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. -;; * -;; * ======================================================== -;; */ - -#ifdef __NE_AMD64__ -.code64 -.intel_syntax noprefix -#endif - -#define kTypeDriver 101 -#define kArchAmd64 122 -#define kHandoverMagic 0xBADCC - -.section .ldr - -.quad kHandoverMagic -.word kTypeDriver diff --git a/dev/Boot/Mod/SysChk/Module.cc b/dev/Boot/Mod/SysChk/Module.cc deleted file mode 100644 index a5575cac..00000000 --- a/dev/Boot/Mod/SysChk/Module.cc +++ /dev/null @@ -1,36 +0,0 @@ -/* - * ======================================================== - * - * NetBoot - * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - * - * ======================================================== - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -EXTERN_C Int32 ModuleMain(NeOS::HEL::BootInfoHeader* handover) -{ -#ifdef __NE_AMD64__ - Boot::BDiskFormatFactory partition_factory; - - if (partition_factory.IsPartitionValid()) - return kEfiOk; - - return kEfiFail; -#else - return kEfiOk; -#endif -} diff --git a/dev/Boot/Mod/SysChk/amd64.json b/dev/Boot/Mod/SysChk/amd64.json deleted file mode 100644 index 6a6a4de0..00000000 --- a/dev/Boot/Mod/SysChk/amd64.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compiler_path": "x86_64-w64-mingw32-g++", - "compiler_std": "c++20", - "headers_path": ["../", "../../", "../../../Kernel", "../../../", "./"], - "sources_path": ["*.cc", "*.S", "../../src/HEL/AMD64/*.cc", "../../src/HEL/AMD64/*.S", "../../src/*.cc"], - "output_name": "syschk.sys", - "compiler_flags": [ - "-nostdlib", - "-std=c++20", - "-fPIC", - "-fno-rtti", - "-fno-exceptions", - "-Wl,--subsystem=17,--image-base,0x10000000,-e,ModuleMain" - ], - "cpp_macros": [ - "__NEOSKRNL__", - "__BOOTZ__", - "__BOOTLDR_STANDALONE__", - "__NE_AMD64__", - "kChkVersionHighest=0x0100", - "kChkVersionLowest=0x0100", - "kChkVersion=0x0100" - ] -} diff --git a/dev/Boot/Mod/SysChk/arm64.json b/dev/Boot/Mod/SysChk/arm64.json deleted file mode 100644 index 09d86309..00000000 --- a/dev/Boot/Mod/SysChk/arm64.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compiler_path": "clang++", - "compiler_std": "c++20", - "headers_path": ["../", "../../", "../../../Kernel", "../../../", "./"], - "sources_path": ["*.cc", "*.S", "../../src/HEL/ARM64/*.cc", "../../src/HEL/ARM64/*.S", "../../src/*.cc"], - "output_name": "syschk.sys", - "compiler_flags": [ - "-ffreestanding", - "-nostdlib", - "-std=c++20", - "-fno-rtti", - "-fno-exceptions", - "-fuse-ld=lld", - "-Wl,-subsystem:efi_application,-entry:ModuleMain", - "-target aarch64-unknown-windows" - ], - "cpp_macros": [ - "__NEOSKRNL__", - "__BOOTZ__", - "__BOOTLDR_STANDALONE__", - "__NE_ARM64__", - "kChkVersionHighest=0x0100", - "kChkVersionLowest=0x0100", - "kChkVersion=0x0100" - ] -} diff --git a/dev/Boot/amd64-desktop.make b/dev/Boot/amd64-desktop.make deleted file mode 100644 index bf61b24e..00000000 --- a/dev/Boot/amd64-desktop.make +++ /dev/null @@ -1,154 +0,0 @@ -################################################## -# (c) Amlal EL Mahrouss, all rights reserved. -# This is the bootloader makefile. -################################################## - -CC_GNU=x86_64-w64-mingw32-g++ -LD_GNU=x86_64-w64-mingw32-ld - -WINDRES=x86_64-w64-mingw32-windres - -ADD_FILE=touch -COPY=cp -HTTP_GET=wget - -# Select this for Windows. -ifneq ($(findstring CYGWIN_NT-10.0,$(shell uname)), ) -EMU=qemu-system-x86_64w.exe -else -# this for NT distributions -EMU=qemu-system-x86_64 -net none -endif - -ifeq ($(NEOS_MODEL), ) -NE_MODEL=-DkMachineModel="\"NeOS\"" -endif - -BIOS=OVMF.fd -IMG=epm-master-1.img -IMG_2=epm-master-2.img - -BOOT=./src/neos.img - -DISK_DRV = - -ifneq ($(ATA_PIO_SUPPORT), ) -DISK_DRV = -D__ATA_PIO__ -endif - -ifneq ($(ATA_DMA_SUPPORT), ) -DISK_DRV = -D__ATA_DMA__ -endif - -ifneq ($(AHCI_SUPPORT), ) -DISK_DRV = -D__AHCI__ -endif - -ifneq ($(DEBUG_SUPPORT), ) -DEBUG_MACRO = -D__DEBUG__ -endif - -ifeq ($(shell uname), Darwin) -EMU_FLAGS=-M q35 -net none -smp 4 -m 8G \ - -bios $(BIOS) -cdrom $(BOOT) -boot d -endif - -ifneq ($(shell uname), Darwin) -EMU_FLAGS=-net none -smp 4 -m 8G \ - -bios $(BIOS) -M q35 -cdrom $(BOOT) -boot d -accel kvm -endif - -LD_FLAGS=-e Main --subsystem=10 - -STANDALONE_MACRO=-D__BOOTLDR_STANDALONE__ -OBJ=*.o - -REM=rm -REM_FLAG=-f - -FLAG_ASM=-f win64 -FLAG_GNU=-fshort-wchar -D__EFI_x86_64__ -mno-red-zone -D__NEOSKRNL__ -D__BOOTZ__ \ - -DEFI_FUNCTION_WRAPPER -I./ -I../Kernel $(DISK_DRV) -I../ -c -nostdlib -fno-rtti -fno-exceptions \ - -std=c++20 -DBOOTZ_GPT_SUPPORT -DBOOTZ_EPM_SUPPORT -D__HAVE_NE_APIS__ -DZBA_USE_FB -D__NE_AMD64__ -D__NE__ -DNE_AUTO_FORMAT - -BOOTLOADER=bootz.exe -KERNEL=neoskrnl.exe -SYSCHK=syschk.sys -STARTUP=startup.sys -SCIKIT=libSCI.dylib - -.PHONY: invalid-recipe -invalid-recipe: - @echo "=== ERROR ===" - @echo "=> Use make compile- instead." - -.PHONY: all -all: compile-amd64 - mkdir -p src/Root/EFI/BOOT - $(LD_GNU) $(OBJ) $(LD_FLAGS) -o src/$(BOOTLOADER) - $(COPY) src/$(BOOTLOADER) src/Root/EFI/BOOT/BOOTX64.EFI - $(COPY) src/$(BOOTLOADER) src/Root/EFI/BOOT/BOOTZ.EFI - $(COPY) ../Kernel/$(KERNEL) src/Root/$(KERNEL) - $(COPY) ./Mod/SysChk/$(SYSCHK) src/Root/$(SYSCHK) - $(COPY) ../LibSCI/$(SCIKIT) src/Root/$(SCIKIT) - $(COPY) src/$(BOOTLOADER) src/Root/$(BOOTLOADER) - -.PHONY: disk -disk: - dd if=/dev/zero of=$(BOOT) bs=30M count=100 - mformat -i $(BOOT) -F -v "NEOS_ESP" - - -ifneq ($(DEBUG_SUPPORT), ) -DEBUG = -D__DEBUG__ -endif - -.PHONY: compile-amd64 -compile-amd64: - $(WINDRES) src/BootloaderRsrc.rsrc -O coff -o BootloaderRsrc.o - $(CC_GNU) $(NE_MODEL) $(STANDALONE_MACRO) $(FLAG_GNU) $(DEBUG) \ - $(wildcard src/HEL/AMD64/*.cc) \ - $(wildcard src/HEL/AMD64/*.S) \ - $(wildcard src/*.cc) - -.PHONY: run-efi-amd64-ahci -run-efi-amd64-ahci: - $(EMU) $(EMU_FLAGS) -d int -hda $(IMG) -s -S -trace ahci_* -boot menu=on - -.PHONY: run-efi-amd64-ata-pio -run-efi-amd64-ata-pio: - $(EMU) $(EMU_FLAGS) -device piix3-ide,id=ide -drive id=disk,file=$(IMG),format=raw,if=none -device ide-hd,drive=disk,bus=ide.0 -s -S - -.PHONY: run-efi-amd64-ata-dma -run-efi-amd64-ata-dma: - $(EMU) $(EMU_FLAGS) -device piix4-ide,id=ide -drive id=disk,file=$(IMG),format=raw,if=none -device ide-hd,drive=disk,bus=ide.0 -s -S - -.PHONY: run-efi-amd64-ata -run-efi-amd64-ata: run-efi-amd64-ata-dma - -# img_2 is the rescue disk. img is the bootable disk, as provided by the Zeta specs. -.PHONY: epm-img -epm-img: - qemu-img create -f raw $(IMG) 4G - -.PHONY: efi -efi: - $(HTTP_GET) https://retrage.github.io/edk2-nightly/bin/DEBUGX64_OVMF.fd -O OVMF.fd - -BINS=*.bin -EXECUTABLES=bootz.exe neoskrnl.exe OVMF.fd - -TARGETS=$(REM_FLAG) $(OBJ) $(BIN) $(IMG) $(IMG_2) $(EXECUTABLES) - -.PHONY: clean -clean: - $(REM) $(TARGETS) - -.PHONY: help -help: - @echo "=== HELP ===" - @echo "epm-img: Format a disk using the Explicit Partition Map." - @echo "gpt-img: Format a disk using the Explicit Partition Map." - @echo "clean: remove bootloader and files." - @echo "bootloader-amd64: Build bootloader. (PC AMD64)" - @echo "run-efi-amd64-: Run bootloader. (PC AMD64)" diff --git a/dev/Boot/arm64-desktop.make b/dev/Boot/arm64-desktop.make deleted file mode 100644 index 7470a9fc..00000000 --- a/dev/Boot/arm64-desktop.make +++ /dev/null @@ -1,112 +0,0 @@ -################################################## -# (c) Amlal EL Mahrouss, all rights reserved. -# This is the bootloader makefile. -################################################## - -CC_GNU = clang++ -LD_GNU = lld-link - -ADD_FILE=touch -COPY=cp -HTTP_GET=wget - -# Select this for Windows. -ifneq ($(findstring CYGWIN_NT-10.0,$(shell uname)), ) -EMU=qemu-system-aarch64w.exe -else -# this for NT distributions -EMU=qemu-system-aarch64 -endif - -ifeq ($(NEOS_MODEL), ) -NE_MODEL=-DkMachineModel="\"NeKernel\"" -endif - -BIOS=OVMF.fd -IMG=epm-master-1.img -IMG_2=epm-slave.img -IMG_3=epm-master-2.img - -EMU_FLAGS=-net none -smp 4 -m 8G -cpu max -M virt \ - -bios $(BIOS) \ - -drive id=disk,file=$(IMG),format=raw,if=none \ - -drive \ - file=fat:rw:src/Root/,index=2,format=raw \ - -no-shutdown -no-reboot -cpu cortex-a72 -device virtio-gpu-pci - -LD_FLAGS=-subsystem:efi_application -entry:Main /nodefaultlib - -STANDALONE_MACRO=-D__BOOTLDR_STANDALONE__ -OBJ=*.o - -REM=rm -REM_FLAG=-f - -FLAG_ASM=-f win64 -FLAG_GNU=-fshort-wchar -c -ffreestanding -MMD -mno-red-zone -D__NE_ARM64__ -fno-rtti -fno-exceptions -I./ \ - -target aarch64-unknown-windows \ - -std=c++20 -DBOOTZ_EPM_SUPPORT -DZBA_USE_FB -D__FSKIT_USE_NEFS__ -D__BOOTLDR_STANDALONE__ -D__NEOSKRNL__ -D__BOOTZ__ -D__HAVE_NE_APIS__ -D__NE__ -I../ -I../Kernel - -BOOT_LOADER=bootz.exe -KERNEL=neoskrnl.exe -SYSCHK=syschk.sys -STARTUP=startup.sys - -.PHONY: invalid-recipe -invalid-recipe: - @echo "invalid-recipe: Use make compile- instead." - -.PHONY: all -all: compile - mkdir -p src/Root/EFI/BOOT - $(LD_GNU) $(OBJ) $(LD_FLAGS) /out:src/$(BOOT_LOADER) - $(COPY) src/$(BOOT_LOADER) src/Root/EFI/BOOT/BOOTAA64.EFI - $(COPY) src/$(BOOT_LOADER) src/Root/EFI/BOOT/BootZ.EFI - $(COPY) ../Kernel/$(KERNEL) src/Root/$(KERNEL) - $(COPY) ./Mod/SysChk/$(SYSCHK) src/Root/$(SYSCHK) - $(COPY) src/$(BOOT_LOADER) src/Root/$(BOOT_LOADER) - -ifneq ($(DEBUG_SUPPORT), ) -DEBUG = -D__DEBUG__ -endif - -.PHONY: compile -compile: - $(RESCMD) - $(CC_GNU) $(NE_MODEL) $(STANDALONE_MACRO) $(FLAG_GNU) $(DEBUG) \ - $(wildcard src/HEL/ARM64/*.cc) \ - $(wildcard src/HEL/ARM64/*.S) \ - $(wildcard src/*.cc) - -.PHONY: run -run: - $(EMU) $(EMU_FLAGS) - -# img_2 is the rescue disk. img is the bootable disk, as provided by the Zeta. -.PHONY: epm-img -epm-img: - qemu-img create -f raw $(IMG) 10G - qemu-img create -f raw $(IMG_2) 4G - qemu-img create -f raw $(IMG_3) 4G - -.PHONY: efi -efi: - $(HTTP_GET) https://retrage.github.io/edk2-nightly/bin/DEBUGAARCH64_QEMU_EFI.fd -O OVMF.fd - -BINS=*.bin -EXECUTABLES=bootz.exe neoskrnl.exe OVMF.fd - -TARGETS=$(REM_FLAG) $(OBJ) $(BIN) $(IMG) $(IMG_2) $(EXECUTABLES) - -.PHONY: clean -clean: - $(REM) $(TARGETS) - -.PHONY: help -help: - @echo "=== HELP ===" - @echo "epm-img: Format a disk using the Explicit Partition Map." - @echo "gpt-img: Format a disk using the Explicit Partition Map." - @echo "clean: clean bootloader." - @echo "bootloader-amd64: Build bootloader. (PC AMD64)" - @echo "run: Run bootloader. (PC AMD64)" diff --git a/dev/Boot/arm64-mobile.make b/dev/Boot/arm64-mobile.make deleted file mode 100644 index c4522e52..00000000 --- a/dev/Boot/arm64-mobile.make +++ /dev/null @@ -1,113 +0,0 @@ -################################################## -# (c) Amlal EL Mahrouss, all rights reserved. -# This is the bootloader makefile. -################################################## - -CC_GNU = clang++ -LD_GNU = lld-link - -ADD_FILE=touch -COPY=cp -HTTP_GET=wget - -# Select this for Windows. -ifneq ($(findstring CYGWIN_NT-10.0,$(shell uname)), ) -EMU=qemu-system-aarch64w.exe -else -# this for NT distributions -EMU=qemu-system-aarch64 -endif - -ifeq ($(NEOS_MODEL), ) -NE_MODEL=-DkMachineModel="\"NeKernel\"" -endif - -BIOS=OVMF.fd -IMG=epm-master-1.img -IMG_2=epm-slave.img -IMG_3=epm-master-2.img - -EMU_FLAGS=-net none -smp 4 -m 8G -cpu max -M virt-9.1 \ - -bios $(BIOS) \ - -drive id=disk,file=$(IMG),format=raw,if=none \ - -drive \ - file=fat:rw:src/Root/,index=1,format=raw \ - -device virtio-tablet-pci \ - -no-shutdown -no-reboot -cpu cortex-a72 -device virtio-gpu-pci - -LD_FLAGS=-subsystem:efi_application -entry:Main /nodefaultlib - -STANDALONE_MACRO=-D__BOOTLDR_STANDALONE__ -OBJ=*.o - -REM=rm -REM_FLAG=-f - -FLAG_ASM=-f win64 -FLAG_GNU=-fshort-wchar -c -ffreestanding -MMD -mno-red-zone -D__NE_ARM64__ -fno-rtti -fno-exceptions -I./ \ - -target aarch64-unknown-windows \ - -std=c++20 -DBOOTZ_EPM_SUPPORT -DkExpectedWidth=320 -DkExpectedHeight=480 -D__FSKIT_USE_NEFS__ -D__BOOTLDR_STANDALONE__ -D__NEOSKRNL__ -D__BOOTZ__ -D__HAVE_NE_APIS__ -D__NE__ -I../ -I../Kernel - -BOOT_LOADER=bootz.exe -KERNEL=neoskrnl.exe -SYSCHK=syschk.sys -STARTUP=startup.sys - -.PHONY: invalid-recipe -invalid-recipe: - @echo "invalid-recipe: Use make compile- instead." - -.PHONY: all -all: compile - mkdir -p src/Root/EFI/BOOT - $(LD_GNU) $(OBJ) $(LD_FLAGS) /out:src/$(BOOT_LOADER) - $(COPY) src/$(BOOT_LOADER) src/Root/EFI/BOOT/BOOTAA64.EFI - $(COPY) src/$(BOOT_LOADER) src/Root/EFI/BOOT/BootZ.EFI - $(COPY) ../Kernel/$(KERNEL) src/Root/$(KERNEL) - $(COPY) ./Mod/SysChk/$(SYSCHK) src/Root/$(SYSCHK) - $(COPY) src/$(BOOT_LOADER) src/Root/$(BOOT_LOADER) - -ifneq ($(DEBUG_SUPPORT), ) -DEBUG = -D__DEBUG__ -endif - -.PHONY: compile -compile: - $(RESCMD) - $(CC_GNU) $(NE_MODEL) $(STANDALONE_MACRO) $(FLAG_GNU) $(DEBUG) \ - $(wildcard src/HEL/ARM64/*.cc) \ - $(wildcard src/HEL/ARM64/*.S) \ - $(wildcard src/*.cc) - -.PHONY: run -run: - $(EMU) $(EMU_FLAGS) - -# img_2 is the rescue disk. img is the bootable disk, as provided by the Zeta. -.PHONY: epm-img -epm-img: - qemu-img create -f raw $(IMG) 10G - qemu-img create -f raw $(IMG_2) 4G - qemu-img create -f raw $(IMG_3) 4G - -.PHONY: efi -efi: - $(HTTP_GET) https://retrage.github.io/edk2-nightly/bin/DEBUGAARCH64_QEMU_EFI.fd -O OVMF.fd - -BINS=*.bin -EXECUTABLES=bootz.exe neoskrnl.exe OVMF.fd - -TARGETS=$(REM_FLAG) $(OBJ) $(BIN) $(IMG) $(IMG_2) $(EXECUTABLES) - -.PHONY: clean -clean: - $(REM) $(TARGETS) - -.PHONY: help -help: - @echo "=== HELP ===" - @echo "epm-img: Format a disk using the Explicit Partition Map." - @echo "gpt-img: Format a disk using the Explicit Partition Map." - @echo "clean: clean bootloader." - @echo "bootloader-amd64: Build bootloader. (PC AMD64)" - @echo "run-efi-amd64: Run bootloader. (PC AMD64)" diff --git a/dev/Boot/gdbinit b/dev/Boot/gdbinit deleted file mode 100644 index 9522f6e8..00000000 --- a/dev/Boot/gdbinit +++ /dev/null @@ -1,3 +0,0 @@ -set disassemble-next-line on -b Main -target remote localhost:1234 diff --git a/dev/Boot/src/.gitkeep b/dev/Boot/src/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Boot/src/BootFileReader.cc b/dev/Boot/src/BootFileReader.cc deleted file mode 100644 index 4712374e..00000000 --- a/dev/Boot/src/BootFileReader.cc +++ /dev/null @@ -1,206 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: FileReader.cc - Purpose: New Boot FileReader, - Read complete file and store it in a buffer. - -------------------------------------------- */ - -#include -#include -#include -#include -#include -#include - -/// @file BootFileReader -/// @brief Bootloader File reader. -/// BUGS: 0 - -//////////////////////////////////////////////////////////////////////////////////////////////////// -/// -/// -/// @name BootFileReader class -/// @brief Reads the file as a blob. -/// -/// -//////////////////////////////////////////////////////////////////////////////////////////////////// - -/*** - @brief File Reader constructor. -*/ -Boot::BootFileReader::BootFileReader(const CharacterTypeUTF16* path, - EfiHandlePtr ImageHandle) -{ - if (path != nullptr) - { - SizeT index = 0UL; - for (; path[index] != L'\0'; ++index) - { - mPath[index] = path[index]; - } - - mPath[index] = 0; - } - - /// Load protocols with their GUIDs. - - EfiGUID guidEfp = EfiGUID(EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID); - - EfiSimpleFilesystemProtocol* efp = nullptr; - - EfiLoadImageProtocol* img = nullptr; - EfiGUID guidImg = EfiGUID(EFI_LOADED_IMAGE_PROTOCOL_GUID); - - if (BS->HandleProtocol(ImageHandle, &guidImg, (void**)&img) != kEfiOk) - { - mWriter.Write(L"BootZ: Handle-Protocol: No-Such-Protocol").Write(L"\r"); - this->mErrorCode = kNotSupported; - } - - if (BS->HandleProtocol(img->DeviceHandle, &guidEfp, (void**)&efp) != kEfiOk) - { - mWriter.Write(L"BootZ: Handle-Protocol: No-Such-Protocol").Write(L"\r"); - this->mErrorCode = kNotSupported; - return; - } - - /// Start doing disk I/O - - if (efp->OpenVolume(efp, &mRootFs) != kEfiOk) - { - mWriter.Write(L"BootZ: Fetch-Protocol: No-Such-Volume").Write(L"\r"); - this->mErrorCode = kNotSupported; - return; - } - - EfiFileProtocol* fileFs = nullptr; - - if (mRootFs->Open(mRootFs, &fileFs, mPath, kEFIFileRead, kEFIReadOnly) != - kEfiOk) - { - mWriter.Write(L"BootZ: Fetch-Protocol: No-Such-Path: ") - .Write(mPath) - .Write(L"\r"); - this->mErrorCode = kNotSupported; - - fb_render_string("BootZ: PLEASE RECOVER YOUR MINKRNL INSTALL.", 40, 10, RGB(0xFF, 0xFF, 0xFF)); - - mRootFs->Close(mRootFs); - - return; - } - - mSizeFile = 0; - mFile = fileFs; - mErrorCode = kOperationOkay; -} - -Boot::BootFileReader::~BootFileReader() -{ - if (this->mFile) - { - this->mFile->Close(this->mFile); - this->mFile = nullptr; - } - - if (this->mRootFs) - { - this->mRootFs->Close(this->mRootFs); - this->mRootFs = nullptr; - } - - if (this->mBlob) - { - BS->FreePool(this->mBlob); - this->mBlob = nullptr; - } - - BSetMem(this->mPath, 0, kPathLen); -} - -/** - @brief Reads all of the file into a buffer. - @param **readUntil** size of file - @param **chunkToRead** chunk to read each time. -*/ -Void Boot::BootFileReader::ReadAll(SizeT readUntil, SizeT chunkToRead, UIntPtr out_address) -{ - UInt32 szInfo = sizeof(EfiFileInfo); - - EfiFileInfo newPtrInfo{}; - - EfiGUID kFileInfoGUID = EFI_FILE_INFO_GUID; - - if (mFile->GetInfo(mFile, &kFileInfoGUID, &szInfo, &newPtrInfo) == kEfiOk) - { - readUntil = newPtrInfo.FileSize; - mWriter.Write(L"BootZ: File size: ").Write(readUntil).Write("\r"); - } - - if (readUntil == 0) - { - mErrorCode = kNotSupported; - return; - } - - if (mBlob == nullptr) - { - if (!out_address) - { - if (auto err = BS->AllocatePool(EfiLoaderCode, readUntil, (VoidPtr*)&mBlob) != - kEfiOk) - { - mWriter.Write(L"*** error: ").Write(err).Write(L" ***\r"); - EFI::ThrowError(L"OutOfMemory", L"Out of memory."); - } - } - else - { - mBlob = (VoidPtr)out_address; - } - } - - mWriter.Write(L"*** Bytes to read: ").Write(readUntil).Write(L" ***\r"); - - UInt64 bufSize = chunkToRead; - UInt64 szCnt = 0UL; - - while (szCnt < readUntil) - { - auto res = mFile->Read(mFile, &bufSize, (VoidPtr)(&((Char*)mBlob)[szCnt])); - - szCnt += bufSize; - - if (res == kBufferTooSmall) - { - bufSize = chunkToRead; - } - } - - mSizeFile = szCnt; - mErrorCode = kOperationOkay; -} - -/// @brief error code getter. -/// @return the error code. -Int32& Boot::BootFileReader::Error() -{ - return mErrorCode; -} - -/// @brief blob getter. -/// @return the blob. -VoidPtr Boot::BootFileReader::Blob() -{ - return mBlob; -} - -/// @breif Size getter. -/// @return the size of the file. -UInt64& Boot::BootFileReader::Size() -{ - return mSizeFile; -} diff --git a/dev/Boot/src/BootString.cc b/dev/Boot/src/BootString.cc deleted file mode 100644 index 194261d0..00000000 --- a/dev/Boot/src/BootString.cc +++ /dev/null @@ -1,92 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: BootString.cc - Purpose: BootZ string library - - Revision History: - - - -------------------------------------------- */ - -#include -#include -#include - -/// BUGS: 0 - -///////////////////////////////////////////////////////////////////////////////////////////////////////// - -NeOS::SizeT Boot::BCopyMem(CharacterTypeUTF16* dest, CharacterTypeUTF16* src, const NeOS::SizeT len) -{ - if (!dest || !src) - return 0; - - SizeT index = 0UL; - for (; index < len; ++index) - { - dest[index] = src[index]; - } - - return index; -} - -NeOS::SizeT Boot::BStrLen(const CharacterTypeUTF16* ptr) -{ - if (!ptr) - return 0; - - NeOS::SizeT cnt = 0; - - while (*ptr != (CharacterTypeUTF16)0) - { - ++ptr; - ++cnt; - } - - return cnt; -} - -NeOS::SizeT Boot::BSetMem(CharacterTypeUTF16* src, const CharacterTypeUTF16 byte, const NeOS::SizeT len) -{ - if (!src) - return 0; - - NeOS::SizeT cnt = 0UL; - - while (*src != 0) - { - if (cnt > len) - break; - - *src = byte; - ++src; - - ++cnt; - } - - return cnt; -} - -NeOS::SizeT Boot::BSetMem(CharacterTypeUTF8* src, const CharacterTypeUTF8 byte, const NeOS::SizeT len) -{ - if (!src) - return 0; - - NeOS::SizeT cnt = 0UL; - - while (*src != 0) - { - if (cnt > len) - break; - - *src = byte; - ++src; - - ++cnt; - } - - return cnt; -} diff --git a/dev/Boot/src/BootSupport.cc b/dev/Boot/src/BootSupport.cc deleted file mode 100644 index 4d808ddc..00000000 --- a/dev/Boot/src/BootSupport.cc +++ /dev/null @@ -1,82 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include -#include -#include -#include - -#ifdef __BOOTLDR_STANDALONE__ - -/// @brief memset definition in C++. -/// @param dst destination pointer. -/// @param byte value to fill in. -/// @param len length of of src. -EXTERN_C VoidPtr memset(void* dst, int byte, long long unsigned int len) -{ - for (size_t i = 0UL; i < len; ++i) - { - ((int*)dst)[i] = byte; - } - - return dst; -} - -/// @brief memcpy definition in C++. -/// @param dst destination pointer. -/// @param src source pointer. -/// @param len length of of src. -EXTERN_C VoidPtr memcpy(void* dst, const void* src, long long unsigned int len) -{ - for (size_t i = 0UL; i < len; ++i) - { - ((int*)dst)[i] = ((int*)src)[i]; - } - - return dst; -} - -/// @brief strlen definition in C++. -EXTERN_C size_t strlen(const char* whatToCheck) -{ - SizeT len = 0; - - while (whatToCheck[len] != 0) - { - ++len; - } - - return len; -} - -/// @brief strcmp definition in C++. -EXTERN_C int strcmp(const char* whatToCheck, const char* whatToCheckRight) -{ - if (!whatToCheck || *whatToCheck == 0) - return 0; - - SizeT len = 0; - - while (whatToCheck[len] == whatToCheckRight[len]) - { - if (whatToCheck[len] == 0) - return 0; - - ++len; - } - - return len; -} - -/// @brief something specific to the Microsoft's ABI, When the stack grows too big. -EXTERN_C void ___chkstk_ms(void) -{ -} - -#endif diff --git a/dev/Boot/src/BootTextWriter.cc b/dev/Boot/src/BootTextWriter.cc deleted file mode 100644 index b58d3429..00000000 --- a/dev/Boot/src/BootTextWriter.cc +++ /dev/null @@ -1,169 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: BootTextWriter.cc - Purpose: BootZ string library - - Revision History: - - - -------------------------------------------- */ - -#include -#include -#include -#include - -///////////////////////////////////////////////////////////////////////////////////////////////////////// -/// BUGS: 0 /// -///////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** -@brief puts wrapper over EFI ConOut. -*/ -Boot::BootTextWriter& Boot::BootTextWriter::Write(const CharacterTypeUTF16* str) -{ -#ifdef __DEBUG__ - if (!str || *str == 0) - return *this; - - CharacterTypeUTF16 strTmp[2]; - strTmp[1] = 0; - - for (size_t i = 0; str[i] != 0; i++) - { - if (str[i] == '\r') - { - strTmp[0] = str[i]; - ST->ConOut->OutputString(ST->ConOut, strTmp); - - strTmp[0] = '\n'; - ST->ConOut->OutputString(ST->ConOut, strTmp); - } - else - { - strTmp[0] = str[i]; - ST->ConOut->OutputString(ST->ConOut, strTmp); - } - } -#endif // ifdef __DEBUG__ - - return *this; -} - -/// @brief UTF-8 equivalent of Write (UTF-16). -/// @param str the input string. -Boot::BootTextWriter& Boot::BootTextWriter::Write(const Char* str) -{ -#ifdef __DEBUG__ - if (!str || *str == 0) - return *this; - - CharacterTypeUTF16 strTmp[2]; - strTmp[1] = 0; - - for (size_t i = 0; str[i] != 0; i++) - { - if (str[i] == '\r') - { - strTmp[0] = str[i]; - ST->ConOut->OutputString(ST->ConOut, strTmp); - - strTmp[0] = '\n'; - ST->ConOut->OutputString(ST->ConOut, strTmp); - } - else - { - strTmp[0] = str[i]; - ST->ConOut->OutputString(ST->ConOut, strTmp); - } - } -#endif // ifdef __DEBUG__ - - return *this; -} - -Boot::BootTextWriter& Boot::BootTextWriter::Write(const UChar* str) -{ -#ifdef __DEBUG__ - if (!str || *str == 0) - return *this; - - CharacterTypeUTF16 strTmp[2]; - strTmp[1] = 0; - - for (size_t i = 0; str[i] != 0; i++) - { - if (str[i] == '\r') - { - strTmp[0] = str[i]; - ST->ConOut->OutputString(ST->ConOut, strTmp); - - strTmp[0] = '\n'; - ST->ConOut->OutputString(ST->ConOut, strTmp); - } - else - { - strTmp[0] = str[i]; - ST->ConOut->OutputString(ST->ConOut, strTmp); - } - } -#endif // ifdef __DEBUG__ - - return *this; -} - -/** -@brief putc wrapper over EFI ConOut. -*/ -Boot::BootTextWriter& Boot::BootTextWriter::WriteCharacter(CharacterTypeUTF16 c) -{ -#ifdef __DEBUG__ - EfiCharType str[2]; - - str[0] = c; - str[1] = 0; - ST->ConOut->OutputString(ST->ConOut, str); -#endif // ifdef __DEBUG__ - - return *this; -} - -Boot::BootTextWriter& Boot::BootTextWriter::Write(const Long& x) -{ -#ifdef __DEBUG__ - this->_Write(x); - this->Write("h"); -#endif // ifdef __DEBUG__ - - return *this; -} - -Boot::BootTextWriter& Boot::BootTextWriter::_Write(const Long& x) -{ -#ifdef __DEBUG__ - UInt64 y = (x > 0 ? x : -x) / 16; - UInt64 h = (x > 0 ? x : -x) % 16; - - if (y) - this->_Write(y); - - /* fail if the hex number is not base-16 */ - if (h > 16) - { - this->WriteCharacter('?'); - return *this; - } - - if (y < 0) - y = -y; - - const char cNumbers[] = "0123456789ABCDEF"; - - this->WriteCharacter(cNumbers[h]); -#endif // ifdef __DEBUG__ - - return *this; -} diff --git a/dev/Boot/src/BootThread.cc b/dev/Boot/src/BootThread.cc deleted file mode 100644 index ff094f72..00000000 --- a/dev/Boot/src/BootThread.cc +++ /dev/null @@ -1,211 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/// @brief External boot services symbol. -EXTERN EfiBootServices* BS; - -/// @note BootThread doesn't parse the symbols so doesn't nullify them, .bss is though. - -namespace Boot -{ - EXTERN_C Int32 rt_jump_to_address(VoidPtr code, HEL::BootInfoHeader* handover, UInt8* stack); - - BootThread::BootThread(VoidPtr blob) - : fBlob(blob), fStartAddress(nullptr) - { - // detect the format. - const Char* blob_bytes = reinterpret_cast(fBlob); - - BootTextWriter writer; - - if (!blob_bytes) - { - // failed to provide a valid pointer. - return; - } - - if (blob_bytes[0] == kMagMz0 && - blob_bytes[1] == kMagMz1) - { - LDR_EXEC_HEADER_PTR header_ptr = CFKit::ldr_find_exec_header(blob_bytes); - LDR_OPTIONAL_HEADER_PTR opt_header_ptr = CFKit::ldr_find_opt_exec_header(blob_bytes); - - if (!header_ptr || !opt_header_ptr) - return; - -#ifdef __NE_AMD64__ - if (header_ptr->Machine != kPeMachineAMD64 || - header_ptr->Signature != kPeSignature) - { - writer.Write("BootZ: Not a PE32+ executable.\r"); - return; - } -#elif defined(__NE_ARM64__) - if (header_ptr->Machine != kPeMachineARM64 || - header_ptr->Signature != kPeSignature) - { - writer.Write("BootZ: Not a PE32+ executable.\r"); - return; - } -#endif // __NE_AMD64__ || __NE_ARM64__ - - writer.Write("BootZ: PE32+ executable detected (NeKernel Subsystem).\r"); - - auto numSecs = header_ptr->NumberOfSections; - - writer.Write("BootZ: Major Linker Ver: ").Write(opt_header_ptr->MajorLinkerVersion).Write("\r"); - writer.Write("BootZ: Minor Linker Ver: ").Write(opt_header_ptr->MinorLinkerVersion).Write("\r"); - writer.Write("BootZ: Major Subsystem Ver: ").Write(opt_header_ptr->MajorSubsystemVersion).Write("\r"); - writer.Write("BootZ: Minor Subsystem Ver: ").Write(opt_header_ptr->MinorSubsystemVersion).Write("\r"); - writer.Write("BootZ: Magic: ").Write(header_ptr->Signature).Write("\r"); - - constexpr auto cPageSize = 512; - - EfiPhysicalAddress loadStartAddress = opt_header_ptr->ImageBase; - loadStartAddress += opt_header_ptr->BaseOfData; - - writer.Write("BootZ: Image base: ").Write(loadStartAddress).Write("\r"); - - auto numPages = opt_header_ptr->SizeOfImage / cPageSize; - BS->AllocatePages(AllocateAddress, EfiLoaderData, numPages, &loadStartAddress); - - LDR_SECTION_HEADER_PTR sectPtr = (LDR_SECTION_HEADER_PTR)(((Char*)opt_header_ptr) + header_ptr->SizeOfOptionalHeader); - - constexpr auto sectionForCode = ".text"; - constexpr auto sectionForNewLdr = ".ldr"; - constexpr auto sectionForBSS = ".bss"; - - for (SizeT sectIndex = 0; sectIndex < numSecs; ++sectIndex) - { - LDR_SECTION_HEADER_PTR sect = §Ptr[sectIndex]; - - SetMem((VoidPtr)(loadStartAddress + sect->VirtualAddress), 0, sect->SizeOfRawData); - - if (StrCmp(sectionForCode, sect->Name) == 0) - { - fStartAddress = (VoidPtr)((UIntPtr)loadStartAddress + opt_header_ptr->AddressOfEntryPoint); - writer.Write("BootZ: Executable entry address: ").Write((UIntPtr)fStartAddress).Write("\r"); - } - else if (StrCmp(sectionForNewLdr, sect->Name) == 0) - { - struct HANDOVER_INFORMATION_STUB - { - UInt64 HandoverMagic; - UInt32 HandoverType; - UInt32 HandoverPad; - UInt32 HandoverArch; - }* handover_struc = (struct HANDOVER_INFORMATION_STUB*)((UIntPtr)fBlob + sect->PointerToRawData); - - if (handover_struc->HandoverMagic != kHandoverMagic && - handover_struc->HandoverType != HEL::kTypeKernel) - { -#ifdef __NE_AMD64__ - if (handover_struc->HandoverArch != HEL::kArchAMD64) - { - fb_render_string("BootZ: Not an handover header, bad CPU...", 40, 10, RGB(0xFF, 0xFF, 0xFF)); - ::EFI::Stop(); - } -#endif - -#ifdef __NE_ARM64__ - if (handover_struc->HandoverArch != HEL::kArchARM64) - { - fb_render_string("BootZ: Not an handover header, bad CPU...", 40, 10, RGB(0xFF, 0xFF, 0xFF)); - ::EFI::Stop(); - } -#endif - fb_render_string("BootZ: Not an handover header...", 40, 10, RGB(0xFF, 0xFF, 0xFF)); - - ::EFI::Stop(); - } - } - - writer.Write("BootZ: Raw offset: ").Write(sect->PointerToRawData).Write(" of ").Write(sect->Name).Write("\r"); - - CopyMem((VoidPtr)(loadStartAddress + sect->VirtualAddress), (VoidPtr)((UIntPtr)fBlob + sect->PointerToRawData), sect->SizeOfRawData); - } - } - else if (blob_bytes[0] == kPefMagic[0] && - blob_bytes[1] == kPefMagic[1] && - blob_bytes[2] == kPefMagic[2] && - blob_bytes[3] == kPefMagic[3]) - { - // ========================================= // - // PEF executable detected. - // ========================================= // - - fStartAddress = nullptr; - writer.Write("BootZ: PEF executable detected, won't load it.\r"); - writer.Write("BootZ: note: PEF executables aren't loadable by default.\r"); - } - else - { - writer.Write("BootZ: Invalid Executable.\r"); - } - - fStack = new UInt8[mib_cast(16)]; - } - - /// @note handover header has to be valid! - Int32 BootThread::Start(HEL::BootInfoHeader* handover, Bool own_stack) - { - HEL::HandoverProc err_fn = [](HEL::BootInfoHeader* rcx) -> Int32 { - fb_render_string("BootZ: Invalid Boot Image...", 50, 10, RGB(0xFF, 0xFF, 0xFF)); - ::EFI::Stop(); - - return NO; - }; - - if (!fStartAddress) - { - err_fn(handover); - } - - fHandover = handover; - - if (own_stack) - { - rt_jump_to_address(fStartAddress, fHandover, &fStack[mib_cast(16) - 1]); - } - else - { - if (fStack) - delete[] fStack; - - fStack = nullptr; - - return reinterpret_cast(fStartAddress)(fHandover); - } - - return kEfiOk; - } - - const Char* BootThread::GetName() - { - return fBlobName; - } - - Void BootThread::SetName(const Char* name) - { - CopyMem(fBlobName, name, StrLen(name)); - } - - bool BootThread::IsValid() - { - return fStartAddress != nullptr; - } -} // namespace Boot diff --git a/dev/Boot/src/BootloaderRsrc.rsrc b/dev/Boot/src/BootloaderRsrc.rsrc deleted file mode 100644 index 8baa8c3d..00000000 --- a/dev/Boot/src/BootloaderRsrc.rsrc +++ /dev/null @@ -1,25 +0,0 @@ -#include "../../Kernel/CompilerKit/Version.h" - -1 VERSIONINFO -FILEVERSION 1,0,0,0 -PRODUCTVERSION 1,0,0,0 -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "080904E4" - BEGIN - VALUE "CompanyName", "Amlal EL Mahrouss" - VALUE "FileDescription", "NeKernel OS Loader." - VALUE "FileVersion", BOOTLOADER_VERSION - VALUE "InternalName", "bootz" - VALUE "LegalCopyright", "Copyright (C) 2024, Amlal EL Mahrouss all rights reserved." - VALUE "OriginalFilename", "bootz.exe" - VALUE "ProductName", "bootz" - VALUE "ProductVersion", BOOTLOADER_VERSION - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x809, 1252 - END -END diff --git a/dev/Boot/src/HEL/64X000/.gitkeep b/dev/Boot/src/HEL/64X000/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Boot/src/HEL/64X000/BootCB.S b/dev/Boot/src/HEL/64X000/BootCB.S deleted file mode 100644 index f286f449..00000000 --- a/dev/Boot/src/HEL/64X000/BootCB.S +++ /dev/null @@ -1,35 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -.section .boot_hdr -.align 4 - -/* BootZ boot header begin for a 64x000 Kernel. */ - -boot_hdr_mag: - .ascii "CB" -boot_hdr_name: - // it has to match ten bytes. - .asciz "bootz\0\0\0" -boot_hdr_ver: - .word 0x104 -boot_hdr_proc: - .long bootloader_start - -/* BootZ boot header end */ - -.extern bootloader_main -.extern bootloader_stack - -.globl bootloader_start -bootloader_start: - psh 4 /* real address of .Laddr */ - ldi 0,(bootloader_stack-bootloader_start)(4) /* stack address location */ - mv 19,0 /* use user defined stack */ - jrl - - bl bootloader_main - blr diff --git a/dev/Boot/src/HEL/AMD64/BootAPI.S b/dev/Boot/src/HEL/AMD64/BootAPI.S deleted file mode 100644 index 963ef46a..00000000 --- a/dev/Boot/src/HEL/AMD64/BootAPI.S +++ /dev/null @@ -1,60 +0,0 @@ -.global rt_jump_to_address -.global rt_reset_hardware - -.text - -.intel_syntax noprefix - -/** - @brief this function setups a stack and then jumps to - a function */ -rt_jump_to_address: - mov rbx, rcx - mov rcx, rdx - push rbx - push rdx - mov rsp, r8 - push rax - jmp rbx - - pop rdx - pop rbx - pop rax - - ret - -rt_reset_hardware: - /* dont raise any interrupts. (except ofc NMIs.) */ - cli - /* remap PIC */ -wait_gate1: - in al,0x64 - and al,2 - jnz wait_gate1 - mov al,0x0D1 - out 0x64,al -wait_gate2: - in al,0x64 - and al,2 - jnz wait_gate2 - mov al,0x0FE - out 0x60,al - - /* trigger triple fault, by writing to cr4 */ - - mov rax, 0 - lidt [rax] - -reset_wait: - jmp reset_wait - -.global boot_write_cr3 -.global boot_read_cr3 - -boot_read_cr3: - mov rax, rax - ret - -boot_write_cr3: - mov cr3, rcx - ret diff --git a/dev/Boot/src/HEL/AMD64/BootATA.cc b/dev/Boot/src/HEL/AMD64/BootATA.cc deleted file mode 100644 index 0ec6ab18..00000000 --- a/dev/Boot/src/HEL/AMD64/BootATA.cc +++ /dev/null @@ -1,283 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -/** - * @file BootATA.cc - * @author Amlal EL Mahrouss (amlalelmahrouss@icloud.com) - * @brief ATA driver. - * @version 0.1 - * @date 2024-02-02 - * - * @copyright Copyright (c) Amlal EL Mahrouss - * - */ - -#include -#include -#include - -/// bugs: 0 - -using namespace Boot; - -#define kATADataLen 256 - -static Boolean kATADetected = false; -static Int32 kATADeviceType = kATADeviceCount; -static UInt16 kATAData[kATADataLen] = {0}; - -Boolean boot_ata_detected(Void); - -STATIC Boolean boot_ata_wait_io(UInt16 IO) -{ - for (int i = 0; i < 400; i++) - rt_in8(IO + ATA_REG_STATUS); - -ATAWaitForIO_Retry: - auto status_rdy = rt_in8(IO + ATA_REG_STATUS); - - if ((status_rdy & ATA_SR_BSY)) - goto ATAWaitForIO_Retry; - -ATAWaitForIO_Retry2: - status_rdy = rt_in8(IO + ATA_REG_STATUS); - - if (status_rdy & ATA_SR_ERR) - return false; - - if (!(status_rdy & ATA_SR_DRDY)) - goto ATAWaitForIO_Retry2; - - return true; -} - -Void boot_ata_select(UInt16 Bus) -{ - if (Bus == ATA_PRIMARY_IO) - rt_out8(Bus + ATA_REG_HDDEVSEL, ATA_PRIMARY_SEL); - else - rt_out8(Bus + ATA_REG_HDDEVSEL, ATA_SECONDARY_SEL); -} - -Boolean boot_ata_init(UInt16 Bus, UInt8 Drive, UInt16& OutBus, UInt8& OutMaster) -{ - if (boot_ata_detected()) - return true; - - BootTextWriter writer; - - UInt16 IO = Bus; - - boot_ata_select(IO); - - // Bus init, NEIN bit. - rt_out8(IO + ATA_REG_NEIN, 1); - - // identify until it's good. -ATAInit_Retry: - auto status_rdy = rt_in8(IO + ATA_REG_STATUS); - - if (status_rdy & ATA_SR_ERR) - { - writer.Write( - L"BootZ: ATA: Not an IDE based drive.\r"); - - return false; - } - - if ((status_rdy & ATA_SR_BSY)) - goto ATAInit_Retry; - - rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_IDENTIFY); - - /// fetch serial info - /// model, speed, number of sectors... - - boot_ata_wait_io(IO); - - for (SizeT indexData = 0ul; indexData < kATADataLen; ++indexData) - { - kATAData[indexData] = NeOS::HAL::rt_in16(IO + ATA_REG_DATA); - } - - OutBus = - (Bus == ATA_PRIMARY_IO) ? BootDeviceATA::kPrimary : BootDeviceATA::kSecondary; - - OutMaster = (Bus == ATA_PRIMARY_IO) ? ATA_MASTER : ATA_SLAVE; - - return true; -} - -Void boot_ata_read(UInt64 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf, SizeT SectorSz, SizeT Size) -{ - Lba /= SectorSz; - - UInt8 Command = ((!Master) ? 0xE0 : 0xF0); - - boot_ata_wait_io(IO); - boot_ata_select(IO); - - rt_out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F)); - - rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz) / SectorSz)); - - rt_out8(IO + ATA_REG_LBA0, (Lba)&0xFF); - rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); - rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); - rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); - - rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_READ_PIO); - - boot_ata_wait_io(IO); - - for (SizeT IndexOff = 0; IndexOff < Size; ++IndexOff) - { - boot_ata_wait_io(IO); - Buf[IndexOff] = NeOS::HAL::rt_in16(IO + ATA_REG_DATA); - boot_ata_wait_io(IO); - } -} - -Void boot_ata_write(UInt64 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf, SizeT SectorSz, SizeT Size) -{ - Lba /= SectorSz; - - UInt8 Command = ((!Master) ? 0xE0 : 0xF0); - - boot_ata_wait_io(IO); - boot_ata_select(IO); - - rt_out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F)); - - rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + (SectorSz)) / SectorSz)); - - rt_out8(IO + ATA_REG_LBA0, (Lba)&0xFF); - rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); - rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); - rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); - - rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_WRITE_PIO); - - boot_ata_wait_io(IO); - - for (SizeT IndexOff = 0; IndexOff < Size; ++IndexOff) - { - boot_ata_wait_io(IO); - rt_out16(IO + ATA_REG_DATA, Buf[IndexOff]); - boot_ata_wait_io(IO); - } - - boot_ata_wait_io(IO); -} - -/// @check is ATA detected? -Boolean boot_ata_detected(Void) -{ - return kATADetected; -} - -/*** - * - * - * @brief ATA Device class. - * - * - */ - -/** - * @brief ATA Device constructor. - * @param void none. - */ -BootDeviceATA::BootDeviceATA() noexcept -{ - if (boot_ata_init(ATA_PRIMARY_IO, true, this->Leak().mBus, - this->Leak().mMaster) || - boot_ata_init(ATA_SECONDARY_IO, true, this->Leak().mBus, - this->Leak().mMaster)) - { - kATADetected = true; - } -} -/** - * @brief Is ATA detected? - */ -BootDeviceATA::operator bool() -{ - return boot_ata_detected(); -} - -/** - @brief Read Buf from disk - @param Sz Sector size - @param Buf buffer -*/ -BootDeviceATA& BootDeviceATA::Read(CharacterTypeUTF8* Buf, const SizeT& SectorSz) -{ - if (!boot_ata_detected()) - { - Leak().mErr = true; - return *this; - } - - this->Leak().mErr = false; - - if (!Buf || SectorSz < 1) - return *this; - - boot_ata_read(this->Leak().mBase, this->Leak().mBus, this->Leak().mMaster, - Buf, SectorSz, this->Leak().mSize); - - return *this; -} - -/** - @brief Write Buf into disk - @param Sz Sector size - @param Buf buffer -*/ -BootDeviceATA& BootDeviceATA::Write(CharacterTypeUTF8* Buf, const SizeT& SectorSz) -{ - if (!boot_ata_detected()) - { - Leak().mErr = true; - return *this; - } - - Leak().mErr = false; - - if (!Buf || SectorSz < 1 || this->Leak().mSize < 1) - { - Leak().mErr = true; - return *this; - } - - boot_ata_write(this->Leak().mBase, this->Leak().mBus, this->Leak().mMaster, - Buf, SectorSz, this->Leak().mSize); - - return *this; -} - -/** - * @brief ATA trait getter. - * @return BootDeviceATA::ATATrait& the drive config. - */ -BootDeviceATA::ATATrait& BootDeviceATA::Leak() -{ - return mTrait; -} - -/*** - @brief Getter, gets the number of sectors inside the drive. -*/ -SizeT BootDeviceATA::GetSectorsCount() noexcept -{ - return (kATAData[61] << 16) | kATAData[60]; -} - -SizeT BootDeviceATA::GetDiskSize() noexcept -{ - return this->GetSectorsCount() * BootDeviceATA::kSectorSize; -} diff --git a/dev/Boot/src/HEL/AMD64/BootEFI.cc b/dev/Boot/src/HEL/AMD64/BootEFI.cc deleted file mode 100644 index 11b70b81..00000000 --- a/dev/Boot/src/HEL/AMD64/BootEFI.cc +++ /dev/null @@ -1,316 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Makes the compiler shut up. -#ifndef kMachineModel -#define kMachineModel "ZkaOS" -#endif // !kMachineModel - -#ifndef kExpectedWidth -#define kExpectedWidth (1280) -#endif - -#ifndef kExpectedHeight -#define kExpectedHeight (720) -#endif - -/** Graphics related. */ - -STATIC EfiGraphicsOutputProtocol* kGop = nullptr; -STATIC UInt16 kGopStride = 0U; -STATIC EfiGUID kGopGuid; - -/** Related to jumping to the reset vector. */ - -EXTERN_C Void rt_reset_hardware(); - -/** Boot Services symbol. */ -EXTERN EfiBootServices* BS; - -/** - @brief Finds and stores the GOP object. -*/ -STATIC Bool boot_init_fb() noexcept -{ - kGopGuid = EfiGUID(EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID); - kGop = nullptr; - - if (BS->LocateProtocol(&kGopGuid, nullptr, (VoidPtr*)&kGop) != kEfiOk) - return No; - - kGopStride = 4; - - for (SizeT i = 0; i < kGop->Mode->MaxMode; ++i) - { - EfiGraphicsOutputProtocolModeInformation* infoPtr = nullptr; - UInt32 sz = 0U; - - kGop->QueryMode(kGop, i, &sz, &infoPtr); - - if (infoPtr->HorizontalResolution == kExpectedWidth && - infoPtr->VerticalResolution == kExpectedHeight) - { - kGop->SetMode(kGop, i); - return Yes; - } - } - - return No; -} - -EfiGUID kEfiGlobalNamespaceVarGUID = { - 0x8BE4DF61, 0x93CA, 0x11D2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C}}; - -/// @brief Main EFI entrypoint. -/// @param image_handle Handle of this image. -/// @param sys_table The system table of it. -/// @return nothing, never returns. -EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr image_handle, - EfiSystemTable* sys_table) -{ - InitEFI(sys_table); ///! Init the EFI library. - - HEL::BootInfoHeader* handover_hdr = - new HEL::BootInfoHeader(); - - UInt32 map_key = 0; - UInt32 size_struct_ptr = sizeof(EfiMemoryDescriptor); - EfiMemoryDescriptor* struct_ptr = nullptr; - UInt32 sz_desc = sizeof(EfiMemoryDescriptor); - UInt32 rev_desc = 0; - -#ifdef ZBA_USE_FB - if (!boot_init_fb()) - return 1; ///! Init the GOP. - - for (SizeT index_vt = 0; index_vt < sys_table->NumberOfTableEntries; - ++index_vt) - { - Char* vendor_table = reinterpret_cast( - sys_table->ConfigurationTable[index_vt].VendorTable); - - // ACPI's 'RSD PTR', which contains the ACPI SDT (MADT, FACP...) - if (vendor_table[0] == 'R' && vendor_table[1] == 'S' && - vendor_table[2] == 'D' && vendor_table[3] == ' ' && - vendor_table[4] == 'P' && vendor_table[5] == 'T' && - vendor_table[6] == 'R' && vendor_table[7] == ' ') - { - handover_hdr->f_HardwareTables.f_VendorPtr = (VoidPtr)vendor_table; - break; - } - } - - // ------------------------------------------ // - // draw background color. - // ------------------------------------------ // - - handover_hdr->f_GOP.f_The = kGop->Mode->FrameBufferBase; - handover_hdr->f_GOP.f_Width = kGop->Mode->Info->VerticalResolution; - handover_hdr->f_GOP.f_Height = kGop->Mode->Info->HorizontalResolution; - handover_hdr->f_GOP.f_PixelPerLine = kGop->Mode->Info->PixelsPerScanLine; - handover_hdr->f_GOP.f_PixelFormat = kGop->Mode->Info->PixelFormat; - handover_hdr->f_GOP.f_Size = kGop->Mode->FrameBufferSize; -#endif // ZBA_USE_FB - - // ------------------------------------------- // - // Grab MP services, extended to runtime. // - // ------------------------------------------- // - - EfiGUID guid_mp = EfiGUID(EFI_MP_SERVICES_PROTOCOL_GUID); - EfiMpServicesProtocol* mp = nullptr; - - BS->LocateProtocol(&guid_mp, nullptr, reinterpret_cast(&mp)); - - handover_hdr->f_HardwareTables.f_MpPtr = reinterpret_cast(mp); - - kHandoverHeader = handover_hdr; - - fb_init(); - - FB::fb_clear_video(); - - FBDrawBitMapInRegion(zka_disk, NE_DISK_WIDTH, NE_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - NE_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - NE_DISK_HEIGHT) / 2); - - fb_clear(); - - UInt32 cnt_enabled = 0; - UInt32 cnt_disabled = 0; - - if (mp) - { - mp->GetNumberOfProcessors(mp, &cnt_disabled, &cnt_enabled); - handover_hdr->f_HardwareTables.f_MultiProcessingEnabled = cnt_enabled > 1; - } - else - { - handover_hdr->f_HardwareTables.f_MultiProcessingEnabled = NO; - } - - // Fill handover header now. - - // ---------------------------------------------------- // - // The following checks for an exisiting partition - // inside the disk, if it doesn't have one, - // format the disk. - // ---------------------------------------------------- // - - BS->GetMemoryMap(&size_struct_ptr, struct_ptr, &map_key, &sz_desc, &rev_desc); - - struct_ptr = new EfiMemoryDescriptor[sz_desc]; - - BS->GetMemoryMap(&size_struct_ptr, struct_ptr, &map_key, &sz_desc, &rev_desc); - - auto kDefaultMemoryMap = 0; // Grab any usable entries. - - //-----------------------------------------------------------// - // A simple loop which finds a usable memory region for us. - //-----------------------------------------------------------// - - SizeT lookup_index = 0UL; - - for (; struct_ptr[lookup_index].Kind != EfiMemoryType::EfiConventionalMemory; ++lookup_index) - { - NE_UNUSED(0); - } - - kDefaultMemoryMap = lookup_index; - - //-------------------------------------------------------------// - // Update handover file specific table and phyiscal start field. - //-------------------------------------------------------------// - - handover_hdr->f_BitMapStart = (VoidPtr)struct_ptr[kDefaultMemoryMap].VirtualStart; /* Start of bitmap. */ - handover_hdr->f_BitMapSize = struct_ptr[kDefaultMemoryMap].NumberOfPages * sizeof(UIntPtr); /* Size of bitmap. */ - - handover_hdr->f_FirmwareCustomTables[0] = (VoidPtr)BS; - handover_hdr->f_FirmwareCustomTables[1] = (VoidPtr)ST; - - Boot::BootFileReader reader_syschk(L"syschk.sys", image_handle); - reader_syschk.ReadAll(0); - - Boot::BootThread* syschk_thread = nullptr; - - // ------------------------------------------ // - // If we succeed in reading the blob, then execute it. - // ------------------------------------------ // - - if (reader_syschk.Blob()) - { - syschk_thread = new Boot::BootThread(reader_syschk.Blob()); - syschk_thread->SetName("BootZ: System Recovery Check"); - syschk_thread->Start(handover_hdr, NO); - } - -#if defined(__ATA_PIO__) - Boot::BDiskFormatFactory partition_factory; - - if (syschk_thread->Start(handover_hdr, NO) != kEfiOk) - { - if (partition_factory.IsPartitionValid() == NO) - { - Boot::BDiskFormatFactory::BFileDescriptor root{}; - - root.fFileName[0] = kNeFSRoot[0]; - root.fFileName[1] = 0; - - root.fKind = kNeFSCatalogKindDir; - - const auto kFSName = "SSD"; - - partition_factory.Format(kFSName, &root, 1); - - fb_init(); - - FB::fb_clear_video(); - - FBDrawBitMapInRegion(zka_has_disk, NE_HAS_DISK_WIDTH, NE_HAS_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - NE_HAS_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - NE_HAS_DISK_HEIGHT) / 2); - - fb_clear(); - } - } -#endif - - // ------------------------------------------ // - // null these fields, to avoid being reused later. - // ------------------------------------------ // - - handover_hdr->f_FirmwareCustomTables[0] = nullptr; - handover_hdr->f_FirmwareCustomTables[1] = nullptr; - - handover_hdr->f_FirmwareVendorLen = Boot::BStrLen(sys_table->FirmwareVendor); - - handover_hdr->f_Magic = kHandoverMagic; - handover_hdr->f_Version = kHandoverVersion; - - // Provide fimware vendor name. - - Boot::BCopyMem(handover_hdr->f_FirmwareVendorName, sys_table->FirmwareVendor, - handover_hdr->f_FirmwareVendorLen); - - handover_hdr->f_FirmwareVendorLen = Boot::BStrLen(sys_table->FirmwareVendor); - - // Assign to global 'kHandoverHeader'. - - WideChar kernel_path[256U] = L"neoskrnl.exe"; - UInt32 kernel_path_sz = 256U; - - if (ST->RuntimeServices->GetVariable(L"/props/boot_path", kEfiGlobalNamespaceVarGUID, nullptr, &kernel_path_sz, kernel_path) != kEfiOk) - { - /// access attributes (in order) - /// EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS - UInt32 attr = 0x00000001 | 0x00000002 | 0x00000004; - ST->RuntimeServices->SetVariable(L"/props/boot_path", kEfiGlobalNamespaceVarGUID, &attr, &kernel_path_sz, kernel_path); - } - - Boot::BootFileReader reader_kernel(kernel_path, image_handle); - - reader_kernel.ReadAll(0); - - Boot::BootThread* kernel_thread = nullptr; - - // ------------------------------------------ // - // If we succeed in reading the blob, then execute it. - // ------------------------------------------ // - - if (reader_kernel.Blob()) - { - kernel_thread = new Boot::BootThread(reader_kernel.Blob()); - kernel_thread->SetName("BootZ: MicroKernel."); - - handover_hdr->f_KernelImage = reader_kernel.Blob(); - } - else - { - fb_init(); - FBDrawBitMapInRegion(zka_no_disk, NE_NO_DISK_WIDTH, NE_NO_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - NE_NO_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - NE_NO_DISK_HEIGHT) / 2); - - EFI::Stop(); - } - - EFI::ExitBootServices(map_key, image_handle); - - // ---------------------------------------------------- // - // Finally load the OS kernel. - // ---------------------------------------------------- // - - kernel_thread->Start(handover_hdr, YES); - - CANT_REACH(); -} diff --git a/dev/Boot/src/HEL/AMD64/BootPlatform.cc b/dev/Boot/src/HEL/AMD64/BootPlatform.cc deleted file mode 100644 index c7ae4085..00000000 --- a/dev/Boot/src/HEL/AMD64/BootPlatform.cc +++ /dev/null @@ -1,106 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include - -#ifdef __BOOTLDR_STANDALONE__ - -using namespace Boot; - -EXTERN_C void rt_hlt() -{ - asm volatile("hlt"); -} - -EXTERN_C void rt_cli() -{ - asm volatile("cli"); -} - -EXTERN_C void rt_sti() -{ - asm volatile("sti"); -} - -EXTERN_C void rt_cld() -{ - asm volatile("cld"); -} - -EXTERN_C void rt_std() -{ - asm volatile("std"); -} - -EXTERN_C void rt_out8(UInt16 port, UInt8 value) -{ - asm volatile("outb %%al, %1" - : - : "a"(value), "Nd"(port) - : "memory"); -} - -EXTERN_C void rt_out16(UInt16 port, UInt16 value) -{ - asm volatile("outw %%ax, %1" - : - : "a"(value), "Nd"(port) - : "memory"); -} - -EXTERN_C void rt_out32(UInt16 port, UInt32 value) -{ - asm volatile("outl %%eax, %1" - : - : "a"(value), "Nd"(port) - : "memory"); -} - -EXTERN_C UInt8 rt_in8(UInt16 port) -{ - UInt8 value; - asm volatile("inb %1, %%al" - : "=a"(value) - : "Nd"(port) - : "memory"); - - return value; -} - -EXTERN_C UInt16 rt_in16(UInt16 port) -{ - UInt16 value; - asm volatile("inw %%dx, %%ax" - : "=a"(value) - : "d"(port)); - - return value; -} - -EXTERN_C UInt32 rt_in32(UInt16 port) -{ - UInt32 value; - asm volatile("inl %1, %%eax" - : "=a"(value) - : "Nd"(port) - : "memory"); - - return value; -} - -#else - -#include - -void rt_hlt() -{ - NeOS::HAL::rt_halt(); -} - -#endif // __BOOTLDR_STANDALONE__ diff --git a/dev/Boot/src/HEL/AMD64/BootSATA.cc b/dev/Boot/src/HEL/AMD64/BootSATA.cc deleted file mode 100644 index b485023d..00000000 --- a/dev/Boot/src/HEL/AMD64/BootSATA.cc +++ /dev/null @@ -1,20 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -/** - * @file BootAHCI.cc - * @author Amlal EL Mahrouss (amlalelmahrouss@icloud.com) - * @brief SATA support for BootZ. - * @version 0.1 - * @date 2024-02-02 - * - * @copyright Copyright (c) Amlal EL Mahrouss - * - */ - -#include -#include -#include diff --git a/dev/Boot/src/HEL/ARM64/.gitkeep b/dev/Boot/src/HEL/ARM64/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Boot/src/HEL/ARM64/BootAPI.S b/dev/Boot/src/HEL/ARM64/BootAPI.S deleted file mode 100644 index a60ad218..00000000 --- a/dev/Boot/src/HEL/ARM64/BootAPI.S +++ /dev/null @@ -1,12 +0,0 @@ -.global rt_jump_to_address - -.text - -/** - @brief this function setups a stack and then jumps to - a function */ -rt_jump_to_address: - mov x19, x0 - mov sp, x2 - blr x19 - diff --git a/dev/Boot/src/HEL/ARM64/BootCB.S b/dev/Boot/src/HEL/ARM64/BootCB.S deleted file mode 100644 index 2d1ff60c..00000000 --- a/dev/Boot/src/HEL/ARM64/BootCB.S +++ /dev/null @@ -1,40 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifdef __NE_COREBOOT__ - -.section .boot_hdr -.align 4 - -/* BootZ boot header begin */ - -boot_hdr_mag: - .ascii "CB" -boot_hdr_name: - // it has to match ten bytes. - .asciz "bootz\0\0" -boot_hdr_ver: - .word 0x104 -boot_hdr_proc: - .long bootloader_start - -/* BootZ boot header end */ - -.extern bootloader_main -.extern bootloader_stack - -.globl bootloader_start -bootloader_start: - adr x0, bootloader_stack - ldr x1, =bootloader_start - sub x0, x0, x1 - ldr x0, [x0] - mov sp, x0 - - bl bootloader_main - ret - -#endif // __NE_COREBOOT__ \ No newline at end of file diff --git a/dev/Boot/src/HEL/ARM64/BootEFI.cc b/dev/Boot/src/HEL/ARM64/BootEFI.cc deleted file mode 100644 index 9df1b2d4..00000000 --- a/dev/Boot/src/HEL/ARM64/BootEFI.cc +++ /dev/null @@ -1,220 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Makes the compiler shut up. -#ifndef kMachineModel -#define kMachineModel "ZkaOS" -#endif // !kMachineModel - -#ifndef kExpectedWidth -#define kExpectedWidth (1920) -#endif - -#ifndef kExpectedHeight -#define kExpectedHeight (1080) -#endif - -/** Graphics related. */ - -STATIC EfiGraphicsOutputProtocol* kGop = nullptr; -STATIC UInt16 kGopStride = 0U; -STATIC EfiGUID kGopGuid; - -EXTERN_C Void rt_reset_hardware(); - -EXTERN EfiBootServices* BS; - -/** - @brief Finds and stores the GOP object. -*/ -STATIC Bool boot_init_fb() noexcept -{ - kGopGuid = EfiGUID(EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID); - kGop = nullptr; - - if (BS->LocateProtocol(&kGopGuid, nullptr, (VoidPtr*)&kGop) != kEfiOk) - return No; - - kGopStride = 4; - - for (SizeT i = 0; i < kGop->Mode->MaxMode; ++i) - { - EfiGraphicsOutputProtocolModeInformation* infoPtr = nullptr; - UInt32 sz = 0U; - - kGop->QueryMode(kGop, i, &sz, &infoPtr); - - if (infoPtr->HorizontalResolution == kExpectedWidth && - infoPtr->VerticalResolution == kExpectedHeight) - { - kGop->SetMode(kGop, i); - return Yes; - } - } - - return No; -} - -EXTERN EfiBootServices* BS; - -/// @brief Main EFI entrypoint. -/// @param image_handle Handle of this image. -/// @param sys_table The system table of it. -/// @return nothing, never returns. -EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr image_handle, - EfiSystemTable* sys_table) -{ - InitEFI(sys_table); ///! Init the EFI library. - - HEL::BootInfoHeader* handover_hdr = - new HEL::BootInfoHeader(); - - UInt32 map_key = 0; - UInt32 size_struct_ptr = sizeof(EfiMemoryDescriptor); - EfiMemoryDescriptor* struct_ptr = nullptr; - UInt32 sz_desc = sizeof(EfiMemoryDescriptor); - UInt32 rev_desc = 0; - -#ifdef ZBA_USE_FB - if (!boot_init_fb()) - return 1; ///! Init the GOP. - - for (SizeT index_vt = 0; index_vt < sys_table->NumberOfTableEntries; - ++index_vt) - { - Char* vendor_table = reinterpret_cast( - sys_table->ConfigurationTable[index_vt].VendorTable); - - // ACPI's 'RSD PTR', which contains the ACPI SDT (MADT, FACP...) - if (vendor_table[0] == 'R' && vendor_table[1] == 'S' && - vendor_table[2] == 'D' && vendor_table[3] == ' ' && - vendor_table[4] == 'P' && vendor_table[5] == 'T' && - vendor_table[6] == 'R' && vendor_table[7] == ' ') - { - handover_hdr->f_HardwareTables.f_VendorPtr = (VoidPtr)vendor_table; - break; - } - } - - // ------------------------------------------ // - // draw background color. - // ------------------------------------------ // - - handover_hdr->f_GOP.f_The = kGop->Mode->FrameBufferBase; - handover_hdr->f_GOP.f_Width = kGop->Mode->Info->VerticalResolution; - handover_hdr->f_GOP.f_Height = kGop->Mode->Info->HorizontalResolution; - handover_hdr->f_GOP.f_PixelPerLine = kGop->Mode->Info->PixelsPerScanLine; - handover_hdr->f_GOP.f_PixelFormat = kGop->Mode->Info->PixelFormat; - handover_hdr->f_GOP.f_Size = kGop->Mode->FrameBufferSize; -#endif // ZBA_USE_FB - - // ------------------------------------------- // - // Grab MP services, extended to runtime. // - // ------------------------------------------- // - - EfiGUID guid_mp = EfiGUID(EFI_MP_SERVICES_PROTOCOL_GUID); - EfiMpServicesProtocol* mp = nullptr; - - BS->LocateProtocol(&guid_mp, nullptr, reinterpret_cast(&mp)); - - handover_hdr->f_HardwareTables.f_MpPtr = reinterpret_cast(mp); - - kHandoverHeader = handover_hdr; - - fb_init(); - - FB::fb_clear_video(); - - FBDrawBitMapInRegion(zka_disk, NE_DISK_WIDTH, NE_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - NE_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - NE_DISK_HEIGHT) / 2); - - fb_clear(); - - UInt32 cnt_enabled = 0; - UInt32 cnt_disabled = 0; - - if (mp) - { - mp->GetNumberOfProcessors(mp, &cnt_disabled, &cnt_enabled); - handover_hdr->f_HardwareTables.f_MultiProcessingEnabled = cnt_enabled > 1; - } - else - { - handover_hdr->f_HardwareTables.f_MultiProcessingEnabled = NO; - } - - //-------------------------------------------------------------// - // Update handover file specific table and phyiscal start field. - //-------------------------------------------------------------// - - handover_hdr->f_BitMapStart = nullptr; /* Start of bitmap. */ - handover_hdr->f_BitMapSize = kHandoverBitMapSz; /* Size of bitmap. */ - - while (BS->AllocatePool(EfiLoaderData, handover_hdr->f_BitMapSize, &handover_hdr->f_BitMapStart) != kEfiOk) - { - if (handover_hdr->f_BitMapStart) - { - BS->FreePool(handover_hdr->f_BitMapStart); - handover_hdr->f_BitMapStart = nullptr; - } - } - - // ------------------------------------------ // - // null these fields, to avoid being reused later. - // ------------------------------------------ // - - handover_hdr->f_FirmwareCustomTables[0] = nullptr; - handover_hdr->f_FirmwareCustomTables[1] = nullptr; - - handover_hdr->f_FirmwareVendorLen = Boot::BStrLen(sys_table->FirmwareVendor); - - handover_hdr->f_Magic = kHandoverMagic; - handover_hdr->f_Version = kHandoverVersion; - - // Provide fimware vendor name. - - Boot::BCopyMem(handover_hdr->f_FirmwareVendorName, sys_table->FirmwareVendor, - handover_hdr->f_FirmwareVendorLen); - - handover_hdr->f_FirmwareVendorLen = Boot::BStrLen(sys_table->FirmwareVendor); - - // Assign to global 'kHandoverHeader'. - - Boot::BootFileReader reader_kernel(L"neoskrnl.exe", image_handle); - - reader_kernel.ReadAll(0); - - // ------------------------------------------ // - // If we succeed in reading the blob, then execute it. - // ------------------------------------------ // - - if (reader_kernel.Blob()) - { - auto kernel_thread = Boot::BootThread(reader_kernel.Blob()); - kernel_thread.SetName("BootZ: MicroKernel."); - - handover_hdr->f_KernelImage = reader_kernel.Blob(); - - EFI::ExitBootServices(map_key, image_handle); - - kernel_thread.Start(handover_hdr, YES); - } - - CANT_REACH(); -} diff --git a/dev/Boot/src/HEL/ARM64/BootPlatform.cc b/dev/Boot/src/HEL/ARM64/BootPlatform.cc deleted file mode 100644 index 9713b80d..00000000 --- a/dev/Boot/src/HEL/ARM64/BootPlatform.cc +++ /dev/null @@ -1,37 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include - -#ifdef __BOOTLDR_STANDALONE__ - -using namespace Boot; - -EXTERN_C void rt_hlt() -{ - while (Yes) - ; -} - -EXTERN_C void rt_cli() -{ -} - -EXTERN_C void rt_sti() -{ -} - -EXTERN_C void rt_cld() -{ -} - -EXTERN_C void rt_std() -{ -} - -#endif // __BOOTLDR_STANDALONE__ diff --git a/dev/Boot/src/HEL/POWER/.gitkeep b/dev/Boot/src/HEL/POWER/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Boot/src/HEL/POWER/BootCB.S b/dev/Boot/src/HEL/POWER/BootCB.S deleted file mode 100644 index 2b64f8c1..00000000 --- a/dev/Boot/src/HEL/POWER/BootCB.S +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -.section .boot_hdr -.align 4 - -/* BootZ boot header begin */ - -boot_hdr_mag: - .ascii "CB" -boot_hdr_name: - // it has to match ten bytes. - .asciz "bootz\0\0\0" -boot_hdr_ver: - .word 0x104 -boot_hdr_proc: - .long bootloader_start - -/* BootZ boot header end */ - -.extern bootloader_main -.extern bootloader_stack - -.globl bootloader_start -bootloader_start: - mflr 4 /* real address of .Laddr */ - lwz 0,(bootloader_stack-bootloader_start)(4) /* stack address location */ - mr 1,0 /* use user defined stack */ - - bl bootloader_main - blr diff --git a/dev/Boot/src/New+Delete.cc b/dev/Boot/src/New+Delete.cc deleted file mode 100644 index 03a1bb68..00000000 --- a/dev/Boot/src/New+Delete.cc +++ /dev/null @@ -1,60 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include - -#ifdef __BOOTLDR_STANDALONE__ -EXTERN EfiBootServices* BS; - -/// @brief Allocates a new object. -/// @param sz the size. -/// @return -void* operator new(size_t sz) -{ - void* buf = nullptr; - - while (BS->AllocatePool(EfiMemoryType::EfiLoaderData, sz, &buf) != kEfiOk) - BS->FreePool(buf); - - return buf; -} - -/// @brief Allocates a new object. -/// @param sz the size. -/// @return -void* operator new[](size_t sz) -{ - void* buf = nullptr; - BS->AllocatePool(EfiMemoryType::EfiLoaderData, sz, &buf); - - return buf; -} - -/// @brief Deletes the object. -/// @param buf the object. -void operator delete(void* buf) -{ - BS->FreePool(buf); -} - -/// @brief Deletes the object. -/// @param buf the object. -void operator delete[](void* buf) -{ - BS->FreePool(buf); -} - -/// @brief Deletes the object (array specific). -/// @param buf the object. -/// @param size it's size. -void operator delete(void* buf, size_t size) -{ - BS->FreePool(buf); -} - -#endif // __BOOTLDR_STANDALONE__ diff --git a/dev/Boot/src/Root/EFI/STARTUP.NSH b/dev/Boot/src/Root/EFI/STARTUP.NSH deleted file mode 100644 index 2cf25f23..00000000 --- a/dev/Boot/src/Root/EFI/STARTUP.NSH +++ /dev/null @@ -1,2 +0,0 @@ -fs0: -BOOT\BOOTAA64.EFI diff --git a/dev/Drivers/.keep b/dev/Drivers/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Hints/CompilerHint.h b/dev/Hints/CompilerHint.h deleted file mode 100644 index 9a1be9f6..00000000 --- a/dev/Hints/CompilerHint.h +++ /dev/null @@ -1,25 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef HINTKIT_HINT_H -#define HINTKIT_HINT_H - -#ifdef __LIBCOMPILER__ -#pragma compiler(hint_manifest) -#endif - -#define _Input -#define _Output - -#define _Optional - -#define _StrictCheckInput -#define _StrictCheckOutput - -#define _InOut -#define _StrictInOut - -#endif // ifndef HINTKIT_HINT_H diff --git a/dev/HintsKit/CompilerHint.h b/dev/HintsKit/CompilerHint.h new file mode 100644 index 00000000..9a1be9f6 --- /dev/null +++ b/dev/HintsKit/CompilerHint.h @@ -0,0 +1,25 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef HINTKIT_HINT_H +#define HINTKIT_HINT_H + +#ifdef __LIBCOMPILER__ +#pragma compiler(hint_manifest) +#endif + +#define _Input +#define _Output + +#define _Optional + +#define _StrictCheckInput +#define _StrictCheckOutput + +#define _InOut +#define _StrictInOut + +#endif // ifndef HINTKIT_HINT_H diff --git a/dev/Kernel/ArchKit/ArchKit.h b/dev/Kernel/ArchKit/ArchKit.h deleted file mode 100644 index 04fc5bf6..00000000 --- a/dev/Kernel/ArchKit/ArchKit.h +++ /dev/null @@ -1,94 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -#include - -#ifdef __NE_AMD64__ -#include -#include -#include -#elif defined(__NE_POWER64__) -#include -#elif defined(__NE_ARM64__) -#include -#elif defined(__NE_SDK__) -#include -#else -#error !!! unknown architecture !!! -#endif - -#define kKernelMaxSystemCalls (512U) - -namespace NeOS -{ - inline SSizeT rt_hash_seed(const Char* seed, int mul) - { - SSizeT hash = 0; - - for (SSizeT idx = 0; seed[idx] != 0; ++idx) - { - hash += seed[idx]; - hash ^= mul; - } - - return hash; - } - - /// @brief write to mapped memory register - /// @param base the base address. - /// @param reg the register. - /// @param value the write to write on it. - template - inline Void ke_dma_write(UIntPtr base, DataKind reg, DataKind value) noexcept - { - *(volatile DataKind*)(base + reg) = value; - } - - /// @brief read from mapped memory register. - /// @param base base address - /// @param reg the register. - /// @return the value inside the register. - template - inline UInt32 ke_dma_read(UIntPtr base, DataKind reg) noexcept - { - return *(volatile DataKind*)(base + reg); - } - - namespace HAL - { - auto mm_is_bitmap(VoidPtr ptr) -> Bool; - } -} // namespace NeOS - -typedef NeOS::Void (*rt_syscall_proc)(NeOS::VoidPtr); - -struct HalSyscallEntry final -{ - NeOS::Int64 fHash; - NeOS::Bool fHooked; - rt_syscall_proc fProc; - - operator bool() - { - return fHooked; - } -}; - -inline NeOS::Array - kSyscalls; - -inline NeOS::Array - kKerncalls; - -EXTERN_C NeOS::HAL::StackFramePtr mp_get_current_context(NeOS::Int64 pid); diff --git a/dev/Kernel/CFKit/GUIDWizard.h b/dev/Kernel/CFKit/GUIDWizard.h deleted file mode 100644 index 5236688f..00000000 --- a/dev/Kernel/CFKit/GUIDWizard.h +++ /dev/null @@ -1,24 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace CFKit::XRN::Version1 -{ - using namespace NeOS; - - Ref cf_make_sequence(const ArrayList& seq); - ErrorOr> cf_try_guid_to_string(Ref& guid); -} // namespace CFKit::XRN::Version1 diff --git a/dev/Kernel/CFKit/GUIDWrapper.h b/dev/Kernel/CFKit/GUIDWrapper.h deleted file mode 100644 index 3b7ada6d..00000000 --- a/dev/Kernel/CFKit/GUIDWrapper.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -/* GUID for C++ Components */ - -#define kXRNNil "@{........-....-M...-N...-............}" - -// eXtensible Resource Information -namespace CFKit::XRN -{ - using namespace NeOS; - - union GUIDSequence { - alignas(8) UShort u8[16]; - alignas(8) UShort u16[8]; - alignas(8) UInt u32[4]; - alignas(8) ULong u64[2]; - - struct - { - alignas(8) UInt fMs1; - UShort fMs2; - UShort fMs3; - UChar fMs4[8]; - }; - }; - - class GUID final - { - public: - explicit GUID() = default; - ~GUID() = default; - - public: - GUID& operator=(const GUID&) = default; - GUID(const GUID&) = default; - - public: - GUIDSequence& operator->() noexcept - { - return fUUID; - } - GUIDSequence& Leak() noexcept - { - return fUUID; - } - - private: - GUIDSequence fUUID; - }; -} // namespace CFKit::XRN diff --git a/dev/Kernel/CFKit/Property.h b/dev/Kernel/CFKit/Property.h deleted file mode 100644 index e4588ad6..00000000 --- a/dev/Kernel/CFKit/Property.h +++ /dev/null @@ -1,56 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef CFKIT_PROPS_H -#define CFKIT_PROPS_H - -#include -#include -#include -#include -#include - -#define kMaxPropLen (256U) - -namespace CFKit -{ - using namespace NeOS; - - /// @brief handle to anything (number, ptr, string...) - using PropertyId = UIntPtr; - - /// @brief Kernel property class. - /// @example /prop/smp_max or /prop/kern_ver - class Property - { - public: - Property(); - virtual ~Property(); - - public: - Property& operator=(const Property&) = default; - Property(const Property&) = default; - - BOOL StringEquals(KString& name); - PropertyId& GetValue(); - KString& GetKey(); - - private: - KString fName{kMaxPropLen}; - PropertyId fValue{0UL}; - Ref fGUID{}; - }; - - template - using PropertyArray = Array; -} // namespace CFKit - -namespace NeOS -{ - using namespace CFKit; -} - -#endif // !CFKIT_PROPS_H diff --git a/dev/Kernel/CFKit/Utils.h b/dev/Kernel/CFKit/Utils.h deleted file mode 100644 index b8f16164..00000000 --- a/dev/Kernel/CFKit/Utils.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef CFKIT_UTILS_H -#define CFKIT_UTILS_H - -#include -#include - -namespace CFKit -{ - using namespace NeOS; - - /// @brief Finds the PE header inside the blob. - inline auto ldr_find_exec_header(DosHeaderPtr ptrDos) -> LDR_EXEC_HEADER_PTR - { - if (!ptrDos) - return nullptr; - - if (ptrDos->eMagic[0] != kMagMz0) - return nullptr; - - if (ptrDos->eMagic[1] != kMagMz1) - return nullptr; - - return (LDR_EXEC_HEADER_PTR)(VoidPtr)(&ptrDos->eLfanew + 1); - } - - /// @brief Finds the PE optional header inside the blob. - inline auto ldr_find_opt_exec_header(DosHeaderPtr ptrDos) -> LDR_OPTIONAL_HEADER_PTR - { - if (!ptrDos) - return nullptr; - - auto exec = ldr_find_exec_header(ptrDos); - - if (!exec) - return nullptr; - - return (LDR_OPTIONAL_HEADER_PTR)(VoidPtr)(&exec->Characteristics + 1); - } - - /// @brief Finds the PE header inside the blob. - /// @note overloaded function. - inline auto ldr_find_exec_header(const Char* ptrDos) -> LDR_EXEC_HEADER_PTR - { - return ldr_find_exec_header((DosHeaderPtr)ptrDos); - } - - /// @brief Finds the PE header inside the blob. - /// @note overloaded function. - inline auto ldr_find_opt_exec_header(const Char* ptrDos) -> LDR_OPTIONAL_HEADER_PTR - { - return ldr_find_opt_exec_header((DosHeaderPtr)ptrDos); - } -} // namespace CFKit - -#endif // ifndef CFKIT_UTILS_H diff --git a/dev/Kernel/CompilerKit/CompilerKit.h b/dev/Kernel/CompilerKit/CompilerKit.h deleted file mode 100644 index c1a5f424..00000000 --- a/dev/Kernel/CompilerKit/CompilerKit.h +++ /dev/null @@ -1,13 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef _INC_CL_H -#define _INC_CL_H - -#include -#include - -#endif /* ifndef _INC_CL_H */ diff --git a/dev/Kernel/CompilerKit/Detail.h b/dev/Kernel/CompilerKit/Detail.h deleted file mode 100644 index c098f273..00000000 --- a/dev/Kernel/CompilerKit/Detail.h +++ /dev/null @@ -1,27 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#ifdef __NEOSKRNL__ -#include -#endif // ifdef __NEOSKRNL__ - -#define NE_COPY_DELETE(KLASS) \ - KLASS& operator=(const KLASS&) = delete; \ - KLASS(const KLASS&) = delete; - -#define NE_COPY_DEFAULT(KLASS) \ - KLASS& operator=(const KLASS&) = default; \ - KLASS(const KLASS&) = default; - -#define NE_MOVE_DELETE(KLASS) \ - KLASS& operator=(KLASS&&) = delete; \ - KLASS(KLASS&&) = delete; - -#define NE_MOVE_DEFAULT(KLASS) \ - KLASS& operator=(KLASS&&) = default; \ - KLASS(KLASS&&) = default; diff --git a/dev/Kernel/CompilerKit/Version.h b/dev/Kernel/CompilerKit/Version.h deleted file mode 100644 index 11854cd8..00000000 --- a/dev/Kernel/CompilerKit/Version.h +++ /dev/null @@ -1,7 +0,0 @@ -// (c) Amlal EL Mahrouss - -#pragma once - -/// .. -#define BOOTLOADER_VERSION "1104.2025.110" -#define KERNEL_VERSION "1104.2025.110" diff --git a/dev/Kernel/FSKit/Defines.h b/dev/Kernel/FSKit/Defines.h deleted file mode 100644 index 9431a9c0..00000000 --- a/dev/Kernel/FSKit/Defines.h +++ /dev/null @@ -1,12 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -#define FSKIT_VERSION "1.0.0" -#define FSKIT_VERSION_BCD 0x0100 diff --git a/dev/Kernel/FSKit/HPFS.h b/dev/Kernel/FSKit/HPFS.h deleted file mode 100644 index 0b15810c..00000000 --- a/dev/Kernel/FSKit/HPFS.h +++ /dev/null @@ -1,59 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -/// @file HPFS.h -/// @brief HPFS filesystem support. - -#define kHPFSVersion (0x0100) -#define kHPFSMagic " HPFS" -#define kHPFSMagicLen (8) - -#define kHPFSFileNameLen (256U) -#define kHPFSPartNameLen (256U) - -#define kHPFSMinimumDiskSize (gib_cast(64)) - -enum -{ - kHPFSInvalidDrive, - kHPFSHDDDrive, - kHPFSSSDDrive, - kHPFSMassStorageDrive, - kHPFSSCSIDrive, - kHPFSDriveCount, -}; - -struct HPFS_BOOT_NODE; - -struct HPFS_BOOT_NODE final -{ - NeOS::Char fMagic[kHPFSMagicLen]; - NeOS::Char fPartName[kHPFSPartNameLen]; - NeOS::UInt32 fVersion; - NeOS::UInt64 fBadSectors; - NeOS::UInt64 fSectorCount; - NeOS::UInt64 fSectorSize; - NeOS::UInt32 fChecksum; - NeOS::UInt8 fDriveKind; - NeOS::UInt8 fTextEncoding; - NeOS::UInt64 fRootINode; - NeOS::UInt64 fRecoveryINode; -}; - -struct HPFS_INDEX_NODE -{ - NeOS::Char fName[kHPFSFileNameLen]; - NeOS::UInt32 fFlags; - NeOS::UInt16 fKind; - NeOS::UInt32 fSize; - NeOS::Lba fFirstINode; - NeOS::Lba fLastINode; - NeOS::UInt32 fChecksum; -}; \ No newline at end of file diff --git a/dev/Kernel/FSKit/IndexableProperty.h b/dev/Kernel/FSKit/IndexableProperty.h deleted file mode 100644 index 6a79bc1b..00000000 --- a/dev/Kernel/FSKit/IndexableProperty.h +++ /dev/null @@ -1,63 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -#define kIndexerCatalogNameLength 256U -#define kIndexerClaimed 0xCF - -namespace NeOS -{ - namespace Indexer - { - struct IndexProperty final - { - public: - Char Drive[kDriveNameLen]; - Char Path[kIndexerCatalogNameLength]; - }; - - class IndexableProperty final : public Property - { - public: - explicit IndexableProperty() - : Property() - { - NeOS::KString strProp(kMaxPropLen); - strProp += "/prop/indexable"; - - this->GetKey() = strProp; - } - - ~IndexableProperty() override = default; - - NE_COPY_DEFAULT(IndexableProperty); - - public: - IndexProperty& Leak() noexcept; - - public: - void AddFlag(Int16 flag); - void RemoveFlag(Int16 flag); - Int16 HasFlag(Int16 flag); - - private: - IndexProperty fIndex; - UInt32 fFlags; - }; - - /// @brief Index a file into the indexer instance. - /// @param filename path - /// @param filenameLen used bytes in path. - /// @param indexer the filesystem indexer. - /// @return none. - Void fs_index_file(const Char* filename, SizeT filenameLen, IndexableProperty& indexer); - } // namespace Indexer -} // namespace NeOS diff --git a/dev/Kernel/FSKit/NeFS.h b/dev/Kernel/FSKit/NeFS.h deleted file mode 100644 index 981cd0d9..00000000 --- a/dev/Kernel/FSKit/NeFS.h +++ /dev/null @@ -1,445 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - FILE: NeFS.h - PURPOSE: NeFS (New extended File System) support. - - Revision History: - - ?/?/?: Added file (amlel) - 12/02/24: Add UUID macro for EPM and GPT partition schemes. - 3/16/24: Add mandatory sector size, kNeFSSectorSz is set to 2048 by -default. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include -#include -#include - -/** - @brief New extended File System specification. - @author Amlal EL Mahrouss (Amlal EL Mahrouss, amlalelmahrouss at icloud dot com) -*/ - -#define kNeFSInvalidFork (-1) -#define kNeFSInvalidCatalog (-1) -#define kNeFSCatalogNameLen (256) - -#define kNeFSMinimumDiskSize (gib_cast(4)) - -#define kNeFSSectorSz (512) - -#define kNeFSIdentLen (8) -#define kNeFSIdent " NeFS" -#define kNeFSPadLen (392) - -#define kNeFSMetaFilePrefix '$' - -#define kNeFSVersionInteger (0x0129) -#define kNeFSVerionString "1.2.9" - -/// @brief Standard fork types. -#define kNeFSDataFork "main_data" -#define kNeFSResourceFork "main_rsrc" - -#define kNeFSForkSize (sizeof(NEFS_FORK_STRUCT)) - -#define kNeFSPartitionTypeStandard (7) -#define kNeFSPartitionTypePage (8) -#define kNeFSPartitionTypeBoot (9) - -#define kNeFSCatalogKindFile (1) -#define kNeFSCatalogKindDir (2) -#define kNeFSCatalogKindAlias (3) - -//! Shared between network and/or partitions. Export forks as .zip when copying. -#define kNeFSCatalogKindShared (4) - -#define kNeFSCatalogKindResource (5) -#define kNeFSCatalogKindExecutable (6) - -#define kNeFSCatalogKindPage (8) - -#define kNeFSCatalogKindDevice (9) -#define kNeFSCatalogKindLock (10) - -#define kNeFSCatalogKindRLE (11) -#define kNeFSCatalogKindMetaFile (12) - -#define kNeFSCatalogKindTTF (13) -#define kNeFSCatalogKindRIFF (14) -#define kNeFSCatalogKindMPEG (15) -#define kNeFSCatalogKindMOFF (16) - -#define kNeFSSeparator '/' -#define kNeFSSeparatorAlt '/' - -#define kNeFSUpDir ".." -#define kNeFSRoot "/" -#define kNeFSRootAlt "/" - -#define kNeFSLF '\r' -#define kNeFSEOF (-1) - -#define kNeFSBitWidth (sizeof(NeOS::Char)) -#define kNeFSLbaType (NeOS::Lba) - -/// @note Start after the partition map header. (Virtual addressing) -#define kNeFSRootCatalogStartAddress (1024) -#define kNeFSCatalogStartAddress (kNeFSRootCatalogStartAddress + sizeof(NEFS_ROOT_PARTITION_BLOCK)) - -#define kResourceTypeDialog (10) -#define kResourceTypeString (11) -#define kResourceTypeMenu (12) -#define kResourceTypeSound (13) -#define kResourceTypeFont (14) -#define kNeFSPartLen (32) - -#define kNeFSFlagDeleted (70) -#define kNeFSFlagUnallocated (0) -#define kNeFSFlagCreated (71) - -#define kNeFSMimeNameLen (200) -#define kNeFSForkNameLen (200) - -#define kNeFSFrameworkExt ".fwrk/" -#define kNeFSStepsExt ".step/" -#define kNeFSApplicationExt ".app/" -#define kNeFSJournalExt ".jrnl" - -struct NEFS_CATALOG_STRUCT; -struct NEFS_FORK_STRUCT; -struct NEFS_ROOT_PARTITION_BLOCK; - -enum -{ - kNeFSHardDrive = 0xC0, // Hard Drive - kNeFSSolidStateDrive = 0xC1, // Solid State Drive - kNeFSOpticalDrive = 0x0C, // Blu-Ray/DVD - kNeFSMassStorageDevice = 0xCC, // USB - kNeFSScsiDrive = 0xC4, // SCSI Hard Drive - kNeFSFlashDrive = 0xC6, - kNeFSUnknown = 0xFF, // Unknown device. - kNeFSDriveCount = 7, -}; - -enum -{ - kNeFSStatusUnlocked = 0x18, - kNeFSStatusLocked, - kNeFSStatusError, - kNeFSStatusInvalid, -}; - -/// @brief Catalog type. -struct PACKED NEFS_CATALOG_STRUCT final -{ - BOOL ForkOrCatalog : 1 {0}; - - NeOS::Char Name[kNeFSCatalogNameLen] = {0}; - NeOS::Char Mime[kNeFSMimeNameLen] = {0}; - - /// Catalog flags. - NeOS::UInt16 Flags; - - /// Catalog allocation status. - NeOS::UInt16 Status; - - /// Custom catalog flags. - NeOS::UInt16 CatalogFlags; - - /// Catalog kind. - NeOS::Int32 Kind; - - /// Size of the data fork. - NeOS::Lba DataForkSize; - - /// Size of all resource forks. - NeOS::Lba ResourceForkSize; - - /// Forks LBA. - NeOS::Lba DataFork; - NeOS::Lba ResourceFork; - - /// Buddy allocation tracker. - NeOS::Lba NextSibling; - NeOS::Lba PrevSibling; - - /// Best-buddy tracker. - NeOS::Lba NextBestSibling; - NeOS::Lba NextPrevSibling; - - NeOS::UInt32 Checksum; -}; - -/// @brief Fork type, contains a data page. -/// @note The way we store is way different than how other filesystems do, specific chunk of code are -/// written into either the data fork or resource fork, the resource fork is reserved for file metadata. -/// whereas the data fork is reserved for file data. -struct PACKED NEFS_FORK_STRUCT final -{ - BOOL ForkOrCatalog : 1 {1}; - - NeOS::Char ForkName[kNeFSForkNameLen] = {0}; - NeOS::Char CatalogName[kNeFSCatalogNameLen] = {0}; - - NeOS::Int32 Flags; - NeOS::Int32 Kind; - - NeOS::Int64 ResourceId; - NeOS::Int32 ResourceKind; - NeOS::Int32 ResourceFlags; - - NeOS::Lba DataOffset; // 8 Where to look for this data? - NeOS::SizeT DataSize; /// Data size according using sector count. - - NeOS::Lba NextSibling; - NeOS::Lba PreviousSibling; - - NeOS::Char Pad[2] = {0}; -}; - -/// @brief Partition block type -struct PACKED NEFS_ROOT_PARTITION_BLOCK final -{ - NeOS::Char Ident[kNeFSIdentLen] = {0}; - NeOS::Char PartitionName[kNeFSPartLen] = {0}; - - NeOS::Int32 Flags; - NeOS::Int32 Kind; - - NeOS::Lba StartCatalog; - NeOS::SizeT CatalogCount; - - NeOS::SizeT DiskSize; - - NeOS::SizeT FreeCatalog; - NeOS::SizeT FreeSectors; - - NeOS::SizeT SectorCount; - NeOS::SizeT SectorSize; - - NeOS::UInt64 Version; - - NeOS::Lba EpmBlock; - - NeOS::Char Pad[kNeFSPadLen]; -}; - -namespace NeOS -{ - class NeFileSystemParser; - class NeFileSystemJournal; - class NeFileSystemHelper; - - enum - { - kNeFSSubDriveA, - kNeFSSubDriveB, - kNeFSSubDriveC, - kNeFSSubDriveD, - kNeFSSubDriveInvalid, - kNeFSSubDriveCount, - }; - - /// \brief Resource fork kind. - enum - { - kNeFSRsrcForkKind = 0, - kNeFSDataForkKind = 1 - }; - - /// - /// \name NeFileSystemParser - /// \brief NeFS parser class. (catalog creation, remove removal, root, - /// forks...) Designed like the DOM, detects the filesystem automatically. - /// - class NeFileSystemParser final - { - public: - explicit NeFileSystemParser() = default; - ~NeFileSystemParser() = default; - - public: - NE_COPY_DEFAULT(NeFileSystemParser); - - public: - /// @brief Creates a new fork inside the NeFS partition. - /// @param catalog it's catalog - /// @param theFork the fork itself. - /// @return the fork - _Output BOOL CreateFork(_Input NEFS_FORK_STRUCT& in); - - /// @brief Find fork inside New filesystem. - /// @param catalog the catalog. - /// @param name the fork name. - /// @return the fork. - _Output NEFS_FORK_STRUCT* FindFork(_Input NEFS_CATALOG_STRUCT* catalog, - _Input const Char* name, - Boolean data); - - _Output Void RemoveFork(_Input NEFS_FORK_STRUCT* fork); - - _Output Void CloseFork(_Input NEFS_FORK_STRUCT* fork); - - _Output NEFS_CATALOG_STRUCT* FindCatalog(_Input const Char* catalog_name, Lba& ou_lba, Bool search_hidden = YES, Bool local_search = NO); - - _Output NEFS_CATALOG_STRUCT* GetCatalog(_Input const Char* name); - - _Output NEFS_CATALOG_STRUCT* CreateCatalog(_Input const Char* name, - _Input const Int32& flags, - _Input const Int32& kind); - - _Output NEFS_CATALOG_STRUCT* CreateCatalog(_Input const Char* name); - - _Output Bool WriteCatalog(_Input const Char* catalog, - _Input Bool rsrc, - _Input VoidPtr data, - _Input SizeT sz, - _Input const Char* name); - - _Output VoidPtr ReadCatalog(_Input _Output NEFS_CATALOG_STRUCT* catalog, - _Input Bool isRsrcFork, - _Input SizeT dataSz, - _Input const Char* forkName); - - _Output Bool Seek(_Input _Output NEFS_CATALOG_STRUCT* catalog, SizeT off); - - _Output SizeT Tell(_Input _Output NEFS_CATALOG_STRUCT* catalog); - - _Output Bool RemoveCatalog(_Input const Char* catalog); - - _Output Bool CloseCatalog(_InOut NEFS_CATALOG_STRUCT* catalog); - - /// @brief Make a EPM+NeFS drive out of the disk. - /// @param drive The drive to write on. - /// @return If it was sucessful, see err_local_get(). - _Output Bool Format(_Input _Output DriveTrait* drive, _Input const Lba endLba, _Input const Int32 flags, const Char* part_name); - - public: - UInt32 mDriveIndex{kNeFSSubDriveA}; - }; - - /// - /// \name NeFileSystemHelper - /// \brief Filesystem helper and utils. - /// - - class NeFileSystemHelper final - { - public: - STATIC const Char* Root(); - STATIC const Char* UpDir(); - STATIC const Char Separator(); - STATIC const Char MetaFile(); - }; - - /// @brief Journal class for NeFS. - class NeFileSystemJournal final - { - private: - NEFS_CATALOG_STRUCT* mNode{nullptr}; - - public: - explicit NeFileSystemJournal(const char* stamp = nullptr) - { - if (!stamp) - { - kout << "Invalid: Journal Stamp, using default name.\r"; - return; - } - - kout << "Info: Journal stamp: " << stamp << kendl; - rt_copy_memory((VoidPtr)stamp, this->mStamp, rt_string_len(stamp)); - } - - ~NeFileSystemJournal() = default; - - NE_COPY_DEFAULT(NeFileSystemJournal); - - Bool CreateJournal(NeFileSystemParser* parser) - { - if (!parser) - return NO; - - delete parser->CreateCatalog("/etc/xml/", 0, kNeFSCatalogKindDir); - mNode = parser->CreateCatalog(mStamp); - - if (!mNode) - return NO; - - return YES; - } - - Bool GetJournal(NeFileSystemParser* parser) - { - if (!parser) - return NO; - - auto node = parser->GetCatalog(mStamp); - - if (node) - { - mNode = node; - return YES; - } - - return NO; - } - - Bool ReleaseJournal() - { - if (mNode) - { - delete mNode; - mNode = nullptr; - return YES; - } - - return NO; - } - - Bool CommitJournal(NeFileSystemParser* parser, - Char* xml_data, - Char* journal_name) - { - if (!parser || - !mNode) - return NO; - - NEFS_FORK_STRUCT new_fork{}; - - rt_copy_memory(mStamp, new_fork.CatalogName, rt_string_len(mStamp)); - rt_copy_memory(journal_name, new_fork.ForkName, rt_string_len(journal_name)); - - new_fork.ResourceKind = 0; - new_fork.ResourceId = 0; - new_fork.ResourceFlags = 0; - new_fork.DataSize = rt_string_len(xml_data); - new_fork.Kind = kNeFSRsrcForkKind; - - if (!parser->CreateFork(new_fork)) - return NO; - - kout << "XML Commited: " << xml_data << "\r\nTo Journal Fork: " << journal_name << kendl; - - auto ret = parser->WriteCatalog(new_fork.CatalogName, YES, xml_data, rt_string_len(xml_data), new_fork.ForkName); - - return ret; - } - - private: - Char mStamp[kNeFSCatalogNameLen] = {"/etc/xml/journal" kNeFSJournalExt}; - }; - - namespace NeFS - { - Boolean fs_init_nefs(Void) noexcept; - } // namespace NeFS -} // namespace NeOS diff --git a/dev/Kernel/FirmwareKit/.gitkeep b/dev/Kernel/FirmwareKit/.gitkeep deleted file mode 100644 index 8b137891..00000000 --- a/dev/Kernel/FirmwareKit/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/dev/Kernel/FirmwareKit/CoreBoot/CoreBoot.h b/dev/Kernel/FirmwareKit/CoreBoot/CoreBoot.h deleted file mode 100644 index 5fe3f4ea..00000000 --- a/dev/Kernel/FirmwareKit/CoreBoot/CoreBoot.h +++ /dev/null @@ -1,31 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -namespace Firmware::Detail::CoreBoot -{ - using namespace NeOS; - - struct LEHeader; - - /// @brief Linear Executable Header - /// @author Amlal EL Mahrouss - struct ATTRIBUTE(aligned(4)) LEHeader - { - const Char fMagic[2]; // magic number - const Char fName[10]; // operating system name - const UInt32 fRevision; // firmware revision - const UInt32 fStartAddress; // start address (master/slave(s) thread) - -#ifdef NE_IS_EXTENDED_COREBOOT - const UIntPtr fMasterStructure; // master structure for MP/PM and device tree and such (ARM) - const UIntPtr fMasterStructureVersion; // master structure version. -#endif - }; -} // namespace Firmware::Detail::CoreBoot diff --git a/dev/Kernel/FirmwareKit/CoreBoot/NS.h b/dev/Kernel/FirmwareKit/CoreBoot/NS.h deleted file mode 100644 index 95576de8..00000000 --- a/dev/Kernel/FirmwareKit/CoreBoot/NS.h +++ /dev/null @@ -1,10 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include \ No newline at end of file diff --git a/dev/Kernel/FirmwareKit/CoreBoot/NetBoot.h b/dev/Kernel/FirmwareKit/CoreBoot/NetBoot.h deleted file mode 100644 index 21ce02ba..00000000 --- a/dev/Kernel/FirmwareKit/CoreBoot/NetBoot.h +++ /dev/null @@ -1,25 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -/// @brief the internet header is used to download updates OTA. -typedef struct NETBOOT_INTERNET_HEADER -{ - NeOS::Char NB1; /// magic char 1 'N' - NeOS::Char NB2; /// magic char 2 'E' - NeOS::Char NB3; /// magic char 3 'T' - NeOS::Char NB4; /// magic char 4 'B' - - NeOS::Char PatchName[256U]; /// example: ColdChoco - NeOS::Int32 PatchLength; /// the patch length. - NeOS::Char PatchTarget[256U]; /// the target file. - NeOS::Boolean ImpliesROM; /// does it imply an EEPROM reprogram? - NeOS::Boolean Preflight; /// is it a preflight packet. - NeOS::Char Patch[]; /// non preflight packet has a patch blob for a **PatchTarget** -} NETBOOT_INTERNET_HEADER; diff --git a/dev/Kernel/FirmwareKit/EFI.h b/dev/Kernel/FirmwareKit/EFI.h deleted file mode 100644 index 57f7e17a..00000000 --- a/dev/Kernel/FirmwareKit/EFI.h +++ /dev/null @@ -1,11 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -/// @note this header is used to reference the EFI/EFI.h diff --git a/dev/Kernel/FirmwareKit/EFI/API.h b/dev/Kernel/FirmwareKit/EFI/API.h deleted file mode 100644 index 34ff212e..00000000 --- a/dev/Kernel/FirmwareKit/EFI/API.h +++ /dev/null @@ -1,107 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef __EFI_API__ -#define __EFI_API__ - -#include -#include -#include -#include - -#define kNeWebsiteMacro "https://aker.com/help" -#define kNeKernelSubsystem (StrLen(kNeWebsiteMacro)) - -#ifdef __BOOTZ__ -// forward decl. -class BootTextWriter; - -#define __BOOTKIT_NO_INCLUDE__ 1 - -#include -#include -#endif // ifdef __BOOTZ__ - -inline EfiSystemTable* ST = nullptr; -inline EfiBootServices* BS = nullptr; - -EXTERN_C void rt_cli(); -EXTERN_C void rt_hlt(); - -namespace EFI -{ - /// @brief Halt and clear interrupts. - /// @return - inline Void Stop() noexcept - { - while (YES) - { - rt_cli(); - rt_hlt(); - } - } - - /** -@brief Exit EFI API to let the OS load correctly. -Bascially frees everything we have in the EFI side. -*/ - inline void ExitBootServices(UInt64 MapKey, EfiHandlePtr ImageHandle) noexcept - { - if (!ST) - return; - - ST->BootServices->ExitBootServices(ImageHandle, MapKey); - } - - inline UInt32 Platform() noexcept - { - return kPeMachineAMD64; - } - - /*** - * @brief Throw an error, stop execution as well. - * @param ErrorCode error code to be print. - * @param Reason reason to be print. - */ - inline void ThrowError(const EfiCharType* ErrorCode, - const EfiCharType* Reason) noexcept - { - ST->ConOut->OutputString(ST->ConOut, L"\r*** STOP ***\r"); - - ST->ConOut->OutputString(ST->ConOut, L"*** ERROR: "); - ST->ConOut->OutputString(ST->ConOut, ErrorCode); - - ST->ConOut->OutputString(ST->ConOut, L" ***\r *** REASON: "); - ST->ConOut->OutputString(ST->ConOut, Reason); - - ST->ConOut->OutputString(ST->ConOut, L" ***\r"); - - EFI::Stop(); - } -} // namespace EFI - -inline void InitEFI(EfiSystemTable* SystemTable) noexcept -{ - if (!SystemTable) - return; - - ST = SystemTable; - BS = ST->BootServices; - - ST->ConOut->ClearScreen(SystemTable->ConOut); - ST->ConOut->SetAttribute(SystemTable->ConOut, kEFIYellow); - - ST->BootServices->SetWatchdogTimer(0, 0, 0, nullptr); - ST->ConOut->EnableCursor(ST->ConOut, false); -} - -#ifdef __BOOTZ__ - -#include - -#endif // ifdef __BOOTZ__ - -#endif /* ifndef __EFI_API__ */ diff --git a/dev/Kernel/FirmwareKit/EFI/EFI.h b/dev/Kernel/FirmwareKit/EFI/EFI.h deleted file mode 100644 index ff97f7d6..00000000 --- a/dev/Kernel/FirmwareKit/EFI/EFI.h +++ /dev/null @@ -1,936 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef FIRMWARE_KIT_EFI_H -#define FIRMWARE_KIT_EFI_H - -/** -@brief Implementation of the main EFI protocols. -*/ - -#include - -using namespace NeOS; - -/* we always use stdcall in EFI, the pascal way of calling functions. */ - -#ifndef EPI_API -#define EFI_API __attribute__((ms_abi)) -#endif // ifndef EPI_API - -#define IN -#define OUT -#define OPTIONAL - -#define EFI_FINAL final - -// Forward decls - -struct EfiTableHeader; -struct EfiLoadFileProtocol; -struct EfiSimpleTextOutputProtocol; -struct EfiDevicePathProtocol; -struct EfiBootServices; -struct EfiMemoryDescriptor; -struct EfiSystemTable; -struct EfiGUID; -struct EfiFileDevicePathProtocol; -struct EfiHandle; -struct EfiGraphicsOutputProtocol; -struct EfiBitmask; -struct EfiFileProtocol; -struct EfiSimpleTextInputProtocol; - -typedef UInt64 EfiStatusType; - -typedef Char16 EfiChar16Type; - -/// @brief Core Handle Kind -/// Self is like NT's Win32 HANDLE type. -typedef struct EfiHandle -{ -} * EfiHandlePtr; - -/* UEFI uses wide characters by default. */ -typedef WideChar EfiCharType; - -typedef UInt64 EfiPhysicalAddress; -typedef UIntPtr EfiVirtualAddress; - -/// What's BootBolicy? -/// If TRUE, indicates that the request originates from the boot manager, and -/// that the boot manager is attempting to load FilePath as a boot selection. If -/// FALSE, then FilePath must match an exact file to be loaded. - -typedef UInt64(EFI_API* EfiTextString)(struct EfiSimpleTextOutputProtocol* Self, - const WideChar* OutputString); - -typedef UInt64(EFI_API* EfiTextAttrib)(struct EfiSimpleTextOutputProtocol* Self, - const WideChar Attribute); - -typedef UInt64(EFI_API* EfiTextClear)(struct EfiSimpleTextOutputProtocol* Self); - -typedef UInt64(EFI_API* EfiLoadFile)(EfiLoadFileProtocol* Self, - EfiFileDevicePathProtocol* FilePath, - Boolean BootPolicy, - UInt32* BufferSize, - VoidPtr Buffer); - -typedef UInt64(EFI_API* EfiCopyMem)(VoidPtr DstBuf, VoidPtr SrcBuf, SizeT Length); - -typedef UInt64(EFI_API* EfiSetMem)(VoidPtr DstBuf, Char Byte, SizeT Length); - -typedef UInt64(EFI_API* EfiHandleProtocol)(EfiHandlePtr Handle, EfiGUID* Guid, VoidPtr* Device); - -typedef UInt64(EFI_API* EfiLocateDevicePath)(EfiGUID* Protocol, - EfiDevicePathProtocol** DevicePath, - EfiHandlePtr Device); - -typedef UInt64(EFI_API* EfiStartImage)(EfiHandlePtr Handle, VoidPtr ArgsSize, VoidPtr ArgsPtr); - -typedef UInt64(EFI_API* EfiLoadImage)(Boolean BootPolicy, - EfiHandlePtr ParentHandle, - EfiFileDevicePathProtocol* DeviceFile, - VoidPtr buffer, - SizeT size, - EfiHandlePtr* ppHandle); - -/// EFI pool helpers, taken from iPXE. - -typedef enum EfiMemoryType -{ - /// - /// Not used. - /// - EfiReservedMemoryType, - /// - /// The code portions of a loaded application. - /// (Note that UEFI OS loaders are UEFI applications.) - /// - EfiLoaderCode, - /// - /// The data portions of a loaded application and the default data allocation - /// type used by an application to allocate pool memory. - /// - EfiLoaderData, - /// - /// The code portions of a loaded Boot Services Driver. - /// - EfiBootServicesCode, - /// - /// The data portions of a loaded Boot Serves Driver, and the default data - /// allocation type used by a Boot Services Driver to allocate pool memory. - /// - EfiBootServicesData, - /// - /// The code portions of a loaded Runtime Services Driver. - /// - EfiRuntimeServicesCode, - /// - /// The data portions of a loaded Runtime Services Driver and the default - /// data allocation type used by a Runtime Services Driver to allocate pool - /// memory. - /// - EfiRuntimeServicesData, - /// - /// Free (unallocated) memory. - /// - EfiConventionalMemory, - /// - /// Memory in which errors have been detected. - /// - EfiUnusableMemory, - /// - /// Memory that holds the ACPI tables. - /// - EfiACPIReclaimMemory, - /// - /// Address space reserved for use by the firmware. - /// - EfiACPIMemoryNVS, - /// - /// Used by system firmware to request that a memory-mapped IO region - /// be mapped by the OS to a virtual address so it can be accessed by EFI - /// runtime services. - /// - EfiMemoryMappedIO, - /// - /// System memory-mapped IO region that is used to translate memory - /// cycles to IO cycles by the processor. - /// - EfiMemoryMappedIOPortSpace, - /// - /// Address space reserved by the firmware for code that is part of the - /// processor. - /// - EfiPalCode, - /// - /// A memory region that operates as EfiConventionalMemory, - /// however it happens to also support byte-addressable non-volatility. - /// - EfiPersistentMemory, - /// - /// A memory region that describes system memory that has not been accepted - /// by a corresponding call to the underlying isolation architecture. - /// - EfiUnacceptedMemoryType, - /// - /// The last type of memory. - /// Not a real type. - /// - EfiMaxMemoryType, -} EfiMemoryType; - -typedef enum EfiAllocateType -{ - /// Anything that satisfy the request. - AllocateAnyPages, - AllocateMaxAddress, - /// - /// Allocate pages at a specified address. - /// - AllocateAddress, - /// - /// Maximum enumeration value that may be used for bounds checking. - /// - MaxAllocateType -} EfiAllocateType; - -typedef struct EfiMemoryDescriptor -{ - /// - /// Kind of the memory region. - /// Kind EFI_MEMORY_TYPE is defined in the - /// AllocatePages() function description. - /// - UInt32 Kind; - /// - /// Physical address of the first byte in the memory region. PhysicalStart - /// must be aligned on a 4 KiB boundary, and must not be above - /// 0xfffffffffffff000. Kind EFI_PHYSICAL_ADDRESS is defined in the - /// AllocatePages() function description - /// - EfiPhysicalAddress PhysicalStart; - /// - /// Virtual address of the first byte in the memory region. - /// VirtualStart must be aligned on a 4 KiB boundary, - /// and must not be above 0xfffffffffffff000. - /// - EfiVirtualAddress VirtualStart; - /// - /// NumberOfPages Number of 4 KiB pages in the memory region. - /// NumberOfPages must not be 0, and must not be any value - /// that would represent a memory page with a start address, - /// either physical or virtual, above 0xfffffffffffff000. - /// - UInt64 NumberOfPages; - /// - /// Attributes of the memory region that describe the bit mask of capabilities - /// for that memory region, and not necessarily the current settings for that - /// memory region. - /// - UInt64 Attribute; -} EfiMemoryDescriptor; - -typedef UInt64(EFI_API* EfiAllocatePool)(EfiMemoryType PoolType, UInt32 Size, VoidPtr* Buffer); - -typedef UInt64(EFI_API* EfiFreePool)(VoidPtr Buffer); - -typedef UInt64(EFI_API* EfiCalculateCrc32)(VoidPtr Data, UInt32 DataSize, UInt32* CrcOut); - -/** -@brief Present in every header, used to identify a UEFI structure. -*/ -typedef struct EfiTableHeader -{ - UInt64 Signature; - UInt32 Revision; - UInt32 HeaderSize; - UInt32 Crc32; - UInt32 Reserved; -} EfiTableHeader; - -#define EFI_ACPI_TABLE_PROTOCOL_GUID \ - { \ - 0xffe06bdd, 0x6107, 0x46a6, \ - { \ - 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c \ - } \ - } - -#define EFI_LOAD_FILE_PROTOCOL_GUID \ - { \ - 0x56EC3091, 0x954C, 0x11d2, \ - { \ - 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ - } \ - } - -#define EFI_LOAD_FILE2_PROTOCOL_GUID \ - { \ - 0x4006c0c1, 0xfcb3, 0x403e, \ - { \ - 0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d \ - } \ - } - -#define EFI_LOADED_IMAGE_PROTOCOL_GUID \ - { \ - 0x5B1B31A1, 0x9562, 0x11d2, \ - { \ - 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B \ - } \ - } - -#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ - { \ - 0x9042a9de, 0x23dc, 0x4a38, \ - { \ - 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a \ - } \ - } - -#define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000 - -#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ - { \ - 0x0964e5b22, 0x6459, 0x11d2, \ - { \ - 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ - } \ - } - -#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \ - { \ - 0xbc62157e, 0x3e33, 0x4fec, \ - { \ - 0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf \ - } \ - } - -#define EFI_DEVICE_PATH_PROTOCOL_GUID \ - { \ - 0x9576e91, 0x6d3f, 0x11d2, \ - { \ - 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ - } \ - } - -#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ - { \ - 0x0964e5b22, 0x6459, 0x11d2, \ - { \ - 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ - } \ - } - -typedef UInt64(EfiImageUnload)(EfiHandlePtr ImageHandle); - -enum -{ - kPixelRedGreenBlueReserved8BitPerColor, - kPixelBlueGreenRedReserved8BitPerColor, - kPixelBitMask, - kPixelBltOnly, - kPixelFormatMax -}; - -typedef struct EfiBitmask -{ - UInt32 RedMask; - UInt32 GreenMask; - UInt32 BlueMask; - UInt32 ReservedMask; -} EfiBitmask; - -typedef struct -{ - UInt8 Blue; - UInt8 Green; - UInt8 Red; - UInt8 Reserved; -} EfiGraphicsOutputBltPixel; - -typedef enum EfiGraphicsOutputProtocolBltOperation -{ - EfiBltVideoFill, - EfiBltVideoToBltBuffer, - EfiBltBufferToVideo, - EfiBltVideoToVideo, - EfiGraphicsOutputBltOperationMax -} EfiGraphicsOutputProtocolBltOperation; - -typedef struct EfiGraphicsOutputProtocolModeInformation -{ - UInt32 Version; - UInt32 HorizontalResolution; - UInt32 VerticalResolution; - UInt32 PixelFormat; - EfiBitmask PixelInformation; - UInt32 PixelsPerScanLine; -} EfiGraphicsOutputProtocolModeInformation; - -typedef UInt64(EFI_API* EfiGraphicsOutputProtocolQueryMode)( - EfiGraphicsOutputProtocol* Self, UInt32 ModeNumber, UInt32* SizeOfInfo, EfiGraphicsOutputProtocolModeInformation** Info); - -typedef UInt64(EFI_API* EfiGraphicsOutputProtocolSetMode)( - EfiGraphicsOutputProtocol* Self, UInt32 ModeNumber); - -typedef UInt64(EFI_API* EfiGraphicsOutputProtocolBlt)( - EfiGraphicsOutputProtocol* Self, EfiGraphicsOutputBltPixel* BltBuffer, EfiGraphicsOutputProtocolBltOperation BltOperation, UInt32 SourceX, UInt32 SourceY, UInt32 DestinationX, UInt32 DestinationY, UInt32 Width, UInt32 Height, UInt32 Delta); - -typedef struct -{ - UInt32 MaxMode; - UInt32 Mode; - EfiGraphicsOutputProtocolModeInformation* Info; - UInt32 SizeOfInfo; - UIntPtr FrameBufferBase; - UInt32 FrameBufferSize; -} EfiGraphicsOutputProtocolMode; - -typedef struct EfiGraphicsOutputProtocol -{ - EfiGraphicsOutputProtocolQueryMode QueryMode; - EfiGraphicsOutputProtocolSetMode SetMode; - EfiGraphicsOutputProtocolBlt Blt; - EfiGraphicsOutputProtocolMode* Mode; -} EfiGraphicsOutputProtocol; - -typedef struct EfiLoadImageProtocol -{ - UInt32 Revision; - EfiHandlePtr ParentHandle; - EfiSystemTable* SystemTable; - - // Source location of the image - EfiHandlePtr DeviceHandle; - EfiDevicePathProtocol* FilePath; - Void* Reserved; - - // Image’s load options - UInt32 LoadOptionsSize; - Void* LoadOptions; - - // Location where image was loaded - Void* ImageBase; - UInt64 ImageSize; - EfiMemoryType ImageCodeType; - EfiMemoryType ImageDataType; - EfiImageUnload Unload; -} EfiLoadImageProtocol; - -typedef struct EfiLoadFileProtocol -{ - EfiLoadFile LoadFile; -} EfiLoadFileProtocol; - -typedef struct EfiDevicePathProtocol -{ - UInt8 Kind; - UInt8 SubType; - UInt8 Length[2]; -} EfiDevicePathProtocol; - -typedef struct EfiFileDevicePathProtocol -{ - EfiDevicePathProtocol Proto; - - /// - /// File Path of this struct - /// - WideChar Path[kPathLen]; -} EfiFileDevicePathProtocol; - -typedef UInt64(EFI_API* EfiExitBootServices)(VoidPtr ImageHandle, - UInt32 MapKey); - -typedef UInt64(EFI_API* EfiAllocatePages)(EfiAllocateType AllocType, - EfiMemoryType MemType, - UInt32 Count, - EfiPhysicalAddress* Memory); - -typedef UInt64(EFI_API* EfiFreePages)(EfiPhysicalAddress* Memory, UInt32 Pages); - -typedef UInt64(EFI_API* EfiGetMemoryMap)(UInt32* MapSize, - EfiMemoryDescriptor* DescPtr, - UInt32* MapKey, - UInt32* DescSize, - UInt32* DescVersion); - -/** - * @brief GUID type, something you can also find in CFKit. - */ -typedef struct EfiGUID EFI_FINAL -{ - UInt32 Data1; - UInt16 Data2; - UInt16 Data3; - UInt8 Data4[8]; -} EfiGUID; - -/*** - * Protocol stuff... - */ - -#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \ - { \ - 0x387477c1, 0x69c7, 0x11d2, \ - { \ - 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ - } \ - } - -/** some helpers */ -#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 -#define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002 -#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004 -#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008 -#define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010 -#define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020 - -typedef UInt64(EFI_API* EfiLocateProtocol)(EfiGUID* Protocol, - VoidPtr Registration, - VoidPtr* Interface); - -typedef UInt64(EFI_API* EfiOpenProtocol)(EfiHandlePtr Handle, EfiGUID* Guid, VoidPtr* Interface, EfiHandlePtr AgentHandle, EfiHandlePtr ControllerHandle, UInt32 Attributes); - -typedef UInt64(EFI_API* EfiEnableCursor)(EfiSimpleTextOutputProtocol* Self, Boolean Visible); - -/** -@name EfiBootServices -@brief UEFI Boot Services record, it contains functions necessary to a -firmware level application. -*/ -typedef struct EfiBootServices -{ - EfiTableHeader SystemTable; - VoidPtr RaiseTPL; - VoidPtr RestoreTPL; - EfiAllocatePages AllocatePages; - EfiFreePages FreePages; - EfiGetMemoryMap GetMemoryMap; - EfiAllocatePool AllocatePool; - EfiFreePool FreePool; - VoidPtr CreateEvent; - VoidPtr SetTimer; - VoidPtr WaitForEvent; - VoidPtr SignalEvent; - VoidPtr CloseEvent; - VoidPtr CheckEvent; - VoidPtr InstallProtocolInterface; - VoidPtr ReinstallProtocolInterface; - VoidPtr UninstallProtocolInterface; - EfiHandleProtocol HandleProtocol; - VoidPtr Reserved; - VoidPtr RegisterProtocolNotify; - VoidPtr LocateHandle; - EfiLocateDevicePath LocateDevicePath; - VoidPtr InstallConfigurationTable; - EfiLoadImage LoadImage; - EfiStartImage StartImage; - VoidPtr Exit; - VoidPtr UnloadImage; - EfiExitBootServices ExitBootServices; - VoidPtr GetNextMonotonicCount; - VoidPtr Stall; - EfiStatusType(EFI_API* SetWatchdogTimer)(UInt32 Timeout, UInt64 WatchdogCode, UInt32 DataSize, EfiCharType* Data); - VoidPtr ConnectController; - VoidPtr DriveonnectController; - EfiOpenProtocol OpenProtocol; - VoidPtr CloseProtocol; - VoidPtr OpenProtocolInformation; - VoidPtr ProtocolsPerHandle; - VoidPtr LocateHandleBuffer; - EfiLocateProtocol LocateProtocol; - VoidPtr InstallMultipleProtocolInterfaces; - VoidPtr UninstallMultipleProtocolInterfaces; - EfiCalculateCrc32 CalculateCrc32; - EfiCopyMem CopyMem; - EfiSetMem SetMem; - VoidPtr CreateEventEx; -} EfiBootServices; - -#define kEntireDevPath 0xFF -#define kThisInstancePath 0x01 - -/** -@brief PrintF like protocol. -*/ -typedef struct EfiSimpleTextOutputProtocol -{ - VoidPtr Reset; - EfiTextString OutputString; - VoidPtr TestString; - VoidPtr QueryMode; - VoidPtr SetMode; - EfiTextAttrib SetAttribute; - EfiTextClear ClearScreen; - VoidPtr SetCursorPosition; - EfiEnableCursor EnableCursor; - VoidPtr Mode; -} EfiSimpleTextOutputProtocol; - -typedef struct -{ - UInt16 ScanCode; - EfiChar16Type UnicodeChar; -} EfiInputKey; - -typedef EfiStatusType(EFI_API* EfiInputReadKey)( - IN EfiSimpleTextInputProtocol* This, - OUT EfiInputKey* Key); - -typedef EfiStatusType(EFI_API* EfiInputReset)( - IN EfiSimpleTextInputProtocol* This, - IN Boolean ExtendedChk); - -typedef EfiStatusType(EFI_API* EfiWaitForEvent)( - IN UInt32 NumberOfEvents, - IN VoidPtr Event, - OUT UInt32* Index); - -typedef struct EfiSimpleTextInputProtocol -{ - EfiInputReset Reset; - EfiInputReadKey ReadKeyStroke; - EfiWaitForEvent WaitForKey; -} EfiSimpleTextInputProtocol; - -/// @biref Open Volume procedure ptr. -typedef UInt64(EFI_API* EfiOpenVolume)(struct EfiSimpleFilesystemProtocol*, - struct EfiFileProtocol**); - -struct EfiSimpleFilesystemProtocol -{ - UInt64 Revision; - EfiOpenVolume OpenVolume; -}; - -typedef struct EfiRuntimeServices -{ - EfiTableHeader SystemTable; - VoidPtr GetTime, SetTime, GetWakeupTime, SetWakeupTime, SetVirtualAddressMap, ConvertPointer; - UInt64(EFI_API* GetVariable)(const WideChar* Name, EfiGUID VendorGUID, UInt32* Attributes, UInt32* DataSize, VoidPtr Data); - VoidPtr GetNextVariable; - UInt64(EFI_API* SetVariable)(const WideChar* Name, EfiGUID VendorGUID, UInt32* Attributes, UInt32* DataSize, VoidPtr Data); - VoidPtr GetNextHighMonotonicCount; - VoidPtr ResetSystem; - VoidPtr UpdateCapsule; - VoidPtr QueryCapsuleCapabilites; - VoidPtr QueryVariableInfo; -} EfiRuntimeServices; - -/** -@brief The Structure that they give you when booting. -*/ -typedef struct EfiSystemTable -{ - EfiTableHeader SystemHeader; - WideChar* FirmwareVendor; - UInt32 FirmwareRevision; - EfiHandlePtr ConsoleInHandle; - EfiSimpleTextInputProtocol* ConIn; - EfiHandlePtr ConsoleOutHandle; - EfiSimpleTextOutputProtocol* ConOut; - EfiHandlePtr StandardErrorHandle; - VoidPtr StdErr; - EfiRuntimeServices* RuntimeServices; - EfiBootServices* BootServices; - UInt64 NumberOfTableEntries; - /// The configuration table (contains the RSD PTR entry.) - struct - { - EfiGUID VendorGUID; - VoidPtr VendorTable; - } * ConfigurationTable; -} EfiSystemTable; - -#define kEfiOk 0 -#define kEfiFail -1 -#define kBufferTooSmall 5 - -#define EFI_EXTERN_C extern "C" - -typedef struct EfiIPV4 -{ - UInt8 Addr[4]; -} EfiIPV4; - -/// -/// 16-byte buffer. An IPv6 internet protocol address. -/// -typedef struct EfiIPV6 -{ - UInt8 Addr[16]; -} EfiIPV6; - -#define kEFIYellow (0x01 | 0x02 | 0x04 | 0x08) - -#ifdef __x86_64 -#define __EFI_x86_64__ 1 -#endif // __x86_64 - -enum -{ - kEFIHwDevicePath = 0x01, - kEFIAcpiDevicePath = 0x02, - kEFIMessaingDevicePath = 0x03, - kEFIMediaDevicePath = 0x04, - kEFIBiosBootPath = 0x05, - kEFIEndOfPath = 0x06, - kEFICount = 6, -}; - -#define END_DEVICE_PATH_TYPE 0x7f -#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xFF -#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01 - -#define kEfiOffsetOf(T, F) __builtin_offsetof(T, F) - -/// File I/O macros - -#define kEFIFileRead 0x0000000000000001 -#define kEFIFileWrite 0x0000000000000002 -#define kEFIFileCreate 0x0000000000000000 - -#define kEFIReadOnly 0x01 -#define kEFIHidden 0x02 -#define kEFISystem 0x04 -#define kEFIReserved 0x08 -#define kEFIDirectory 0x10 -#define kEFIArchive 0x20 - -#define EFI_FILE_PROTOCOL_REVISION 0x00010000 -#define EFI_FILE_PROTOCOL_REVISION2 0x00020000 -#define EFI_FILE_PROTOCOL_LATEST_REVISION EFI_FILE_PROTOCOL_REVISION2 - -#define EFI_EXTRA_DESCRIPTOR_SIZE 8 - -#define EFI_MP_SERVICES_PROTOCOL_GUID \ - { \ - 0x3fdda605, 0xa76e, 0x4f46, \ - { \ - 0xad, 0x29, 0x12, 0xf4, \ - 0x53, 0x1b, 0x3d, 0x08 \ - } \ - } - -#define PROCESSOR_AS_BSP_BIT 0x00000001 -#define PROCESSOR_ENABLED_BIT 0x00000002 -#define PROCESSOR_HEALTH_STATUS_BIT 0x00000004 - -#define END_OF_CPU_LIST 0xffffffff - -typedef struct EfiIOToken -{ - // - // If Event is NULL, then blocking I/O is performed. - // If Event is not NULL and non-blocking I/O is supported, then non-blocking - // I/O is performed, and Event will be signaled when the read request is - // completed. The caller must be prepared to handle the case where the - // callback associated with Event occurs before the original asynchronous I/O - // request call returns. - // - UInt64 Event; - - // - // Defines whether or not the signaled event encountered an error. - // - UInt64 Status; - - // - // For OpenEx(): Not Used, ignored. - // For ReadEx(): On input, the size of the Buffer. On output, the amount of - // data returned in Buffer. - // In both cases, the size is measured in bytes. - // For WriteEx(): On input, the size of the Buffer. On output, the amount of - // data actually written. - // In both cases, the size is measured in bytes. - // For FlushEx(): Not used, ignored. - // - UInt32 BufferSize; - - // - // For OpenEx(): Not Used, ignored. - // For ReadEx(): The buffer into which the data is read. - // For WriteEx(): The buffer of data to write. - // For FlushEx(): Not Used, ignored. - // - Void* Buffer; -} EfiIOToken; - -typedef struct EfiFileProtocol -{ - UInt64 Revision; - - EfiStatusType(EFI_API* Open)(struct EfiFileProtocol* Self, - struct EfiFileProtocol** Out, - EfiCharType* CharType, - UInt64 OpenMode, - UInt64 Attrib); - - EfiStatusType(EFI_API* Close)(struct EfiFileProtocol* Self); - - EfiStatusType(EFI_API* Delete)(struct EfiFileProtocol* Self); - - EfiStatusType(EFI_API* Read)(struct EfiFileProtocol* Self, UInt64* BufSize, VoidPtr BufOut); - - EfiStatusType(EFI_API* Write)(struct EfiFileProtocol* Self, UInt64* BufSize, VoidPtr BufOut); - - EfiStatusType(EFI_API* GetPosition)(EfiFileProtocol* Self, UInt64* Position); - - EfiStatusType(EFI_API* SetPosition)(EfiFileProtocol* Self, UInt64* Position); - - EfiStatusType(EFI_API* GetInfo)(struct EfiFileProtocol*, struct EfiGUID*, UInt32*, void*); - - EfiStatusType(EFI_API* SetInfo)(struct EfiFileProtocol*, struct EfiGUID*, UInt32*, void*); - - EfiStatusType(EFI_API* Flush)(EfiFileProtocol*); - - EfiStatusType(EFI_API* OpenEx)(EfiFileProtocol* Self, - EfiFileProtocol** OutHandle, - EfiCharType* Path, - UInt64 Mode, - UInt64 Attrib, - struct EfiIOToken* Token); - - EfiStatusType(EFI_API* ReadEx)(EfiFileProtocol* Self, - struct EfiIOToken* Token); - - EfiStatusType(EFI_API* WriteEx)(EfiFileProtocol* Self, - struct EfiIOToken* Token); - - EfiStatusType(EFI_API* FlushEx)(EfiFileProtocol* Self, - struct EfiIOToken* Token); -} EfiFileProtocol, *EfiFileProtocolPtr; - -typedef UInt64 EfiCursorType; - -typedef struct EfiTime -{ - UInt16 Year; - UInt8 Month; - UInt8 Day; - UInt8 Hour; - UInt8 Minute; - UInt8 Second; - UInt8 Pad1; - UInt32 Nanosecond; - Int16 TimeZone; - UInt8 Daylight; - UInt8 Pad2; -} EfiTime; - -#define EFI_FILE_INFO_GUID \ - { \ - 0x09576e92, 0x6d3f, 0x11d2, \ - { \ - 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ - } \ - } - -struct EfiFileInfo EFI_FINAL -{ - /// @brief Structure size. - UInt64 Size; - /// @brief File size. - UInt64 FileSize; - /// @brief Physical size on disk. - UInt64 PhysicalSize; - /// @brief Create time. - EfiTime CreateTime; - /// @brief Last access time. - EfiTime LastAccessTime; - /// @brief Edit time. - EfiTime EditTime; - /// @brief Attributes. - UInt64 Attribute; - /// @brief VLA file name. - WideChar FileName[1]; -}; - -//******************************************************* -// EFI_CPU_PHYSICAL_LOCATION -// @note As in the EFI specs. -//******************************************************* -typedef struct _EfiCPUPhyiscalLocation -{ - UInt32 Package; - UInt32 Core; - UInt32 Thread; -} EfiCPUPhyiscalLocation; - -typedef union _EfiExtendedProcessorInformation { - EfiCPUPhyiscalLocation Location2; -} EfiExtendedProcessorInformation; - -typedef struct _EfiProcessorInformation -{ - UInt64 ProcessorId; - UInt32 StatusFlag; - EfiCPUPhyiscalLocation Location; - EfiExtendedProcessorInformation ExtendedInformation; -} EfiProcessorInformation; - -typedef EfiStatusType EFI_API (*EfiMpServicesGetNumberOfProcessors)( - IN struct _EfiMpServicesProtocol* Self, - OUT UInt32* NumberOfProcessors, - OUT UInt32* NumberOfEnabledProcessors); - -typedef EfiStatusType EFI_API (*EfiMpServicesGetProcessorInfo)( - IN struct _EfiMpServicesProtocol* Self, - IN UInt32* ProcessorNumber, - OUT struct _EfiProcessorInformation* NumberOfEnabledProcessors); - -typedef void EFI_API (*EFI_AP_PROCEDURE)( - IN VoidPtr ProcedureArgument); - -typedef EfiStatusType EFI_API (*EfiMpServicesStartupAllAPS)( - IN struct _EfiMpServicesProtocol* Self, - IN EFI_AP_PROCEDURE Procedure, - IN Boolean SingleThread, - IN VoidPtr WaitEvent OPTIONAL, // EFI_EVENT first, but unused here. - IN UInt32 TimeoutInMicroSeconds, - IN Void* ProcedureArgument OPTIONAL, - OUT UInt32** FailedCpuList OPTIONAL); - -typedef EfiStatusType EFI_API (*EfiMpServicesSwitchBSP)( - IN struct _EfiMpServicesProtocol* Self, - IN UInt32 ProcessorNumber, - IN Boolean EnableOldBSP); - -typedef EfiStatusType EFI_API (*EfiMpServicesStartupThisAP)( - IN struct _EfiMpServicesProtocol* Self, - IN EFI_AP_PROCEDURE Procedure, - IN UInt32 ProcessorNumber, - IN VoidPtr WaitEvent OPTIONAL, - IN UInt32 TimeoutInMicroseconds, - IN Void* ProcedureArgument OPTIONAL, - OUT Boolean* Finished OPTIONAL); - -typedef EfiStatusType EFI_API (*EfiMpServicesDisableThisAP)( - IN struct _EfiMpServicesProtocol* Self, - IN UInt32 ProcessorNumber, - IN Boolean EnableAP, - IN UInt32* HealthFlag OPTIONAL); - -typedef EfiStatusType EFI_API (*EfiMpServicesWhoAmI)( - IN struct _EfiMpServicesProtocol* Self, - OUT UInt32* ProcessorNumber); - -typedef struct _EfiMpServicesProtocol -{ - EfiMpServicesGetNumberOfProcessors GetNumberOfProcessors; - EfiMpServicesGetProcessorInfo GetProcessorInfo; - EfiMpServicesStartupAllAPS StartupAllAPs; - EfiMpServicesStartupThisAP StartupThisAP; - EfiMpServicesSwitchBSP SwitchBSP; - EfiMpServicesDisableThisAP EnableDisableAP; - EfiMpServicesWhoAmI WhoAmI; -} EfiMpServicesProtocol; - -#endif // ifndef FIRMWARE_KIT_EFI_H diff --git a/dev/Kernel/FirmwareKit/EFI/NS.h b/dev/Kernel/FirmwareKit/EFI/NS.h deleted file mode 100644 index 18da8aaa..00000000 --- a/dev/Kernel/FirmwareKit/EFI/NS.h +++ /dev/null @@ -1,20 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -namespace Firmware::Detail::EFI -{ - using namespace NeOS; - - EXTERN_C - { -#include - } - -} // namespace Firmware::Detail::EFI diff --git a/dev/Kernel/FirmwareKit/EPM.h b/dev/Kernel/FirmwareKit/EPM.h deleted file mode 100644 index b5e49d02..00000000 --- a/dev/Kernel/FirmwareKit/EPM.h +++ /dev/null @@ -1,111 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -/** - @brief The Explicit Partition Map scheme. -*/ - -#ifndef FIRMWAREKIT_EPM_H -#define FIRMWAREKIT_EPM_H - -#include - -#define kEPMNameLength (32) -#define kEPMFilesystemLength (16) -#define kEPMMagicLength (5) - -/* @brief AMD64 magic for EPM */ -#define kEPMMagic86 "EPMAM" - -/* @brief RISC-V magic for EPM */ -#define kEPMMagicRISCV "EPMRV" - -/* @brief ARM magic for EPM */ -#define kEPMMagicARM "EPMAR" - -/* @brief 64x0 magic for EPM */ -#define kEPMMagic64k "EPM64" - -/* @brief 32x0 magic for EPM */ -#define kEPMMagic32k "EPM32" - -/* @brief POWER magic for EPM */ -#define kEPMMagicPPC "EPMPC" - -/* @brief Invalid magic for EPM */ -#define kEPMMagicError "EPM??" - -#ifdef __NE_AMD64__ -#define kEPMMagic kEPMMagic86 -#else -#ifdef __NE_ARM64__ -#define kEPMMagic kEPMMagicARM -#else -#define kEPMMagic kEPMMagicError -#endif -#endif - -///! @brief partition must start at this address. -///! Anything below is reserved for Data backup by the Main OS. -#define kEPMPartBlockLba (sizeof(EPM_PART_BLOCK)) - -///! @brief Current EPM revision. -#define kEPMRevisionBcd (0x0100) - -/// !@brief EPM boot block address. -#define kEPMBootBlockLba (0U) - -#define kEPMReserveLen (399) - -struct EPM_GUID; -struct EPM_PART_BLOCK; - -/* The first 0 > 128 addresses of a disk contains these headers. */ - -/// @brief EPM GUID structure. -typedef struct EPM_GUID -{ - NeOS::UInt32 Data1; - NeOS::UInt16 Data2; - NeOS::UInt16 Data3; - NeOS::UInt8 Data4[8]; -} PACKED EPM_GUID; - -/** - * @brief The EPM boot block. - * @note NumBlock and LbaStart are ignored on some platforms. - */ -struct PACKED EPM_PART_BLOCK -{ - NeOS::Char Magic[kEPMMagicLength]; - NeOS::Char Name[kEPMNameLength]; - EPM_GUID Guid; - NeOS::Int32 Version; - NeOS::Int64 NumBlocks; - NeOS::Int64 SectorSz; - NeOS::Int64 LbaStart; // base offset - NeOS::Int64 LbaEnd; // end offset - NeOS::Int16 Kind; - NeOS::Int16 Flags; - NeOS::Int32 FsVersion; - NeOS::Char Fs[kEPMFilesystemLength]; /* NeFS, HPFS... */ - NeOS::Char Reserved[kEPMReserveLen]; // to fill a full sector. -}; - -///! @brief Version kind enum. -///! @brief Use in boot block version field. - -enum -{ - kEPMInvalid = 0x00, - kEPMGenericOS = 0xcf, // Generic OS - kEPMLinux = 0x8f, // Linux on EPM - kEPMBSD = 0x9f, // Berkeley Soft. Distribution - kEPMNeOS = 0x1f, // This OS. - kEPMInvalidOS = 0xff, -}; - -#endif // ifndef FIRMWAREKIT_EPM_H diff --git a/dev/Kernel/FirmwareKit/GPT.h b/dev/Kernel/FirmwareKit/GPT.h deleted file mode 100644 index 91838bc7..00000000 --- a/dev/Kernel/FirmwareKit/GPT.h +++ /dev/null @@ -1,57 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include - -#define kSectorSizeGPT (512U) - -namespace NeOS -{ - struct GPT_GUID; - struct GPT_PARTITION_TABLE; - struct GPT_PARTITION_ENTRY; - - /// @brief GPT GUID structure. - typedef struct GPT_GUID - { - NeOS::UInt32 Data1; - NeOS::UInt16 Data2; - NeOS::UInt16 Data3; - NeOS::UInt8 Data4[8]; - } GPT_GUID; - - struct PACKED GPT_PARTITION_TABLE final - { - Char PartitionName[8]; - UInt32 Revision; - UInt32 HeaderSize; - UInt32 ChecksumCRC32; - UInt32 Reserved1; - UInt64 LBAHeader; - UInt64 LBAAltHeader; - UInt64 FirstGPTEntry; - UInt64 LastGPTEntry; - GPT_GUID Guid; - UInt64 StartingLBA; - UInt32 NumPartitionEntries; - UInt32 SizeOfEntries; - UInt32 CRC32PartEntry; - UInt8 Reserved2[kSectorSizeGPT]; - }; - - struct PACKED GPT_PARTITION_ENTRY - { - GPT_GUID PartitionTypeGUID; - GPT_GUID UniquePartitionGUID; - UInt64 StartLBA; - UInt64 EndLBA; - UInt64 Attributes; - UInt8 Name[72]; - }; -} // namespace NeOS diff --git a/dev/Kernel/FirmwareKit/Handover.h b/dev/Kernel/FirmwareKit/Handover.h deleted file mode 100644 index 4ff681ed..00000000 --- a/dev/Kernel/FirmwareKit/Handover.h +++ /dev/null @@ -1,108 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -/** - * @file Handover.h - * @author Amlal EL Mahrouss (amlalelmahrouss@icloud.com) - * @brief The handover boot protocol. - * @version 1.15 - * @date 2024-02-23 - * - * @copyright Copyright (c) 2024, Amlal EL Mahrouss - * - */ - -#pragma once - -#include - -#define kHandoverMagic 0xBADCC -#define kHandoverVersion 0x0117 - -/* Initial bitmap pointer location and size. */ -#define kHandoverBitMapSz (gib_cast(4)) -#define kHandoverStructSz sizeof(HEL::BootInfoHeader) - -namespace NeOS::HEL -{ - /** - @brief The executable type enum. - */ - enum - { - kTypeKernel = 100, - kTypeKernelDriver = 101, - kTypeRsrc = 102, - kTypeInvalid = 103, - kTypeCount = 4, - }; - - /** - @brief The executable architecture enum. - */ - - enum - { - kArchAMD64 = 122, - kArchARM64 = 123, - kArchRISCV = 124, - kArchCount = 3, - }; - - struct BootInfoHeader final - { - UInt64 f_Magic; - UInt64 f_Version; - - VoidPtr f_BitMapStart; - SizeT f_BitMapSize; - - VoidPtr f_PageStart; - - VoidPtr f_KernelImage; - SizeT f_KernelSz; - VoidPtr f_StartupImage; - SizeT f_StartupSz; - - WideChar f_FirmwareVendorName[32]; - SizeT f_FirmwareVendorLen; - - VoidPtr f_FirmwareCustomTables[2]; // On EFI 0: BS 1: ST - - struct - { - VoidPtr f_SmBios; - VoidPtr f_VendorPtr; - VoidPtr f_MpPtr; - Bool f_MultiProcessingEnabled; - } f_HardwareTables; - - struct - { - UIntPtr f_The; - SizeT f_Size; - UInt32 f_Width; - UInt32 f_Height; - UInt32 f_PixelFormat; - UInt32 f_PixelPerLine; - } f_GOP; - - UInt64 f_FirmwareSpecific[8]; - }; - - enum - { - kHandoverSpecificKind, - kHandoverSpecificAttrib, - kHandoverSpecificMemoryEfi, - }; - - /// @brief Alias of bootloader main type. - typedef Int32 (*HandoverProc)(BootInfoHeader* boot_info); -} // namespace NeOS::HEL - -/// @brief Bootloader information header global variable. -inline NeOS::HEL::BootInfoHeader* kHandoverHeader = nullptr; diff --git a/dev/Kernel/HALKit/.gitkeep b/dev/Kernel/HALKit/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Kernel/HALKit/AMD64/CPUID.h b/dev/Kernel/HALKit/AMD64/CPUID.h deleted file mode 100644 index 7f04ac27..00000000 --- a/dev/Kernel/HALKit/AMD64/CPUID.h +++ /dev/null @@ -1,86 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: CPUID.h - Purpose: CPUID flags. - - Revision History: - - 30/01/24: Added file (amlel) - -------------------------------------------- */ - -#pragma once - -#include - -enum CPUFeatureEnum -{ - kCPUFeatureSSE3 = 1 << 0, - kCPUFeaturePCLMUL = 1 << 1, - kCPUFeatureDTES64 = 1 << 2, - kCPUFeatureMONITOR = 1 << 3, - kCPUFeatureDS_CPL = 1 << 4, - kCPUFeatureVMX = 1 << 5, - kCPUFeatureSMX = 1 << 6, - kCPUFeatureEST = 1 << 7, - kCPUFeatureTM2 = 1 << 8, - kCPUFeatureSSSE3 = 1 << 9, - kCPUFeatureCID = 1 << 10, - kCPUFeatureSDBG = 1 << 11, - kCPUFeatureFMA = 1 << 12, - kCPUFeatureCX16 = 1 << 13, - kCPUFeatureXTPR = 1 << 14, - kCPUFeaturePDCM = 1 << 15, - kCPUFeaturePCID = 1 << 17, - kCPUFeatureDCA = 1 << 18, - kCPUFeatureSSE4_1 = 1 << 19, - kCPUFeatureSSE4_2 = 1 << 20, - kCPUFeatureX2APIC = 1 << 21, - kCPUFeatureMOVBE = 1 << 22, - kCPUFeaturePOP3C = 1 << 23, - kCPUFeatureECXTSC = 1 << 24, - kCPUFeatureAES = 1 << 25, - kCPUFeatureXSAVE = 1 << 26, - kCPUFeatureOSXSAVE = 1 << 27, - kCPUFeatureAVX = 1 << 28, - kCPUFeatureF16C = 1 << 29, - kCPUFeatureRDRAND = 1 << 30, - kCPUFeatureHYPERVISOR = 1 << 31, - kCPUFeatureFPU = 1 << 0, - kCPUFeatureVME = 1 << 1, - kCPUFeatureDE = 1 << 2, - kCPUFeaturePSE = 1 << 3, - kCPUFeatureEDXTSC = 1 << 4, - kCPUFeatureMSR = 1 << 5, - kCPUFeaturePAE = 1 << 6, - kCPUFeatureMCE = 1 << 7, - kCPUFeatureCX8 = 1 << 8, - kCPUFeatureAPIC = 1 << 9, - kCPUFeatureSEP = 1 << 11, - kCPUFeatureMTRR = 1 << 12, - kCPUFeaturePGE = 1 << 13, - kCPUFeatureMCA = 1 << 14, - kCPUFeatureCMOV = 1 << 15, - kCPUFeaturePAT = 1 << 16, - kCPUFeaturePSE36 = 1 << 17, - kCPUFeaturePSN = 1 << 18, - kCPUFeatureCLFLUSH = 1 << 19, - kCPUFeatureDS = 1 << 21, - kCPUFeatureACPI = 1 << 22, - kCPUFeatureMMX = 1 << 23, - kCPUFeatureFXSR = 1 << 24, - kCPUFeatureSSE = 1 << 25, - kCPUFeatureSSE2 = 1 << 26, - kCPUFeatureSS = 1 << 27, - kCPUFeatureHTT = 1 << 28, - kCPUFeatureTM = 1 << 29, - kCPUFeatureIA64 = 1 << 30, - kCPUFeaturePBE = 1 << 31 -}; - -namespace NeOS -{ - typedef Int64 CPUID; -} // namespace NeOS diff --git a/dev/Kernel/HALKit/AMD64/HalACPIFactoryInterface.cc b/dev/Kernel/HALKit/AMD64/HalACPIFactoryInterface.cc deleted file mode 100644 index 17ccf07e..00000000 --- a/dev/Kernel/HALKit/AMD64/HalACPIFactoryInterface.cc +++ /dev/null @@ -1,122 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include -#include - -namespace NeOS -{ - namespace Detail - { - struct FADT final : public SDT - { - UInt32 FirmwareCtrl; - UInt32 Dsdt; - - // field used in ACPI 1.0; no longer in use, for compatibility only - UInt8 Reserved; - - UInt8 PreferredPowerManagementProfile; - UInt16 SCI_Interrupt; - UInt32 SMI_CommandPort; - UInt8 AcpiEnable; - UInt8 AcpiDisable; - UInt8 S4BIOS_REQ; - UInt8 PSTATE_Control; - UInt32 PM1aEventBlock; - UInt32 PM1bEventBlock; - UInt32 PM1aControlBlock; - UInt32 PM1bControlBlock; - UInt32 PM2ControlBlock; - UInt32 PMTimerBlock; - UInt32 GPE0Block; - UInt32 GPE1Block; - UInt8 PM1EventLength; - UInt8 PM1ControlLength; - UInt8 PM2ControlLength; - UInt8 PMTimerLength; - UInt8 GPE0Length; - UInt8 GPE1Length; - UInt8 GPE1Base; - UInt8 CStateControl; - UInt16 WorstC2Latency; - UInt16 WorstC3Latency; - UInt16 FlushSize; - UInt16 FlushStride; - UInt8 DutyOffset; - UInt8 DutyWidth; - UInt8 DayAlarm; - UInt8 MonthAlarm; - UInt8 Century; - - // reserved in ACPI 1.0; used since ACPI 2.0+ - UInt16 BootArchitecturkMMFlags; - - UInt8 Reserved2; - UInt32 Flags; - - // 12 byte structure; see below for details - ACPI_ADDRESS ResetReg; - - UInt8 ResetValue; - UInt8 Reserved3[3]; - - // 64bit pointers - Available on ACPI 2.0+ - UInt64 X_FirmwareControl; - UInt64 X_Dsdt; - - ACPI_ADDRESS X_PM1aEventBlock; - ACPI_ADDRESS X_PM1bEventBlock; - ACPI_ADDRESS X_PM1aControlBlock; - ACPI_ADDRESS X_PM1bControlBlock; - ACPI_ADDRESS X_PM2ControlBlock; - ACPI_ADDRESS X_PMTimerBlock; - ACPI_ADDRESS X_GPE0Block; - ACPI_ADDRESS X_GPE1Block; - }; - } // namespace Detail - - ACPIFactoryInterface::ACPIFactoryInterface(VoidPtr rsp_ptr) - : fRsdp(rsp_ptr), fEntries(0) - { - } - - Bool ACPIFactoryInterface::Shutdown() - { - failed_to_shutdown: - return NO; - } - - /// @brief Reboot machine in either ACPI or by triple faulting. - /// @return nothing it's a reboot. - Void ACPIFactoryInterface::Reboot() - { - failed_to_reboot: - asm volatile(".intel_syntax noprefix; " - "rt_reset_hardware:; " - "cli; " - "wait_gate1: ; " - "in al,0x64 ; " - "and al,2 ; " - "jnz wait_gate1 ; " - "mov al,0x0D1 ; " - "out 0x64,al ; " - "wait_gate2: ; " - "in al,0x64 ; " - "and al,2 ; " - "jnz wait_gate2 ; " - "mov al,0x0FE ; " - "out 0x60,al ; " - "xor rax,rax ; " - "lidt [rax] ; " - "reset_wait: ; " - "jmp reset_wait ; " - ".att_syntax; "); - } -} // namespace NeOS diff --git a/dev/Kernel/HALKit/AMD64/HalAPICController.cc b/dev/Kernel/HALKit/AMD64/HalAPICController.cc deleted file mode 100644 index bd98932f..00000000 --- a/dev/Kernel/HALKit/AMD64/HalAPICController.cc +++ /dev/null @@ -1,44 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -#define cIOAPICRegVal (4) -#define cIOAPICRegReg (0) - -namespace NeOS::HAL -{ - APICController::APICController(VoidPtr base) - : fApic(base) - { - } - - /// @brief Read from APIC controller. - /// @param reg register. - UInt32 APICController::Read(UInt32 reg) noexcept - { - MUST_PASS(this->fApic); - - UInt32 volatile* io_apic = (UInt32 volatile*)this->fApic; - io_apic[cIOAPICRegReg] = (reg & 0xFF); - - return io_apic[cIOAPICRegVal]; - } - - /// @brief Write to APIC controller. - /// @param reg register. - /// @param value value. - Void APICController::Write(UInt32 reg, UInt32 value) noexcept - { - MUST_PASS(this->fApic); - - UInt32 volatile* io_apic = (UInt32 volatile*)this->fApic; - - io_apic[cIOAPICRegReg] = (reg & 0xFF); - io_apic[cIOAPICRegVal] = value; - } -} // namespace NeOS::HAL diff --git a/dev/Kernel/HALKit/AMD64/HalApplicationProcessor.cc b/dev/Kernel/HALKit/AMD64/HalApplicationProcessor.cc deleted file mode 100644 index 38d31d48..00000000 --- a/dev/Kernel/HALKit/AMD64/HalApplicationProcessor.cc +++ /dev/null @@ -1,271 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define kApicSignature "APIC" - -#define kAPIC_ICR_Low 0x300 -#define kAPIC_ICR_High 0x310 -#define kAPIC_SIPI_Vector 0x00500 -#define kAPIC_EIPI_Vector 0x00400 - -#define kAPIC_BASE_MSR 0x1B -#define kAPIC_BASE_MSR_BSP 0x100 -#define kAPIC_BASE_MSR_ENABLE 0x800 - -/// @note: _hal_switch_context is internal - -/////////////////////////////////////////////////////////////////////////////////////// - -//! NOTE: fGSI stands 'Field Global System Interrupt' - -/////////////////////////////////////////////////////////////////////////////////////// - -namespace NeOS::HAL -{ - struct PROCESS_APIC_MADT; - struct PROCESS_CONTROL_BLOCK; - - struct PROCESS_CONTROL_BLOCK final - { - HAL::StackFramePtr mFrame; - }; - - STATIC struct PROCESS_APIC_MADT* kMADTBlock = nullptr; - STATIC Bool kSMPAware = false; - STATIC Int64 kSMPCount = 0; - - STATIC UIntPtr kApicBaseAddress = 0UL; - - STATIC Int32 kSMPInterrupt = 0; - STATIC UInt64 kAPICLocales[kSchedProcessLimitPerTeam] = {0}; - STATIC VoidPtr kRawMADT = nullptr; - - /// @brief Multiple APIC Descriptor Table. - struct PROCESS_APIC_MADT final SDT_OBJECT - { - UInt32 Address; // Madt address - UInt8 Flags; // Madt flags - - struct - { - UInt8 Type; - UInt8 Len; - - union { - struct - { - UInt8 IoID; - UInt8 Zero; - UInt32 IoAddress; - UInt32 GISBase; - } IOAPIC; - - struct - { - UInt8 Source; - UInt8 IRQSource; - UInt32 GSI; - UInt16 Flags; - } LApicNMI; - - struct - { - UInt8 ProcessorID; - UInt16 Flags; - UInt8 LINT; - } LAPIC; - - struct - { - UInt16 Reserved; - UInt64 Address; - } LApicOverride; - - struct - { - UInt16 Reserved; - UInt32 x2APICID; - UInt32 Flags; - UInt32 AcpiID; - } LApic; - }; - } List[]; // Records List - }; - - /////////////////////////////////////////////////////////////////////////////////////// - - /***********************************************************************************/ - /// @brief Send IPI command to APIC. - /// @param apic_id programmable interrupt controller id. - /// @param vector vector interrupt. - /// @param target target APIC adress. - /// @return - /***********************************************************************************/ - - Void hal_send_start_ipi(UInt32 target, UInt32 apic_id) - { - NeOS::ke_dma_write(target, kAPIC_ICR_High, apic_id << 24); - NeOS::ke_dma_write(target, kAPIC_ICR_Low, 0x00000500 | 0x00004000 | 0x00000000); - - while (NeOS::ke_dma_read(target, kAPIC_ICR_Low) & 0x1000) - { - ; - } - } - - /***********************************************************************************/ - /// @brief Send end IPI for CPU. - /// @param apic_id - /// @param vector - /// @param target - /// @return - /***********************************************************************************/ - Void hal_send_sipi(UInt32 target, UInt32 apic_id, UInt8 vector) - { - NeOS::ke_dma_write(target, kAPIC_ICR_High, apic_id << 24); - NeOS::ke_dma_write(target, kAPIC_ICR_Low, 0x00000600 | 0x00004000 | 0x00000000 | vector); - - while (NeOS::ke_dma_read(target, kAPIC_ICR_Low) & 0x1000) - { - NE_UNUSED(0); - } - } - - STATIC PROCESS_CONTROL_BLOCK kProcessBlocks[kSchedProcessLimitPerTeam] = {0}; - - EXTERN_C HAL::StackFramePtr mp_get_current_context(Int64 pid) - { - const auto process_index = pid % kSchedProcessLimitPerTeam; - return kProcessBlocks[process_index].mFrame; - } - - EXTERN_C BOOL mp_register_process(HAL::StackFramePtr stack_frame, ProcessID pid) - { - MUST_PASS(stack_frame); - - const auto process_index = pid % kSchedProcessLimitPerTeam; - - kProcessBlocks[process_index].mFrame = stack_frame; - - auto first_id = kAPICLocales[0]; - - hal_send_sipi(kApicBaseAddress, first_id, (UInt8)(((UIntPtr)stack_frame->BP) >> 12)); - - return YES; - } - - /***********************************************************************************/ - /// @brief Is the current config SMP aware? - /// @return True if YES, False if not. - /***********************************************************************************/ - Bool mp_is_smp(Void) noexcept - { - return kSMPAware; - } - - /***********************************************************************************/ - /// @brief Assembly symbol to bootstrap AP. - /***********************************************************************************/ - EXTERN_C Char* hal_ap_blob_start; - - /***********************************************************************************/ - /// @brief Assembly symbol to bootstrap AP. - /***********************************************************************************/ - EXTERN_C Char* hal_ap_blob_end; - - /***********************************************************************************/ - /// @brief Fetch and enable SMP scheduler. - /// @param vendor_ptr SMP containing structure. - /***********************************************************************************/ - Void mp_get_cores(VoidPtr vendor_ptr) noexcept - { - if (!vendor_ptr) - return; - - if (!kHandoverHeader->f_HardwareTables.f_MultiProcessingEnabled) - { - kSMPAware = NO; - return; - } - - auto hw_and_pow_int = PowerFactoryInterface(vendor_ptr); - kRawMADT = hw_and_pow_int.Find(kApicSignature).Leak().Leak(); - - kMADTBlock = reinterpret_cast(kRawMADT); - kSMPAware = NO; - - if (kMADTBlock) - { - SizeT index = 0; - - kSMPInterrupt = 0; - kSMPCount = 0; - - kout << "SMP: Starting APs...\r"; - - UInt32 eax, edx; - kApicBaseAddress = kMADTBlock->Address; - - while (Yes) - { - if (kMADTBlock->List[index].Type > 9 || - kSMPCount > kSchedProcessLimitPerTeam) - break; - - switch (kMADTBlock->List[index].Type) - { - case 0x00: { - if (kMADTBlock->List[kSMPCount].LAPIC.ProcessorID < 1) - break; - - kAPICLocales[kSMPCount] = kMADTBlock->List[kSMPCount].LAPIC.ProcessorID; - kout << "SMP: APIC ID: " << number(kAPICLocales[kSMPCount]) << kendl; - - // I'll just make the AP start from scratch here. - - hal_send_start_ipi(kApicBaseAddress, kAPICLocales[kSMPCount]); - - HardwareTimer timer(NeOS::rtl_ms(10)); - timer.Wait(); - - /// TODO: HAL helper to create an address. - - hal_send_sipi(kApicBaseAddress, kAPICLocales[kSMPCount], (UInt8)(((UIntPtr)hal_ap_blob_start) >> 12)); - - ++kSMPCount; - break; - } - default: - break; - } - - ++index; - } - - kout << "SMP: number of APs: " << number(kSMPCount) << kendl; - - // Kernel is now SMP aware. - // That means that the scheduler is now available (on MP Kernels) - - kSMPAware = true; - - /// TODO: Notify Boot AP that it must start. - } - } -} // namespace NeOS::HAL - -/////////////////////////////////////////////////////////////////////////////////////// diff --git a/dev/Kernel/HALKit/AMD64/HalApplicationProcessorGNU.s b/dev/Kernel/HALKit/AMD64/HalApplicationProcessorGNU.s deleted file mode 100644 index a8ad3b76..00000000 --- a/dev/Kernel/HALKit/AMD64/HalApplicationProcessorGNU.s +++ /dev/null @@ -1,8 +0,0 @@ -.data - -.global hal_ap_blob_start /* Export the start symbol */ -.global hal_ap_blob_end /* Export the end symbol */ - -hal_ap_blob_start: - .incbin "HALKit/AMD64/HalApplicationProcessorStartup.bin" -hal_ap_blob_end: diff --git a/dev/Kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm b/dev/Kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm deleted file mode 100644 index c64e0a09..00000000 --- a/dev/Kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm +++ /dev/null @@ -1,77 +0,0 @@ -;; /* -;; * ======================================================== -;; * -;; * NeKernel -;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. -;; * -;; * ======================================================== -;; */ - -[bits 16] -[org 0x7c000] - -hal_ap_start: - mov ax, 0x0 - mov ss, ax - mov esp, 0x7000 - - cli - mov eax, cr0 - or eax, 1 - mov cr0, eax - jmp .hal_ap_start_flush -.hal_ap_start_flush: - mov ax, 0x10 - mov ds, ax - mov es, ax - mov fs, ax - mov gs, ax - mov ss, ax - - mov eax, cr4 - or eax, 1 << 5 - mov cr4, eax - - mov eax, cr3 - mov cr3, eax - - mov ecx, 0xC0000080 - rdmsr - or eax, 1 - wrmsr - - mov eax, cr0 - or eax, (1 << 31) - mov cr0, eax - - jmp 0x08:hal_ap_64bit_entry -hal_ap_end: - -hal_ap_length: - dq hal_ap_end - hal_ap_start - -[bits 64] - -hal_ap_64bit_entry: - mov ax, 0x23 - mov ds, ax - mov es, ax - mov fs, ax - mov gs, ax - mov ss, ax - mov rsp, [hal_ap_64bit_entry_stack_end] - - push 0x33 - push qword [hal_ap_64bit_entry_loop] - o64 pushf - push rsp - push 0x33 - - o64 iret - -hal_ap_64bit_entry_loop: - jmp $ - -hal_ap_64bit_entry_stack: - resb 8196*2 -hal_ap_64bit_entry_stack_end: \ No newline at end of file diff --git a/dev/Kernel/HALKit/AMD64/HalBoot.asm b/dev/Kernel/HALKit/AMD64/HalBoot.asm deleted file mode 100644 index 3ccdd50e..00000000 --- a/dev/Kernel/HALKit/AMD64/HalBoot.asm +++ /dev/null @@ -1,28 +0,0 @@ -;; /* -;; * ======================================================== -;; * -;; * NeKernel -;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. -;; * -;; * ======================================================== -;; */ - -[bits 64] - -;; Global symbol of this unit -[extern hal_init_platform] - -%define kTypeKernel 100 -%define kArchAmd64 122 -%define kHandoverMagic 0xBADCC - -section .ldr - -HandoverMagic: - dq kHandoverMagic -HandoverType: - dw kTypeKernel -HandoverPad: - dw 0 -HandoverArch: - dw kArchAmd64 diff --git a/dev/Kernel/HALKit/AMD64/HalCommonAPI.asm b/dev/Kernel/HALKit/AMD64/HalCommonAPI.asm deleted file mode 100644 index 671a955b..00000000 --- a/dev/Kernel/HALKit/AMD64/HalCommonAPI.asm +++ /dev/null @@ -1,82 +0,0 @@ -;; /* -;; * ======================================================== -;; * -;; * NeKernel -;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. -;; * -;; * ======================================================== -;; */ - -section .text - -extern rt_wait_400ns - -global rt_out8 -global rt_out16 -global rt_out32 - -global rt_in8 -global rt_in16 -global rt_in32 - -rt_out8: - mov al, dl - mov dx, cx - out dx, al - ret - -rt_out16: - mov ax, dx - mov dx, cx - out dx, ax - ret - -rt_out32: - mov eax, edx - mov edx, ecx - out dx, eax - ret - -rt_in8: - mov dx, cx - in al, dx - ret - -rt_in16: - mov edx, ecx - in ax, dx - ret - -rt_in32: - mov rdx, rcx - in eax, dx - ret - -extern hal_system_call_enter -global mp_system_call_handler - -mp_system_call_handler: - - push r8 - push r9 - push r10 - push r11 - push r12 - push r13 - push r14 - push r15 - - jmp hal_system_call_enter - - pop r15 - pop r14 - pop r13 - pop r12 - pop r11 - pop r10 - pop r9 - pop r8 - - o64 sysret - -[bits 16] diff --git a/dev/Kernel/HALKit/AMD64/HalControlRegister.s b/dev/Kernel/HALKit/AMD64/HalControlRegister.s deleted file mode 100644 index b94744f5..00000000 --- a/dev/Kernel/HALKit/AMD64/HalControlRegister.s +++ /dev/null @@ -1,45 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -.globl hal_write_cr3 -.globl hal_write_cr0 -.globl hal_read_cr2 -.globl hal_read_cr3 -.globl hal_read_cr0 -.globl hal_flush_tlb -.globl hal_invl_tlb - -.text - -hal_invl_tlb: - invlpg (%rcx) - retq - -hal_flush_tlb: - call hal_read_cr3 - mov %rax, %rcx - call hal_write_cr3 - retq - -hal_read_cr3: - movq %cr3, %rax - retq - -hal_read_cr0: - movq %cr0, %rax - retq - -hal_read_cr2: - movq %cr2, %rax - retq - -hal_write_cr3: - movq %rcx, %cr3 - retq - -hal_write_cr0: - movq %rcx, %cr0 - retq diff --git a/dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc b/dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc deleted file mode 100644 index 9eaa24eb..00000000 --- a/dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc +++ /dev/null @@ -1,245 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include - -STATIC BOOL kIsScheduling = NO; - -/// @brief Handle GPF fault. -/// @param rsp -EXTERN_C void idt_handle_gpf(NeOS::UIntPtr rsp) -{ - auto process = NeOS::UserProcessScheduler::The().CurrentProcess(); - - if (process.Leak().Status != NeOS::ProcessStatusKind::kRunning) - return; - - kIsScheduling = NO; - - kout << "Kernel: General Protection Fault.\r"; - - process.Leak().ProcessSignal.SignalArg = rsp; - process.Leak().ProcessSignal.SignalID = SIGKILL; - process.Leak().ProcessSignal.PreviousStatus = process.Leak().Status; - - kout << "Kernel: SIGKILL status.\r"; - - process.Leak().Status = NeOS::ProcessStatusKind::kKilled; - - process.Leak().Crash(); -} - -/// @brief Handle page fault. -/// @param rsp -EXTERN_C void idt_handle_pf(NeOS::UIntPtr rsp) -{ - auto process = NeOS::UserProcessScheduler::The().CurrentProcess(); - - if (process.Leak().Status != NeOS::ProcessStatusKind::kRunning) - return; - - kIsScheduling = NO; - - kout << "Kernel: Page Fault.\r"; - kout << "Kernel: SIGKILL\r"; - - process.Leak().ProcessSignal.SignalArg = rsp; - process.Leak().ProcessSignal.SignalID = SIGKILL; - process.Leak().ProcessSignal.PreviousStatus = process.Leak().Status; - - process.Leak().Status = NeOS::ProcessStatusKind::kKilled; - - process.Leak().Crash(); -} - -namespace NeOS::Detail -{ - constexpr static Int32 kTimeoutCount = 100000UL; -} - -/// @brief Handle scheduler interrupt. -EXTERN_C void idt_handle_scheduler(NeOS::UIntPtr rsp) -{ - static NeOS::Int64 try_count_before_brute = NeOS::Detail::kTimeoutCount; - - while (kIsScheduling) - { - --try_count_before_brute; - - if (try_count_before_brute < 1) - break; - } - - try_count_before_brute = NeOS::Detail::kTimeoutCount; - kIsScheduling = YES; - - NeOS::UserProcessHelper::StartScheduling(); - - kIsScheduling = NO; -} - -/// @brief Handle math fault. -/// @param rsp -EXTERN_C void idt_handle_math(NeOS::UIntPtr rsp) -{ - auto process = NeOS::UserProcessScheduler::The().CurrentProcess(); - - if (process.Leak().Status != NeOS::ProcessStatusKind::kRunning) - return; - - kIsScheduling = NO; - - kout << "Kernel: Math error (division by zero?).\r"; - - process.Leak().ProcessSignal.SignalArg = rsp; - process.Leak().ProcessSignal.SignalID = SIGKILL; - process.Leak().ProcessSignal.PreviousStatus = process.Leak().Status; - - kout << "Kernel: SIGKILL status.\r"; - - process.Leak().Status = NeOS::ProcessStatusKind::kKilled; - - process.Leak().Crash(); -} - -/// @brief Handle any generic fault. -/// @param rsp -EXTERN_C void idt_handle_generic(NeOS::UIntPtr rsp) -{ - auto process = NeOS::UserProcessScheduler::The().CurrentProcess(); - - if (process.Leak().Status != NeOS::ProcessStatusKind::kRunning) - { - kout << "Getting here.\r"; - return; - } - - kIsScheduling = NO; - - kout << "Kernel: Generic Process Fault.\r"; - - process.Leak().ProcessSignal.SignalArg = rsp; - process.Leak().ProcessSignal.SignalID = SIGKILL; - process.Leak().ProcessSignal.PreviousStatus = process.Leak().Status; - - kout << "Kernel: SIGKILL status.\r"; - - process.Leak().Status = NeOS::ProcessStatusKind::kKilled; - - process.Leak().Crash(); -} - -EXTERN_C NeOS::Void idt_handle_breakpoint(NeOS::UIntPtr rip) -{ - auto process = NeOS::UserProcessScheduler::The().CurrentProcess(); - - if (process.Leak().Status != NeOS::ProcessStatusKind::kRunning) - { - kout << "Kernel: SIGTRAP\r"; - - while (YES) - ; - } - - kIsScheduling = NO; - - kout << "Kernel: Process RIP: " << NeOS::hex_number(rip) << kendl; - kout << "Kernel: SIGTRAP\r"; - - process.Leak().ProcessSignal.SignalArg = rip; - process.Leak().ProcessSignal.SignalID = SIGTRAP; - - process.Leak().ProcessSignal.PreviousStatus = process.Leak().Status; - - kout << "Kernel: SIGTRAP status.\r"; - - process.Leak().Status = NeOS::ProcessStatusKind::kFrozen; -} - -/// @brief Handle #UD fault. -/// @param rsp -EXTERN_C void idt_handle_ud(NeOS::UIntPtr rsp) -{ - auto process = NeOS::UserProcessScheduler::The().CurrentProcess(); - - if (process.Leak().Status != NeOS::ProcessStatusKind::kRunning) - return; - - kIsScheduling = NO; - - kout << "Kernel: Undefined Opcode.\r"; - - process.Leak().ProcessSignal.SignalArg = rsp; - process.Leak().ProcessSignal.SignalID = SIGKILL; - process.Leak().ProcessSignal.PreviousStatus = process.Leak().Status; - - kout << "Kernel: SIGKILL status.\r"; - - process.Leak().Status = NeOS::ProcessStatusKind::kKilled; - - process.Leak().Crash(); -} - -/// @brief Enter syscall from assembly. -/// @param stack the stack pushed from assembly routine. -/// @return nothing. -EXTERN_C NeOS::Void hal_system_call_enter(NeOS::UIntPtr rcx_syscall_index, NeOS::UIntPtr rdx_syscall_struct) -{ - if (rcx_syscall_index < kSyscalls.Count()) - { - kout << "syscall: Enter Syscall.\r"; - - if (kSyscalls[rcx_syscall_index].fHooked) - { - if (kSyscalls[rcx_syscall_index].fProc) - { - (kSyscalls[rcx_syscall_index].fProc)((NeOS::VoidPtr)rdx_syscall_struct); - } - else - { - kout << "syscall: syscall isn't valid at all! (is nullptr)\r"; - } - } - else - { - kout << "syscall: syscall isn't hooked at all! (is set to false)\r"; - } - - kout << "syscall: Exit Syscall.\r"; - } -} - -/// @brief Enter Kernel call from assembly (DDK only). -/// @param stack the stack pushed from assembly routine. -/// @return nothing. -EXTERN_C NeOS::Void hal_kernel_call_enter(NeOS::UIntPtr rcx_kerncall_index, NeOS::UIntPtr rdx_kerncall_struct) -{ - if (rcx_kerncall_index < kKerncalls.Count()) - { - kout << "kerncall: Enter Kernel Call List.\r"; - - if (kKerncalls[rcx_kerncall_index].fHooked) - { - if (kKerncalls[rcx_kerncall_index].fProc) - { - (kKerncalls[rcx_kerncall_index].fProc)((NeOS::VoidPtr)rdx_kerncall_struct); - } - else - { - kout << "kerncall: Kernel call isn't valid at all! (is nullptr)\r"; - } - } - else - { - kout << "kerncall: Kernel call isn't hooked at all! (is set to false)\r"; - } - - kout << "kerncall: Exit Kernel Call List.\r"; - } -} diff --git a/dev/Kernel/HALKit/AMD64/HalCoreSystemCalls.cc b/dev/Kernel/HALKit/AMD64/HalCoreSystemCalls.cc deleted file mode 100644 index 75eb1f15..00000000 --- a/dev/Kernel/HALKit/AMD64/HalCoreSystemCalls.cc +++ /dev/null @@ -1,5 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2025, Amlal EL Mahrouss, all rights reserved. - - ------------------------------------------- */ diff --git a/dev/Kernel/HALKit/AMD64/HalDebugOutput.cc b/dev/Kernel/HALKit/AMD64/HalDebugOutput.cc deleted file mode 100644 index f262eee0..00000000 --- a/dev/Kernel/HALKit/AMD64/HalDebugOutput.cc +++ /dev/null @@ -1,190 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include -#include -#include - -namespace NeOS -{ - enum CommStatus : UInt16 - { - kStateInvalid, - kStateReady = 0xCF, - kStateTransmit = 0xFC, - kStateCnt = 3 - }; - - namespace Detail - { - constexpr const UInt16 kPort = 0x3F8; - static UInt16 kState = kStateInvalid; - - /// @brief Init COM1. - /// @return - template - bool hal_serial_init() noexcept - { - if (kState == kStateReady || kState == kStateTransmit) - return true; - - HAL::rt_out8(PORT + 1, 0x00); // Disable all interrupts - HAL::rt_out8(PORT + 3, 0x80); // Enable DLAB (set baud rate divisor) - HAL::rt_out8(PORT + 0, 0x03); // Set divisor to 3 (lo byte) 38400 baud - HAL::rt_out8(PORT + 1, 0x00); // (hi byte) - HAL::rt_out8(PORT + 3, 0x03); // 8 bits, no parity, one stop bit - HAL::rt_out8(PORT + 2, 0xC7); // Enable FIFO, clear them, with 14-byte threshold - HAL::rt_out8(PORT + 4, 0x0B); // IRQs enabled, RTS/DSR set - HAL::rt_out8(PORT + 4, 0x1E); // Set in loopback mode, test the serial chip - HAL::rt_out8(PORT + 0, 0xAE); // Test serial chip (send byte 0xAE and check if - // serial returns same byte) - - // Check if serial is faulty (i.e: not same byte as sent) - if (HAL::rt_in8(PORT) != 0xAE) - { - return false; - } - - kState = kStateReady; - - // If serial is not faulty set it in normal operation mode - // (not-loopback with IRQs enabled and OUT#1 and OUT#2 bits enabled) - HAL::rt_out8(PORT + 4, 0x0F); - - return true; - } - } // namespace Detail - - TerminalDevice::~TerminalDevice() = default; - - EXTERN_C void ke_io_write(IDeviceObject* obj, const Char* bytes) - { -#ifdef __DEBUG__ - Detail::hal_serial_init(); - - if (!bytes || Detail::kState != kStateReady) - return; - - if (*bytes == 0) - return; - - Detail::kState = kStateTransmit; - - SizeT index = 0; - SizeT len = 0; - - index = 0; - len = rt_string_len(bytes, 256U); - - static int x = kFontSizeX, y = kFontSizeY; - - static BOOL not_important = YES; - - while (index < len) - { - if (bytes[index] == '\r') - HAL::rt_out8(Detail::kPort, '\r'); - - HAL::rt_out8(Detail::kPort, bytes[index] == '\r' ? '\n' : bytes[index]); - - char tmp_str[2]; - tmp_str[0] = bytes[index]; - tmp_str[1] = 0; - - if (bytes[index] == '*') - { - if (not_important) - not_important = NO; - else - not_important = YES; - - ++index; - - continue; - } - - fb_render_string(tmp_str, y, x, not_important ? RGB(0xff, 0xff, 0xff) : RGB(0x00, 0x00, 0xff)); - - if (bytes[index] == '\r') - { - y += kFontSizeY; - x = kFontSizeX; - } - - x += kFontSizeX; - - if (y > kHandoverHeader->f_GOP.f_Height) - { - y = kFontSizeY; - - fb_init(); - - FBDrawInRegion(fb_get_clear_clr(), FB::UIAccessibilty::Height(), FB::UIAccessibilty::Width(), - 0, 0); - - fb_clear(); - } - - ++index; - } - - Detail::kState = kStateReady; -#endif // __DEBUG__ - } - - EXTERN_C void ke_io_read(IDeviceObject*, const Char* bytes) - { -#ifdef __DEBUG__ - Detail::hal_serial_init(); - - if (!bytes || Detail::kState != kStateReady) - return; - - Detail::kState = kStateTransmit; - - SizeT index = 0; - - ///! TODO: Look on how to wait for the UART to complete. - while (true) - { - auto in = HAL::rt_in8(Detail::kPort); - - ///! If enter pressed then break. - if (in == 0xD) - { - break; - } - - if (in < '0' || in < 'A' || in < 'a') - { - if (in != '@' || in != '!' || in != '?' || in != '.' || in != '/' || - in != ':') - { - continue; - } - } - - ((char*)bytes)[index] = in; - - ++index; - } - - ((char*)bytes)[index] = 0; - - Detail::kState = kStateReady; -#endif // __DEBUG__ - } - - TerminalDevice TerminalDevice::The() noexcept - { - TerminalDevice out(NeOS::ke_io_write, NeOS::ke_io_read); - return out; - } - -} // namespace NeOS diff --git a/dev/Kernel/HALKit/AMD64/HalDebugPort.cc b/dev/Kernel/HALKit/AMD64/HalDebugPort.cc deleted file mode 100644 index 7eada646..00000000 --- a/dev/Kernel/HALKit/AMD64/HalDebugPort.cc +++ /dev/null @@ -1,42 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -//! @file DebuggerPort.cc -//! @brief UART debug via packets. - -#include -#include - -// after that we have start of additional data. - -namespace NeOS -{ - void rt_debug_listen(DebuggerPortHeader* theHook) noexcept - { - if (theHook == nullptr) - return; - - for (UInt32 i = 0U; i < kDebugMaxPorts; ++i) - { - HAL::rt_out16(theHook->fPort[i], kDebugMag0); - HAL::rt_wait_400ns(); - - HAL::rt_out16(theHook->fPort[i], kDebugMag1); - HAL::rt_wait_400ns(); - - HAL::rt_out16(theHook->fPort[i], kDebugMag2); - HAL::rt_wait_400ns(); - - HAL::rt_out16(theHook->fPort[i], kDebugMag3); - HAL::rt_wait_400ns(); - - if (HAL::rt_in16(theHook->fPort[i]) != kDebugUnboundPort) - ++theHook->fPortCnt; - - HAL::rt_wait_400ns(); - } - } -} // namespace NeOS diff --git a/dev/Kernel/HALKit/AMD64/HalDescriptorLoader.cc b/dev/Kernel/HALKit/AMD64/HalDescriptorLoader.cc deleted file mode 100644 index 154b11af..00000000 --- a/dev/Kernel/HALKit/AMD64/HalDescriptorLoader.cc +++ /dev/null @@ -1,126 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -#define kPITDefaultTicks (1000U) - -namespace NeOS::HAL -{ - namespace Detail - { - STATIC ::NeOS::Detail::AMD64::InterruptDescriptorAMD64 - kInterruptVectorTable[kKernelIdtSize] = {}; - - STATIC void hal_set_irq_mask(UInt8 irql); - STATIC void hal_clear_irq_mask(UInt8 irql); - - STATIC Void hal_enable_pit(UInt16 ticks) noexcept - { - if (ticks == 0) - ticks = kPITDefaultTicks; - - // Configure PIT to receieve scheduler interrupts. - - UInt16 kPITCommDivisor = kPITFrequency / ticks; // 100 Hz. - - HAL::rt_out8(kPITControlPort, 0x36); // Command to PIT - HAL::rt_out8(kPITChannel0Port, kPITCommDivisor & 0xFF); // Send low byte - HAL::rt_out8(kPITChannel0Port, (kPITCommDivisor >> 8) & 0xFF); // Send high byte - - hal_clear_irq_mask(32); - } - - STATIC void hal_set_irq_mask(UInt8 irql) - { - UInt16 port; - UInt8 value; - - if (irql < 8) - { - port = kPICData; - } - else - { - port = kPIC2Data; - irql -= 8; - } - - value = rt_in8(port) | (1 << irql); - rt_out8(port, value); - } - - STATIC void hal_clear_irq_mask(UInt8 irql) - { - UInt16 port; - UInt8 value; - - if (irql < 8) - { - port = kPICData; - } - else - { - port = kPIC2Data; - irql -= 8; - } - - value = rt_in8(port) & ~(1 << irql); - rt_out8(port, value); - } - } // namespace Detail - - /// @brief Loads the provided Global Descriptor Table. - /// @param gdt - /// @return - Void GDTLoader::Load(RegisterGDT& gdt) - { - hal_load_gdt(gdt); - } - - Void IDTLoader::Load(Register64& idt) - { - rt_cli(); - - const Int16 kPITTickForScheduler = kPITDefaultTicks; - - volatile ::NeOS::UIntPtr** ptr_ivt = (volatile ::NeOS::UIntPtr**)idt.Base; - - for (SizeT idt_indx = 0; idt_indx < kKernelIdtSize; ++idt_indx) - { - Detail::kInterruptVectorTable[idt_indx].Selector = kIDTSelector; - Detail::kInterruptVectorTable[idt_indx].Ist = 0; - Detail::kInterruptVectorTable[idt_indx].TypeAttributes = kInterruptGate; - Detail::kInterruptVectorTable[idt_indx].OffsetLow = ((UIntPtr)ptr_ivt[idt_indx] & 0xFFFF); - Detail::kInterruptVectorTable[idt_indx].OffsetMid = (((UIntPtr)ptr_ivt[idt_indx] >> 16) & 0xFFFF); - Detail::kInterruptVectorTable[idt_indx].OffsetHigh = - (((UIntPtr)ptr_ivt[idt_indx] >> 32) & 0xFFFFFFFF); - - Detail::kInterruptVectorTable[idt_indx].Zero = 0; - } - - idt.Base = (UIntPtr)&Detail::kInterruptVectorTable[0]; - idt.Limit = sizeof(::NeOS::Detail::AMD64::InterruptDescriptorAMD64) * - (kKernelIdtSize); - - hal_load_idt(idt); - - Detail::hal_enable_pit(kPITTickForScheduler); - - rt_sti(); - } - - void GDTLoader::Load(Ref& gdt) - { - GDTLoader::Load(gdt.Leak()); - } - - void IDTLoader::Load(Ref& idt) - { - IDTLoader::Load(idt.Leak()); - } -} // namespace NeOS::HAL diff --git a/dev/Kernel/HALKit/AMD64/HalInterruptAPI.asm b/dev/Kernel/HALKit/AMD64/HalInterruptAPI.asm deleted file mode 100644 index ffea6707..00000000 --- a/dev/Kernel/HALKit/AMD64/HalInterruptAPI.asm +++ /dev/null @@ -1,402 +0,0 @@ -;; /* -;; * --------------------------------------------------- -;; * -;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. -;; * -;; * File: HalInterruptAPI.asm -;; * Purpose: Interrupt API, redirect raw interrupts into their handlers. -;; * -;; * --------------------------------------------------- -;; */ - -[bits 64] - -%define kInterruptId 50 - -%macro IntExp 1 -global __NE_INT_%1 -__NE_INT_%1: - cld - - std - - o64 iret -%endmacro - -%macro IntNormal 1 -global __NE_INT_%1 -__NE_INT_%1: - cld - - std - - o64 iret -%endmacro - -; This file handles the core interrupt table -; Last edited 31/01/24 - -global ke_handle_irq -global kInterruptVectorTable - -extern idt_handle_gpf -extern idt_handle_pf -extern ke_io_write -extern idt_handle_ud -extern idt_handle_generic -extern idt_handle_breakpoint - -section .text - -__NE_INT_0: - cld - - mov al, 0x20 - out 0x20, al - - push rcx - call idt_handle_generic - pop rcx - - std - - o64 iret - -__NE_INT_1: - cld - - mov al, 0x20 - out 0x20, al - - push rcx - call idt_handle_generic - pop rcx - - std - - o64 iret - -__NE_INT_2: - cld - - mov al, 0x20 - out 0x20, al - - push rcx - call idt_handle_generic - pop rcx - - std - - o64 iret - -;; @brief Triggers a breakpoint and freeze the process. RIP is also fetched. -__NE_INT_3: - cld - - mov al, 0x20 - out 0x20, al - - push rcx - mov rcx, rsp - call idt_handle_generic - pop rcx - - std - - o64 iret - -__NE_INT_4: - cld - - mov al, 0x20 - out 0x20, al - - - push rcx - call idt_handle_generic - pop rcx - - std - - o64 iret - -__NE_INT_5: - cld - - mov al, 0x20 - out 0x20, al - - std - - o64 iret - -;; Invalid opcode interrupt -__NE_INT_6: - cld - - mov al, 0x20 - out 0x20, al - - push rcx - call idt_handle_generic - pop rcx - - std - - o64 iret - -__NE_INT_7: - cld - - mov al, 0x20 - out 0x20, al - - push rcx - call idt_handle_generic - pop rcx - - std - - o64 iret - -;; Invalid opcode interrupt -__NE_INT_8: - cld - - mov al, 0x20 - out 0xA0, al - out 0x20, al - - push rcx - call idt_handle_generic - pop rcx - - std - - o64 iret - -IntNormal 9 -IntExp 10 -IntExp 11 - -IntExp 12 - -__NE_INT_13: - cld - - mov al, 0x20 - out 0xA0, al - out 0x20, al - - push rcx - call idt_handle_gpf - pop rcx - - std - - o64 iret - -__NE_INT_14: - cld - - mov al, 0x20 - out 0xA0, al - out 0x20, al - - push rcx - call idt_handle_pf - pop rcx - - std - - o64 iret - -IntNormal 15 -IntNormal 16 -IntExp 17 -IntNormal 18 -IntNormal 19 -IntNormal 20 -IntNormal 21 - -IntNormal 22 - -IntNormal 23 -IntNormal 24 -IntNormal 25 -IntNormal 26 -IntNormal 27 -IntNormal 28 -IntNormal 29 -IntExp 30 -IntNormal 31 - -[extern idt_handle_scheduler] - -__NE_INT_32: - cld - - mov al, 0x20 - out 0xA0, al - out 0x20, al - - push rax - mov rcx, rsp - call idt_handle_scheduler - pop rax - - std - - o64 iret - -IntNormal 33 - -IntNormal 34 -IntNormal 35 -IntNormal 36 -IntNormal 37 -IntNormal 38 -IntNormal 39 -IntNormal 40 - -IntNormal 41 - -IntNormal 42 -IntNormal 43 -IntNormal 44 -IntNormal 45 -IntNormal 46 -IntNormal 47 -IntNormal 48 -IntNormal 49 - -[extern hal_system_call_enter] -[extern hal_kernel_call_enter] - -__NE_INT_50: - cld - - mov al, 0x20 - out 0xA0, al - out 0x20, al - - push rax - mov rax, hal_system_call_enter - - mov rcx, r8 - mov rdx, r9 - - call rax - pop rax - - std - - o64 iret - -__NE_INT_51: - cld - - mov al, 0x20 - out 0xA0, al - out 0x20, al - - push rax - mov rax, hal_kernel_call_enter - - mov rcx, r8 - mov rdx, r9 - - call rax - pop rax - - std - - o64 iret - -IntNormal 52 - -IntNormal 53 -IntNormal 54 -IntNormal 55 -IntNormal 56 -IntNormal 57 -IntNormal 58 -IntNormal 59 -IntNormal 60 - -%assign i 61 -%rep 195 - IntNormal i -%assign i i+1 -%endrep - -section .text - -[global hal_load_gdt] - -hal_load_gdt: - cld - - lgdt [rcx] - - mov ax, 0x10 - mov ds, ax - mov es, ax - mov fs, ax - mov gs, ax - mov ss, ax - - mov rax, 0x08 - push rax - push hal_reload_segments - - o64 retf - -extern hal_real_init - -hal_reload_segments: - std - jmp hal_real_init - ret - -global hal_load_idt - -hal_load_idt: - lidt [rcx] - - ; Master PIC initialization - mov al, 0x11 ; Start initialization in cascade mode - out 0x20, al ; Send initialization command to Master PIC - out 0xA0, al ; Send initialization command to Slave PIC - - ; Remap the PIC to use vectors 32-39 for Master and 40-47 for Slave - mov al, 0x20 ; Set Master PIC offset to 32 - out 0x21, al ; Send offset to Master PIC - - mov al, 0x28 ; Set Slave PIC offset to 40 - out 0xA1, al ; Send offset to Slave PIC - - ; Configure Master PIC to inform Slave PIC at IRQ2 - mov al, 0x04 ; Tell Master PIC there is a Slave PIC at IRQ2 - out 0x21, al - - ; Configure Slave PIC identity - mov al, 0x02 ; Tell Slave PIC its cascade identity - out 0xA1, al - - ; Set both PICs to 8086 mode - mov al, 0x01 ; 8086 mode - out 0x21, al - out 0xA1, al - - ret - -section .data - -kInterruptVectorTable: - %assign i 0 - %rep 256 - dq __NE_INT_%+i - %assign i i+1 - %endrep diff --git a/dev/Kernel/HALKit/AMD64/HalKernelMain.cc b/dev/Kernel/HALKit/AMD64/HalKernelMain.cc deleted file mode 100644 index e87e6fb1..00000000 --- a/dev/Kernel/HALKit/AMD64/HalKernelMain.cc +++ /dev/null @@ -1,117 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -EXTERN_C NeOS::VoidPtr kInterruptVectorTable[]; -EXTERN_C NeOS::VoidPtr mp_user_switch_proc; -EXTERN_C NeOS::Char mp_user_switch_proc_stack_begin[]; - -STATIC NeOS::Void hal_init_scheduler_team() -{ - for (NeOS::SizeT i = 0U; i < NeOS::UserProcessScheduler::The().CurrentTeam().AsArray().Count(); ++i) - { - NeOS::UserProcessScheduler::The().CurrentTeam().AsArray()[i] = NeOS::UserProcess(); - NeOS::UserProcessScheduler::The().CurrentTeam().AsArray()[i].Status = NeOS::ProcessStatusKind::kKilled; - } -} - -STATIC NeOS::UInt64 hal_rdtsc_fn() -{ - NeOS::UInt32 lo, hi; - __asm__ volatile("rdtsc" - : "=a"(lo), "=d"(hi)); - - return ((NeOS::UInt64)hi << 32) | lo; -} - -STATIC NeOS::UInt64 kStartTim, kEndTim; - -/// @brief Kernel init procedure. -EXTERN_C void hal_init_platform( - NeOS::HEL::BootInfoHeader* handover_hdr) -{ - kStartTim = hal_rdtsc_fn(); - - kHandoverHeader = handover_hdr; - - if (kHandoverHeader->f_Magic != kHandoverMagic && - kHandoverHeader->f_Version != kHandoverVersion) - { - return; - } - - hal_init_scheduler_team(); - - /************************************** */ - /* INITIALIZE BIT MAP. */ - /************************************** */ - - kKernelBitMpSize = kHandoverHeader->f_BitMapSize; - kKernelBitMpStart = reinterpret_cast( - reinterpret_cast(kHandoverHeader->f_BitMapStart)); - - /************************************** */ - /* INITIALIZE GDT AND SEGMENTS. */ - /************************************** */ - - STATIC CONST auto kGDTEntriesCount = 6; - - /* GDT, mostly descriptors for user and kernel segments. */ - STATIC NeOS::HAL::Detail::NE_GDT_ENTRY ALIGN(0x08) kGDTArray[kGDTEntriesCount] = { - {.fLimitLow = 0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0x00, .fFlags = 0x00, .fBaseHigh = 0}, // Null entry - {.fLimitLow = 0x0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0x9A, .fFlags = 0xAF, .fBaseHigh = 0}, // Kernel code - {.fLimitLow = 0x0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0x92, .fFlags = 0xCF, .fBaseHigh = 0}, // Kernel data - {.fLimitLow = 0x0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0xFA, .fFlags = 0xAF, .fBaseHigh = 0}, // User code - {.fLimitLow = 0x0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0xF2, .fFlags = 0xCF, .fBaseHigh = 0}, // User data - }; - - // Load memory descriptors. - NeOS::HAL::RegisterGDT gdt_reg; - - gdt_reg.Base = reinterpret_cast(kGDTArray); - gdt_reg.Limit = (sizeof(NeOS::HAL::Detail::NE_GDT_ENTRY) * kGDTEntriesCount) - 1; - - FB::fb_clear_video(); - - //! GDT will load hal_read_init after it successfully loads the segments. - NeOS::HAL::GDTLoader gdt_loader; - gdt_loader.Load(gdt_reg); - - NeOS::ke_panic(RUNTIME_CHECK_BOOTSTRAP); -} - -EXTERN_C NeOS::Void hal_real_init(NeOS::Void) noexcept -{ - NeOS::NeFS::fs_init_nefs(); - - NeOS::HAL::mp_get_cores(kHandoverHeader->f_HardwareTables.f_VendorPtr); - - NeOS::HAL::Register64 idt_reg; - - idt_reg.Base = (NeOS::UIntPtr)kInterruptVectorTable; - - NeOS::HAL::IDTLoader idt_loader; - - kEndTim = hal_rdtsc_fn(); - - kout << "Cycles Spent Before Userland: " << NeOS::number(kEndTim - kStartTim) << kendl; - - idt_loader.Load(idt_reg); - - while (YES) - { - continue; - } -} diff --git a/dev/Kernel/HALKit/AMD64/HalKernelPanic.cc b/dev/Kernel/HALKit/AMD64/HalKernelPanic.cc deleted file mode 100644 index 663a8f8e..00000000 --- a/dev/Kernel/HALKit/AMD64/HalKernelPanic.cc +++ /dev/null @@ -1,68 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Each error code is attributed with an ID, which will prompt a string onto the - * screen. Wait for debugger... */ - -namespace NeOS -{ - /// @brief Dumping factory class. - class RecoveryFactory final - { - public: - STATIC Void Recover() noexcept; - }; - - /***********************************************************************************/ - /// @brief Stops execution of the kernel. - /// @param id kernel stop ID. - /***********************************************************************************/ - Void ke_panic(const NeOS::Int32& id, const Char* message) - { - fb_init(); - - auto panic_text = RGB(0xff, 0xff, 0xff); - - auto y = 10; - auto x = 10; - - kout << "Kernel_Panic_MSG: " << message << kendl; - kout << "Kernel_Panic_ID: " << hex_number(id) << kendl; - kout << "Kernel_Panic_CR2: " << hex_number((UIntPtr)hal_read_cr2()) << kendl; - - RecoveryFactory::Recover(); - } - - Void RecoveryFactory::Recover() noexcept - { - while (YES) - { - HAL::rt_halt(); - } - } - - void ke_runtime_check(bool expr, const Char* file, const Char* line) - { - if (!expr) - { - kout << "Kernel_Panic_File: " << file << kendl; - kout << "Kernel_Panic_Line: " << line << kendl; - - ke_panic(RUNTIME_CHECK_FAILED, file); // Runtime Check failed - } - } -} // namespace NeOS diff --git a/dev/Kernel/HALKit/AMD64/HalPagingMgrAMD64.cc b/dev/Kernel/HALKit/AMD64/HalPagingMgrAMD64.cc deleted file mode 100644 index fe9f0421..00000000 --- a/dev/Kernel/HALKit/AMD64/HalPagingMgrAMD64.cc +++ /dev/null @@ -1,204 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: HalPagingMgr.cc - Purpose: Platform Paging Manager. - -------------------------------------------- */ - -#include -#include - -namespace NeOS::HAL -{ - typedef UInt32 PageTableIndex; - - /***********************************************************************************/ - /// \brief Page store type. - /***********************************************************************************/ - struct NE_PAGE_STORE final - { - struct - { - PDE* fPde{nullptr}; - PTE* fPte{nullptr}; - VoidPtr fPAddr{nullptr}; - } fInternalStore; - - Bool fStoreOp{No}; // Store operation is in progress. - - bool IsValidPage(PTE* pte) - { - return pte && pte->Present; - } - - bool IsWRPage(PTE* pte) - { - return pte && pte->Wr; - } - - bool IsUserPage(PTE* pte) - { - return pte && pte->User; - } - - static NE_PAGE_STORE& The() - { - static NE_PAGE_STORE the; - return the; - } - }; - - /// @brief Go over the Page structure and find the address of *virtual_address* - - UIntPtr hal_get_phys_address(VoidPtr virtual_address) - { - // Constants for table index bits - const UInt64 kPmlIndexMask = 0x1FFULL; // Mask for PML4, PDPT, PD, PT index (9 bits) - const UInt64 kPtIndexMask = 0xFFFULL; // Mask for page table index (12 bits) - - UInt64 cr3 = (UInt64)hal_read_cr3(); - - NE_PAGE_STORE& page_store = NE_PAGE_STORE::The(); - - // Extract the indices from the virtual address - UInt64 pml4_index = ((UIntPtr)virtual_address >> 39) & kPmlIndexMask; - UInt64 pdpt_index = ((UIntPtr)virtual_address >> 30) & kPmlIndexMask; - UInt64 pd_index = ((UIntPtr)virtual_address >> 21) & kPmlIndexMask; - UInt64 pt_index = ((UIntPtr)virtual_address >> 12) & kPmlIndexMask; - - page_store.fStoreOp = Yes; - - const auto kPmlEntrySize = 8; - - // Read the PML4 entry from memory - UInt64 pml4_base = cr3 & ~kPtIndexMask; // CR3 points to the PML4 table base, mask off lower bits - UInt64 pml4_entry = (pml4_base + pml4_index * kPmlEntrySize); // Each entry is 8 bytes - - // Read the PDPT entry - UInt64 pdpt_base = pml4_entry & ~kPtIndexMask; // Get the PDPT base physical address - UInt64 pdpt_entry = (pdpt_base + pdpt_index * kPmlEntrySize); - - // Read the PD entry - UInt64 pd_base = pdpt_entry & ~kPtIndexMask; // Get the Page Directory base physical address - UInt64 pd_entry = (pd_base + pd_index * kPmlEntrySize); - - // Read the PT entry - UInt64 pt_base = pd_entry & ~kPtIndexMask; // Get the Page Table base physical address - UInt64 pt_entry = (pt_base + pt_index * kPmlEntrySize); - - // Lastly, grab the pte entry. - NE_PDE* pde_struct = reinterpret_cast(pt_base); - - return pde_struct->fEntries[pt_entry]->PhysicalAddress; - } - - /***********************************************************************************/ - /// \brief Retrieve the page status of a PTE. - /// \param pte Page Table Entry pointer. - /***********************************************************************************/ - STATIC Void mmi_page_status(PTE* pte) - { - kout << (pte->Present ? "Present" : "Not Present") << kendl; - kout << (pte->Wr ? "W/R" : "Not W/R") << kendl; - kout << (pte->ExecDisable ? "NX" : "Not NX") << kendl; - kout << (pte->User ? "User" : "Not User") << kendl; - } - - STATIC Int32 mmi_map_page_table_entry(UInt32 physical_address, UInt32 flags, NE_PTE* pt_entry, NE_PDE* pd_entry); - - /***********************************************************************************/ - /// @brief Maps or allocates a page from virtual_address. - /// @param virtual_address a valid virtual address. - /// @param phys_addr point to physical address. - /// @param flags the flags to put on the page. - /// @return Status code of page manipulation process. - /***********************************************************************************/ - EXTERN_C Int32 mm_map_page(VoidPtr virtual_address, VoidPtr physical_address, UInt32 flags) - { - // Constants for table index bits - const UInt64 kPmlIndexMask = 0x1FFULL; // Mask for PML4, PDPT, PD, PT index (9 bits) - const UInt64 kPtIndexMask = 0xFFFULL; // Mask for page table index (12 bits) - - UInt64 cr3 = (UInt64)hal_read_cr3(); - - NE_PAGE_STORE& page_store = NE_PAGE_STORE::The(); - - // Extract the indices from the virtual address - UInt64 pml4_index = ((UIntPtr)virtual_address >> 39) & kPmlIndexMask; - UInt64 pdpt_index = ((UIntPtr)virtual_address >> 30) & kPmlIndexMask; - UInt64 pd_index = ((UIntPtr)virtual_address >> 21) & kPmlIndexMask; - UInt64 pt_index = ((UIntPtr)virtual_address >> 12) & kPmlIndexMask; - - page_store.fStoreOp = Yes; - - const auto kPmlEntrySize = 8; - - // Read the PML4 entry from memory - UInt64 pml4_base = cr3 & ~kPtIndexMask; // CR3 points to the PML4 table base, mask off lower bits - UInt64 pml4_entry = (pml4_base + pml4_index * kPmlEntrySize); // Each entry is 8 bytes - - // Read the PDPT entry - UInt64 pdpt_base = pml4_entry & ~kPtIndexMask; // Get the PDPT base physical address - UInt64 pdpt_entry = (pdpt_base + pdpt_index * kPmlEntrySize); - - // Read the PD entry - UInt64 pd_base = pdpt_entry & ~kPtIndexMask; // Get the Page Directory base physical address - UInt64 pd_entry = (pd_base + pd_index * kPmlEntrySize); - - // Read the PT entry - UInt64 pt_base = pd_entry & ~kPtIndexMask; // Get the Page Table base physical address - UInt64 pt_entry = (pt_base + pt_index * kPmlEntrySize); - - // Lastly, grab the pte entry. - NE_PDE* pde_struct = reinterpret_cast(pt_base); - - return mmi_map_page_table_entry((UInt32)(UInt64)physical_address, flags, pde_struct->fEntries[pt_entry], pde_struct); - } - - /***********************************************************************************/ - /// @brief Maps flags for a specific pte. - /// @internal Internal function. - /***********************************************************************************/ - STATIC Int32 mmi_map_page_table_entry(UInt32 physical_address, UInt32 flags, NE_PTE* pt_entry, NE_PDE* pd_entry) - { - if (!pt_entry) - return 1; - - pt_entry->Present = true; - - if (flags & kMMFlagsWr) - pt_entry->Wr = true; - else if (flags & ~kMMFlagsWr) - pt_entry->Wr = false; - - if (flags & kMMFlagsNX) - pt_entry->ExecDisable = true; - else if (flags & ~kMMFlagsNX) - pt_entry->ExecDisable = false; - - if (flags & kMMFlagsUser) - pt_entry->User = true; - else if (flags & ~kMMFlagsUser) - pt_entry->User = false; - - pt_entry->PhysicalAddress = physical_address; - - hal_invl_tlb(reinterpret_cast(pt_entry)); - - mmi_page_status(pt_entry); - - NE_PAGE_STORE& page_store = NE_PAGE_STORE::The(); - - // Update Internal store. - - page_store.fInternalStore.fPde = pd_entry; - page_store.fInternalStore.fPte = pt_entry; - page_store.fInternalStore.fPAddr = (VoidPtr)(UIntPtr)physical_address; - - page_store.fStoreOp = No; - - return 0; - } -} // namespace NeOS::HAL diff --git a/dev/Kernel/HALKit/AMD64/HalProcessorAMD64.cc b/dev/Kernel/HALKit/AMD64/HalProcessorAMD64.cc deleted file mode 100644 index b3da8352..00000000 --- a/dev/Kernel/HALKit/AMD64/HalProcessorAMD64.cc +++ /dev/null @@ -1,101 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: HalCPU.cc - Purpose: Platform processor routines. - -------------------------------------------- */ - -#include -#include - -/** - * @file HalCPU.cc - * @brief Common CPU API. - */ - -namespace NeOS::HAL -{ - Void lrt_out8(UInt16 port, UInt8 value) - { - asm volatile("outb %%al, %1" - : - : "a"(value), "Nd"(port) - : "memory"); - } - - Void lrt_out16(UInt16 port, UInt16 value) - { - asm volatile("outw %%ax, %1" - : - : "a"(value), "Nd"(port) - : "memory"); - } - - Void lrt_out32(UInt16 port, UInt32 value) - { - asm volatile("outl %%eax, %1" - : - : "a"(value), "Nd"(port) - : "memory"); - } - - UInt8 lrt_in8(UInt16 port) - { - UInt8 value = 0UL; - asm volatile("inb %1, %%al" - : "=a"(value) - : "Nd"(port) - : "memory"); - - return value; - } - - UInt16 lrt_in16(UInt16 port) - { - UInt16 value = 0UL; - asm volatile("inw %1, %%ax" - : "=a"(value) - : "Nd"(port) - : "memory"); - - return value; - } - - UInt32 lrt_in32(UInt16 port) - { - UInt32 value = 0UL; - asm volatile("inl %1, %%eax" - : "=a"(value) - : "Nd"(port) - : "memory"); - - return value; - } - - Void rt_halt() - { - asm volatile("hlt"); - } - - Void rt_cli() - { - asm volatile("cli"); - } - - Void rt_sti() - { - asm volatile("sti"); - } - - Void rt_cld() - { - asm volatile("cld"); - } - - Void rt_std() - { - asm volatile("std"); - } -} // namespace NeOS::HAL diff --git a/dev/Kernel/HALKit/AMD64/HalRoutineWait.s b/dev/Kernel/HALKit/AMD64/HalRoutineWait.s deleted file mode 100644 index 89051ba4..00000000 --- a/dev/Kernel/HALKit/AMD64/HalRoutineWait.s +++ /dev/null @@ -1,11 +0,0 @@ -.globl rt_wait_400ns - -.section .text -rt_wait_400ns: - jmp .loop - pause - .loop: - jmp .loop2 - pause - .loop2: - ret diff --git a/dev/Kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc b/dev/Kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc deleted file mode 100644 index bf4b9d91..00000000 --- a/dev/Kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc +++ /dev/null @@ -1,52 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -namespace NeOS -{ - /***********************************************************************************/ - /// @brief Unimplemented function (crashes by default) - /// @param - /***********************************************************************************/ - - EXTERN_C Void __zka_pure_call(UserProcess* process) - { - if (process) - process->Crash(); - } - - /***********************************************************************************/ - /// @brief Validate user stack. - /// @param stack_ptr the frame pointer. - /***********************************************************************************/ - - EXTERN_C Bool hal_check_stack(HAL::StackFramePtr stack_ptr) - { - if (!stack_ptr) - return No; - - return stack_ptr->SP != 0 && stack_ptr->BP != 0; - } - - /// @brief Wakes up thread. - /// Wakes up thread from the hang state. - Void mp_wakeup_thread(HAL::StackFrame* stack) - { - NeOS::UserProcessHelper::StartScheduling(); - } - - /// @brief makes the thread sleep on a loop. - /// hooks and hangs thread to prevent code from executing. - Void mp_hang_thread(HAL::StackFrame* stack) - { - while (Yes) - { - /* Nothing to do, code is spinning */ - } - } -} // namespace NeOS diff --git a/dev/Kernel/HALKit/AMD64/HalSystemCallInstall.cc b/dev/Kernel/HALKit/AMD64/HalSystemCallInstall.cc deleted file mode 100644 index e4e9daab..00000000 --- a/dev/Kernel/HALKit/AMD64/HalSystemCallInstall.cc +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include diff --git a/dev/Kernel/HALKit/AMD64/HalTimerAMD64.cc b/dev/Kernel/HALKit/AMD64/HalTimerAMD64.cc deleted file mode 100644 index 9b3380c3..00000000 --- a/dev/Kernel/HALKit/AMD64/HalTimerAMD64.cc +++ /dev/null @@ -1,86 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: HalTimer.cc - Purpose: HAL timer - - Revision History: - - 07/07/24: Added file (amlel) - -------------------------------------------- */ - -#include -#include -#include - -// timer slot 0 - -#define cHPETCounterRegValue (0x00) -#define cHPETConfigRegValue (0x20) -#define cHPETCompRegValue (0x24) -#define cHPETInterruptRegValue (0x2C) - -///! BUGS: 0 -///! @file HalTimer.cc -///! @brief Hardware Timer (HPET) - -namespace NeOS::Detail -{ - struct HPET_BLOCK : public NeOS::SDT - { - NeOS::UInt8 hardware_rev_id; - NeOS::UInt8 comparator_count : 5; - NeOS::UInt8 counter_size : 1; - NeOS::UInt8 reserved : 1; - NeOS::UInt8 legacy_replacement : 1; - NeOS::UInt16 pci_vendor_id; - ACPI_ADDRESS address; - NeOS::UInt8 hpet_number; - NeOS::UInt16 minimum_tick; - NeOS::UInt8 page_protection; - } PACKED; -} // namespace NeOS::Detail - -using namespace NeOS; - -HardwareTimer::HardwareTimer(Int64 ms) - : fWaitFor(ms) -{ - auto power = PowerFactoryInterface(kHandoverHeader->f_HardwareTables.f_VendorPtr); - - auto hpet = (Detail::HPET_BLOCK*)power.Find("HPET").Leak().Leak(); - MUST_PASS(hpet); - - fDigitalTimer = (IntPtr*)hpet->address.Address; -} - -HardwareTimer::~HardwareTimer() -{ - fDigitalTimer = nullptr; - fWaitFor = 0; -} - -BOOL HardwareTimer::Wait() noexcept -{ - if (fWaitFor < 1) - return NO; - - // if not enabled yet. - if (!(*(fDigitalTimer + cHPETConfigRegValue) & (1 << 0))) - { - *(fDigitalTimer + cHPETConfigRegValue) |= (1 << 0); // enable it - *(fDigitalTimer + cHPETConfigRegValue) |= (1 << 3); // one shot conf - } - - UInt64 ticks = fWaitFor / ((*(fDigitalTimer) >> 32) & __UINT32_MAX__); - UInt64 prev = *(fDigitalTimer + cHPETCounterRegValue); - - prev += ticks; - - while (*(fDigitalTimer + cHPETCounterRegValue) < (ticks)) - ; - - return YES; -} diff --git a/dev/Kernel/HALKit/AMD64/HalUtils.asm b/dev/Kernel/HALKit/AMD64/HalUtils.asm deleted file mode 100644 index 83453714..00000000 --- a/dev/Kernel/HALKit/AMD64/HalUtils.asm +++ /dev/null @@ -1,26 +0,0 @@ -;; /* -;; * ======================================================== -;; * -;; * NeKernel -;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. -;; * -;; * ======================================================== -;; */ - -[bits 64] - -[global rt_install_tib] - -section .text - -;; changed: rs, fs -;; expected: rcx, rdx - -rt_install_tib: - mov rcx, gs ;; TIB -> Thread Information Block - mov rdx, fs ;; PIB -> Process Information Block - ret - -;; //////////////////////////////////////////////////// ;; - -[extern kApicMadtAddressesCount] diff --git a/dev/Kernel/HALKit/AMD64/Hypervisor.h b/dev/Kernel/HALKit/AMD64/Hypervisor.h deleted file mode 100644 index 4c226eee..00000000 --- a/dev/Kernel/HALKit/AMD64/Hypervisor.h +++ /dev/null @@ -1,25 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -namespace NeOS -{ - MAKE_STRING_ENUM(HYPERVISOR) - ENUM_STRING(Qemu, "TCGTCGTCGTCG"); - ENUM_STRING(KVM, " KVMKVMKVM "); - ENUM_STRING(VMWare, "VMwareVMware"); - ENUM_STRING(VirtualBox, "VBoxVBoxVBox"); - ENUM_STRING(Xen, "XenVMMXenVMM"); - ENUM_STRING(Microsoft, "Microsoft Hv"); - ENUM_STRING(Parallels, " prl hyperv "); - ENUM_STRING(ParallelsAlt, " lrpepyh vr "); - ENUM_STRING(Bhyve, "bhyve bhyve "); - ENUM_STRING(Qnx, " QNXQVMBSQG "); - END_STRING_ENUM() -} // namespace NeOS diff --git a/dev/Kernel/HALKit/AMD64/MBCI/HalMBCI.cc b/dev/Kernel/HALKit/AMD64/MBCI/HalMBCI.cc deleted file mode 100644 index 58124a18..00000000 --- a/dev/Kernel/HALKit/AMD64/MBCI/HalMBCI.cc +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include diff --git a/dev/Kernel/HALKit/AMD64/PCI/DMA.cc b/dev/Kernel/HALKit/AMD64/PCI/DMA.cc deleted file mode 100644 index c756a572..00000000 --- a/dev/Kernel/HALKit/AMD64/PCI/DMA.cc +++ /dev/null @@ -1,87 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -namespace NeOS -{ - DMAWrapper::operator bool() - { - return this->fAddress; - } - - bool DMAWrapper::operator!() - { - return !this->fAddress; - } - - Boolean DMAWrapper::Check(UIntPtr offset) const - { - if (!this->fAddress) - return false; - - if (offset == 0) - return false; - - kout << "[DMAWrapper::IsIn] Checking offset..\n"; - return reinterpret_cast(this->fAddress) >= offset; - } - - bool DMAWrapper::Write(const UIntPtr& bit, const UInt32& offset) - { - kout << "[DMAWrapper::Read] Checking this->fAddress..\n"; - - if (!this->fAddress) - return false; - - kout << "[DMAWrapper::Write] Writing at address..\n"; - - auto addr = - (volatile UIntPtr*)(reinterpret_cast(this->fAddress) + offset); - *addr = bit; - - return true; - } - - UIntPtr DMAWrapper::Read(const UInt32& offset) - { - kout << "[DMAWrapper::Read] Checking this->fAddress..\n"; - - if (!this->fAddress) - return 0; - - kout << "[DMAWrapper::Read] Reading this->fAddress..\n"; - - return *(volatile UIntPtr*)(reinterpret_cast(this->fAddress) + offset); - ; - } - - UIntPtr DMAWrapper::operator[](const UIntPtr& offset) - { - return this->Read(offset); - } - - OwnPtr> DMAFactory::Construct(OwnPtr& dma) - { - if (!dma) - return {}; - - OwnPtr> dmaOwnPtr = - make_ptr, char*>(reinterpret_cast(dma->fAddress)); - - if (!dmaOwnPtr) - return {}; - - kout << "Returning the new OwnPtr>!\r"; - return dmaOwnPtr; - } - - DMAWrapper& DMAWrapper::operator=(voidPtr Ptr) - { - this->fAddress = Ptr; - return *this; - } -} // namespace NeOS diff --git a/dev/Kernel/HALKit/AMD64/PCI/Database.cc b/dev/Kernel/HALKit/AMD64/PCI/Database.cc deleted file mode 100644 index c5aa1282..00000000 --- a/dev/Kernel/HALKit/AMD64/PCI/Database.cc +++ /dev/null @@ -1,11 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -namespace NeOS -{ -} diff --git a/dev/Kernel/HALKit/AMD64/PCI/Device.cc b/dev/Kernel/HALKit/AMD64/PCI/Device.cc deleted file mode 100644 index 348e058a..00000000 --- a/dev/Kernel/HALKit/AMD64/PCI/Device.cc +++ /dev/null @@ -1,171 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -#define PCI_BAR_IO 0x01 -#define PCI_BAR_LOWMEM 0x02 -#define PCI_BAR_64 0x04 -#define PCI_BAR_PREFETCH 0x08 - -NeOS::UInt NE_PCIReadRaw(NeOS::UInt bar, NeOS::UShort bus, NeOS::UShort dev, NeOS::UShort fun) -{ - NeOS::UInt target = 0x80000000 | ((NeOS::UInt)bus << 16) | - ((NeOS::UInt)dev << 11) | ((NeOS::UInt)fun << 8) | - (bar & 0xFC); - - NeOS::HAL::rt_out32((NeOS::UShort)NeOS::PCI::PciConfigKind::ConfigAddress, - target); - - NeOS::HAL::rt_wait_400ns(); - - return NeOS::HAL::rt_in32((NeOS::UShort)NeOS::PCI::PciConfigKind::ConfigData); -} - -void NE_PCISetCfgTarget(NeOS::UInt bar, NeOS::UShort bus, NeOS::UShort dev, NeOS::UShort fun) -{ - NeOS::UInt target = 0x80000000 | ((NeOS::UInt)bus << 16) | - ((NeOS::UInt)dev << 11) | ((NeOS::UInt)fun << 8) | - (bar & 0xFC); - - NeOS::HAL::rt_out32((NeOS::UShort)NeOS::PCI::PciConfigKind::ConfigAddress, - target); - - NeOS::HAL::rt_wait_400ns(); -} - -namespace NeOS::PCI -{ - Device::Device(UShort bus, UShort device, UShort func, UInt32 bar) - : fBus(bus), fDevice(device), fFunction(func), fBar(bar) - { - } - - Device::~Device() = default; - - UInt Device::Read(UInt bar, Size sz) - { - // Ensure aligned access by masking to 4-byte boundary - NE_PCISetCfgTarget(bar & 0xFC, fBus, fDevice, fFunction); - - // Read 4 bytes and shift out the correct value - UInt data = HAL::rt_in32((UShort)PciConfigKind::ConfigData); - - if (sz == 4) - return data; - if (sz == 2) - return (data >> ((bar & 2) * 8)) & 0xFFFF; - if (sz == 1) - return (data >> ((bar & 3) * 8)) & 0xFF; - - return (UShort)PciConfigKind::Invalid; - } - - void Device::Write(UInt bar, UIntPtr data, Size sz) - { - NE_PCISetCfgTarget(bar & 0xFC, fBus, fDevice, fFunction); - - if (sz == 4) - HAL::rt_out32((UShort)PciConfigKind::ConfigData, (UInt)data); - else if (sz == 2) - { - UInt temp = HAL::rt_in32((UShort)PciConfigKind::ConfigData); - temp &= ~(0xFFFF << ((bar & 2) * 8)); - temp |= (data & 0xFFFF) << ((bar & 2) * 8); - HAL::rt_out32((UShort)PciConfigKind::ConfigData, temp); - } - else if (sz == 1) - { - UInt temp = HAL::rt_in32((UShort)PciConfigKind::ConfigData); - temp &= ~(0xFF << ((bar & 3) * 8)); - temp |= (data & 0xFF) << ((bar & 3) * 8); - HAL::rt_out32((UShort)PciConfigKind::ConfigData, temp); - } - } - - UShort Device::DeviceId() - { - return (UShort)(NE_PCIReadRaw(0x0, fBus, fDevice, fFunction) >> 16); - } - - UShort Device::VendorId() - { - return (UShort)(NE_PCIReadRaw(0x0, fBus, fDevice, fFunction) & 0xFFFF); - } - - UShort Device::InterfaceId() - { - return (UShort)(NE_PCIReadRaw(0x0, fBus, fDevice, fFunction) >> 16); - } - - UChar Device::Class() - { - return (UChar)(NE_PCIReadRaw(0x08, fBus, fDevice, fFunction) >> 24); - } - - UChar Device::Subclass() - { - return (UChar)(NE_PCIReadRaw(0x08, fBus, fDevice, fFunction) >> 16); - } - - UChar Device::ProgIf() - { - return (UChar)(NE_PCIReadRaw(0x08, fBus, fDevice, fFunction) >> 8); - } - - UChar Device::HeaderType() - { - return (UChar)(NE_PCIReadRaw(0xC, fBus, fDevice, fFunction) >> 16); - } - - void Device::EnableMmio(UInt32 bar_in) - { - UInt32 enable = Read(bar_in, sizeof(UInt32)); - enable |= (1 << 1); - - Write(bar_in, enable, sizeof(UInt32)); - } - - void Device::BecomeBusMaster(UInt32 bar_in) - { - UInt32 enable = Read(bar_in, sizeof(UInt32)); - enable |= (1 << 2); - - Write(bar_in, enable, sizeof(UInt32)); - } - - UIntPtr Device::Bar(UInt32 bar_in) - { - UInt32 bar = NE_PCIReadRaw(bar_in & ~0x03, fBus, fDevice, fFunction); - - if (bar & PCI_BAR_IO) - return static_cast(bar & ~0x03); - - if (bar & PCI_BAR_64) - { - UInt32 high = NE_PCIReadRaw((bar_in + 4) & ~0x03, fBus, fDevice, fFunction); - return (static_cast(high) << 32) | (bar & ~0x0F); - } - - return static_cast(bar & ~0x0F); - } - - UShort Device::Vendor() - { - UShort vendor = VendorId(); - - if (vendor != (UShort)PciConfigKind::Invalid) - fDevice = (UShort)Read(0x0, sizeof(UShort)); - - return fDevice; - } - - Device::operator bool() - { - return VendorId() != (UShort)PciConfigKind::Invalid; - } -} // namespace NeOS::PCI diff --git a/dev/Kernel/HALKit/AMD64/PCI/Express.cc b/dev/Kernel/HALKit/AMD64/PCI/Express.cc deleted file mode 100644 index 487cbd39..00000000 --- a/dev/Kernel/HALKit/AMD64/PCI/Express.cc +++ /dev/null @@ -1,11 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -namespace NeOS -{ -} diff --git a/dev/Kernel/HALKit/AMD64/PCI/IO.cc b/dev/Kernel/HALKit/AMD64/PCI/IO.cc deleted file mode 100644 index c20e1b0e..00000000 --- a/dev/Kernel/HALKit/AMD64/PCI/IO.cc +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include diff --git a/dev/Kernel/HALKit/AMD64/PCI/Iterator.cc b/dev/Kernel/HALKit/AMD64/PCI/Iterator.cc deleted file mode 100644 index bf215fe2..00000000 --- a/dev/Kernel/HALKit/AMD64/PCI/Iterator.cc +++ /dev/null @@ -1,39 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -namespace NeOS::PCI -{ - Iterator::Iterator(const Types::PciDeviceKind& type) - { - // probe devices. - for (int bus = 0; bus < NE_BUS_COUNT; ++bus) - { - for (int device = 0; device < NE_DEVICE_COUNT; ++device) - { - for (int function = 0; function < NE_FUNCTION_COUNT; ++function) - { - Device dev(bus, device, function, 0x00); - - if (dev.Class() == type) - { - fDevices[bus] = dev; - } - } - } - } - } - - Iterator::~Iterator() - { - } - - Ref Iterator::operator[](const Size& at) - { - return fDevices[at]; - } -} // namespace NeOS::PCI diff --git a/dev/Kernel/HALKit/AMD64/PCI/PCI.cc b/dev/Kernel/HALKit/AMD64/PCI/PCI.cc deleted file mode 100644 index 01f2c23b..00000000 --- a/dev/Kernel/HALKit/AMD64/PCI/PCI.cc +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include diff --git a/dev/Kernel/HALKit/AMD64/Paging.h b/dev/Kernel/HALKit/AMD64/Paging.h deleted file mode 100644 index 4e2ac1b1..00000000 --- a/dev/Kernel/HALKit/AMD64/Paging.h +++ /dev/null @@ -1,99 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -/** --------------------------------------------------- - - * THIS FILE CONTAINS CODE FOR X86_64 PAGING. - -------------------------------------------------------- */ - -#include - -#ifndef kPageMax -#define kPageMax (0x200) -#endif //! kPageMax - -#ifndef kPageAlign -#define kPageAlign (0x08) -#endif //! kPageAlign - -#ifndef kPageSize -#define kPageSize (0x1000) -#endif // !kPageSize - -#ifndef kAlign -#define kAlign __BIGGEST_ALIGNMENT__ -#endif // !kAlign - -EXTERN_C void hal_flush_tlb(); -EXTERN_C void hal_invl_tlb(NeOS::VoidPtr addr); -EXTERN_C void hal_write_cr3(NeOS::VoidPtr cr3); -EXTERN_C void hal_write_cr0(NeOS::VoidPtr bit); - -EXTERN_C NeOS::VoidPtr hal_read_cr0(); // @brief CPU control register. -EXTERN_C NeOS::VoidPtr hal_read_cr2(); // @brief Fault address. -EXTERN_C NeOS::VoidPtr hal_read_cr3(); // @brief Page table. - -namespace NeOS::HAL -{ - /// @brief Final page entry (Not PML, PDPT) - struct PACKED NE_PTE final - { - UInt64 Present : 1; - UInt64 Wr : 1; - UInt64 User : 1; - UInt64 Wt : 1; - UInt64 Cache : 1; - UInt64 Accessed : 1; - UInt64 Dirty : 1; - UInt64 MemoryType : 1; - UInt64 Global : 1; - UInt64 Resvered1 : 3; - UInt64 PhysicalAddress : 36; - UInt64 Reserved2 : 10; - UInt64 ProtectionKey : 5; - UInt64 ExecDisable : 1; - }; - - namespace Detail - { - enum class ControlRegisterBits - { - ProtectedModeEnable = 0, - MonitorCoProcessor = 1, - Emulation = 2, - TaskSwitched = 3, - ExtensionType = 4, - NumericError = 5, - WriteProtect = 16, - AlignementMask = 18, - NotWriteThrough = 29, - CacheDisable = 30, - PageEnable = 31, - }; - - inline UInt8 control_register_cast(ControlRegisterBits reg) - { - return static_cast(reg); - } - } // namespace Detail - - struct NE_PDE final - { - NE_PTE* ALIGN(kPageAlign) fEntries[kPageMax]; - }; - - auto mm_alloc_bitmap(Boolean wr, Boolean user, SizeT size, Bool is_page) -> VoidPtr; - auto mm_free_bitmap(VoidPtr page_ptr) -> Bool; -} // namespace NeOS::HAL - -namespace NeOS -{ - typedef HAL::NE_PTE PTE; - typedef HAL::NE_PDE PDE; -} // namespace NeOS diff --git a/dev/Kernel/HALKit/AMD64/Processor.h b/dev/Kernel/HALKit/AMD64/Processor.h deleted file mode 100644 index d223c320..00000000 --- a/dev/Kernel/HALKit/AMD64/Processor.h +++ /dev/null @@ -1,326 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: Prcoessor.h - Purpose: AMD64 processor abstraction. - - Revision History: - - 30/01/24: Added file (amlel) - -------------------------------------------- */ - -#pragma once - -#include -#include -#include -#include -#include - -#define kPITControlPort (0x43) -#define kPITChannel0Port (0x40) -#define kPITFrequency (1193180) - -#define kPICCommand (0x20) -#define kPICData (0x21) -#define kPIC2Command (0xA0) -#define kPIC2Data (0xA1) - -EXTERN_C -{ -#include -} - -#include - -/// @brief Maximum entries of the interrupt descriptor table. -#define kKernelIdtSize (0x100) - -/// @brief interrupt for system call. -#define kKernelInterruptId (0x32) - -#define IsActiveLow(FLG) (FLG & 2) -#define IsLevelTriggered(FLG) (FLG & 8) - -#define kInterruptGate (0x8E) -#define kTrapGate (0xEF) -#define kTaskGate (0b10001100) -#define kIDTSelector (0x08) - -namespace NeOS -{ - namespace Detail::AMD64 - { - struct PACKED InterruptDescriptorAMD64 final - { - UInt16 OffsetLow; // offset bits 0..15 - UInt16 Selector; // a code segment selector in GDT or LDT - UInt8 Ist; - UInt8 TypeAttributes; - UInt16 OffsetMid; - UInt32 OffsetHigh; - UInt32 Zero; // reserved - }; - } // namespace Detail::AMD64 -} // namespace NeOS - -namespace NeOS::HAL -{ - /// @brief Memory Manager mapping flags. - enum - { - kMMFlagsInvalid = 0 << 0, - kMMFlagsPresent = 1 << 0, - kMMFlagsWr = 1 << 1, - kMMFlagsUser = 1 << 2, - kMMFlagsNX = 1 << 3, - kMMFlagsCount = 4, - }; - - struct PACKED Register64 final - { - UShort Limit; - UIntPtr Base; - }; - - struct PACKED RegisterGDT final - { - UShort Limit; - UIntPtr Base; - }; - - using RawRegister = UInt64; - using Reg = RawRegister; - using InterruptId = UInt16; /* For each element in the IVT */ - - /// @brief Stack frame (as retrieved from assembly.) - struct PACKED StackFrame final - { - RawRegister R8{0}; - RawRegister R9{0}; - RawRegister R10{0}; - RawRegister FS{0}; - RawRegister R12{0}; - RawRegister R13{0}; - RawRegister R14{0}; - RawRegister R15{0}; - RawRegister GS{0}; - RawRegister SP{0}; - RawRegister BP{0}; - }; - - typedef StackFrame* StackFramePtr; - - class InterruptDescriptor final - { - public: - UShort Offset; - UShort Selector; - UChar Ist; - UChar Atrributes; - - UShort SecondOffset; - UInt ThirdOffset; - UInt Zero; - - operator bool() - { - return Offset != 0xFFFF; - } - }; - - using InterruptDescriptorArray = Array; - - class SegmentDescriptor final - { - public: - UInt16 Base; - UInt8 BaseMiddle; - UInt8 BaseHigh; - - UShort Limit; - UChar Gran; - UChar AccessByte; - }; - - /*** - * @brief Segment Boolean operations - */ - class SegmentDescriptorComparator final - { - public: - Bool IsValid(SegmentDescriptor& seg) - { - return seg.Base > seg.Limit; - } - - Bool Equals(SegmentDescriptor& seg, SegmentDescriptor& segRight) - { - return seg.Base == segRight.Base && seg.Limit == segRight.Limit; - } - }; - - using SegmentArray = Array; - - class GDTLoader final - { - public: - static Void Load(RegisterGDT& gdt); - static Void Load(Ref& gdt); - }; - - class IDTLoader final - { - public: - static Void Load(Register64& idt); - static Void Load(Ref& idt); - }; - - /***********************************************************************************/ - /// @brief Is the current config SMP aware? - /// @return True if YES, False if not. - /***********************************************************************************/ - - Bool mp_is_smp(Void) noexcept; - - /***********************************************************************************/ - /// @brief Fetch and enable SMP scheduler. - /// @param vendor_ptr SMP containing structure. - /***********************************************************************************/ - Void mp_get_cores(VoidPtr vendor_ptr) noexcept; - - /***********************************************************************************/ - /// @brief Do a cpuid to check if MSR exists on CPU. - /// @retval true it does exists. - /// @retval false it doesn't. - /***********************************************************************************/ - inline Bool hal_has_msr() noexcept - { - static UInt32 eax, unused, edx; // eax, edx - - __get_cpuid(1, &eax, &unused, &unused, &edx); - - // edx returns the flag for MSR (which is 1 shifted to 5.) - return edx & (1 << 5); - } - - UIntPtr hal_get_phys_address(VoidPtr virtual_address); - - /***********************************************************************************/ - /// @brief Get Model specific register inside core. - /// @param msr MSR - /// @param lo low byte - /// @param hi high byte - /***********************************************************************************/ - inline UInt32 hal_get_msr(UInt32 msr, UInt32* lo, UInt32* hi) noexcept - { - if (!lo || !hi) - return 0; - - asm volatile("rdmsr" - : "=a"(*lo), "=d"(*hi) - : "c"(msr)); - - return *lo + *hi; - } - - /// @brief Set Model-specific register. - /// @param msr MSR - /// @param lo low byte - /// @param hi high byte - inline Void hal_set_msr(UInt32 msr, UInt32 lo, UInt32 hi) noexcept - { - asm volatile("wrmsr" - : - : "a"(lo), "d"(hi), "c"(msr)); - } - - /// @brief Processor specific namespace. - namespace Detail - { - /* @brief TSS struct. */ - struct NE_TSS final - { - UInt32 fReserved1; - UInt64 fRsp0; - UInt64 fRsp1; - UInt64 fRsp2; - UInt64 fReserved2; - UInt64 fIst1; - UInt64 fIst2; - UInt64 fIst3; - UInt64 fIst4; - UInt64 fIst5; - UInt64 fIst6; - UInt64 fIst7; - UInt64 fReserved3; - UInt16 fReserved4; - UInt16 fIopb; - }; - - /** - @brief Global descriptor table entry, either null, code or data. - */ - - struct PACKED NE_GDT_ENTRY final - { - UInt16 fLimitLow; - UInt16 fBaseLow; - UInt8 fBaseMid; - UInt8 fAccessByte; - UInt8 fFlags; - UInt8 fBaseHigh; - }; - } // namespace Detail - - class APICController final - { - public: - explicit APICController(VoidPtr base); - ~APICController() = default; - - NE_COPY_DEFAULT(APICController); - - public: - UInt32 Read(UInt32 reg) noexcept; - Void Write(UInt32 reg, UInt32 value) noexcept; - - private: - VoidPtr fApic{nullptr}; - }; - - /// @brief Set a PTE from pd_base. - /// @param virt_addr a valid virtual address. - /// @param phys_addr point to physical address. - /// @param flags the flags to put on the page. - /// @return Status code of page manip. - EXTERN_C Int32 mm_map_page(VoidPtr virtual_address, VoidPtr physical_address, UInt32 flags); - - EXTERN_C UInt8 rt_in8(UInt16 port); - EXTERN_C UInt16 rt_in16(UInt16 port); - EXTERN_C UInt32 rt_in32(UInt16 port); - - EXTERN_C Void rt_out16(UShort port, UShort byte); - EXTERN_C Void rt_out8(UShort port, UChar byte); - EXTERN_C Void rt_out32(UShort port, UInt byte); - - EXTERN_C Void rt_wait_400ns(); - EXTERN_C Void rt_halt(); - EXTERN_C Void rt_cli(); - EXTERN_C Void rt_sti(); - EXTERN_C Void rt_cld(); - EXTERN_C Void rt_std(); -} // namespace NeOS::HAL - -EXTERN_C NeOS::Void idt_handle_generic(NeOS::UIntPtr rsp); -EXTERN_C NeOS::Void idt_handle_gpf(NeOS::UIntPtr rsp); -EXTERN_C NeOS::Void idt_handle_math(NeOS::UIntPtr rsp); -EXTERN_C NeOS::Void idt_handle_pf(NeOS::UIntPtr rsp); - -EXTERN_C ATTRIBUTE(naked) NeOS::Void hal_load_idt(NeOS::HAL::Register64 ptr); -EXTERN_C ATTRIBUTE(naked) NeOS::Void hal_load_gdt(NeOS::HAL::RegisterGDT ptr); - -inline NeOS::VoidPtr kKernelBitMpStart = nullptr; -inline NeOS::UIntPtr kKernelBitMpSize = 0UL; diff --git a/dev/Kernel/HALKit/AMD64/ReadMe.md b/dev/Kernel/HALKit/AMD64/ReadMe.md deleted file mode 100644 index 02c8c86f..00000000 --- a/dev/Kernel/HALKit/AMD64/ReadMe.md +++ /dev/null @@ -1,8 +0,0 @@ -# AMD64 Hardware Abstraction Layer - -## Brief - -- Supported CPU: AMD64 BASED CPUs. -- Supported Firmware: EDK 2. - -###### Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. All rights reserved. diff --git a/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc deleted file mode 100644 index a17f3843..00000000 --- a/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc +++ /dev/null @@ -1,424 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal El Mahrouss Corporation, all rights reserved. - -------------------------------------------- */ - -/** - * @file AHCI.cc - * @author Amlal El Mahrouss (amlalelmahrouss@icloud.com) - * @brief AHCI driver. - * @version 0.1 - * @date 2024-02-02 - * - * @copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. - * - */ - -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include - -#define kHBAErrTaskFile (1 << 30) -#define kHBAPxCmdST (0x0001) -#define kHBAPxCmdFre (0x0010) -#define kHBAPxCmdFR (0x4000) -#define kHBAPxCmdCR (0x8000) - -#define kSATALBAMode (1 << 6) - -#define kSATASRBsy (0x80) -#define kSATASRDrq (0x08) - -#define kHBABohcBiosOwned (1 << 0) -#define kHBABohcOSOwned (1 << 1) - -#define kSATAPortCnt (0x20) - -#define kSATASig (0x00000101) -#define kSATAPISig (0xEB140101) - -#define kSATAProgIfAHCI (0x01) -#define kSATASubClass (0x06) -#define kSATABar5 (0x24) - -using namespace NeOS; - -STATIC PCI::Device kSATADev; -STATIC HbaMem* kSATAHba; -STATIC Lba kSATASectorCount = 0UL; -STATIC UInt16 kSATAIndex = 0U; -STATIC Char kCurrentDiskModel[50] = {"UNKNOWN AHCI DRIVE"}; -STATIC UInt16 kSATAPortsImplemented = 0U; - -template -STATIC Void drv_std_input_output(UInt64 lba, UInt8* buffer, SizeT sector_sz, SizeT size_buffer) noexcept; - -STATIC Int32 drv_find_cmd_slot(HbaPort* port) noexcept; - -STATIC Void drv_compute_disk_ahci() noexcept; - -STATIC Void drv_compute_disk_ahci() noexcept -{ - kSATASectorCount = 0UL; - - const UInt16 kSzIdent = kib_cast(1); - - UInt8 identify_data[kSzIdent] = {0}; - - rt_set_memory(identify_data, 0, kSzIdent); - - drv_std_input_output(0, identify_data, kAHCISectorSize, kSzIdent); - - kSATASectorCount = (identify_data[61] << 16) | identify_data[60]; - - kout << "Disk Model: " << kCurrentDiskModel << kendl; - kout << "Disk Size: " << number(drv_get_size()) << kendl; - kout << "Disk Sector Count: " << number(kSATASectorCount) << kendl; -} - -STATIC Int32 drv_find_cmd_slot(HbaPort* port) noexcept -{ - UInt32 slots = (port->Sact | port->Ci); - - for (Int32 i = 0; i < kSATAPortCnt; ++i) - { - if ((slots & 1) == 0) - return i; - - slots >>= 1; - } - - return ~0; -} - -template -STATIC Void drv_std_input_output(UInt64 lba, UInt8* buffer, SizeT sector_sz, SizeT size_buffer) noexcept -{ - UIntPtr slot = 0UL; - - slot = drv_find_cmd_slot(&kSATAHba->Ports[kSATAIndex]); - - if (slot == ~0) - return; - - volatile HbaCmdHeader* command_header = ((HbaCmdHeader*)(((UInt64)kSATAHba->Ports[kSATAIndex].Clb))); - - command_header += slot; - - MUST_PASS(command_header); - - command_header->Cfl = sizeof(FisRegH2D) / sizeof(UInt32); - command_header->Write = Write; - command_header->Prdtl = (UInt16)((size_buffer - 1) >> 4) + 1; - - HbaCmdTbl* command_table = (HbaCmdTbl*)((VoidPtr)((UInt64)command_header->Ctba)); - - rt_set_memory(command_table, 0, sizeof(HbaCmdTbl) + (command_header->Prdtl - 1) * sizeof(HbaPrdtEntry)); - - MUST_PASS(command_table); - - UIntPtr buffer_phys = HAL::hal_get_phys_address(buffer); - - UInt16 prd_i = 0; - - for (; prd_i < (command_header->Prdtl - 1); prd_i++) - { - command_table->Prdt[prd_i].Dbc = ((size_buffer / command_header->Prdtl - 1) - 1); - command_table->Prdt[prd_i].Dba = ((UInt32)(UInt64)buffer_phys + (prd_i * command_table->Prdt[prd_i].Dbc)); - command_table->Prdt[prd_i].Dbau = (((UInt64)(buffer_phys) >> 32) + (prd_i * command_table->Prdt[prd_i].Dbc)); - command_table->Prdt[prd_i].Ie = YES; - } - - command_table->Prdt[prd_i].Dba = ((UInt32)(UInt64)buffer_phys + (prd_i * command_table->Prdt[prd_i].Dbc)); - command_table->Prdt[prd_i].Dbau = (((UInt64)(buffer_phys) >> 32) + (prd_i * command_table->Prdt[prd_i].Dbc)); - command_table->Prdt[prd_i].Dbc = ((size_buffer / command_header->Prdtl - 1) - 1); - command_table->Prdt[prd_i].Ie = YES; - - FisRegH2D* h2d_fis = (FisRegH2D*)(&command_table->Cfis); - - h2d_fis->FisType = kFISTypeRegH2D; - h2d_fis->CmdOrCtrl = CommandOrCTRL; - h2d_fis->Command = Write ? kAHCICmdWriteDmaEx : kAHCICmdReadDmaEx; - - if (Identify) - h2d_fis->Command = kAHCICmdIdentify; - - h2d_fis->Lba0 = (lba)&0xFF; - h2d_fis->Lba1 = (lba >> 8) & 0xFF; - h2d_fis->Lba2 = (lba >> 16) & 0xFF; - - h2d_fis->Device = Identify ? 0U : kSATALBAMode; - - h2d_fis->Lba3 = (lba >> 24) & 0xFF; - h2d_fis->Lba4 = (lba >> 32) & 0xFF; - h2d_fis->Lba5 = (lba >> 40) & 0xFF; - - h2d_fis->CountLow = (size_buffer)&0xFF; - h2d_fis->CountHigh = (size_buffer >> 8) & 0xFF; - - while (kSATAHba->Ports[kSATAIndex].Tfd & (kSATASRBsy | kSATASRDrq)) - { - ; - } - - kSATAHba->Ports[kSATAIndex].Ci = (1 << slot); - - while (YES) - { - if (!(kSATAHba->Ports[kSATAIndex].Ci & (1 << slot))) - break; - - if (kSATAHba->Is & kHBAErrTaskFile) - { - err_global_get() = kErrorDiskIsCorrupted; - return; - } - } - - if (kSATAHba->Is & kHBAErrTaskFile) - { - err_global_get() = kErrorDiskIsCorrupted; - return; - } -} - -/*** - @brief Gets the number of sectors inside the drive. - @return Sector size in bytes. - */ -SizeT drv_get_sector_count_ahci() -{ - return kSATASectorCount; -} - -/// @brief Get the drive size. -/// @return Disk size in bytes. -SizeT drv_get_size_ahci() -{ - return drv_get_sector_count() * kAHCISectorSize; -} - -/// @brief Enable Host and probe using the IDENTIFY command. -STATIC Void ahci_enable_and_probe() -{ - if (kSATAHba->Bohc & kHBABohcBiosOwned) - { - kSATAHba->Bohc |= kHBABohcOSOwned; - - while (kSATAHba->Bohc & kHBABohcBiosOwned) - { - ; - } - } - - // Poll until ready. - while (kSATAHba->Ports[kSATAIndex].Cmd & kHBAPxCmdCR) - { - ; - } - - kSATAHba->Ports[kSATAIndex].Cmd |= kHBAPxCmdFre; - kSATAHba->Ports[kSATAIndex].Cmd |= kHBAPxCmdST; - - drv_compute_disk_ahci(); -} - -/// @brief Initializes an AHCI disk. -/// @param pi the amount of ports that have been detected. -/// @param atapi reference value, tells whether we should detect ATAPI instead of SATA. -/// @return if the disk was successfully initialized or not. -STATIC Bool drv_std_init_ahci(UInt16& pi, BOOL& atapi) -{ - PCI::Iterator iterator(Types::PciDeviceKind::MassStorageController); - - for (SizeT device_index = 0; device_index < NE_BUS_COUNT; ++device_index) - { - kSATADev = iterator[device_index].Leak(); // Leak device. - - if (kSATADev.Subclass() == kSATASubClass && - kSATADev.ProgIf() == kSATAProgIfAHCI) - { - HbaMem* mem_ahci = (HbaMem*)kSATADev.Bar(kSATABar5); - - kSATADev.EnableMmio((UIntPtr)mem_ahci); - kSATADev.BecomeBusMaster((UIntPtr)mem_ahci); - - UInt32 ports_implemented = mem_ahci->Pi; - UInt16 ahci_index = 0; - - pi = ports_implemented; - - const UInt16 kMaxPortsImplemented = kSATAPortCnt; - const UInt32 kSATASignature = kSATASig; - const UInt32 kSATAPISignature = kSATAPISig; - const UInt8 kSATAPresent = 0x03; - const UInt8 kSATAIPMActive = 0x01; - - kSATAHba = mem_ahci; - - while (ports_implemented) - { - UInt8 ipm = (mem_ahci->Ports[ahci_index].Ssts >> 8) & 0x0F; - UInt8 det = mem_ahci->Ports[ahci_index].Ssts & 0x0F; - - if (det != kSATAPresent || ipm != kSATAIPMActive) - continue; - - if (mem_ahci->Ports[ahci_index].Sig == kSATASignature) - { - kout << "Detect: /dev/sat" << number(ahci_index) << kendl; - - kSATAIndex = ahci_index; - kSATAHba = mem_ahci; - - ahci_enable_and_probe(); - - break; - } - else if (atapi && kSATAPISignature == mem_ahci->Ports[ahci_index].Sig) - { - kout << "Detect: /dev/atp" << number(ahci_index) << kendl; - - kSATAIndex = ahci_index; - kSATAHba = mem_ahci; - - ahci_enable_and_probe(); - - break; - } - - ports_implemented >>= 1; - ++ahci_index; - } - - return YES; - } - } - - return NO; -} - -Bool drv_std_detected_ahci() -{ - return kSATADev.DeviceId() != (UShort)PCI::PciConfigKind::Invalid && kSATADev.Bar(kSATABar5) != 0; -} - -namespace NeOS -{ - UInt16 sk_init_ahci_device(BOOL atapi) - { - UInt16 pi = 0; - return drv_std_init_ahci(pi, atapi); - - kSATAPortsImplemented = pi; - - return pi; - } - - namespace Detail - { - /// @brief Read AHCI device. - /// @param self device - /// @param mnt mounted disk. - STATIC Void sk_io_read_ahci(IDeviceObject* self, MountpointInterface* mnt) - { - AHCIDeviceInterface* dev = (AHCIDeviceInterface*)self; - - if (!dev) - return; - - auto disk = mnt->GetAddressOf(dev->GetIndex()); - - if (!disk) - return; - - drv_std_input_output(disk->fPacket.fPacketLba, (UInt8*)disk->fPacket.fPacketContent, kAHCISectorSize, disk->fPacket.fPacketSize); - } - - /// @brief Write AHCI device. - /// @param self device - /// @param mnt mounted disk. - STATIC Void sk_io_write_ahci(IDeviceObject* self, MountpointInterface* mnt) - { - AHCIDeviceInterface* dev = (AHCIDeviceInterface*)self; - - if (!dev) - return; - - auto disk = mnt->GetAddressOf(dev->GetIndex()); - - if (!disk) - return; - - drv_std_input_output(disk->fPacket.fPacketLba, (UInt8*)disk->fPacket.fPacketContent, kAHCISectorSize, disk->fPacket.fPacketSize); - } - } // namespace Detail - - ErrorOr sk_acquire_ahci_device(Int32 drv_index) - { - if (!drv_std_detected_ahci()) - return ErrorOr(kErrorDisk); - - AHCIDeviceInterface device(Detail::sk_io_read_ahci, - Detail::sk_io_write_ahci, - nullptr); - - device.SetPortsImplemented(kSATAPortsImplemented); - device.SetIndex(drv_index); - - return ErrorOr(device); - } -} // namespace NeOS - -#ifdef __AHCI__ - -Void drv_std_write(UInt64 lba, Char* buffer, SizeT sector_sz, SizeT size_buffer) -{ - drv_std_input_output(lba, (UInt8*)buffer, sector_sz, size_buffer); -} - -Void drv_std_read(UInt64 lba, Char* buffer, SizeT sector_sz, SizeT size_buffer) -{ - drv_std_input_output(lba, (UInt8*)buffer, sector_sz, size_buffer); -} - -Bool drv_std_init(UInt16& pi) -{ - BOOL atapi = NO; - return drv_std_init_ahci(pi, atapi); -} - -Bool drv_std_detected(Void) -{ - return drv_std_detected_ahci(); -} - -/*** - @brief Gets the number of sectors inside the drive. - @return Sector size in bytes. - */ -SizeT drv_get_sector_count() -{ - return drv_get_sector_count_ahci(); -} - -/// @brief Get the drive size. -/// @return Disk size in bytes. -SizeT drv_get_size() -{ - return drv_get_size_ahci(); -} - -#endif // ifdef __AHCI__ diff --git a/dev/Kernel/HALKit/AMD64/Storage/DMA+Generic.cc b/dev/Kernel/HALKit/AMD64/Storage/DMA+Generic.cc deleted file mode 100644 index 109b55af..00000000 --- a/dev/Kernel/HALKit/AMD64/Storage/DMA+Generic.cc +++ /dev/null @@ -1,253 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -/** - * @file ATA-PIO.cc - * @author Amlal EL Mahrouss (amlalelmahrouss@icloud.com) - * @brief ATA driver (PIO mode). - * @version 0.1 - * @date 2024-02-02 - * - * @copyright Copyright (c) Amlal EL Mahrouss - * - */ - -#include -#include -#include - -#if defined(__ATA_DMA__) - -#define kATADataLen (256) - -using namespace NeOS; -using namespace NeOS::HAL; - -/// BUGS: 0 - -STATIC Boolean kATADetected = false; -STATIC Int32 kATADeviceType = kATADeviceCount; -STATIC Char kATAData[kATADataLen] = {0}; -STATIC NeOS::PCI::Device kATADevice; -STATIC Char kCurrentDiskModel[50] = {"UNKNOWN DMA DRIVE"}; - -Boolean drv_std_wait_io(UInt16 IO) -{ - for (int i = 0; i < 400; i++) - rt_in8(IO + ATA_REG_STATUS); - -ATAWaitForIO_Retry: - auto status_rdy = rt_in8(IO + ATA_REG_STATUS); - - if ((status_rdy & ATA_SR_BSY)) - goto ATAWaitForIO_Retry; - -ATAWaitForIO_Retry2: - status_rdy = rt_in8(IO + ATA_REG_STATUS); - - if (status_rdy & ATA_SR_ERR) - return false; - - if (!(status_rdy & ATA_SR_DRDY)) - goto ATAWaitForIO_Retry2; - - return true; -} - -Void drv_std_select(UInt16 Bus) -{ - if (Bus == ATA_PRIMARY_IO) - rt_out8(Bus + ATA_REG_HDDEVSEL, ATA_PRIMARY_SEL); - else - rt_out8(Bus + ATA_REG_HDDEVSEL, ATA_SECONDARY_SEL); -} - -Boolean drv_std_init(UInt16 Bus, UInt8 Drive, UInt16& OutBus, UInt8& OutMaster) -{ - PCI::Iterator iterator(Types::PciDeviceKind::MassStorageController); - - for (SizeT device_index = 0; device_index < NE_BUS_COUNT; ++device_index) - { - kATADevice = iterator[device_index].Leak(); // And then leak the reference. - - // if SATA and then interface is AHCI... - if (kATADevice.Subclass() == 0x01) - { - UInt16 IO = Bus; - - drv_std_select(IO); - - // Bus init, NEIN bit. - rt_out8(IO + ATA_REG_NEIN, 1); - - // identify until it's good. - ATAInit_Retry: - auto status_rdy = rt_in8(IO + ATA_REG_STATUS); - - if (status_rdy & ATA_SR_ERR) - { - return false; - } - - if ((status_rdy & ATA_SR_BSY)) - goto ATAInit_Retry; - - rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_IDENTIFY); - - /// fetch serial info - /// model, speed, number of sectors... - - drv_std_wait_io(IO); - - for (SizeT i = 0ul; i < kATADataLen; ++i) - { - drv_std_wait_io(IO); - kATAData[i] = NeOS::HAL::rt_in16(IO + ATA_REG_DATA); - drv_std_wait_io(IO); - } - - for (SizeT i = 0; i < 40; i += 2) - { - kCurrentDiskModel[i * 2] = kATAData[27 + i * 2] >> 8; - kCurrentDiskModel[i * 2 + 1] = kATAData[27 + i * 2] & 0xFF; - } - - kCurrentDiskModel[40] = '\0'; - - kout << "Drive Model: " << kCurrentDiskModel << kendl; - - OutBus = (Bus == ATA_PRIMARY_IO) ? ATA_PRIMARY_IO : ATA_SECONDARY_IO; - OutMaster = (Bus == ATA_PRIMARY_IO) ? ATA_MASTER : ATA_SLAVE; - - return YES; - } - } - - ke_panic(RUNTIME_CHECK_BOOTSTRAP, "Invalid ATA DMA driver, not detected"); - - return NO; -} - -namespace Detail -{ - using namespace NeOS; - - struct PRDEntry - { - UInt32 mAddress; - UInt16 mByteCount; - UInt16 mFlags; - }; -} // namespace Detail - -static UIntPtr kReadAddr = mib_cast(2); -static UIntPtr kWriteAddr = mib_cast(4); - -Void drv_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz, SizeT Size) -{ - Lba /= SectorSz; - - if (Size > kib_cast(64)) - ke_panic(RUNTIME_CHECK_FAILED, "ATA-DMA only supports < 64kb DMA transfers."); - - UInt8 Command = ((!Master) ? 0xE0 : 0xF0); - - rt_copy_memory((VoidPtr)Buf, (VoidPtr)kReadAddr, Size); - - drv_std_select(IO); - - rt_out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F)); - - rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz - 1) / SectorSz)); - - rt_out8(IO + ATA_REG_LBA0, (Lba)&0xFF); - rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); - rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); - rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); - - Detail::PRDEntry* prd = (Detail::PRDEntry*)(kATADevice.Bar(0x20) + 4); // The PRDEntry is not correct. - - prd->mAddress = (UInt32)(UIntPtr)kReadAddr; - prd->mByteCount = Size - 1; - prd->mFlags = 0x8000; // indicate the end of prd. - - rt_out32(kATADevice.Bar(0x20) + 0x04, (UInt32)(UIntPtr)prd); - - rt_out8(kATADevice.Bar(0x20) + ATA_REG_COMMAND, ATA_CMD_READ_DMA); - - rt_out8(kATADevice.Bar(0x20) + 0x00, 0x09); // Start DMA engine - - while (rt_in8(kATADevice.Bar(0x20) + ATA_REG_STATUS) & 0x01) - ; - - rt_out8(kATADevice.Bar(0x20) + 0x00, 0x00); // Stop DMA engine - - rt_copy_memory((VoidPtr)kReadAddr, (VoidPtr)Buf, Size); - - delete prd; - prd = nullptr; -} - -Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz, SizeT Size) -{ - Lba /= SectorSz; - - if (Size > kib_cast(64)) - ke_panic(RUNTIME_CHECK_FAILED, "ATA-DMA only supports < 64kb DMA transfers."); - - UInt8 Command = ((!Master) ? 0xE0 : 0xF0); - - rt_copy_memory((VoidPtr)Buf, (VoidPtr)kWriteAddr, Size); - - rt_out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F)); - - rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + (SectorSz - 1)) / SectorSz)); - - rt_out8(IO + ATA_REG_LBA0, (Lba)&0xFF); - rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); - rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); - rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); - - Detail::PRDEntry* prd = (Detail::PRDEntry*)(kATADevice.Bar(0x20) + 4); - prd->mAddress = (UInt32)(UIntPtr)kWriteAddr; - prd->mByteCount = Size - 1; - prd->mFlags = 0x8000; - - rt_out32(kATADevice.Bar(0x20) + 0x04, (UInt32)(UIntPtr)prd); - rt_out8(kATADevice.Bar(0x20) + ATA_REG_COMMAND, ATA_CMD_WRITE_DMA); - - rt_out8(IO + 0x00, 0x09); // Start DMA engine - - while (rt_in8(kATADevice.Bar(0x20) + ATA_REG_STATUS) & 0x01) - ; - - rt_out8(kATADevice.Bar(0x20) + 0x00, 0x00); // Stop DMA engine - - delete prd; - prd = nullptr; -} - -/// @brief is ATA detected? -Boolean drv_std_detected(Void) -{ - return kATADetected; -} - -/*** - @brief Getter, gets the number of sectors inside the drive. -*/ -NeOS::SizeT drv_get_sector_count() -{ - return (kATAData[61] << 16) | kATAData[60]; -} - -/// @brief Get the drive size. -NeOS::SizeT drv_get_size() -{ - return (drv_get_sector_count()) * kATASectorSize; -} - -#endif /* ifdef __ATA_DMA__ */ diff --git a/dev/Kernel/HALKit/AMD64/Storage/PIO+Generic.cc b/dev/Kernel/HALKit/AMD64/Storage/PIO+Generic.cc deleted file mode 100644 index 8e6197c9..00000000 --- a/dev/Kernel/HALKit/AMD64/Storage/PIO+Generic.cc +++ /dev/null @@ -1,191 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -/** - * @file PIO.cc - * @author Amlal EL Mahrouss (amlalelmahrouss@icloud.com) - * @brief ATA driver (PIO mode). - * @version 0.1 - * @date 2024-02-02 - * - * @copyright Copyright (c) Amlal EL Mahrouss - * - */ - -#include -#include - -#ifdef __ATA_PIO__ - -using namespace NeOS; -using namespace NeOS::HAL; - -/// BUGS: 0 - -#define kATADataLen 512 - -STATIC Boolean kATADetected = false; -STATIC Int32 kATADeviceType = kATADeviceCount; -STATIC Char kATAData[kATADataLen] = {0}; -STATIC Char kCurrentDiskModel[50] = {"UNKNOWN PIO DRIVE"}; - -Boolean drv_std_wait_io(UInt16 IO) -{ - for (int i = 0; i < 400; i++) - rt_in8(IO + ATA_REG_STATUS); - -ATAWaitForIO_Retry: - auto stat_rdy = rt_in8(IO + ATA_REG_STATUS); - - if ((stat_rdy & ATA_SR_BSY)) - goto ATAWaitForIO_Retry; - -ATAWaitForIO_Retry2: - stat_rdy = rt_in8(IO + ATA_REG_STATUS); - - if (stat_rdy & ATA_SR_ERR) - return false; - - if (!(stat_rdy & ATA_SR_DRDY)) - goto ATAWaitForIO_Retry2; - - return true; -} - -Void drv_std_select(UInt16 Bus) -{ - if (Bus == ATA_PRIMARY_IO) - rt_out8(Bus + ATA_REG_HDDEVSEL, ATA_PRIMARY_SEL); - else - rt_out8(Bus + ATA_REG_HDDEVSEL, ATA_SECONDARY_SEL); -} - -Boolean drv_std_init(UInt16 Bus, UInt8 Drive, UInt16& OutBus, UInt8& OutMaster) -{ - UInt16 IO = Bus; - - drv_std_select(IO); - - // Bus init, NEIN bit. - rt_out8(IO + ATA_REG_NEIN, 1); - - // identify until it's good. -ATAInit_Retry: - auto stat_rdy = rt_in8(IO + ATA_REG_STATUS); - - if (stat_rdy & ATA_SR_ERR) - { - return false; - } - - if ((stat_rdy & ATA_SR_BSY)) - goto ATAInit_Retry; - - OutBus = (Bus == ATA_PRIMARY_IO) ? ATA_PRIMARY_IO : ATA_SECONDARY_IO; - OutMaster = (Bus == ATA_PRIMARY_IO) ? ATA_MASTER : ATA_SLAVE; - - rt_out8(OutBus + ATA_REG_COMMAND, ATA_CMD_IDENTIFY); - - drv_std_wait_io(IO); - - /// fetch serial info - /// model, speed, number of sectors... - - for (SizeT i = 0ul; i < kATADataLen; ++i) - { - kATAData[i] = HAL::rt_in16(OutBus + ATA_REG_DATA); - } - - for (Int32 i = 0; i < 20; i++) - { - kCurrentDiskModel[i * 2] = kATAData[27 + i] >> 8; - kCurrentDiskModel[i * 2 + 1] = kATAData[27 + i + 1] & 0xFF; - } - - kCurrentDiskModel[40] = '\0'; - - kout << "Detect: /dev/ata0" << kendl; - - kout << "Drive Model: " << kCurrentDiskModel << kendl; - - return true; -} - -Void drv_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz, SizeT Size) -{ - Lba /= SectorSz; - - UInt8 Command = ((!Master) ? 0xE0 : 0xF0); - - drv_std_wait_io(IO); - drv_std_select(IO); - - rt_out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F)); - - rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz) / SectorSz)); - - rt_out8(IO + ATA_REG_LBA0, (Lba)&0xFF); - rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); - rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); - rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); - - rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_READ_PIO); - - for (SizeT IndexOff = 0; IndexOff < Size; ++IndexOff) - { - drv_std_wait_io(IO); - Buf[IndexOff] = HAL::rt_in16(IO + ATA_REG_DATA); - } -} - -Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz, SizeT Size) -{ - Lba /= SectorSz; - - UInt8 Command = ((!Master) ? 0xE0 : 0xF0); - - drv_std_wait_io(IO); - drv_std_select(IO); - - rt_out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F)); - - rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + (SectorSz)) / SectorSz)); - - rt_out8(IO + ATA_REG_LBA0, (Lba)&0xFF); - rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); - rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); - rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); - - rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_WRITE_PIO); - - for (SizeT IndexOff = 0; IndexOff < Size; ++IndexOff) - { - drv_std_wait_io(IO); - rt_out16(IO + ATA_REG_DATA, Buf[IndexOff]); - } -} - -/// @brief is ATA detected? -Boolean drv_std_detected(Void) -{ - return kATADetected; -} - -/*** - @brief Getter, gets the number of sectors inside the drive. - */ -SizeT drv_get_sector_count() -{ - return (kATAData[61] << 16) | kATAData[60]; -} - -/// @brief Get the drive size. -SizeT drv_get_size() -{ - return (drv_get_sector_count()) * kATASectorSize; -} - -#endif /* ifdef __ATA_PIO__ */ \ No newline at end of file diff --git a/dev/Kernel/HALKit/AMD64/make_ap_blob.sh b/dev/Kernel/HALKit/AMD64/make_ap_blob.sh deleted file mode 100755 index 3f079187..00000000 --- a/dev/Kernel/HALKit/AMD64/make_ap_blob.sh +++ /dev/null @@ -1,3 +0,0 @@ -# !/bin/sh - -nasm -f bin HalApplicationProcessorStartup.asm -o HalApplicationProcessorStartup.bin \ No newline at end of file diff --git a/dev/Kernel/HALKit/ARM64/APM/APM+IO.cc b/dev/Kernel/HALKit/ARM64/APM/APM+IO.cc deleted file mode 100644 index a3366da4..00000000 --- a/dev/Kernel/HALKit/ARM64/APM/APM+IO.cc +++ /dev/null @@ -1,37 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -using namespace NeOS; - -/// @brief Send APM command to it's space. -/// @param base_dma the IO base port. -/// @param cmd the command. -/// @return status code. -EXTERN_C Int32 apm_send_io_command(UInt16 cmd, APMPowerCmd value) -{ - switch (cmd) - { - case kAPMPowerCommandReboot: { - asm volatile( - "ldr x0, =0x84000004\n" - "svc #0\n"); - - return kErrorSuccess; - } - case kAPMPowerCommandShutdown: { - asm volatile( - "ldr x0, =0x84000008\n" - "svc #0\n"); - - return kErrorSuccess; - } - default: - return kErrorInvalidData; - } -} diff --git a/dev/Kernel/HALKit/ARM64/ApplicationProcessor.h b/dev/Kernel/HALKit/ARM64/ApplicationProcessor.h deleted file mode 100644 index d263f9b8..00000000 --- a/dev/Kernel/HALKit/ARM64/ApplicationProcessor.h +++ /dev/null @@ -1,19 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include - -/************************************************** */ -/* INITIALIZE THE GIC ON CPU. */ -/************************************************** */ - -namespace NeOS -{ - BOOL mp_initialize_gic(NeOS::Void); -} \ No newline at end of file diff --git a/dev/Kernel/HALKit/ARM64/HalACPIFactoryInterface.cc b/dev/Kernel/HALKit/ARM64/HalACPIFactoryInterface.cc deleted file mode 100644 index 8ca9ac06..00000000 --- a/dev/Kernel/HALKit/ARM64/HalACPIFactoryInterface.cc +++ /dev/null @@ -1,32 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include -#include - -namespace NeOS -{ - ACPIFactoryInterface::ACPIFactoryInterface(VoidPtr rsp_ptr) - : fRsdp(rsp_ptr), fEntries(0) - { - } - - BOOL ACPIFactoryInterface::Shutdown() - { - apm_send_io_command(kAPMPowerCommandShutdown, 0); - return NO; - } - - /// @brief Reboot machine in either ACPI or by triple faulting. - /// @return nothing it's a reboot. - Void ACPIFactoryInterface::Reboot() - { - apm_send_io_command(kAPMPowerCommandReboot, 0); - } -} // namespace NeOS diff --git a/dev/Kernel/HALKit/ARM64/HalApplicationProcessor.cc b/dev/Kernel/HALKit/ARM64/HalApplicationProcessor.cc deleted file mode 100644 index 660af502..00000000 --- a/dev/Kernel/HALKit/ARM64/HalApplicationProcessor.cc +++ /dev/null @@ -1,145 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include - -#define GICD_BASE 0x08000000 // Distributor base address -#define GICC_BASE 0x08010000 // CPU interface base address - -#define GICD_CTLR 0x000 // Distributor Control Register -#define GICD_ISENABLER 0x100 // Interrupt Set-Enable Registers -#define GICD_ICENABLER 0x180 // Interrupt Clear-Enable Registers -#define GICD_ISPENDR 0x200 // Interrupt Set-Pending Registers -#define GICD_ICPENDR 0x280 // Interrupt Clear-Pending Registers -#define GICD_IPRIORITYR 0x400 // Interrupt Priority Registers -#define GICD_ITARGETSR 0x800 // Interrupt Processor Targets Registers -#define GICD_ICFGR 0xC00 // Interrupt Configuration Registers - -#define GICC_CTLR 0x000 // CPU Interface Control Register -#define GICC_PMR 0x004 // Interrupt Priority Mask Register -#define GICC_IAR 0x00C // Interrupt Acknowledge Register -#define GICC_EOIR 0x010 // End of Interrupt Register - -// ================================================================= // - -namespace NeOS -{ - struct PROCESS_CONTROL_BLOCK final - { - HAL::StackFramePtr mFrame; - }; - - STATIC PROCESS_CONTROL_BLOCK kProcessBlocks[kSchedProcessLimitPerTeam] = {0}; - - namespace Detail - { - STATIC BOOL kGICEnabled = NO; - - STATIC void mp_hang_fn(void) - { - while (YES) - ; - - dbg_break_point(); - } - - Void mp_setup_gic_el0(Void) - { - // enable distributor. - ke_dma_write(GICD_BASE, GICD_CTLR, YES); - - UInt32 gicc_ctlr = ke_dma_read(GICC_BASE, GICC_CTLR); - - const auto kEnableSignalInt = YES; - - gicc_ctlr |= kEnableSignalInt; // Enable signaling of interrupts - gicc_ctlr |= (kEnableSignalInt << 1); // Allow Group 1 interrupts in EL0 - - ke_dma_write(GICC_BASE, GICC_CTLR, gicc_ctlr); - - // Set priority mask (accept all priorities) - ke_dma_write(GICC_BASE, GICC_PMR, 0xFF); - - UInt32 icfgr = ke_dma_read(GICD_BASE, GICD_ICFGR + (0x20 / 0x10) * 4); - - icfgr |= (0x2 << ((32 % 16) * 2)); // Edge-triggered - ke_dma_write(GICD_BASE, GICD_ICFGR + (0x20 / 0x10) * 4, icfgr); - - // Target interrupt 32 to CPU 1 - ke_dma_write(GICD_BASE, GICD_ITARGETSR + (0x20 / 0x04) * 4, 0x2 << ((32 % 4) * 8)); - - // Set interrupt 32 priority to lowest (0xFF) - ke_dma_write(GICD_BASE, GICD_IPRIORITYR + (0x20 / 0x04) * 4, 0xFF << ((32 % 4) * 8)); - - // Enable interrupt 32 for AP. - ke_dma_write(GICD_BASE, GICD_ISENABLER + 4, 0x01); - } - - BOOL mp_handle_gic_interrupt_el0(Void) - { - // Read the interrupt ID - UInt32 interrupt_id = ke_dma_read(GICC_BASE, GICC_IAR); - - // Check if it's a valid interrupt (not spurious) - if ((interrupt_id & 0x3FF) < 1020) - { - auto interrupt = interrupt_id & 0x3FF; - - const UInt16 kInterruptScheduler = 0x20; - - kout << "Handling interrupt for AP: " << interrupt << kendl; - - switch (interrupt) - { - case kInterruptScheduler: { - ke_dma_write(GICC_BASE, GICC_EOIR, interrupt_id); - UserProcessHelper::StartScheduling(); - break; - } - default: { - ke_dma_write(GICC_BASE, GICC_EOIR, interrupt_id); - break; - } - } - - return YES; - } - - // spurious interrupt - return NO; - } - } // namespace Detail - - EXTERN_C HAL::StackFramePtr mp_get_current_context(ProcessID pid) - { - return kProcessBlocks[pid % kSchedProcessLimitPerTeam].mFrame; - } - - EXTERN_C Bool mp_register_process(HAL::StackFramePtr stack_frame, ProcessID pid) - { - MUST_PASS(stack_frame); - - const auto process_index = pid % kSchedProcessLimitPerTeam; - - kProcessBlocks[process_index].mFrame = stack_frame; - - return YES; - } - - BOOL mp_initialize_gic(Void) - { - if (!Detail::kGICEnabled) - { - Detail::kGICEnabled = YES; - Detail::mp_setup_gic_el0(); - } - - return Detail::kGICEnabled; - } -} // namespace NeOS \ No newline at end of file diff --git a/dev/Kernel/HALKit/ARM64/HalDebugOutput.cc b/dev/Kernel/HALKit/ARM64/HalDebugOutput.cc deleted file mode 100644 index 8d54739f..00000000 --- a/dev/Kernel/HALKit/ARM64/HalDebugOutput.cc +++ /dev/null @@ -1,83 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include - -namespace NeOS -{ - EXTERN_C void ke_io_write(IDeviceObject* self, const Char* bytes) - { -#ifdef __DEBUG__ - if (*bytes == 0) - return; - - SizeT index = 0; - SizeT len = 0; - - index = 0; - len = rt_string_len(bytes, 256U); - - volatile UInt8* uart_ptr = (UInt8*)0x09000000; - - while (index < len) - { - if (bytes[index] == '\r') - *uart_ptr = '\r'; - - *uart_ptr = bytes[index] == '\r' ? '\n' : bytes[index]; - ++index; - } -#endif // __DEBUG__ - } - - TerminalDevice::~TerminalDevice() = default; - - EXTERN_C void ke_io_read(IDeviceObject* self, const Char* bytes) - { -#ifdef __DEBUG__ - SizeT index = 0; - - volatile UInt8* uart_ptr = (UInt8*)0x09000000; - - ///! TODO: Look on how to wait for the UART to complete. - while (Yes) - { - auto in = *uart_ptr; - - ///! If enter pressed then break. - if (in == 0xD) - { - break; - } - - if (in < '0' || in < 'A' || in < 'a') - { - if (in != '@' || in != '!' || in != '?' || in != '.' || in != '/' || - in != ':') - { - continue; - } - } - - ((char*)bytes)[index] = in; - - ++index; - } - - ((char*)bytes)[index] = 0; -#endif // __DEBUG__ - } - - TerminalDevice TerminalDevice::The() noexcept - { - TerminalDevice out(NeOS::ke_io_write, NeOS::ke_io_read); - return out; - } - -} // namespace NeOS diff --git a/dev/Kernel/HALKit/ARM64/HalFlushTLB.S b/dev/Kernel/HALKit/ARM64/HalFlushTLB.S deleted file mode 100644 index 8fcf40ff..00000000 --- a/dev/Kernel/HALKit/ARM64/HalFlushTLB.S +++ /dev/null @@ -1,5 +0,0 @@ -.text - -hal_flush_tlb: - tlbi - ret diff --git a/dev/Kernel/HALKit/ARM64/HalKernelMain.cc b/dev/Kernel/HALKit/ARM64/HalKernelMain.cc deleted file mode 100644 index 5a6d0dc2..00000000 --- a/dev/Kernel/HALKit/ARM64/HalKernelMain.cc +++ /dev/null @@ -1,54 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -EXTERN_C void hal_init_platform( - NeOS::HEL::BootInfoHeader* handover_hdr) -{ - - /************************************************** */ - /* INITIALIZE AND VALIDATE HEADER. */ - /************************************************** */ - - kHandoverHeader = handover_hdr; - - if (kHandoverHeader->f_Magic != kHandoverMagic && - kHandoverHeader->f_Version != kHandoverVersion) - { - return; - } - - /************************************** */ - /* INITIALIZE BIT MAP. */ - /************************************** */ - - kKernelBitMpSize = kHandoverHeader->f_BitMapSize; - kKernelBitMpStart = reinterpret_cast( - reinterpret_cast(kHandoverHeader->f_BitMapStart)); - - /// @note do initialize the interrupts after it. - - NeOS::mp_initialize_gic(); - - while (YES) - { - } -} diff --git a/dev/Kernel/HALKit/ARM64/HalKernelPanic.cc b/dev/Kernel/HALKit/ARM64/HalKernelPanic.cc deleted file mode 100644 index 533ae982..00000000 --- a/dev/Kernel/HALKit/ARM64/HalKernelPanic.cc +++ /dev/null @@ -1,80 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Each error code is attributed with an ID, which will prompt a string onto the - * screen. Wait for debugger... */ - -namespace NeOS -{ - /// @brief Dumping factory class. - class RecoveryFactory final - { - public: - STATIC Void Recover() noexcept; - }; - - /***********************************************************************************/ - /// @brief Stops execution of the kernel. - /// @param id kernel stop ID. - /***********************************************************************************/ - Void ke_panic(const NeOS::Int32& id, const Char* message) - { - fb_init(); - - auto panic_text = RGB(0xff, 0xff, 0xff); - - auto y = 10; - auto x = 10; - - Char* message_apicid = new Char[128]; - rt_set_memory(message_apicid, 0, 128); - - rt_copy_memory((VoidPtr) "panic id: ", message_apicid, rt_string_len("panic id: ")); - rt_to_string(message_apicid + rt_string_len("panic id: "), (UIntPtr)id, 10); - - fb_render_string(message_apicid, y, x, panic_text); - - y += 10; - - fb_render_string((message ? message : "message: panic raised, going nowhere after this!"), y, x, panic_text); - - y += 10; - - fb_clear(); - - RecoveryFactory::Recover(); - } - - Void RecoveryFactory::Recover() noexcept - { - while (YES) - { - HAL::rt_halt(); - } - } - - void ke_runtime_check(bool expr, const Char* file, const Char* line) - { - if (!expr) - { - kout << "FAILED: FILE: " << file << kendl; - kout << "FAILED: LINE: " << line << kendl; - - ke_panic(RUNTIME_CHECK_FAILED, file); // Runtime Check failed - } - } -} // namespace NeOS diff --git a/dev/Kernel/HALKit/ARM64/HalPagingMgrARM64.cc b/dev/Kernel/HALKit/ARM64/HalPagingMgrARM64.cc deleted file mode 100644 index 4ec45b51..00000000 --- a/dev/Kernel/HALKit/ARM64/HalPagingMgrARM64.cc +++ /dev/null @@ -1,86 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: HalPagingMgr.cc - Purpose: Platform Paging Manager. - -------------------------------------------- */ - -#include -#include - -namespace NeOS::HAL -{ - typedef UInt32 PageTableIndex; - - /// \brief Page store type. - struct NE_PAGE_STORE final - { - struct - { - PDE* fPde{nullptr}; - PTE* fPte{nullptr}; - VoidPtr fVAddr{nullptr}; - } fInternalStore; - - Bool fStoreOp{No}; // Store operation in progress. - - static NE_PAGE_STORE& The() - { - static NE_PAGE_STORE the; - return the; - } - }; - - /// \brief Retrieve the page status of a PTE. - STATIC Void mmi_page_status(PTE* pte) - { - } - - STATIC Int32 mmi_map_page_table_entry(VoidPtr virtual_address, UInt32 flags, PTE* pt_entry); - - /// @brief Maps or allocates a page from virtual_address. - /// @param virtual_address a valid virtual address. - /// @param phys_addr point to physical address. - /// @param flags the flags to put on the page. - /// @return Status code of page manipulation process. - EXTERN_C Int32 mm_map_page(VoidPtr virtual_address, VoidPtr physical_address, UInt32 flags) - { - if (!virtual_address || - !flags) - return 0; - - NE_PAGE_STORE& page_store = NE_PAGE_STORE::The(); - - while (page_store.fStoreOp) - ; - - page_store.fStoreOp = Yes; - - if (page_store.fInternalStore.fVAddr == virtual_address) - { - page_store.fStoreOp = No; - return mmi_map_page_table_entry(page_store.fInternalStore.fVAddr, flags, page_store.fInternalStore.fPte); - } - - return 1; - } - - /// @brief Maps flags for a specific pte. - /// @internal Internal function. - STATIC Int32 mmi_map_page_table_entry(VoidPtr virtual_address, UInt32 flags, PTE* pt_entry) - { - NE_PAGE_STORE& page_store = NE_PAGE_STORE::The(); - - // Update internal store. - - page_store.fInternalStore.fPde = nullptr; - page_store.fInternalStore.fPte = pt_entry; - page_store.fInternalStore.fVAddr = virtual_address; - - page_store.fStoreOp = No; - - return 0; - } -} // namespace NeOS::HAL diff --git a/dev/Kernel/HALKit/ARM64/HalSchedulerCoreARM64.cc b/dev/Kernel/HALKit/ARM64/HalSchedulerCoreARM64.cc deleted file mode 100644 index 55c8aab5..00000000 --- a/dev/Kernel/HALKit/ARM64/HalSchedulerCoreARM64.cc +++ /dev/null @@ -1,24 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -namespace NeOS -{ - /// @brief Wakes up thread. - /// Wakes up thread from the hang state. - Void mp_wakeup_thread(HAL::StackFrame* stack) - { - NE_UNUSED(stack); - } - - /// @brief makes the thread sleep on a loop. - /// hooks and hangs thread to prevent code from executing. - Void mp_hang_thread(HAL::StackFrame* stack) - { - NE_UNUSED(stack); - } -} // namespace NeOS diff --git a/dev/Kernel/HALKit/ARM64/HalSchedulerCorePrimitivesARM64.cc b/dev/Kernel/HALKit/ARM64/HalSchedulerCorePrimitivesARM64.cc deleted file mode 100644 index 3a9b7074..00000000 --- a/dev/Kernel/HALKit/ARM64/HalSchedulerCorePrimitivesARM64.cc +++ /dev/null @@ -1,35 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -namespace NeOS -{ - /***********************************************************************************/ - /// @brief Unimplemented function (crashes by default) - /// @param void - /***********************************************************************************/ - - EXTERN_C Void __zka_pure_call(UserProcess* process) - { - if (process) - process->Crash(); - } - - /***********************************************************************************/ - /// @brief Validate user stack. - /// @param stack_ptr the frame pointer. - /***********************************************************************************/ - - EXTERN_C Bool hal_check_stack(HAL::StackFramePtr stack_ptr) - { - if (!stack_ptr) - return No; - - return stack_ptr->SP != 0 && stack_ptr->BP != 0; - } -} // namespace NeOS diff --git a/dev/Kernel/HALKit/ARM64/HalTimerARM64.cc b/dev/Kernel/HALKit/ARM64/HalTimerARM64.cc deleted file mode 100644 index 785d2d5c..00000000 --- a/dev/Kernel/HALKit/ARM64/HalTimerARM64.cc +++ /dev/null @@ -1,14 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: HalTimer.cc - Purpose: HAL timer - - Revision History: - - 07/07/24: Added file (amlel) - -------------------------------------------- */ - -#include diff --git a/dev/Kernel/HALKit/ARM64/MBCI/MBCI.cc b/dev/Kernel/HALKit/ARM64/MBCI/MBCI.cc deleted file mode 100644 index d9c39f4a..00000000 --- a/dev/Kernel/HALKit/ARM64/MBCI/MBCI.cc +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include \ No newline at end of file diff --git a/dev/Kernel/HALKit/ARM64/Paging.h b/dev/Kernel/HALKit/ARM64/Paging.h deleted file mode 100644 index 3c24f757..00000000 --- a/dev/Kernel/HALKit/ARM64/Paging.h +++ /dev/null @@ -1,120 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -/** --------------------------------------------------- - - * THIS FILE CONTAINS CODE FOR ARMV8 PAGING. - -------------------------------------------------------- */ - -#include - -#ifndef kPageMax -#define kPageMax (0x200) -#endif //! kPageMax - -#ifndef kPageAlign -#define kPageAlign (0x1000) -#endif //! kPageAlign - -#ifndef kPageSize -#define kPageSize (0x1000) -#endif // !kPageSize - -//! short format address range - -#define c16KBPage 0b000 -#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 \ - } - -namespace NeOS::HAL -{ - struct PACKED PTE_4KB final - { - UInt64 Valid : 1; - UInt64 Table : 1; - UInt64 AttrIndex : 3; - UInt64 NS : 1; - UInt64 AP : 2; - UInt64 SH : 2; - UInt64 AF : 1; - UInt64 NG : 1; - UInt64 Reserved1 : 1; - UInt64 Contiguous : 1; - UInt64 Dirty : 1; - UInt64 Reserved : 2; - UInt64 PhysicalAddress : 36; - UInt64 Reserved3 : 4; - UInt64 PXN : 1; - UInt64 XN : 1; - UInt64 Reserved4 : 9; - }; - - namespace Detail - { - enum class ControlRegisterBits - { - ProtectedModeEnable = 0, - MonitorCoProcessor = 1, - Emulation = 2, - TaskSwitched = 3, - ExtensionType = 4, - NumericError = 5, - WriteProtect = 16, - AlignementMask = 18, - NotWriteThrough = 29, - CacheDisable = 30, - PageEnable = 31, - }; - - inline UInt8 control_register_cast(ControlRegisterBits reg) - { - return static_cast(reg); - } - } // namespace Detail - - struct PDE_4KB final - { - PTE_4KB ALIGN(kPageAlign) fEntries[kPageMax]; - }; - - auto mm_alloc_bitmap(Boolean wr, Boolean user, SizeT size, Bool is_page) -> VoidPtr; - auto mm_free_bitmap(VoidPtr page_ptr) -> Bool; -} // namespace NeOS::HAL - -namespace NeOS -{ - typedef HAL::PTE_4KB PTE; - typedef HAL::PDE_4KB PDE; -} // namespace NeOS - -EXTERN_C void hal_flush_tlb(); diff --git a/dev/Kernel/HALKit/ARM64/Processor.h b/dev/Kernel/HALKit/ARM64/Processor.h deleted file mode 100644 index 940cfbe9..00000000 --- a/dev/Kernel/HALKit/ARM64/Processor.h +++ /dev/null @@ -1,91 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include -#include - -#define kCPUBackendName "ARMv8" - -namespace NeOS::HAL -{ - struct PACKED Register64 final - { - UShort Limit; - UIntPtr Base; - }; - - /// @brief Memory Manager mapping flags. - enum - { - kMMFlagsPresent = 1 << 0, - kMMFlagsWr = 1 << 1, - kMMFlagsUser = 1 << 2, - kMMFlagsNX = 1 << 3, - kMMFlagsCount = 3, - }; - - /// @brief Set a PTE from pd_base. - /// @param virt_addr a valid virtual address. - /// @param phys_addr point to physical address. - /// @param flags the flags to put on the page. - /// @return Status code of page manip. - EXTERN_C Int32 mm_map_page(VoidPtr virtual_address, VoidPtr physical_address, UInt32 flags); - - typedef UIntPtr Reg; - typedef Register64 Register; - - /// @note let's keep the same name as AMD64 HAL. - struct PACKED StackFrame final - { - Reg R8{0}; - Reg R9{0}; - Reg R10{0}; - Reg R11{0}; - Reg R12{0}; - Reg R13{0}; - Reg R14{0}; - Reg R15{0}; - Reg SP{0}; - Reg BP{0}; - }; - - typedef StackFrame* StackFramePtr; - - inline Void rt_halt() noexcept - { - while (Yes) - { - } - } - - template - inline void hal_dma_write(UIntPtr address, DataKind value) - { - *reinterpret_cast(address) = value; - } - - template - inline DataKind hal_dma_read(UIntPtr address) - { - return *reinterpret_cast(address); - } - - inline Void hal_wfi(Void) - { - asm volatile("wfi"); - } -} // namespace NeOS::HAL - -inline NeOS::VoidPtr kKernelBitMpStart = nullptr; -inline NeOS::UIntPtr kKernelBitMpSize = 0UL; - -inline NeOS::VoidPtr kKernelPhysicalStart = nullptr; - -#include diff --git a/dev/Kernel/HALKit/ARM64/ReadMe.md b/dev/Kernel/HALKit/ARM64/ReadMe.md deleted file mode 100644 index c51229f2..00000000 --- a/dev/Kernel/HALKit/ARM64/ReadMe.md +++ /dev/null @@ -1,3 +0,0 @@ -# ARM64 Hardware Abstraction Layer - -- Supported Firmware: CoreBoot/EDK/OpenMobileBoot diff --git a/dev/Kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc b/dev/Kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc deleted file mode 100644 index 3ccca867..00000000 --- a/dev/Kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc +++ /dev/null @@ -1,119 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifdef NE_USE_MBCI_FLASH - -#include -#include -#include -#include - -/// @file MBCI+Flash.cc -/// @brief MBCI Flash support. - -#define MBCI_MAX_SLOTS (8U) - -namespace NeOS -{ - /// /Mount/Flash/n - constexpr auto kFlashBridgeMagic = 0x70768372; - constexpr auto kFlashBridgeRevision = 1; - - STATIC BOOL kFlashEnabled = NO; - STATIC SizeT kFlashSize[MBCI_MAX_SLOTS] = {}; - STATIC SizeT kFlashSectorSz[MBCI_MAX_SLOTS] = {}; - STATIC IMBCIHost* kFlashMetaPackets[MBCI_MAX_SLOTS] = {}; - STATIC IMBCIHost* kFlashDataPackets[MBCI_MAX_SLOTS] = {}; - - STATIC Void drv_std_io(Int32 slot, UInt64 lba, Char* buf, SizeT sector_sz, SizeT buf_sz); - - /// @brief Enable flash memory builtin. - STATIC Void drv_enable_flash(Int32 slot); - - /// @brief Disable flash memory builtin. - STATIC Void drv_disable_flash(Int32 slot); - - /// @brief get slot sector count. - /// @return slot sector count. - SizeT drv_get_sector_count(Int32 slot) - { - if (slot > MBCI_MAX_SLOTS) - return 0; - - return kFlashSectorSz[slot]; - } - - /// @brief get slot full size (in bytes). - /// @return drive slot size - SizeT drv_get_size(Int32 slot) - { - if (slot > MBCI_MAX_SLOTS) - return 0; - - return kFlashSize[slot]; - } - - /// @brief Enable flash memory at slot. - BOOL drv_enable_at(Int32 slot) - { - if (slot > MBCI_MAX_SLOTS) - return NO; - - kFlashMetaPackets[slot]->InterruptEnable = YES; - - kout << "Enabled hardware slot at: " << number(slot) << kendl; - - return YES; - } - - /// @brief Disable flash memory at slot. - BOOL drv_disable_at(Int32 slot) - { - if (slot > MBCI_MAX_SLOTS) - return NO; - - kFlashMetaPackets[slot]->InterruptEnable = NO; - - kout << "Disabled hardware slot at: " << number(slot) << kendl; - - return YES; - } - - STATIC Void drv_std_io(Int32 slot, UInt64 lba, Char* buf, SizeT sector_sz, SizeT buf_sz) - { - UInt64* packet_frame = (UInt64*)kFlashDataPackets[slot]->BaseAddressRegister; - - if (packet_frame[0] != (UInt64)kFlashBridgeMagic) - return; - - if (packet_frame[8] != (UInt64)kFlashBridgeRevision) - return; - - packet_frame[16 + 0] = lba; - packet_frame[16 + 4] = sector_sz; - packet_frame[16 + 8] = lba; - packet_frame[16 + 12] = buf_sz; - packet_frame[16 + 14] = (UIntPtr)HAL::hal_get_phys_address(buf); - - while (packet_frame[0] == lba) - ; - } - - Void drv_std_read(Int32 slot, UInt64 lba, Char* buf, SizeT sector_sz, SizeT buf_sz) - { - rt_set_memory(buf, 0, buf_sz); - - drv_std_io(slot, lba, buf, sector_sz, buf_sz); - } - - Void drv_std_write(Int32 slot, UInt64 lba, Char* buf, SizeT sector_sz, SizeT buf_sz) - { - drv_std_io(slot, lba, buf, sector_sz, buf_sz); - } - -} // namespace NeOS - -#endif // if NE_USE_MBCI_FLASH diff --git a/dev/Kernel/HALKit/ARM64/Storage/UFS+Generic.cc b/dev/Kernel/HALKit/ARM64/Storage/UFS+Generic.cc deleted file mode 100644 index 20d06671..00000000 --- a/dev/Kernel/HALKit/ARM64/Storage/UFS+Generic.cc +++ /dev/null @@ -1,11 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -/// @file UFS.cc -/// @brief UFS Flash Memory support. - -#define UFS_PCI_VENDOR_ID (0x01001) /* AKER */ -#define UFS_PCI_DEVICE_ID (0xAEAEA) /* AKER */ \ No newline at end of file diff --git a/dev/Kernel/HALKit/AXP/CR.s b/dev/Kernel/HALKit/AXP/CR.s deleted file mode 100644 index 4d68257d..00000000 --- a/dev/Kernel/HALKit/AXP/CR.s +++ /dev/null @@ -1,11 +0,0 @@ -.globl read_lr1 -.globl read_lr0 - -.section .text - read_lr0: - movq %r30, %cr3 - ret - - hal_read_cr0: - movq %r30, %cr0 - ret \ No newline at end of file diff --git a/dev/Kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp b/dev/Kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp b/dev/Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp deleted file mode 100644 index f77186fd..00000000 --- a/dev/Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -/// @brief Internal call for syscall, to work with C++. -/// @param stack -/// @return nothing. -EXTERN_C void rt_syscall_handle(NeOS::HAL::StackFrame* stack) -{ - if (stack->Rcx <= (kSyscalls.Count() - 1)) - { - kout << "syscall: enter.\r"; - - if (kSyscalls[stack->Rcx].Leak().Leak().fHooked) - (kSyscalls[stack->Rcx].Leak().Leak().fProc)(stack); - - kout << "syscall: exit.\r"; - } -} diff --git a/dev/Kernel/HALKit/AXP/HAL.s b/dev/Kernel/HALKit/AXP/HAL.s deleted file mode 100644 index 0178527f..00000000 --- a/dev/Kernel/HALKit/AXP/HAL.s +++ /dev/null @@ -1,13 +0,0 @@ -.globl rt_wait_400ns - -.section .text -rt_wait_400ns: - jmp .L -.L: - jmp .L2 - wtint ;; wait for interrupt -.L2: - - ret - - diff --git a/dev/Kernel/HALKit/AXP/Processor.h b/dev/Kernel/HALKit/AXP/Processor.h deleted file mode 100644 index bb14c9c6..00000000 --- a/dev/Kernel/HALKit/AXP/Processor.h +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once diff --git a/dev/Kernel/HALKit/AXP/SYSCALL.s b/dev/Kernel/HALKit/AXP/SYSCALL.s deleted file mode 100644 index 19cab808..00000000 --- a/dev/Kernel/HALKit/AXP/SYSCALL.s +++ /dev/null @@ -1,10 +0,0 @@ -.section .text -system_handle_user_call: - .cfi_startproc - - push %r0 - jmp %r1 - mov %r30, %r2 - - .cfi_endproc - retsys \ No newline at end of file diff --git a/dev/Kernel/HALKit/AXP/VM.s b/dev/Kernel/HALKit/AXP/VM.s deleted file mode 100644 index 7024086b..00000000 --- a/dev/Kernel/HALKit/AXP/VM.s +++ /dev/null @@ -1,5 +0,0 @@ -.global hal_flush_tlb - -.section .text -hal_flush_tlb: - swppal \ No newline at end of file diff --git a/dev/Kernel/HALKit/POWER/.gitkeep b/dev/Kernel/HALKit/POWER/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Kernel/HALKit/POWER/AP.h b/dev/Kernel/HALKit/POWER/AP.h deleted file mode 100644 index e0ef3ffb..00000000 --- a/dev/Kernel/HALKit/POWER/AP.h +++ /dev/null @@ -1,39 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: AP.h - Purpose: POWER hardware threads. - - Revision History: - - 14/04/24: Added file (amlel) - -------------------------------------------- */ - -#pragma once - -#include - -namespace NeOS -{ - struct HAL_HARDWARE_THREAD; - - /// @brief hardware thread indentification type. - typedef NeOS::Int32 hal_ap_kind; - - /// @brief Hardware thread information structure. - typedef struct HAL_HARDWARE_THREAD - { - NeOS::UIntPtr fStartAddress; - NeOS::UInt8 fPrivleged : 1; - NeOS::UInt32 fPageMemoryFlags; - hal_ap_kind fIdentNumber; - } HAL_HARDWARE_THREAD; - - /// @brief Set PC to specific hart. - /// @param hart the hart - /// @param epc the pc. - /// @return - EXTERN_C NeOS::Void hal_set_pc_to_hart(HAL_HARDWARE_THREAD* hart, NeOS::VoidPtr epc); -} // namespace NeOS diff --git a/dev/Kernel/HALKit/POWER/APM/.gitkeep b/dev/Kernel/HALKit/POWER/APM/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Kernel/HALKit/POWER/HalAP.cc b/dev/Kernel/HALKit/POWER/HalAP.cc deleted file mode 100644 index 32f91a5f..00000000 --- a/dev/Kernel/HALKit/POWER/HalAP.cc +++ /dev/null @@ -1,40 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include - -using namespace NeOS; - -namespace NeOS::Detail -{ - STATIC void mp_hang_fn(void) - { - while (YES) - ; - } -} // namespace NeOS::Detail - -/// @brief wakes up thread. -/// wakes up thread from hang. -void mp_wakeup_thread(HAL::StackFramePtr stack) -{ - if (!stack) - return; - - hal_set_pc_to_hart(reinterpret_cast(stack->R15), reinterpret_cast(stack->BP)); -} - -/// @brief makes thread sleep. -/// hooks and hangs thread to prevent code from executing. -void mp_hang_thread(HAL::StackFramePtr stack) -{ - if (!stack) - return; - - hal_set_pc_to_hart(reinterpret_cast(stack->R15), reinterpret_cast(NeOS::Detail::mp_hang_fn)); -} diff --git a/dev/Kernel/HALKit/POWER/HalDebugOutput.cc b/dev/Kernel/HALKit/POWER/HalDebugOutput.cc deleted file mode 100644 index e9b2c85a..00000000 --- a/dev/Kernel/HALKit/POWER/HalDebugOutput.cc +++ /dev/null @@ -1,27 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -using namespace NeOS; - -/// @brief Writes to COM1. -/// @param bytes -void ke_io_write(const Char* bytes) -{ - if (!bytes) - return; - - SizeT index = 0; - SizeT len = rt_string_len(bytes, 256U); - - while (index < len) - { - // TODO - ++index; - } -} diff --git a/dev/Kernel/HALKit/POWER/HalStartSequence.s b/dev/Kernel/HALKit/POWER/HalStartSequence.s deleted file mode 100644 index 2882be80..00000000 --- a/dev/Kernel/HALKit/POWER/HalStartSequence.s +++ /dev/null @@ -1,14 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -.globl __ImageStart -.extern hal_init_platform -.align 4 -.text - -__ImageStart: - bl hal_init_platform - blr diff --git a/dev/Kernel/HALKit/POWER/HalThread.cc b/dev/Kernel/HALKit/POWER/HalThread.cc deleted file mode 100644 index 0d2e140b..00000000 --- a/dev/Kernel/HALKit/POWER/HalThread.cc +++ /dev/null @@ -1,8 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include diff --git a/dev/Kernel/HALKit/POWER/HalVirtualMemory.cc b/dev/Kernel/HALKit/POWER/HalVirtualMemory.cc deleted file mode 100644 index d3d4b694..00000000 --- a/dev/Kernel/HALKit/POWER/HalVirtualMemory.cc +++ /dev/null @@ -1,49 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include - -/// @note Refer to SoC documentation. - -using namespace NeOS; - -EXTERN_C Void hal_write_tlb(UInt32 mas0, UInt32 mas1, UInt32 mas2, UInt32 mas3, UInt32 mas7) -{ - hal_mtspr(MAS0, mas0); - hal_mtspr(MAS1, mas1); - hal_mtspr(MAS2, mas2); - hal_mtspr(MAS3, mas3); - hal_mtspr(MAS7, mas7); - - hal_flush_tlb(); -} - -EXTERN_C Bool hal_set_tlb(UInt8 tlb, UInt32 epn, UInt64 rpn, UInt8 perms, UInt8 wimge, UInt8 ts, UInt8 esel, UInt8 tsize, UInt8 iprot) -{ - if ((hal_mfspr(SPRN_MMUCFG) & MMUCFG_MAVN) == MMUCFG_MAVN_V1 && (tsize & 1)) - { - // this MMU does not allow odd tsize values - return false; - } - - UInt32 mas0 = FSL_BOOKE_MAS0(tlb, esel, 0); - UInt32 mas1 = FSL_BOOKE_MAS1(1, iprot, 0, ts, tsize); - UInt32 mas2 = FSL_BOOKE_MAS2(epn, wimge); - UInt32 mas3 = FSL_BOOKE_MAS3(rpn, 0, perms); - UInt32 mas7 = FSL_BOOKE_MAS7(rpn); - - hal_write_tlb(mas0, mas1, mas2, mas3, mas7); - - return true; -} - -/// @brief Flush TLB -EXTERN_C void hal_flush_tlb() -{ - asm volatile("isync;tlbwe;msync;isync"); -} diff --git a/dev/Kernel/HALKit/POWER/MBCI/.gitkeep b/dev/Kernel/HALKit/POWER/MBCI/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Kernel/HALKit/POWER/MBCI/HalMBCIHost.cc b/dev/Kernel/HALKit/POWER/MBCI/HalMBCIHost.cc deleted file mode 100644 index 0d2e140b..00000000 --- a/dev/Kernel/HALKit/POWER/MBCI/HalMBCIHost.cc +++ /dev/null @@ -1,8 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include diff --git a/dev/Kernel/HALKit/POWER/Processor.h b/dev/Kernel/HALKit/POWER/Processor.h deleted file mode 100644 index bbcfd01f..00000000 --- a/dev/Kernel/HALKit/POWER/Processor.h +++ /dev/null @@ -1,62 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - Purpose: POWER processor header. - -------------------------------------------- */ - -#pragma once - -#include -#include - -#define NoOp() asm volatile("mr 0, 0") -#define kHalPPCAlignment __attribute__((aligned(4))) - -namespace NeOS::HAL -{ - typedef UIntPtr Reg; - - /// @brief Stack frame (as retrieved from assembly.) - struct PACKED StackFrame final - { - Reg R8{0}; - Reg R9{0}; - Reg R10{0}; - Reg R11{0}; - Reg R12{0}; - Reg R13{0}; - Reg R14{0}; - Reg R15{0}; - Reg SP{0}; - Reg BP{0}; - }; - - typedef StackFrame* StackFramePtr; - - inline void rt_halt() - { - while (true) - { - NoOp(); // no oop. - } - } - - inline void rt_cli() - { - NoOp(); // no oop - } -} // namespace NeOS::HAL - -EXTERN_C NeOS::Void int_handle_math(NeOS::UIntPtr sp); -EXTERN_C NeOS::Void int_handle_pf(NeOS::UIntPtr sp); - -/// @brief Set TLB. -NeOS::Bool hal_set_tlb(NeOS::UInt8 tlb, NeOS::UInt32 epn, NeOS::UInt64 rpn, NeOS::UInt8 perms, NeOS::UInt8 wimge, NeOS::UInt8 ts, NeOS::UInt8 esel, NeOS::UInt8 tsize, NeOS::UInt8 iprot); - -/// @brief Write TLB. -NeOS::Void hal_write_tlb(NeOS::UInt32 mas0, NeOS::UInt32 mas1, NeOS::UInt32 mas2, NeOS::UInt32 mas3, NeOS::UInt32 mas7); - -/// @brief Flush TLB. -EXTERN_C NeOS::Void hal_flush_tlb(); diff --git a/dev/Kernel/HALKit/POWER/ReadMe.md b/dev/Kernel/HALKit/POWER/ReadMe.md deleted file mode 100644 index a9751581..00000000 --- a/dev/Kernel/HALKit/POWER/ReadMe.md +++ /dev/null @@ -1,4 +0,0 @@ -POWER Hardware Abstraction Layer - -- Supported CPU: POWER -- Supported Firmware: CoreBoot \ No newline at end of file diff --git a/dev/Kernel/HALKit/RISCV/.keep b/dev/Kernel/HALKit/RISCV/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Kernel/HALKit/RISCV/AP.h b/dev/Kernel/HALKit/RISCV/AP.h deleted file mode 100644 index c198a404..00000000 --- a/dev/Kernel/HALKit/RISCV/AP.h +++ /dev/null @@ -1,35 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: AP.h - Purpose: RISC-V hardware threads. - - Revision History: - - 30/01/24: Added file (amlel) - -------------------------------------------- */ - -#pragma once - -#include - -namespace NeOS -{ - typedef Int64 hal_ap_kind; - - typedef struct HAL_HARDWARE_THREAD - { - NeOS::UIntPtr fStartAddress; - NeOS::UInt8 fPrivleged : 1; - NeOS::UInt32 fPageMemoryFlags; - hal_ap_kind fIdentNumber; - } HAL_HARDWARE_THREAD; - - /// @brief Set PC to specific hart. - /// @param hart the hart - /// @param epc the pc. - /// @return - EXTERN_C NeOS::Void hal_set_pc_to_hart(HAL_HARDWARE_THREAD* hart, NeOS::VoidPtr epc); -} // namespace NeOS diff --git a/dev/Kernel/HALKit/RISCV/APM/.gitkeep b/dev/Kernel/HALKit/RISCV/APM/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Kernel/HALKit/RISCV/HalAP.cc b/dev/Kernel/HALKit/RISCV/HalAP.cc deleted file mode 100644 index 788acf0f..00000000 --- a/dev/Kernel/HALKit/RISCV/HalAP.cc +++ /dev/null @@ -1,40 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include - -using namespace NeOS; - -namespace NeOS::Detail -{ - STATIC void mp_hang_fn(void) - { - while (YES) - ; - } -} // namespace NeOS::Detail - -/// @brief wakes up thread. -/// wakes up thread from hang. -void mp_wakeup_thread(HAL::StackFramePtr stack) -{ - if (!stack) - return; - - hal_set_pc_to_hart(reinterpret_cast(stack->R15), reinterpret_cast(stack->BP)); -} - -/// @brief makes thread sleep. -/// hooks and hangs thread to prevent code from executing. -void mp_hang_thread(HAL::StackFramePtr stack) -{ - if (!stack) - return; - - hal_set_pc_to_hart(reinterpret_cast(stack->R15), reinterpret_cast(NeOS::Detail::mp_hang_fn)); -} diff --git a/dev/Kernel/HALKit/RISCV/ReadMe.md b/dev/Kernel/HALKit/RISCV/ReadMe.md deleted file mode 100644 index b099aa31..00000000 --- a/dev/Kernel/HALKit/RISCV/ReadMe.md +++ /dev/null @@ -1,4 +0,0 @@ -RISCV64 Hardware Abstraction Layer - -- Supported CPU: RISCV64 -- Supported Firmware: CoreBoot \ No newline at end of file diff --git a/dev/Kernel/HALKit/RISCV/Storage/.gitkeep b/dev/Kernel/HALKit/RISCV/Storage/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Kernel/HALKit/X86S/.gitkeep b/dev/Kernel/HALKit/X86S/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Kernel/HALKit/X86S/ACPI/.gitkeep b/dev/Kernel/HALKit/X86S/ACPI/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Kernel/HALKit/X86S/Storage/.gitkeep b/dev/Kernel/HALKit/X86S/Storage/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Kernel/KernelKit/BinaryMutex.h b/dev/Kernel/KernelKit/BinaryMutex.h deleted file mode 100644 index 21b2ca6d..00000000 --- a/dev/Kernel/KernelKit/BinaryMutex.h +++ /dev/null @@ -1,43 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -namespace NeOS -{ - class UserProcess; - - typedef UserProcess& UserProcessRef; - - /// @brief Access control class, which locks a task until one is done. - class BinaryMutex final - { - public: - explicit BinaryMutex() = default; - ~BinaryMutex() = default; - - public: - bool IsLocked() const; - bool Unlock() noexcept; - - public: - BOOL WaitForProcess(const Int16& sec) noexcept; - - public: - bool Lock(UserProcess& process); - bool LockOrWait(UserProcess& process, TimerInterface* timer); - - public: - NE_COPY_DEFAULT(BinaryMutex); - - private: - UserProcessRef fLockingProcess; - }; -} // namespace NeOS diff --git a/dev/Kernel/KernelKit/CodeMgr.h b/dev/Kernel/KernelKit/CodeMgr.h deleted file mode 100644 index 5f83c74b..00000000 --- a/dev/Kernel/KernelKit/CodeMgr.h +++ /dev/null @@ -1,37 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: CodeMgr.h - Purpose: Code Mgr. - - Revision History: - - 30/01/24: Added file (amlel) - 3/8/24: Add UPP struct. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -namespace NeOS -{ - /// @brief Main process entrypoint. - typedef void (*rtl_main_kind)(const SizeT argc, Char** argv, Char** envp, const SizeT envp_len); - - /// @brief C++ Constructor entrypoint. - typedef void (*rtl_ctor_kind)(void); - - /// @brief C++ Destructor entrypoint. - typedef void (*rtl_dtor_kind)(void); - - /// @brief Executes a new process from a function. Kernel code only. - /// @note This sets up a new stack, anything on the main function that calls the Kernel will not be accessible. - /// @param main the start of the process. - /// @return The team's process id. - ProcessID rtl_create_process(rtl_main_kind main, const Char* process_name) noexcept; -} // namespace NeOS diff --git a/dev/Kernel/KernelKit/DebugOutput.h b/dev/Kernel/KernelKit/DebugOutput.h deleted file mode 100644 index cfadd38d..00000000 --- a/dev/Kernel/KernelKit/DebugOutput.h +++ /dev/null @@ -1,213 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include -#include - -#define kDebugMaxPorts 56 - -#define kDebugUnboundPort 0x0FEED - -#define kDebugMag0 'Z' -#define kDebugMag1 'D' -#define kDebugMag2 'B' -#define kDebugMag3 'G' - -#define kDebugSourceFile 0 -#define kDebugLine 33 -#define kDebugTeam 43 -#define kDebugEOP 49 - -namespace NeOS -{ - class TerminalDevice; - class DTraceDevice; - - inline TerminalDevice end_line(); - inline TerminalDevice number(const Long& x); - inline TerminalDevice hex_number(const Long& x); - - // @brief Emulates a VT100 terminal. - class TerminalDevice final NE_DEVICE - { - public: - TerminalDevice(void (*print)(IDeviceObject*, const Char*), void (*gets)(IDeviceObject*, const Char*)) - : IDeviceObject(print, gets) - { - } - - ~TerminalDevice() override; - - /// @brief returns device name (terminal name) - /// @return string type (const Char*) - const Char* Name() const override - { - return ("TerminalDevice"); - } - - NE_COPY_DEFAULT(TerminalDevice); - - STATIC TerminalDevice The() noexcept; - }; - - inline TerminalDevice end_line() - { - TerminalDevice self = TerminalDevice::The(); - - self.operator<<("\r"); - return self; - } - - inline TerminalDevice carriage_return() - { - TerminalDevice self = TerminalDevice::The(); - - self.operator<<("\r"); - return self; - } - - inline TerminalDevice tabulate() - { - TerminalDevice self = TerminalDevice::The(); - - self.operator<<("\t"); - return self; - } - - /// @brief emulate a terminal bell, like the VT100 does. - inline TerminalDevice bell() - { - TerminalDevice self = TerminalDevice::The(); - - self.operator<<("\a"); - return self; - } - - namespace Detail - { - inline TerminalDevice _write_number(const Long& x, TerminalDevice& term) - { - UInt64 y = (x > 0 ? x : -x) / 10; - UInt64 h = (x > 0 ? x : -x) % 10; - - if (y) - _write_number(y, term); - - /* fail if the number is not base-10 */ - if (h > 10) - { - _write_number('?', term); - return term; - } - - if (y < 0) - y = -y; - - const Char kNumbers[11] = "0123456789"; - - Char buf[2]; - buf[0] = kNumbers[h]; - buf[1] = 0; - - term.operator<<(buf); - return term; - } - - inline TerminalDevice _write_number_hex(const Long& x, TerminalDevice& term) - { - UInt64 y = (x > 0 ? x : -x) / 16; - UInt64 h = (x > 0 ? x : -x) % 16; - - if (y) - _write_number_hex(y, term); - - /* fail if the hex number is not base-16 */ - if (h > 16) - { - _write_number_hex('?', term); - return term; - } - - if (y < 0) - y = -y; - - const Char kNumbers[17] = "0123456789ABCDEF"; - - Char buf[2]; - buf[0] = kNumbers[h]; - buf[1] = 0; - - term.operator<<(buf); - return term; - } - } // namespace Detail - - inline TerminalDevice hex_number(const Long& x) - { - TerminalDevice self = TerminalDevice::The(); - - Detail::_write_number_hex(x, self); - self.operator<<("h"); - - return self; - } - - inline TerminalDevice number(const Char* x) - { - TerminalDevice self = TerminalDevice::The(); - - self << "?"; - - return self; - } - - inline TerminalDevice number(const Long& x) - { - TerminalDevice self = TerminalDevice::The(); - - Detail::_write_number(x, self); - - return self; - } - - inline TerminalDevice get_console_in(Char* buf) - { - TerminalDevice self = TerminalDevice::The(); - - self >> buf; - - return self; - } - - constexpr SizeT kDebugTypeLen = 256U; - - typedef Char rt_debug_type[kDebugTypeLen]; - - class DebuggerPortHeader final - { - public: - Int16 fPort[kDebugMaxPorts]; - Int16 fPortCnt; - }; - - inline TerminalDevice& operator<<(TerminalDevice& src, const Long& num) - { - src = number(num); - return src; - } -} // namespace NeOS - -#ifdef kout -#undef kout -#endif // ifdef kout - -#define kout NeOS::TerminalDevice::The() << "[NeKernel] *" << __FILE__ << "*: " - -#define kendl NeOS::TerminalDevice::The() << NeOS::end_line() diff --git a/dev/Kernel/KernelKit/Defines.h b/dev/Kernel/KernelKit/Defines.h deleted file mode 100644 index d86988a7..00000000 --- a/dev/Kernel/KernelKit/Defines.h +++ /dev/null @@ -1,15 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -#define KERNELKIT_VERSION "1.0.2" -#define KERNELKIT_VERSION_BCD 0x01020 - -class UserProcessScheduler; -class UserProcess; diff --git a/dev/Kernel/KernelKit/DeviceMgr.h b/dev/Kernel/KernelKit/DeviceMgr.h deleted file mode 100644 index fa68d2e7..00000000 --- a/dev/Kernel/KernelKit/DeviceMgr.h +++ /dev/null @@ -1,140 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -/* ------------------------------------------- - - Revision History: - - 31/01/24: Add kDeviceCnt (amlel) - 15/11/24: Add NE_DEVICE macro, to inherit from device object. - - ------------------------------------------- */ - -#pragma once - -/* @note Device Mgr. */ -/* @file KernelKit/DeviceMgr.h */ -/* @brief Device abstraction and I/O buffer. */ - -#include -#include - -#define kDeviceMgrRootDirPath "/Devices/" - -#define NE_DEVICE : public ::NeOS::IDeviceObject - -// Last Rev: Wed, Apr 3, 2024 9:09:41 AM - -namespace NeOS -{ - template - class IDeviceObject; - - /***********************************************************************************/ - /// @brief Device contract interface, represents an HW device. - /***********************************************************************************/ - template - class IDeviceObject - { - public: - explicit IDeviceObject(void (*Out)(IDeviceObject*, T), void (*In)(IDeviceObject*, T)) - : fOut(Out), fIn(In) - { - } - - virtual ~IDeviceObject() = default; - - public: - IDeviceObject& operator=(const IDeviceObject&) = default; - IDeviceObject(const IDeviceObject&) = default; - - public: - virtual IDeviceObject& operator<<(T Data) - { - fOut(this, Data); - return *this; - } - - virtual IDeviceObject& operator>>(T Data) - { - fIn(this, Data); - return *this; - } - - virtual const char* Name() const - { - return "/dev/null"; - } - - operator bool() - { - return fOut && fIn; - } - - Bool operator!() - { - return !fOut || !fIn; - } - - protected: - Void (*fOut)(IDeviceObject*, T Data) = {nullptr}; - Void (*fIn)(IDeviceObject*, T Data) = {nullptr}; - }; - - /// - /// @brief Input Output abstract class. - /// Used mainly to communicate between OS to hardware. - /// - template - class IOBuf final - { - public: - explicit IOBuf(T dma_addr) - : fData(dma_addr) - { - // At least pass something valid when instancating this struct. - MUST_PASS(fData); - } - - IOBuf& operator=(const IOBuf&) = default; - IOBuf(const IOBuf&) = default; - - ~IOBuf() = default; - - public: - template - R operator->() const - { - return fData; - } - - template - R& operator[](Size index) const - { - return fData[index]; - } - - private: - T fData; - }; - - ///! @brief Device enum types. - enum - { - kDeviceTypeIDE, - kDeviceTypeEthernet, - kDeviceTypeWiFi, - kDeviceTypeFW, - kDeviceTypeBT, - kDeviceTypeRS232, - kDeviceTypeSCSI, - kDeviceTypeAHCI, - kDeviceTypeMBCI, - kDeviceTypeUSB, - kDeviceTypeMediaCtrl, // MM controller - kDeviceTypeCount, - }; -} // namespace NeOS diff --git a/dev/Kernel/KernelKit/DriveMgr.h b/dev/Kernel/KernelKit/DriveMgr.h deleted file mode 100644 index f5699dcb..00000000 --- a/dev/Kernel/KernelKit/DriveMgr.h +++ /dev/null @@ -1,191 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef INC_DRIVE_MANAGER_H -#define INC_DRIVE_MANAGER_H - -#include -#include -#include -#include -#include -#include -#include -#include - -#define kDriveMaxCount (4U) -#define kDriveSectorSz (512U) -#define kDriveInvalidID (-1) -#define kDriveNameLen (32) - -#define drv_sector_cnt(SIZE, SECTOR_SZ) (((SIZE) + (SECTOR_SZ)) / (SECTOR_SZ)) - -namespace NeOS -{ - enum - { - kInvalidDrive = -1, - - /// Storage types, combine with flags. - kBlockDevice = 0xAD, - kMassStorageDrive = 0xDA, - kFloppyDrive = 0xCD, - kOpticalDrive = 0xDC, // CD-ROM/DVD-ROM/Blu-Ray - kTapeDrive = 0xD7, - - /// Storage flags, combine with types. - kReadOnlyDrive = 0x10, // Read only drive - kEPMDrive = 0x11, // Explicit Partition Map. - kEPTDrive = 0x12, // ESP w/ EPM partition. - kMBRDrive = 0x13, // PC classic partition scheme - kGPTDrive = 0x14, // PC new partition scheme - kUnformattedDrive = 0x15, - kStorageCount = 9, - }; - - /// @brief Media drive trait type. - struct DriveTrait final - { - Char fName[kDriveNameLen]; // /System, /Boot, //./Devices/USB... - Int32 fKind; // fMassStorage, fFloppy, fOpticalDrive. - Int32 fFlags; // fReadOnly, fEPMDrive... - - /// @brief Packet drive (StorageKit compilant.) - struct DrivePacket final - { - VoidPtr fPacketContent{nullptr}; //! packet body. - Char fPacketMime[kDriveNameLen] = "*/*"; //! identify what we're sending. - SizeT fPacketSize{0UL}; //! packet size - UInt32 fPacketCRC32{0UL}; //! sanity crc, in case if good is set to false - Boolean fPacketGood{YES}; - Lba fPacketLba{0UL}; - Boolean fPacketReadOnly{NO}; - } fPacket; - - Lba fLbaStart{0}, fLbaEnd{0}; - SizeT fSectorSz{512}; - - Void (*fInput)(DrivePacket packet); - Void (*fOutput)(DrivePacket packet); - Void (*fVerify)(DrivePacket packet); - Void (*fInit)(DrivePacket packet); - const Char* (*fDriveKind)(Void); - }; - - ///! drive as a device. - typedef DriveTrait* DriveTraitPtr; - - /** - * @brief Mounted drives interface. - * @note This class has all of it's drive set to nullptr, allocate them using - * GetAddressOf(index). - */ - class MountpointInterface final - { - public: - explicit MountpointInterface() = default; - ~MountpointInterface() = default; - - NE_COPY_DEFAULT(MountpointInterface); - - public: - DriveTrait& A() - { - return mA; - } - - DriveTrait& B() - { - return mB; - } - - DriveTrait& C() - { - return mC; - } - - DriveTrait& D() - { - return mD; - } - - enum - { - kDriveIndexA = 0, - kDriveIndexB, - kDriveIndexC, - kDriveIndexD, - kDriveIndexInvalid, - }; - - DriveTraitPtr GetAddressOf(const Int32& index) - { - err_local_get() = kErrorSuccess; - - switch (index) - { - case kDriveIndexA: - return &mA; - case kDriveIndexB: - return &mB; - case kDriveIndexC: - return &mC; - case kDriveIndexD: - return &mD; - default: { - err_local_get() = kErrorNoSuchDisk; - kout << "No such disc letter.\n"; - - break; - } - } - - return nullptr; - } - - private: - DriveTrait mA, mB, mC, mD; - }; - - /// @brief Unimplemented drive. - /// @param pckt the packet to read. - /// @return - Void io_drv_unimplemented(DriveTrait::DrivePacket* pckt) noexcept; - - /// @brief Gets the drive kind (ATA, SCSI, AHCI...) - /// @param void none. - /// @return the drive kind (ATA, Flash, NVM) - const Char* io_drv_kind(Void); - - /// @brief Makes a new drive. - /// @return the new drive as a trait. - DriveTrait io_construct_blank_drive(Void) noexcept; - - /// @brief Fetches the main drive. - /// @return the new drive as a trait. - DriveTrait io_construct_main_drive(Void) noexcept; - - namespace Detect - { - Void io_detect_drive(DriveTrait& trait); - } - - /// @brief Read from newfs disk. - /// @param Mnt mounted interface. - /// @param DrvTrait drive info - /// @param DrvIndex drive index. - /// @return - Int32 fs_ifs_read(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex); - - /// @brief Write to ifs disk. - /// @param Mnt mounted interface. - /// @param DrvTrait drive info - /// @param DrvIndex drive index. - /// @return - Int32 fs_ifs_write(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex); -} // namespace NeOS - -#endif /* ifndef INC_DRIVE_MANAGER_H */ diff --git a/dev/Kernel/KernelKit/FileMgr.h b/dev/Kernel/KernelKit/FileMgr.h deleted file mode 100644 index 543a9ae4..00000000 --- a/dev/Kernel/KernelKit/FileMgr.h +++ /dev/null @@ -1,392 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss Labs, all rights reserved. - - File: FileMgr.h - Purpose: Kernel file manager. - -------------------------------------------- */ - -/* ------------------------------------------- - - Revision History: - - 31/01/24: Update documentation (amlel) - 05/07/24: NeFS support, and fork support, updated constants and specs - as well. - 18/01/25: Patches to FileStream class. - - ------------------------------------------- */ - -#ifndef INC_FILEMGR_H -#define INC_FILEMGR_H - -#ifdef __FSKIT_INCLUDES_NEFS__ -#include -#endif // __FSKIT_INCLUDES_NEFS__ - -#ifdef __FSKIT_INCLUDES_HPFS__ -#include -#endif // __FSKIT_INCLUDES_HPFS__ - -#include -#include -#include -#include -#include -#include -#include -#include - -/// @brief Filesystem manager, abstraction over mounted filesystem. -/// Works like the VFS or IFS. - -#define kRestrictR "r" -#define kRestrictRB "rb" -#define kRestrictW "w" -#define kRestrictWB "rw" -#define kRestrictRWB "rwb" - -#define kRestrictMax (5U) - -#define node_cast(PTR) reinterpret_cast(PTR) - -/** - @note Refer to first enum. -*/ -#define kFileOpsCount (4U) -#define kFileMimeGeneric "n-application-kind/all" - -/** @brief invalid position. (n-pos) */ -#define kNPos (SizeT)(-1); - -namespace NeOS -{ - enum - { - kFileWriteAll = 100, - kFileReadAll = 101, - kFileReadChunk = 102, - kFileWriteChunk = 103, - kFileIOCnt = (kFileWriteChunk - kFileWriteAll) + 1, - // file flags - kFileFlagRsrc = 104, - kFileFlagData = 105, - }; - - typedef VoidPtr NodePtr; - - /** - @brief Filesystem Mgr Interface class - @brief Used to provide common I/O for a specific filesystem. -*/ - class IFilesystemMgr - { - public: - explicit IFilesystemMgr() = default; - virtual ~IFilesystemMgr() = default; - - public: - NE_COPY_DEFAULT(IFilesystemMgr); - - public: - /// @brief Mounts a new filesystem into an active state. - /// @param interface the filesystem interface - /// @return - static bool Mount(IFilesystemMgr* interface); - - /// @brief Unmounts the active filesystem - /// @return - static IFilesystemMgr* Unmount(); - - /// @brief Getter, gets the active filesystem. - /// @return - static IFilesystemMgr* GetMounted(); - - public: - virtual NodePtr Create(_Input const Char* path) = 0; - virtual NodePtr CreateAlias(_Input const Char* path) = 0; - virtual NodePtr CreateDirectory(_Input const Char* path) = 0; - virtual NodePtr CreateSwapFile(const Char* path) = 0; - - public: - virtual bool Remove(_Input const Char* path) = 0; - - public: - 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 _Output VoidPtr Read(_Input NodePtr node, - _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; - - virtual _Output VoidPtr Read(_Input const Char* name, - _Input NodePtr node, - _Input Int32 flags, - _Input SizeT sz) = 0; - - public: - virtual bool Seek(_Input NodePtr node, _Input SizeT off) = 0; - - public: - virtual SizeT Tell(_Input NodePtr node) = 0; - virtual bool Rewind(_Input NodePtr node) = 0; - }; - -#ifdef __FSKIT_INCLUDES_NEFS__ - /** - * @brief Based of IFilesystemMgr, takes care of managing NeFS - * disks. - */ - class NeFileSystemMgr final : public IFilesystemMgr - { - public: - explicit NeFileSystemMgr(); - ~NeFileSystemMgr() override; - - public: - NE_COPY_DEFAULT(NeFileSystemMgr); - - public: - NodePtr Create(const Char* path) override; - NodePtr CreateAlias(const Char* path) override; - NodePtr CreateDirectory(const Char* path) override; - NodePtr CreateSwapFile(const Char* path) override; - - public: - bool Remove(_Input const Char* path) override; - NodePtr Open(_Input const Char* path, _Input const Char* r) override; - Void Write(_Input NodePtr node, _Input VoidPtr data, _Input Int32 flags, _Input SizeT sz) override; - VoidPtr Read(_Input NodePtr node, _Input Int32 flags, _Input SizeT sz) override; - bool Seek(_Input NodePtr node, _Input SizeT off) override; - SizeT Tell(_Input NodePtr node) override; - bool Rewind(_Input NodePtr node) override; - - Void Write(_Input const Char* name, - _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; - - public: - /// @brief Get NeFS parser class. - /// @return The filesystem parser class. - NeFileSystemParser* GetParser() noexcept; - - private: - NeFileSystemParser* mParser{nullptr}; - }; - -#endif // ifdef __FSKIT_INCLUDES_NEFS__ - - /** - * FileStream class. - * @tparam Encoding file encoding (char, wchar_t...) - * @tparam FSClass Filesystem contract who takes care of it. - */ - template - class FileStream final - { - public: - explicit FileStream(const Encoding* path, const Encoding* restrict_type); - ~FileStream(); - - public: - FileStream& operator=(const FileStream&); - FileStream(const FileStream&); - - public: - ErrorOr Write(const SizeT offset, const VoidPtr data, SizeT len) noexcept - { - if (this->fFileRestrict != kFileMgrRestrictReadWrite && - this->fFileRestrict != kFileMgrRestrictReadWriteBinary && - this->fFileRestrict != kFileMgrRestrictWrite && - this->fFileRestrict != kFileMgrRestrictWriteBinary) - return ErrorOr(kErrorInvalidData); - - if (data == nullptr) - return ErrorOr(kErrorInvalidData); - - auto man = FSClass::GetMounted(); - - if (man) - { - man->Write(offset, fFile, data, len); - return ErrorOr(0); - } - - return ErrorOr(kErrorInvalidData); - } - - ErrorOr Write(const Char* name, const VoidPtr data, SizeT len) noexcept - { - if (this->fFileRestrict != kFileMgrRestrictReadWrite && - this->fFileRestrict != kFileMgrRestrictReadWriteBinary && - this->fFileRestrict != kFileMgrRestrictWrite && - this->fFileRestrict != kFileMgrRestrictWriteBinary) - return ErrorOr(kErrorInvalidData); - - if (data == nullptr) - return ErrorOr(kErrorInvalidData); - - auto man = FSClass::GetMounted(); - - if (man) - { - man->Write(name, fFile, data, 0, len); - return ErrorOr(0); - } - - return ErrorOr(kErrorInvalidData); - } - - VoidPtr Read(const Char* name, const SizeT sz) noexcept - { - if (this->fFileRestrict != kFileMgrRestrictReadWrite && - this->fFileRestrict != kFileMgrRestrictReadWriteBinary && - this->fFileRestrict != kFileMgrRestrictRead && - this->fFileRestrict != kFileMgrRestrictReadBinary) - return nullptr; - - auto man = FSClass::GetMounted(); - - if (man) - { - VoidPtr ret = man->Read(name, fFile, kFileReadAll, 0); - return ret; - } - - return nullptr; - } - - VoidPtr Read(SizeT offset, const SizeT sz) - { - if (this->fFileRestrict != kFileMgrRestrictReadWrite && - this->fFileRestrict != kFileMgrRestrictReadWriteBinary && - this->fFileRestrict != kFileMgrRestrictRead && - this->fFileRestrict != kFileMgrRestrictReadBinary) - return nullptr; - - auto man = FSClass::GetMounted(); - - if (man) - { - man->Seek(fFile, offset); - auto ret = man->Read(fFile, kFileReadChunk, sz); - - return ret; - } - - return nullptr; - } - - public: - /// @brief Leak node pointer. - /// @return The node pointer. - NodePtr Leak() - { - return fFile; - } - - /// @brief Leak MIME. - /// @return The MIME. - Char* MIME() noexcept - { - return const_cast(fMime); - } - - enum - { - kFileMgrRestrictRead, - kFileMgrRestrictReadBinary, - kFileMgrRestrictWrite, - kFileMgrRestrictWriteBinary, - kFileMgrRestrictReadWrite, - kFileMgrRestrictReadWriteBinary, - }; - - private: - NodePtr fFile{nullptr}; - Int32 fFileRestrict{kFileMgrRestrictReadBinary}; - const Char* fMime{kFileMimeGeneric}; - }; - - using FileStreamUTF8 = FileStream; - using FileStreamUTF16 = FileStream; - - typedef UInt64 CursorType; - - inline static const auto kRestrictStrLen = 8U; - - /// @brief restrict information about the file descriptor. - struct FileRestrictKind final - { - Char fRestrict[kRestrictStrLen]; - Int32 fMappedTo; - }; - - /// @brief constructor - template - inline FileStream::FileStream(const Encoding* path, - const Encoding* restrict_type) - : fFile(Class::GetMounted()->Open(path, restrict_type)) - { - const SizeT kRestrictCount = kRestrictMax; - const FileRestrictKind kRestrictList[] = { - { - .fRestrict = kRestrictR, - .fMappedTo = kFileMgrRestrictRead, - }, - { - .fRestrict = kRestrictRB, - .fMappedTo = kFileMgrRestrictReadBinary, - }, - { - .fRestrict = kRestrictRWB, - .fMappedTo = kFileMgrRestrictReadWriteBinary, - }, - { - .fRestrict = kRestrictW, - .fMappedTo = kFileMgrRestrictWrite, - }, - { - .fRestrict = kRestrictWB, - .fMappedTo = kFileMgrRestrictReadWrite, - }}; - - for (SizeT index = 0; index < kRestrictCount; ++index) - { - if (rt_string_cmp(restrict_type, kRestrictList[index].fRestrict, - rt_string_len(kRestrictList[index].fRestrict)) == 0) - { - fFileRestrict = kRestrictList[index].fMappedTo; - break; - } - } - - kout << "new file: " << path << ".\r"; - } - - /// @brief destructor of the file stream. - template - inline FileStream::~FileStream() - { - mm_delete_heap(fFile); - } -} // namespace NeOS - -#endif // ifndef INC_FILEMGR_H diff --git a/dev/Kernel/KernelKit/HardwareThreadScheduler.h b/dev/Kernel/KernelKit/HardwareThreadScheduler.h deleted file mode 100644 index 1866686e..00000000 --- a/dev/Kernel/KernelKit/HardwareThreadScheduler.h +++ /dev/null @@ -1,149 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef __INC_MP_MANAGER_H__ -#define __INC_MP_MANAGER_H__ - -#include -#include -#include - -/// @note Last Rev Sun 28 Jul CET 2024 -/// @note Last Rev Thu, Aug 1, 2024 9:07:38 AM - -#define kMaxAPInsideSched (8U) - -namespace NeOS -{ - class HardwareThread; - class HardwareThreadScheduler; - - using ThreadID = UInt32; - - enum ThreadKind - { - kAPInvalid, - kAPSystemReserved, // System reserved thread, well user can't use it - kAPStandard, // user thread, cannot be used by Kernel - kAPRealTime, // fallback thread, cannot be used by user if not clear or - // used by Kernel. - kAPBoot, // The core we booted from, the mama. - kAPCount, - }; - - typedef enum ThreadKind ThreadKind; - typedef ThreadID ThreadID; - - /***********************************************************************************/ - /// - /// \name HardwareThread - /// \brief Abstraction over the CPU's core, used to run processes or threads. - /// - /***********************************************************************************/ - - class HardwareThread final - { - public: - explicit HardwareThread(); - ~HardwareThread(); - - public: - NE_COPY_DEFAULT(HardwareThread) - - public: - operator bool(); - - public: - void Wake(const bool wakeup = false) noexcept; - void Busy(const bool busy = false) noexcept; - - public: - bool Switch(VoidPtr image, Ptr8 stack_ptr, HAL::StackFramePtr frame, const ThreadID& pid); - bool IsWakeup() noexcept; - - public: - HAL::StackFramePtr StackFrame() noexcept; - const ThreadKind& Kind() noexcept; - bool IsBusy() noexcept; - const ThreadID& ID() noexcept; - - private: - HAL::StackFramePtr fStack{nullptr}; - ThreadKind fKind{ThreadKind::kAPStandard}; - ThreadID fID{0}; - ThreadID fPID{0}; - Bool fWakeup{NO}; - Bool fBusy{NO}; - UInt64 fPTime{0}; - - private: - friend class HardwareThreadScheduler; - friend class UserProcessHelper; - }; - - /// - /// \name HardwareThreadScheduler - /// \brief Class to manage the thread scheduling. - /// - - class HardwareThreadScheduler final : public ISchedulable - { - private: - friend class UserProcessHelper; - - public: - explicit HardwareThreadScheduler(); - ~HardwareThreadScheduler(); - NE_COPY_DEFAULT(HardwareThreadScheduler); - - public: - HAL::StackFramePtr Leak() noexcept; - - public: - Ref operator[](const SizeT& idx); - bool operator!() noexcept; - operator bool() noexcept; - - const Bool IsUser() override - { - return Yes; - } - - const Bool IsKernel() override - { - return No; - } - - const Bool HasMP() override - { - return kHandoverHeader->f_HardwareTables.f_MultiProcessingEnabled; - } - - public: - /// @brief Shared instance of the MP Mgr. - /// @return the reference to the mp manager class. - STATIC HardwareThreadScheduler& The(); - - public: - /// @brief Returns the amount of threads present in the system. - /// @returns SizeT the amount of cores present. - SizeT Capacity() noexcept; - - private: - Array fThreadList; - ThreadID fCurrentThread{0}; - }; - - /// @brief wakes up thread. - /// wakes up thread from hang. - Void mp_wakeup_thread(HAL::StackFramePtr stack); - - /// @brief makes thread sleep. - /// hooks and hangs thread to prevent code from executing. - Void mp_hang_thread(HAL::StackFramePtr stack); -} // namespace NeOS - -#endif // !__INC_MP_MANAGER_H__ diff --git a/dev/Kernel/KernelKit/IDylibObject.h b/dev/Kernel/KernelKit/IDylibObject.h deleted file mode 100644 index c872b86f..00000000 --- a/dev/Kernel/KernelKit/IDylibObject.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * ======================================================== - * - * Kernel - * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - * - * ======================================================== - */ - -#pragma once - -#include -#include - -#define NE_DYLIB_OBJECT : public IDylibObject - -namespace NeOS -{ - /// @brief DLL class object. A handle to a shared library. - class IDylibObject - { - public: - explicit IDylibObject() = default; - virtual ~IDylibObject() = default; - - struct DLL_TRAITS final - { - VoidPtr ImageObject{nullptr}; - VoidPtr ImageEntrypointOffset{nullptr}; - - Bool IsValid() - { - return ImageObject && ImageEntrypointOffset; - } - }; - - NE_COPY_DEFAULT(IDylibObject); - - virtual DLL_TRAITS** GetAddressOf() = 0; - virtual DLL_TRAITS* Get() = 0; - - virtual Void Mount(DLL_TRAITS* to_mount) = 0; - virtual Void Unmount() = 0; - }; - - /// @brief Pure implementation, missing method/function handler. - EXTERN_C void __zka_pure_call(void); -} // namespace NeOS diff --git a/dev/Kernel/KernelKit/IPEFDylibObject.h b/dev/Kernel/KernelKit/IPEFDylibObject.h deleted file mode 100644 index 20f87410..00000000 --- a/dev/Kernel/KernelKit/IPEFDylibObject.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * ======================================================== - * - * Kernel - * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - * - * ======================================================== - */ - -#ifndef __KERNELKIT_SHARED_OBJECT_H__ -#define __KERNELKIT_SHARED_OBJECT_H__ - -#include -#include -#include -#include -#include - -namespace NeOS -{ - /** - * @brief Shared Library class - * Load library from this class - */ - class IPEFDylibObject final NE_DYLIB_OBJECT - { - public: - explicit IPEFDylibObject() = default; - ~IPEFDylibObject() = default; - - public: - NE_COPY_DEFAULT(IPEFDylibObject); - - private: - DLL_TRAITS* fMounted{nullptr}; - - public: - DLL_TRAITS** GetAddressOf() - { - return &fMounted; - } - - DLL_TRAITS* Get() - { - return fMounted; - } - - public: - void Mount(DLL_TRAITS* to_mount) - { - if (!to_mount || !to_mount->ImageObject) - return; - - fMounted = to_mount; - - if (fLoader && to_mount) - { - delete fLoader; - fLoader = nullptr; - } - - if (!fLoader) - { - fLoader = new PEFLoader(fMounted->ImageObject); - } - } - - void Unmount() - { - if (fMounted) - fMounted = nullptr; - }; - - template - SymbolType Load(const Char* symbol_name, SizeT len, Int32 kind) - { - if (symbol_name == nullptr || *symbol_name == 0) - return nullptr; - if (len > kPathLen || len < 1) - return nullptr; - - auto ret = - reinterpret_cast(fLoader->FindSymbol(symbol_name, kind)); - - if (!ret) - { - if (kind == kPefCode) - return (VoidPtr)&__zka_pure_call; - - return nullptr; - } - - return ret; - } - - private: - PEFLoader* fLoader{nullptr}; - }; - - typedef IPEFDylibObject* IDylibRef; - - EXTERN_C IDylibRef rtl_init_dylib(UserProcess& header); - EXTERN_C Void rtl_fini_dylib(UserProcess& header, IDylibRef lib, Bool* successful); -} // namespace NeOS - -#endif /* ifndef __KERNELKIT_SHARED_OBJECT_H__ */ diff --git a/dev/Kernel/KernelKit/LPC.h b/dev/Kernel/KernelKit/LPC.h deleted file mode 100644 index d76eeff1..00000000 --- a/dev/Kernel/KernelKit/LPC.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -/// @file LPC.h -/// @brief Local Process Codes. - -#define err_local_ok() (NeOS::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode() == NeOS::kErrorSuccess) -#define err_local_fail() (NeOS::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode() != NeOS::kErrorSuccess) -#define err_local_get() (NeOS::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode()) - -#define err_global_ok() (NeOS::kErrorLocalNumber == NeOS::kErrorSuccess) -#define err_global_fail() (NeOS::kErrorLocalNumber != NeOS::kErrorSuccess) -#define err_global_get() (NeOS::kErrorLocalNumber) - -namespace NeOS -{ - typedef Int32 HError; - - inline HError kErrorLocalNumber = 0UL; - - inline constexpr HError kErrorSuccess = 0; - inline constexpr HError kErrorExecutable = 33; - inline constexpr HError kErrorExecutableLib = 34; - 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 kErrorIPC = 59; - inline constexpr HError kErrorSign = 60; - inline constexpr HError kErrorInvalidCreds = 61; - inline constexpr HError kErrorCDTrayBroken = 62; - inline constexpr HError kErrorUnrecoverableDisk = 63; - inline constexpr HError kErrorFileLocked = 64; - inline constexpr HError kErrorUnimplemented = -1; - - /// @brief Raises a bug check stop code. - Void err_bug_check_raise(Void) noexcept; - - /// @brief Does a system wide bug check. - /// @param void no params are needed. - /// @return if error-free: false, otherwise true. - Boolean err_bug_check(Void) noexcept; -} // namespace NeOS diff --git a/dev/Kernel/KernelKit/LoaderInterface.h b/dev/Kernel/KernelKit/LoaderInterface.h deleted file mode 100644 index b81dfa16..00000000 --- a/dev/Kernel/KernelKit/LoaderInterface.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include -#include - -namespace NeOS -{ - /// @brief This interface is used to make loader contracts (MSCOFF, PEF). - /// @author @Amlal-El-Mahrouss - class LoaderInterface - { - public: - explicit LoaderInterface() = default; - virtual ~LoaderInterface() = default; - - NE_COPY_DEFAULT(LoaderInterface); - - public: - virtual _Output ErrorOr GetBlob() = 0; - virtual _Output const Char* AsString() = 0; - virtual _Output const Char* MIME() = 0; - virtual _Output const Char* Path() = 0; - virtual _Output ErrorOr FindStart() = 0; - virtual _Output VoidPtr FindSymbol(_Input const Char* name, _Input Int32 kind) = 0; - }; -} // namespace NeOS diff --git a/dev/Kernel/KernelKit/LockDelegate.h b/dev/Kernel/KernelKit/LockDelegate.h deleted file mode 100644 index a657caa0..00000000 --- a/dev/Kernel/KernelKit/LockDelegate.h +++ /dev/null @@ -1,69 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include - -namespace NeOS -{ - enum - { - kLockDone = 200, - kLockTimedOut, - }; - - /// @brief Lock condition pointer. - typedef Boolean* LockPtr; - - /// @brief Locking delegate class, hangs until limit. - /// @tparam N the amount of cycles to wait. - template - class LockDelegate final - { - public: - LockDelegate() = delete; - - public: - explicit LockDelegate(LockPtr expr) - { - auto spin = 0U; - - while (spin < N) - { - if (*expr) - { - fLockStatus | kLockDone; - break; - } - - ++spin; - } - - if (spin > N) - fLockStatus | kLockTimedOut; - } - - ~LockDelegate() = default; - - LockDelegate& operator=(const LockDelegate&) = delete; - LockDelegate(const LockDelegate&) = delete; - - bool Done() - { - return fLockStatus[kLockDone] == kLockDone; - } - - bool HasTimedOut() - { - return fLockStatus[kLockTimedOut] != kLockTimedOut; - } - - private: - Atom fLockStatus; - }; -} // namespace NeOS diff --git a/dev/Kernel/KernelKit/MBCI/.keep b/dev/Kernel/KernelKit/MBCI/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Kernel/KernelKit/MSDOS.h b/dev/Kernel/KernelKit/MSDOS.h deleted file mode 100644 index 1a3df13b..00000000 --- a/dev/Kernel/KernelKit/MSDOS.h +++ /dev/null @@ -1,52 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: MSDOS.h - Purpose: MS-DOS header for Kernel. - - Revision History: - - 30/01/24: Added file (amlel) - -------------------------------------------- */ - -#ifndef __MSDOS_EXEC__ -#define __MSDOS_EXEC__ - -#include -#include - -// Last Rev -// Sat Feb 24 CET 2024 - -#define kMagMz0 'M' -#define kMagMz1 'Z' - -typedef NeOS::UInt32 DosWord; -typedef NeOS::Long DosLong; - -typedef struct _DosHeader -{ - NeOS::UInt8 eMagic[2]; - DosWord eMagLen; - DosWord ePagesCount; - DosWord eCrlc; - DosWord eCParHdr; - DosWord eMinAlloc; - DosWord eMaxAlloc; - DosWord eStackSeg; - DosWord eStackPtr; - DosWord eChksum; - DosWord eIp; - DosWord eCs; - DosWord eLfarlc; - DosWord eOvno; - DosWord eRes[4]; - DosWord eOemid; - DosWord eOeminfo; - DosWord eRes2[10]; - DosLong eLfanew; -} DosHeader, *DosHeaderPtr; - -#endif /* ifndef __MSDOS_EXEC__ */ diff --git a/dev/Kernel/KernelKit/MemoryMgr.h b/dev/Kernel/KernelKit/MemoryMgr.h deleted file mode 100644 index ac12587f..00000000 --- a/dev/Kernel/KernelKit/MemoryMgr.h +++ /dev/null @@ -1,87 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef INC_KERNEL_HEAP_H -#define INC_KERNEL_HEAP_H - -/// @date 30/01/24 -/// @file: MemoryMgr.h -/// @brief: heap allocation support. - -#include -#include -#include - -namespace NeOS -{ - /// @brief Declare pointer as free. - /// @param heap_ptr the pointer. - /// @return a status code regarding the deallocation. - Int32 mm_delete_heap(VoidPtr heap_ptr); - - /// @brief Declare a new size for heap_ptr. - /// @param heap_ptr the pointer. - /// @return unsupported always returns nullptr. - VoidPtr mm_realloc_heap(VoidPtr heap_ptr, SizeT new_sz); - - /// @brief Check if pointer is a valid Kernel pointer. - /// @param heap_ptr the pointer - /// @return if it exists it returns true. - Boolean mm_is_valid_heap(VoidPtr heap_ptr); - - /// @brief Allocate chunk of memory. - /// @param sz Size of pointer - /// @param wr Read Write bit. - /// @param user User enable bit. - /// @return The newly allocated pointer, or nullptr. - VoidPtr mm_new_heap(const SizeT sz, const Bool wr, const Bool user); - - /// @brief Protect the heap with a CRC value. - /// @param heap_ptr pointer. - /// @return if it valid: point has crc now., otherwise fail. - Boolean mm_protect_heap(VoidPtr heap_ptr); - - /// @brief Makes a Kernel page. - /// @param heap_ptr the page pointer. - /// @return status code - Int32 mm_make_page(VoidPtr heap_ptr); - - /// @brief Overwrites and set the flags of a heap header. - /// @param heap_ptr the pointer to update. - /// @param flags the flags to set. - Int32 mm_make_flags(VoidPtr heap_ptr, UInt64 flags); - - /// @brief Gets the flags of a heap header. - /// @param heap_ptr the pointer to get. - UInt64 mm_get_flags(VoidPtr heap_ptr); - - /// @brief Allocate C++ class. - /// @param cls The class to allocate. - /// @param args The args to pass. - template - inline BOOL mm_new_class(_Input _Output T** cls, _Input Args&&... args) - { - if (*cls) - { - err_global_get() = NeOS::kErrorInvalidData; - return NO; - } - - *cls = new T(move(args)...); - return *cls; - } - - /// @brief Delete and nullify C++ class. - /// @param cls The class to delete. - template - inline Void mm_delete_class(_Input _Output T** cls) - { - delete *cls; - *cls = nullptr; - } -} // namespace NeOS - -#endif // !INC_KERNEL_HEAP_H diff --git a/dev/Kernel/KernelKit/PCI/DMA.h b/dev/Kernel/KernelKit/PCI/DMA.h deleted file mode 100644 index 68f3fa37..00000000 --- a/dev/Kernel/KernelKit/PCI/DMA.h +++ /dev/null @@ -1,81 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include -#include -#include - -namespace NeOS -{ - enum class DmaKind - { - PCI, // Bus mastering is required to be turned on. Basiaclly a request - // control system. 64-Bit access depends on the PAE bit and the device - // (if Double Address Cycle is available) - ISA, // Four DMA channels 0-3; 8 bit transfers and only a megabyte of RAM. - Invalid, - }; - - class DMAWrapper final - { - public: - explicit DMAWrapper() = delete; - - public: - explicit DMAWrapper(nullPtr) = delete; - explicit DMAWrapper(voidPtr Ptr, DmaKind Kind = DmaKind::PCI) - : fAddress(Ptr), fKind(Kind) - { - } - - public: - DMAWrapper& operator=(voidPtr Ptr); - - public: - DMAWrapper& operator=(const DMAWrapper&) = default; - DMAWrapper(const DMAWrapper&) = default; - - public: - ~DMAWrapper() = default; - - template - T* operator->(); - - template - T* Get(const UIntPtr off = 0); - - public: - operator bool(); - bool operator!(); - - public: - bool Write(const UIntPtr& bit, const UInt32& offset); - UIntPtr Read(const UInt32& offset); - Boolean Check(UIntPtr offset) const; - - public: - UIntPtr operator[](const UIntPtr& offset); - - private: - voidPtr fAddress{nullptr}; - DmaKind fKind{DmaKind::Invalid}; - - private: - friend class DMAFactory; - }; - - class DMAFactory final - { - public: - static OwnPtr> Construct(OwnPtr& dma); - }; -} // namespace NeOS - -#include diff --git a/dev/Kernel/KernelKit/PCI/DMA.inl b/dev/Kernel/KernelKit/PCI/DMA.inl deleted file mode 100644 index d9c6e551..00000000 --- a/dev/Kernel/KernelKit/PCI/DMA.inl +++ /dev/null @@ -1,20 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -namespace NeOS -{ - template - T* DMAWrapper::operator->() - { - return this->fAddress; - } - - template - T* DMAWrapper::Get(const UIntPtr offset) - { - return reinterpret_cast((UIntPtr)this->fAddress + offset); - } -} // namespace NeOS diff --git a/dev/Kernel/KernelKit/PCI/Database.h b/dev/Kernel/KernelKit/PCI/Database.h deleted file mode 100644 index cb12a731..00000000 --- a/dev/Kernel/KernelKit/PCI/Database.h +++ /dev/null @@ -1,58 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ -#pragma once - -#include -#include - -namespace NeOS -{ - namespace Types - { - // https://wiki.osdev.org/PCI - enum class PciDeviceKind : UChar - { - MassStorageController = 0x1, - NetworkController = 0x2, - DisplayController = 0x3, - MultimediaController = 0x4, - MemoryController = 0x5, - Bridge = 0x6, - CommunicationController = 0x7, - GenericSystemPeripheral = 0x8, - InputDeviceController = 0x9, - DockingStation = 0xa, - Processor = 0xb, - SerialBusController = 0xc, - WirelessController = 0xd, - IntelligentController = 0xe, - SatelliteCommunicationsController = 0xf, - CoProcessor = 0x40, - Unassgined = 0xf, - Invalid = Unassgined, - }; - } // namespace Types -} // namespace NeOS - -inline BOOL operator!=(const NeOS::Types::PciDeviceKind& lhs, NeOS::UChar rhs) -{ - return rhs != (NeOS::UChar)lhs; -} - -inline BOOL operator==(const NeOS::Types::PciDeviceKind& lhs, NeOS::UChar rhs) -{ - return rhs == (NeOS::UChar)lhs; -} - -inline BOOL operator!=(NeOS::UChar lhs, const NeOS::Types::PciDeviceKind& rhs) -{ - return lhs != (NeOS::UChar)rhs; -} - -inline BOOL operator==(NeOS::UChar lhs, const NeOS::Types::PciDeviceKind& rhs) -{ - return lhs == (NeOS::UChar)rhs; -} \ No newline at end of file diff --git a/dev/Kernel/KernelKit/PCI/Device.h b/dev/Kernel/KernelKit/PCI/Device.h deleted file mode 100644 index 9870f618..00000000 --- a/dev/Kernel/KernelKit/PCI/Device.h +++ /dev/null @@ -1,81 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ -#pragma once - -#include - -namespace NeOS::PCI -{ - enum class PciConfigKind : UShort - { - ConfigAddress = 0xCF8, - ConfigData = 0xCFC, - CommandReg = 0x0004, - Invalid = 0xFFFF, - }; - - class Device final - { - public: - Device() = default; - - public: - explicit Device(UShort bus, UShort device, UShort function, UInt32 bar); - - Device& operator=(const Device&) = default; - - Device(const Device&) = default; - - ~Device(); - - public: - UInt Read(UInt bar, Size szData); - void Write(UInt bar, UIntPtr data, Size szData); - - public: - operator bool(); - - public: - template - UInt Read(UInt bar) - { - static_assert(sizeof(T) <= 4, "64-bit PCI addressing is unsupported"); - return Read(bar, sizeof(T)); - } - - template - void Write(UInt bar, UIntPtr data) - { - static_assert(sizeof(T) <= 4, "64-bit PCI addressing is unsupported"); - Write(bar, data, sizeof(T)); - } - - public: - UShort DeviceId(); - UShort VendorId(); - UShort InterfaceId(); - UChar Class(); - UChar Subclass(); - UChar ProgIf(); - UChar HeaderType(); - UIntPtr Bar(UInt32 bar_in); - - public: - void EnableMmio(UInt32 bar_in); - void BecomeBusMaster(UInt32 bar_in); // for PCI-DMA, PC-DMA does not need that. - - UShort Vendor(); - - private: - UShort fBus; - UShort fDevice; - UShort fFunction; - UInt32 fBar; - }; -} // namespace NeOS::PCI - -EXTERN_C void NewOSPCISetCfgTarget(NeOS::UInt bar); -EXTERN_C NeOS::UInt NewOSPCIReadRaw(NeOS::UInt bar); diff --git a/dev/Kernel/KernelKit/PCI/Express.h b/dev/Kernel/KernelKit/PCI/Express.h deleted file mode 100644 index c437a1cb..00000000 --- a/dev/Kernel/KernelKit/PCI/Express.h +++ /dev/null @@ -1,12 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include - -#define PCI_EXPRESS_BUS_COUNT (4096) diff --git a/dev/Kernel/KernelKit/PCI/IO.h b/dev/Kernel/KernelKit/PCI/IO.h deleted file mode 100644 index 1d60df8e..00000000 --- a/dev/Kernel/KernelKit/PCI/IO.h +++ /dev/null @@ -1,75 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include -#include - -namespace NeOS -{ - template - class IOArray final - { - public: - IOArray() = delete; - - IOArray(nullPtr) = delete; - - explicit IOArray(Array& ports) - : fPorts(ports) - { - } - - ~IOArray() - { - } - - IOArray& operator=(const IOArray&) = default; - - IOArray(const IOArray&) = default; - - operator bool() - { - return !fPorts.Empty(); - } - - public: - template - T In(SizeT index); - - template - void Out(SizeT index, T value); - - private: - Array fPorts; - }; - - inline constexpr UInt16 kMaxPorts = 16; - - using IOArray16 = IOArray; - - template - inline Array make_ports(UShort base) - { - Array ports; - - for (UShort i = 0; i < Sz; ++i) - { - ports[i] = base + i; - } - - return ports; - } -} // namespace NeOS - -#ifdef __x86_64__ -#include -#else -#error Please provide platform specific code for the I/O -#endif // ifdef __x86_64__ diff --git a/dev/Kernel/KernelKit/PCI/IOArray+AMD64.inl b/dev/Kernel/KernelKit/PCI/IOArray+AMD64.inl deleted file mode 100644 index 2630fa98..00000000 --- a/dev/Kernel/KernelKit/PCI/IOArray+AMD64.inl +++ /dev/null @@ -1,54 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: IO-Impl-AMD64.h - Purpose: I/O for AMD64. - - Revision History: - - 30/01/24: Add file. (amlel) - 02/02/24: Update I/O routines. (amlel) - -------------------------------------------- */ - -namespace NeOS -{ - template - template - T IOArray::In(SizeT index) - { - switch (sizeof(T)) - { -#ifdef __NE_AMD64__ - case 4: - return HAL::rt_in32(fPorts[index].Leak()); - case 2: - return HAL::rt_in16(fPorts[index].Leak()); - case 1: - return HAL::rt_in8(fPorts[index].Leak()); -#endif - default: - return 0xFFFF; - } - } - - template - template - void IOArray::Out(SizeT index, T value) - { - switch (sizeof(T)) - { -#ifdef __NE_AMD64__ - case 4: - HAL::rt_out32(fPorts[index].Leak(), value); - case 2: - HAL::rt_out16(fPorts[index].Leak(), value); - case 1: - HAL::rt_out8(fPorts[index].Leak(), value); -#endif - default: - break; - } - } -} // namespace NeOS \ No newline at end of file diff --git a/dev/Kernel/KernelKit/PCI/Iterator.h b/dev/Kernel/KernelKit/PCI/Iterator.h deleted file mode 100644 index 2a788450..00000000 --- a/dev/Kernel/KernelKit/PCI/Iterator.h +++ /dev/null @@ -1,43 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef __PCI_ITERATOR_H__ -#define __PCI_ITERATOR_H__ - -#include -#include -#include -#include -#include - -#define NE_BUS_COUNT (256) -#define NE_DEVICE_COUNT (33) -#define NE_FUNCTION_COUNT (8) - -namespace NeOS::PCI -{ - class Iterator final - { - public: - Iterator() = delete; - - public: - explicit Iterator(const Types::PciDeviceKind& deviceType); - - Iterator& operator=(const Iterator&) = default; - Iterator(const Iterator&) = default; - - ~Iterator(); - - public: - Ref operator[](const Size& sz); - - private: - Array fDevices; - }; -} // namespace NeOS::PCI - -#endif // __PCI_ITERATOR_H__ diff --git a/dev/Kernel/KernelKit/PCI/PCI.h b/dev/Kernel/KernelKit/PCI/PCI.h deleted file mode 100644 index 7eec9ec1..00000000 --- a/dev/Kernel/KernelKit/PCI/PCI.h +++ /dev/null @@ -1,59 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -#define kPCIConfigAddressPort (0xCF8) -#define kPCIConfigDataPort (0xCFC) - -#define kPCIDeviceCount (32) -#define kPCIFuncCount (8) -#define kPCIBusCount (256U) - -namespace NeOS::PCI -{ - // model - struct DeviceHeader - { - UInt16 VendorId; - UInt16 DeviceId; - UInt8 Command; - UInt8 Status; - UInt8 RevisionId; - UInt8 ProgIf; - UInt8 SubClass; - UInt8 Class; - UInt8 CacheLineSz; - UInt8 LatencyTimer; - UInt8 HeaderType; - UInt8 Bist; - UInt8 Bus; - UInt8 Device; - UInt8 Function; - }; - - namespace Detail - { - class BAR - { - public: - UIntPtr BAR; - SizeT Size; - }; - } // namespace Detail - - class BAR - { - public: - Detail::BAR BAR1; - Detail::BAR BAR2; - Detail::BAR BAR3; - Detail::BAR BAR4; - Detail::BAR BAR5; - }; -} // namespace NeOS::PCI diff --git a/dev/Kernel/KernelKit/PE.h b/dev/Kernel/KernelKit/PE.h deleted file mode 100644 index dbcf2ded..00000000 --- a/dev/Kernel/KernelKit/PE.h +++ /dev/null @@ -1,143 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: PE.h - Purpose: Portable Executable for Kernel. - - Revision History: - - 30/01/24: Added file (amlel) - -------------------------------------------- */ - -#ifndef __KERNELKIT_INC_PE_H__ -#define __KERNELKIT_INC_PE_H__ - -#include - -#define kPeSignature 0x00004550 - -#define kPeDLLBase 0x4000000 -#define kPeEXEBase 0x1000000 - -#define kPeMagic32 0x010b -#define kPeMagic64 0x020b - -#define kPeMachineAMD64 0x8664 -#define kPeMachineARM64 0xaa64 - -typedef struct LDR_EXEC_HEADER final -{ - NeOS::UInt32 Signature; - NeOS::UInt16 Machine; - NeOS::UInt16 NumberOfSections; - NeOS::UInt32 TimeDateStamp; - NeOS::UInt32 PointerToSymbolTable; - NeOS::UInt32 NumberOfSymbols; - NeOS::UInt16 SizeOfOptionalHeader; - NeOS::UInt16 Characteristics; -} LDR_EXEC_HEADER, *LDR_EXEC_HEADER_PTR; - -typedef struct LDR_OPTIONAL_HEADER final -{ - NeOS::UInt16 Magic; // 0x010b - PE32, 0x020b - PE32+ (64 bit) - NeOS::UInt8 MajorLinkerVersion; - NeOS::UInt8 MinorLinkerVersion; - NeOS::UInt32 SizeOfCode; - NeOS::UInt32 SizeOfInitializedData; - NeOS::UInt32 SizeOfUninitializedData; - NeOS::UInt32 AddressOfEntryPoint; - NeOS::UInt32 BaseOfCode; - NeOS::UInt32 BaseOfData; - NeOS::UInt32 ImageBase; - NeOS::UInt32 SectionAlignment; - NeOS::UInt32 FileAlignment; - NeOS::UInt16 MajorOperatingSystemVersion; - NeOS::UInt16 MinorOperatingSystemVersion; - NeOS::UInt16 MajorImageVersion; - NeOS::UInt16 MinorImageVersion; - NeOS::UInt16 MajorSubsystemVersion; - NeOS::UInt16 MinorSubsystemVersion; - NeOS::UInt32 Win32VersionValue; - NeOS::UInt32 SizeOfImage; - NeOS::UInt32 SizeOfHeaders; - NeOS::UInt32 CheckSum; - NeOS::UInt16 Subsystem; - NeOS::UInt16 DllCharacteristics; - NeOS::UInt32 SizeOfStackReserve; - NeOS::UInt32 SizeOfStackCommit; - NeOS::UInt32 SizeOfHeapReserve; - NeOS::UInt32 SizeOfHeapCommit; - NeOS::UInt32 LoaderFlags; - NeOS::UInt32 NumberOfRvaAndSizes; -} LDR_OPTIONAL_HEADER, *LDR_OPTIONAL_HEADER_PTR; - -typedef struct LDR_SECTION_HEADER final -{ - NeOS::Char Name[8]; - NeOS::UInt32 VirtualSize; - NeOS::UInt32 VirtualAddress; - NeOS::UInt32 SizeOfRawData; - NeOS::UInt32 PointerToRawData; - NeOS::UInt32 PointerToRelocations; - NeOS::UInt32 PointerToLineNumbers; - NeOS::UInt16 NumberOfRelocations; - NeOS::UInt16 NumberOfLinenumbers; - NeOS::UInt32 Characteristics; -} LDR_SECTION_HEADER, *LDR_SECTION_HEADER_PTR; - -enum kExecDataDirParams -{ - kExecExport, - kExecImport, - kExecInvalid, - kExecCount, -}; - -typedef struct LDR_EXPORT_DIRECTORY -{ - NeOS::UInt32 Characteristics; - NeOS::UInt32 TimeDateStamp; - NeOS::UInt16 MajorVersion; - NeOS::UInt16 MinorVersion; - NeOS::UInt32 Name; - NeOS::UInt32 Base; - NeOS::UInt32 NumberOfFunctions; - NeOS::UInt32 NumberOfNames; - NeOS::UInt32 AddressOfFunctions; // export table rva - NeOS::UInt32 AddressOfNames; - NeOS::UInt32 AddressOfNameOrdinal; // ordinal table rva -} LDR_EXPORT_DIRECTORY, *LDR_EXPORT_DIRECTORY_PTR; - -typedef struct LDR_IMPORT_DIRECTORY -{ - union { - NeOS::UInt32 Characteristics; - NeOS::UInt32 OriginalFirstThunk; - }; - NeOS::UInt32 TimeDateStamp; - NeOS::UInt32 ForwarderChain; - NeOS::UInt32 NameRva; - NeOS::UInt32 ThunkTableRva; -} LDR_IMPORT_DIRECTORY, *LDR_IMPORT_DIRECTORY_PTR; - -typedef struct LDR_DATA_DIRECTORY -{ - NeOS::UInt32 VirtualAddress; - NeOS::UInt32 Size; -} LDR_DATA_DIRECTORY, *LDR_DATA_DIRECTORY_PTR; - -typedef struct LDR_IMAGE_HEADER -{ - LDR_EXEC_HEADER Header; - LDR_OPTIONAL_HEADER OptHdr; -} LDR_IMAGE_HEADER, *LDR_IMAGE_HEADER_PTR; - -enum -{ - kUserSection = 0x00000020, - kPEResourceId = 0xFFaadd00, -}; - -#endif /* ifndef __KERNELKIT_INC_PE_H__ */ diff --git a/dev/Kernel/KernelKit/PECodeMgr.h b/dev/Kernel/KernelKit/PECodeMgr.h deleted file mode 100644 index 1e445b9f..00000000 --- a/dev/Kernel/KernelKit/PECodeMgr.h +++ /dev/null @@ -1,24 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: PECodeMgr.h - Purpose: PE32+ Code Mgr and DLL mgr. - - Revision History: - - 12/02/24: Added file (amlel) - -------------------------------------------- */ - -#pragma once - -//////////////////////////////////////////////////// - -// LAST REV: Mon Feb 12 13:52:01 CET 2024 - -//////////////////////////////////////////////////// - -#include -#include -#include diff --git a/dev/Kernel/KernelKit/PEF.h b/dev/Kernel/KernelKit/PEF.h deleted file mode 100644 index dfdaed12..00000000 --- a/dev/Kernel/KernelKit/PEF.h +++ /dev/null @@ -1,117 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: PEF.h - Purpose: Preferred Executable Format for Kernel. - - Revision History: - - ?/?/23: Added file (amlel) - -------------------------------------------- */ - -#ifndef KERNELKIT_PEF_H -#define KERNELKIT_PEF_H - -#include -#include -#include - -#define kPefMagic "Joy!" -#define kPefMagicFat "yoJ!" - -#define kPefMagicLen 5 - -#define kPefVersion 3 -#define kPefNameLen 256U - -/* not mandatory, only for non fork based filesystems. */ -#define kPefExt ".o" -#define kPefDylibExt ".dylib" -#define kPefLibExt ".lib" -#define kPefObjectExt ".obj" -#define kPefDebugExt ".dbg" -#define kPefDriverExt ".sys" - -// Kernel System Binary Interface. -#define kPefAbi (0x5046) - -#define kPefBaseOrigin (0x40000000) - -#define kPefStart "__ImageStart" - -#define kPefForkKind kPefMagic -#define kPefForkKindFAT kPefMagicFat - -namespace NeOS -{ - enum - { - kPefArchIntel86S, - kPefArchAMD64, - kPefArchRISCV, - kPefArch64x0, /* 64x0. ISA */ - kPefArch32x0, /* 32x0. ISA */ - kPefArchPowerPC, - kPefArchARM64, - kPefArchCount = (kPefArchPowerPC - kPefArchIntel86S) + 1, - kPefArchInvalid = 0xFF, - }; - - enum - { - kPefSubArchAMD, - kPefSubArchIntel, - kPefSubArchARM, - kPefSubArchGeneric, - kPefSubArchIBM, - }; - - enum - { - kPefKindExec = 1, /* .o */ - kPefKindDylib = 2, /* .dylib */ - kPefKindObject = 4, /* .obj */ - kPefKindDebug = 5, /* .dbg */ - kPefKindDriver = 6, - kPefKindCount, - }; - - typedef struct PEFContainer final - { - Char Magic[kPefMagicLen]; - UInt32 Linker; - UInt32 Version; - UInt32 Kind; - UInt32 Abi; - UInt32 Cpu; - UInt32 SubCpu; /* Cpu specific information */ - UIntPtr Start; - SizeT HdrSz; /* Size of header */ - SizeT Count; /* container header count */ - } PACKED PEFContainer; - - /* First PEFCommandHeader starts after PEFContainer */ - - typedef struct PEFCommandHeader final - { - Char Name[kPefNameLen]; /* container name */ - UInt32 Cpu; /* container cpu */ - UInt32 SubCpu; /* container sub-cpu */ - UInt32 Flags; /* container flags */ - UInt16 Kind; /* container kind */ - UIntPtr Offset; /* content offset */ - SizeT Size; /* content Size */ - } PACKED PEFCommandHeader; - - enum - { - kPefCode = 0xC, - kPefData = 0xD, - kPefZero = 0xE, - kPefLinkerID = 0x1, - }; -} // namespace NeOS - -#endif /* ifndef KERNELKIT_PEF_H */ diff --git a/dev/Kernel/KernelKit/PEFCodeMgr.h b/dev/Kernel/KernelKit/PEFCodeMgr.h deleted file mode 100644 index 47aea432..00000000 --- a/dev/Kernel/KernelKit/PEFCodeMgr.h +++ /dev/null @@ -1,72 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef _INC_CODE_MANAGER_PEF_H_ -#define _INC_CODE_MANAGER_PEF_H_ - -#include -#include -#include -#include - -#ifndef INC_PROCESS_SCHEDULER_H -#include -#endif - -#define kPefApplicationMime "application/vnd-zka-executable" - -namespace NeOS -{ - /// - /// \name PEFLoader - /// \brief PEF loader class. - /// - class PEFLoader : public LoaderInterface - { - private: - explicit PEFLoader() = delete; - - public: - explicit PEFLoader(const VoidPtr blob); - explicit PEFLoader(const Char* path); - ~PEFLoader() override; - - public: - NE_COPY_DEFAULT(PEFLoader); - - public: - const Char* Path() override; - const Char* AsString() override; - const Char* MIME() override; - - public: - ErrorOr FindStart() override; - VoidPtr FindSymbol(const Char* name, Int32 kind) override; - ErrorOr GetBlob() override; - - public: - bool IsLoaded() noexcept; - - private: -#ifdef __FSKIT_INCLUDES_NEFS__ - OwnPtr> fFile; -#else - OwnPtr> fFile; -#endif // __FSKIT_INCLUDES_NEFS__ - - Ref fPath; - VoidPtr fCachedBlob; - bool fFatBinary; - bool fBad; - }; - - namespace Utils - { - ProcessID rtl_create_process(PEFLoader& exec, const Int32& procKind) noexcept; - } // namespace Utils -} // namespace NeOS - -#endif // ifndef _INC_CODE_MANAGER_PEF_H_ diff --git a/dev/Kernel/KernelKit/Semaphore.h b/dev/Kernel/KernelKit/Semaphore.h deleted file mode 100644 index ac810c62..00000000 --- a/dev/Kernel/KernelKit/Semaphore.h +++ /dev/null @@ -1,16 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -namespace NeOS -{ - typedef Int64 Semaphore; -} // namespace NeOS \ No newline at end of file diff --git a/dev/Kernel/KernelKit/ThreadLocalStorage.h b/dev/Kernel/KernelKit/ThreadLocalStorage.h deleted file mode 100644 index 573b40b8..00000000 --- a/dev/Kernel/KernelKit/ThreadLocalStorage.h +++ /dev/null @@ -1,69 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef KERNELKIT_TLS_H -#define KERNELKIT_TLS_H - -#include -#include - -///! @brief Thread Local Storage for neoskrnl. - -#define kCookieMag0Idx 0 -#define kCookieMag1Idx 1 -#define kCookieMag2Idx 2 - -#define kCookieMag0 'Z' -#define kCookieMag1 'K' -#define kCookieMag2 'A' - -#define kTLSCookieLen (3U) - -struct THREAD_INFORMATION_BLOCK; - -/// @brief Thread Information Block. -/// Located in GS on AMD64, other architectures have their own stuff. (64x0, 32x0, ARM64) -struct PACKED THREAD_INFORMATION_BLOCK final -{ - NeOS::Char Cookie[kTLSCookieLen]{0}; //! Thread magic number. - NeOS::VoidPtr Record{nullptr}; //! Thread information record. -}; - -///! @brief Cookie Sanity check. -NeOS::Boolean tls_check_tib(THREAD_INFORMATION_BLOCK* the_tib); - -///! @brief new ptr syscall. -template -T* tls_new_ptr(void) noexcept; - -///! @brief delete ptr syscall. -template -NeOS::Boolean tls_delete_ptr(T* ptr) noexcept; - -//! @brief Delete process pointer. -//! @param obj The pointer to delete. -template -inline NeOS::Bool tls_delete_ptr(NeOS::ErrorOr obj) noexcept; - -//! @brief Delete process pointer. -//! @param obj The pointer to delete. -template -inline NeOS::Bool tls_delete_ptr(NeOS::ErrorOr obj) noexcept; - -template -T* tls_new_class(Args&&... args); - -/// @brief TLS install TIB and PIB. (syscall) -EXTERN_C NeOS::Void rt_install_tib(THREAD_INFORMATION_BLOCK* TIB, THREAD_INFORMATION_BLOCK* PIB); - -/// @brief TLS check (syscall) -EXTERN_C NeOS::Bool tls_check_syscall_impl(NeOS::VoidPtr TIB) noexcept; - -#include - -// last rev 7/7/24 - -#endif /* ifndef KERNELKIT_TLS_H */ diff --git a/dev/Kernel/KernelKit/ThreadLocalStorage.inl b/dev/Kernel/KernelKit/ThreadLocalStorage.inl deleted file mode 100644 index d912f5aa..00000000 --- a/dev/Kernel/KernelKit/ThreadLocalStorage.inl +++ /dev/null @@ -1,99 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -//! @file ThreadLocalStorage.inl -//! @brief Allocate resources from the process's heap storage. - -#ifndef INC_PROCESS_SCHEDULER_H -#include -#endif - -template -inline T* tls_new_ptr(void) noexcept -{ - using namespace NeOS; - - auto ref_process = UserProcessScheduler::The().CurrentProcess(); - MUST_PASS(ref_process); - - auto pointer = ref_process.Leak().New(sizeof(T)); - - if (pointer.Error()) - return nullptr; - - return reinterpret_cast(pointer.Leak().Leak()); -} - -//! @brief Delete process pointer. -//! @param obj The pointer to delete. -template -inline NeOS::Bool tls_delete_ptr(T* obj) noexcept -{ - using namespace NeOS; - - if (!obj) - return No; - - auto ref_process = UserProcessScheduler::The().CurrentProcess(); - MUST_PASS(ref_process); - - ErrorOr obj_wrapped{obj}; - - return ref_process.Leak().Delete(obj_wrapped, sizeof(T)); -} - -//! @brief Delete process pointer. -//! @param obj The pointer to delete. -template -inline NeOS::Bool tls_delete_ptr(NeOS::ErrorOr obj) noexcept -{ - return tls_delete_ptr(obj.Leak()); -} - -//! @brief Delete process pointer. -//! @param obj The pointer to delete. -template -inline NeOS::Bool tls_delete_ptr(NeOS::ErrorOr obj) noexcept -{ - return tls_delete_ptr(obj->Leak()); -} - -/// @brief Allocate a C++ class, and then call the constructor of it. -/// @tparam T class type. -/// @tparam ...Args varg class type. -/// @param args arguments list. -/// @return Class instance. -template -T* tls_new_class(Args&&... args) -{ - using namespace NeOS; - - T* obj = tls_new_ptr(); - - if (obj) - { - *obj = T(forward(args)...); - return obj; - } - - return nullptr; -} - -/// @brief Delete a C++ class (call constructor first.) -/// @tparam T -/// @param obj -/// @return -template -inline NeOS::Bool tls_delete_class(T* obj) -{ - using namespace NeOS; - - if (!obj) - return No; - - obj->~T(); - return tls_delete_ptr(obj); -} diff --git a/dev/Kernel/KernelKit/Timer.h b/dev/Kernel/KernelKit/Timer.h deleted file mode 100644 index abca5352..00000000 --- a/dev/Kernel/KernelKit/Timer.h +++ /dev/null @@ -1,83 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include - -namespace NeOS -{ - class SoftwareTimer; - class TimerInterface; - - inline constexpr Int16 kTimeUnit = 1000; - - class TimerInterface - { - public: - /// @brief Default constructor - explicit TimerInterface() = default; - virtual ~TimerInterface() = default; - - public: - NE_COPY_DEFAULT(TimerInterface); - - public: - virtual BOOL Wait() noexcept; - }; - - class SoftwareTimer final : public TimerInterface - { - public: - explicit SoftwareTimer(Int64 seconds); - ~SoftwareTimer() override; - - public: - NE_COPY_DEFAULT(SoftwareTimer); - - public: - BOOL Wait() noexcept override; - - private: - IntPtr* fDigitalTimer{nullptr}; - Int64 fWaitFor{0}; - }; - - class HardwareTimer final : public TimerInterface - { - public: - explicit HardwareTimer(Int64 seconds); - ~HardwareTimer() override; - - public: - NE_COPY_DEFAULT(HardwareTimer); - - public: - BOOL Wait() noexcept override; - - private: - IntPtr* fDigitalTimer{nullptr}; - Int64 fWaitFor{0}; - }; - - inline Int64 rtl_ms(Int64 time) - { - if (time < 0) - return 0; - - // TODO: nanoseconds maybe? - return kTimeUnit * kTimeUnit * time; - } - - inline Int64 rtl_seconds(Int64 time) - { - if (time < 0) - return 0; - - return kTimeUnit * rtl_ms(time); - } -} // namespace NeOS diff --git a/dev/Kernel/KernelKit/User.h b/dev/Kernel/KernelKit/User.h deleted file mode 100644 index 9ab2b02e..00000000 --- a/dev/Kernel/KernelKit/User.h +++ /dev/null @@ -1,95 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef INC_USER_H -#define INC_USER_H - -/* ------------------------------------------- - - Revision History: - - 04/03/25: Set users directory as /user/ instead of /usr/ - - ------------------------------------------- */ - -#include -#include -#include -#include - -///! We got the Super, Standard (%s format) and Guest user, -///! all are used to make authorization operations on the OS. -#define kSuperUser "OS AUTHORITY/SUPER/%s" -#define kGuestUser "OS AUTHORITY/GUEST/%s" -#define kStdUser "OS AUTHORITY/STD/%s" - -#define kUsersDir "/user/" - -#define kMaxUserNameLen (256U) -#define kMaxUserTokenLen (256U) - -namespace NeOS -{ - class User; - - enum class UserRingKind - { - kRingInvalid = 0, - kRingStdUser = 1, - kRingSuperUser = 2, - kRingGuestUser = 5, - kRingCount = 3, - }; - - typedef Char* UserPublicKey; - typedef Char UserPublicKeyType; - - /// @brief User class. - class User final - { - public: - User() = delete; - - User(const Int32& sel, const Char* username); - User(const UserRingKind& kind, const Char* username); - - ~User(); - - public: - NE_COPY_DEFAULT(User); - - public: - bool operator==(const User& lhs); - bool operator!=(const User& lhs); - - public: - /// @brief Get software ring - const UserRingKind& Ring() noexcept; - - /// @brief Get user name - Char* Name() noexcept; - - /// @brief Is he a standard user? - Bool IsStdUser() noexcept; - - /// @brief Is she a super user? - Bool IsSuperUser() noexcept; - - /// @brief Saves a password from the public key. - Bool Save(const UserPublicKey password) noexcept; - - /// @brief Checks if a password matches the **password**. - /// @param password the password to check. - Bool Matches(const UserPublicKey password) noexcept; - - private: - UserRingKind mUserRing{UserRingKind::kRingStdUser}; - Char mUserName[kMaxUserNameLen] = {0}; - Char mUserKey[kMaxUserTokenLen] = {0}; - }; -} // namespace NeOS - -#endif /* ifndef INC_USER_H */ diff --git a/dev/Kernel/KernelKit/UserProcessScheduler.h b/dev/Kernel/KernelKit/UserProcessScheduler.h deleted file mode 100644 index 10a08e0f..00000000 --- a/dev/Kernel/KernelKit/UserProcessScheduler.h +++ /dev/null @@ -1,343 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef INC_PROCESS_SCHEDULER_H -#define INC_PROCESS_SCHEDULER_H - -#include -#include -#include -#include - -#define kSchedMinMicroTime (AffinityKind::kStandard) -#define kSchedInvalidPID (-1) -#define kSchedProcessLimitPerTeam (32U) - -#define kSchedMaxMemoryLimit gib_cast(128) /* max physical memory limit */ -#define kSchedMaxStackSz mib_cast(8) /* maximum stack size */ - -#define kProcessInvalidID (-1) -#define kProcessNameLen (128U) - -//////////////////////////////////////////////////// -// The current date is: Thu 11/28/2024 // -//////////////////////////////////////////////////// - -namespace NeOS -{ - //! @note Forward class declarations. - - class IDylibObject; - class UserProcess; - class UserProcessTeam; - class UserProcessScheduler; - class UserProcessHelper; - - typedef UInt64 PTime; - - //! @brief Local Process identifier. - typedef Int64 ProcessID; - - //! @brief Local Process status enum. - enum class ProcessStatusKind : Int32 - { - kInvalid, - kStarting, - kRunning, - kKilled, - kFrozen, - kFinished, - kCount, - }; - - //! @brief Affinity is the amount of nano-seconds this process is going - //! to run. - enum class AffinityKind : Int32 - { - kRealTime = 500, - kVeryHigh = 250, - kHigh = 200, - kStandard = 1000, - kLowUsage = 1500, - kVeryLowUsage = 2000, - }; - - // operator overloading. - - inline bool operator<(AffinityKind lhs, AffinityKind rhs) - { - Int32 lhs_int = static_cast(lhs); - Int32 rhs_int = static_cast(rhs); - - return lhs_int < rhs_int; - } - - inline bool operator>(AffinityKind lhs, AffinityKind rhs) - { - Int32 lhs_int = static_cast(lhs); - Int32 rhs_int = static_cast(rhs); - - return lhs_int > rhs_int; - } - - inline bool operator<=(AffinityKind lhs, AffinityKind rhs) - { - Int32 lhs_int = static_cast(lhs); - Int32 rhs_int = static_cast(rhs); - - return lhs_int <= rhs_int; - } - - inline bool operator>=(AffinityKind lhs, AffinityKind rhs) - { - Int32 lhs_int = static_cast(lhs); - Int32 rhs_int = static_cast(rhs); - - return lhs_int >= rhs_int; - } - - // end of operator overloading. - - enum class ProcessSubsystem : Int32 - { - kProcessSubsystemSecurity = 100, - kProcessSubsystemApplication, - kProcessSubsystemService, - kProcessSubsystemDriver, - kProcessSubsystemInvalid = 256U, - kProcessSubsystemCount = 4, - }; - - using ProcessTime = UInt64; - using PID = Int64; - - // for permission manager, tells where we run the code. - enum class ProcessLevelRing : Int32 - { - kRingStdUser = 1, - kRingSuperUser = 2, - kRingGuestUser = 5, - kRingCount = 5, - }; - - /// @brief Helper type to describe a code image. - using ImagePtr = VoidPtr; - - struct UserProcessImage final - { - explicit UserProcessImage() = default; - - ImagePtr fCode; - ImagePtr fBlob; - - Bool HasCode() - { - return this->fCode != nullptr; - } - - Bool HasImage() - { - return this->fBlob != nullptr; - } - }; - - /// @name UserProcess - /// @brief User process class, holds information about the running process/thread. - class UserProcess final - { - public: - explicit UserProcess(); - ~UserProcess(); - - public: - NE_COPY_DEFAULT(UserProcess); - - public: - Char Name[kProcessNameLen] = {"Process"}; - ProcessSubsystem SubSystem{ProcessSubsystem::kProcessSubsystemInvalid}; - User* Owner{nullptr}; - HAL::StackFramePtr StackFrame{nullptr}; - AffinityKind Affinity{AffinityKind::kStandard}; - ProcessStatusKind Status{ProcessStatusKind::kFinished}; - UInt8* StackReserve{nullptr}; - UserProcessImage Image{}; - SizeT StackSize{kSchedMaxStackSz}; - IDylibObject* DylibDelegate{nullptr}; - SizeT MemoryCursor{0UL}; - SizeT MemoryLimit{kSchedMaxMemoryLimit}; - SizeT UsedMemory{0UL}; - - struct ProcessMemoryHeapList final - { - VoidPtr MemoryEntry{nullptr}; - SizeT MemoryEntrySize{0UL}; - SizeT MemoryEntryPad{0UL}; - - struct ProcessMemoryHeapList* MemoryPrev{nullptr}; - struct ProcessMemoryHeapList* MemoryNext{nullptr}; - }; - - struct UserProcessSignal final - { - UIntPtr SignalArg; - ProcessStatusKind PreviousStatus; - UIntPtr SignalID; - }; - - UserProcessSignal ProcessSignal; - ProcessMemoryHeapList* ProcessMemoryHeap{nullptr}; - UserProcessTeam* ProcessParentTeam; - - VoidPtr VMRegister{0UL}; - - enum - { - kInvalidExecutableKind, - kExectuableKind, - kExectuableDylibKind, - kExectuableKindCount, - }; - - ProcessTime PTime{0}; //! @brief Process allocated tine. - - PID ProcessId{kSchedInvalidPID}; - Int32 Kind{kExectuableKind}; - - public: - //! @brief boolean operator, check status. - operator bool(); - - ///! @brief Crashes the app, exits with code ~0. - Void Crash(); - - ///! @brief Exits the app. - Void Exit(const Int32& exit_code = 0); - - ///! @brief TLS allocate. - ///! @param sz size of new ptr. - ErrorOr New(const SizeT& sz, const SizeT& pad_amount = 0); - - ///! @brief TLS free. - ///! @param ptr the pointer to free. - ///! @param sz the size of it. - template - Boolean Delete(ErrorOr ptr, const SizeT& sz); - - ///! @brief Wakes up threads. - Void Wake(const Bool wakeup = false); - - public: - //! @brief Gets the local exit code. - const UInt32& GetExitCode() noexcept; - - ///! @brief Get the process's name - ///! @example 'C Runtime Library' - const Char* GetName() noexcept; - - //! @brief return local error code of process. - //! @return Int32 local error code. - Int32& GetLocalCode() noexcept; - - const User* GetOwner() noexcept; - const ProcessStatusKind& GetStatus() noexcept; - const AffinityKind& GetAffinity() noexcept; - - private: - UInt32 fLastExitCode{0}; - Int32 fLocalCode{0}; - - friend UserProcessScheduler; - friend UserProcessHelper; - }; - - /// \brief Processs Team (contains multiple processes inside it.) - /// Equivalent to a process batch - class UserProcessTeam final - { - public: - explicit UserProcessTeam(); - ~UserProcessTeam() = default; - - NE_COPY_DEFAULT(UserProcessTeam); - - Array& AsArray(); - Ref& AsRef(); - ProcessID& Id() noexcept; - - public: - Array mProcessList; - Ref mCurrentProcess; - ProcessID mTeamId{0}; - ProcessID mProcessCount{0}; - }; - - typedef Array UserThreadArray; - - using UserProcessRef = UserProcess&; - - /// @brief Process scheduler class. - /// The main class which you call to schedule user processes. - class UserProcessScheduler final : public ISchedulable - { - friend class UserProcessHelper; - - public: - explicit UserProcessScheduler() = default; - ~UserProcessScheduler() override = default; - - NE_COPY_DEFAULT(UserProcessScheduler) - - operator bool(); - bool operator!(); - - public: - UserProcessTeam& CurrentTeam(); - - public: - ProcessID Spawn(const Char* name, VoidPtr code, VoidPtr image); - const Bool Remove(ProcessID process_id); - - const Bool IsUser() override; - const Bool IsKernel() override; - const Bool HasMP() override; - - public: - Ref& CurrentProcess(); - const SizeT Run() noexcept; - - public: - STATIC UserProcessScheduler& The(); - - private: - UserProcessTeam mTeam{}; - }; - - /* - * \brief UserProcess helper class, which contains needed utilities for the scheduler. - */ - - class UserProcessHelper final - { - public: - STATIC Bool Switch(VoidPtr image_ptr, UInt8* stack_ptr, HAL::StackFramePtr frame_ptr, const PID& new_pid); - STATIC Bool CanBeScheduled(const UserProcess& process); - STATIC ErrorOr TheCurrentPID(); - STATIC SizeT StartScheduling(); - }; - - const UInt32& sched_get_exit_code(void) noexcept; -} // namespace NeOS - -#include -#include - -//////////////////////////////////////////////////// - -// END - -//////////////////////////////////////////////////// - -#endif /* ifndef INC_PROCESS_SCHEDULER_H */ diff --git a/dev/Kernel/KernelKit/UserProcessScheduler.inl b/dev/Kernel/KernelKit/UserProcessScheduler.inl deleted file mode 100644 index 6b3b9300..00000000 --- a/dev/Kernel/KernelKit/UserProcessScheduler.inl +++ /dev/null @@ -1,62 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - FILE: UserProcessScheduler.inl - PURPOSE: Low level/Ring-3 Process scheduler. - -------------------------------------------- */ - -namespace NeOS -{ - /***********************************************************************************/ - /** @brief Free pointer from usage. */ - /***********************************************************************************/ - - template - Boolean UserProcess::Delete(ErrorOr ptr, const SizeT& sz) - { - if (!ptr) - return No; - - if (!this->ProcessMemoryHeap) - { - kout << "Process Memory is empty.\r"; - return No; - } - - ProcessMemoryHeapList* entry = this->ProcessMemoryHeap; - - while (entry != nullptr) - { - if (entry->MemoryEntry == ptr.Leak().Leak()) - { - this->UsedMemory -= entry->MemoryEntrySize; - -#ifdef __NE_AMD64__ - auto pd = hal_read_cr3(); - - hal_write_cr3(this->VMRegister); - - auto ret = mm_delete_heap(entry->MemoryEntry); - - hal_write_cr3(pd); - - return ret == kErrorSuccess; -#else - Bool ret = mm_delete_heap(ptr.Leak().Leak()); - - return ret == kErrorSuccess; -#endif - } - - entry = entry->MemoryNext; - } - - kout << "Invalid Pointer: Trying to free a pointer which doesn't exist.\r"; - - this->Crash(); - - return No; - } -} // namespace NeOS diff --git a/dev/Kernel/KernelKit/XCOFF.h b/dev/Kernel/KernelKit/XCOFF.h deleted file mode 100644 index 5e59e717..00000000 --- a/dev/Kernel/KernelKit/XCOFF.h +++ /dev/null @@ -1,51 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: XCOFF.h - Purpose: XCOFF for Kernel. - - Revision History: - - 04/07/24: Added file (amlel) - -------------------------------------------- */ - -#ifndef INC_XOCFF_H -#define INC_XOCFF_H - -#include - -#define kXCOFF64Magic (0x01F7) - -#define kXCOFFRelFlg (0x0001) -#define kXCOFFExecutable (0x0002) -#define kXCOFFLnno (0x0004) -#define kXCOFFLSyms (0x0008) - -struct XCoffFileHeader; -struct XCoffForkHeader; - -/// @brief XCoff file header, meant for POWER apps. -typedef struct XCoffFileHeader -{ - NeOS::UInt16 fMagic; - NeOS::UInt16 fTarget; - NeOS::UInt16 fNumSecs; - NeOS::UInt32 fTimeDat; - NeOS::UIntPtr fSymPtr; - NeOS::UInt32 fNumSyms; - NeOS::UInt16 fOptHdr; // ?: Number of bytes in optional header -} XCoffFileHeader64; - -#define kForkNameLen (256U) - -/// @brief This the executable manifest fork. -typedef struct XCoffForkHeader -{ - NeOS::Char fPropertiesXMLFork[kForkNameLen]; - NeOS::Char fDynamicLoaderFork[kForkNameLen]; - NeOS::Char fCodeSignFork[kForkNameLen]; -} XCoffForkHeader; - -#endif // ifndef INC_XOCFF_H diff --git a/dev/Kernel/KernelRsrc.rsrc b/dev/Kernel/KernelRsrc.rsrc deleted file mode 100644 index 921645b0..00000000 --- a/dev/Kernel/KernelRsrc.rsrc +++ /dev/null @@ -1,25 +0,0 @@ -#include "CompilerKit/Version.h" - -1 VERSIONINFO -FILEVERSION 1,0,0,0 -PRODUCTVERSION 1,0,0,0 -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "080904E4" - BEGIN - VALUE "CompanyName", "Amlal El Mahrouss." - VALUE "FileDescription", "NeKernel MicroKernel." - VALUE "FileVersion", KERNEL_VERSION - VALUE "InternalName", "neoskrnl" - VALUE "LegalCopyright", "(c) 2024 Amlal El Mahrouss, all rights reserved." - VALUE "OriginalFilename", "neoskrnl.exe" - VALUE "ProductName", "NeKernel." - VALUE "ProductVersion", KERNEL_VERSION - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x809, 1252 - END -END diff --git a/dev/Kernel/MoveAll.ARM64.sh b/dev/Kernel/MoveAll.ARM64.sh deleted file mode 100755 index 35e0909e..00000000 --- a/dev/Kernel/MoveAll.ARM64.sh +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/sh - -for file in *.o; do - mv -- "$file" "${file%.o}.obj" -done - -mv *.obj obj/ diff --git a/dev/Kernel/MoveAll.X64.sh b/dev/Kernel/MoveAll.X64.sh deleted file mode 100755 index 1c135d06..00000000 --- a/dev/Kernel/MoveAll.X64.sh +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/sh - -for file in *.o; do - mv -- "$file" "${file%.o}.obj" -done - -mv *.obj HALKit/AMD64/*.obj obj/ diff --git a/dev/Kernel/NetworkKit/IP.h b/dev/Kernel/NetworkKit/IP.h deleted file mode 100644 index 4a552d87..00000000 --- a/dev/Kernel/NetworkKit/IP.h +++ /dev/null @@ -1,83 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include -#include - -namespace NeOS -{ - class RawIPAddress6; - class RawIPAddress; - class IPFactory; - - class RawIPAddress final - { - private: - explicit RawIPAddress(char bytes[4]); - ~RawIPAddress() = default; - - RawIPAddress& operator=(const RawIPAddress&) = delete; - RawIPAddress(const RawIPAddress&) = default; - - public: - Char* Address(); - - Char& operator[](const Size& index); - - BOOL operator==(const RawIPAddress& ipv6); - BOOL operator!=(const RawIPAddress& ipv6); - - private: - Char fAddr[4]; - - friend IPFactory; // it is the one creating these addresses, thus this - // is why the constructors are private. - }; - - /** - * @brief IPv6 address. - */ - class RawIPAddress6 final - { - private: - explicit RawIPAddress6(char Bytes[8]); - ~RawIPAddress6() = default; - - RawIPAddress6& operator=(const RawIPAddress6&) = delete; - RawIPAddress6(const RawIPAddress6&) = default; - - public: - char* Address() - { - return fAddr; - } - - char& operator[](const Size& index); - - bool operator==(const RawIPAddress6& ipv6); - bool operator!=(const RawIPAddress6& ipv6); - - private: - char fAddr[8]; - - friend IPFactory; - }; - - /** - * @brief IP Creation helpers - */ - class IPFactory final - { - public: - static ErrorOr ToKString(Ref& ipv6); - static ErrorOr ToKString(Ref& ipv4); - static bool IpCheckVersion4(const Char* ip); - }; -} // namespace NeOS diff --git a/dev/Kernel/NetworkKit/IPC.h b/dev/Kernel/NetworkKit/IPC.h deleted file mode 100644 index 9047a8af..00000000 --- a/dev/Kernel/NetworkKit/IPC.h +++ /dev/null @@ -1,91 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.. - - File: IPC.h. - Purpose: IPC protocol. - -------------------------------------------- */ - -#ifndef INC_IPC_H -#define INC_IPC_H - -#include -#include -#include - -/// @file IPC.h -/// @brief IPC comm. protocol. - -/// IA separator. -#define kIPCRemoteSeparator ":" - -/// Interchange address, consists of PID:TEAM. -#define kIPCRemoteInvalid "00:00" - -#define kIPCHeaderMagic (0x4950434) - -namespace NeOS -{ - struct IPC_ADDR; - struct IPC_MSG; - - /// @brief 128-bit IPC address. - struct PACKED IPC_ADDR final - { - UInt64 UserProcessID; - UInt64 UserProcessTeam; - - //////////////////////////////////// - // some operators. - //////////////////////////////////// - - bool operator==(const IPC_ADDR& addr) noexcept; - - bool operator==(IPC_ADDR& addr) noexcept; - - bool operator!=(const IPC_ADDR& addr) noexcept; - - bool operator!=(IPC_ADDR& addr) noexcept; - }; - - typedef struct IPC_ADDR IPC_ADDR; - - enum - { - kIPCLittleEndian = 0, - kIPCBigEndian = 1, - kIPCMixedEndian = 2, - }; - - constexpr inline auto kIPCMsgSize = 6094U; - - /// @brief IPC connection header, message cannot be greater than 6K. - typedef struct IPC_MSG final - { - UInt32 IpcHeaderMagic; // cRemoteHeaderMagic - UInt8 IpcEndianess; // 0 : LE, 1 : BE - SizeT IpcPacketSize; - IPC_ADDR IpcFrom; - IPC_ADDR IpcTo; - UInt32 IpcCRC32; - UInt32 IpcMsg; - UInt32 IpcMsgSz; - UInt8 IpcData[kIPCMsgSize]; - - /// @brief Passes the message to target, could be anything, HTTP packet, JSON or whatever. - static Bool Pass(IPC_MSG* self, IPC_MSG* target) noexcept; - } PACKED IPC_MSG; - - /// @brief Sanitize packet function - /// @retval true packet is correct. - /// @retval false packet is incorrect and process has crashed. - Bool ipc_sanitize_packet(_Input IPC_MSG* pckt_in); - - /// @brief Construct packet function - /// @retval true packet is correct. - /// @retval false packet is incorrect and process has crashed. - Bool ipc_construct_packet(_Output _Input IPC_MSG** pckt_in); -} // namespace NeOS - -#endif // INC_IPC_H diff --git a/dev/Kernel/NetworkKit/LTE.h b/dev/Kernel/NetworkKit/LTE.h deleted file mode 100644 index e0a0ff64..00000000 --- a/dev/Kernel/NetworkKit/LTE.h +++ /dev/null @@ -1,16 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.. - - File: LTE.h. - Purpose: LTE protocol classes. - -------------------------------------------- */ - -#ifndef _INC_NETWORK_LTE_H_ -#define _INC_NETWORK_LTE_H_ - -#include -#include - -#endif // ifndef _INC_NETWORK_LTE_H_ diff --git a/dev/Kernel/NetworkKit/MAC.h b/dev/Kernel/NetworkKit/MAC.h deleted file mode 100644 index f7283708..00000000 --- a/dev/Kernel/NetworkKit/MAC.h +++ /dev/null @@ -1,36 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -#define kMACAddrLen (12) - -namespace NeOS -{ - class MacAddressGetter; - - /// \brief This retrieves the MAC address of the device. - /// \note Listens for the current NIC. - class MacAddressGetter final - { - public: - MacAddressGetter() = default; - ~MacAddressGetter() = default; - - NE_COPY_DEFAULT(MacAddressGetter); - - public: - Array& AsBytes(); - - private: - Array fMacAddress; - }; - -} // namespace NeOS diff --git a/dev/Kernel/NetworkKit/NetworkDevice.h b/dev/Kernel/NetworkKit/NetworkDevice.h deleted file mode 100644 index c95573f3..00000000 --- a/dev/Kernel/NetworkKit/NetworkDevice.h +++ /dev/null @@ -1,83 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef __INC_NETWORK_DEVICE_H__ -#define __INC_NETWORK_DEVICE_H__ - -#include -#include - -/// @note Can either work with: Ethernet, GPRS, WiFi - -namespace NeOS -{ - struct NetworkDeviceCommand; - class NetworkDevice; - - /** - * \brief Network device interface, establishes a connection to the NIC. - */ - class NetworkDevice final : public IDeviceObject - { - public: - NetworkDevice(void (*out)(IDeviceObject*, NetworkDeviceCommand), - void (*in)(IDeviceObject*, NetworkDeviceCommand), - void (*onCleanup)(void) = nullptr); - - ~NetworkDevice() override; - - public: - NetworkDevice& operator=(const NetworkDevice&) = default; - NetworkDevice(const NetworkDevice&) = default; - - public: - const Char* Name() const override; - Boolean Name(const Char* newStr); - - private: - static constexpr auto cNetworkNameLen = 512; - - Void (*fCleanup)(void); - Char fNetworkName[cNetworkNameLen]; - }; - - struct NetworkDeviceCommand final - { - UInt32 CommandName; - UInt32 CommandType; - UInt32 CommandFlags; - VoidPtr CommandBuffer; - SizeT CommandSizeBuffer; - }; - - /// @brief TCP device. - using TCPNetworkDevice = NetworkDevice; - - /// @brief UDP device. - using UDPNetworkDevice = NetworkDevice; - - /// @brief PPP device. - using PPPNetworkDevice = NetworkDevice; - - /// @brief IPC device. - using IPCNetworkDevice = NetworkDevice; - - /// @brief GRPS device. - using GPRSNetworkDevice = NetworkDevice; - - /// @brief GSM device. - using GSMNetworkDevice = NetworkDevice; - - /// @brief Bluetooth device. - using BTNetworkDevice = NetworkDevice; - - /// @brief LTE device. - using LTENetworkDevice = NetworkDevice; -} // namespace NeOS - -#include - -#endif // !__INC_NETWORK_DEVICE_H__ diff --git a/dev/Kernel/NetworkKit/NetworkDevice.inl b/dev/Kernel/NetworkKit/NetworkDevice.inl deleted file mode 100644 index dceae66e..00000000 --- a/dev/Kernel/NetworkKit/NetworkDevice.inl +++ /dev/null @@ -1,32 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -/*** - Dtor and ctors. -*/ - -namespace NeOS -{ - NetworkDevice::NetworkDevice(void (*out)(IDeviceObject*, NetworkDeviceCommand), - void (*in)(IDeviceObject*, NetworkDeviceCommand), - void (*on_cleanup)(void)) - : IDeviceObject(out, in), fCleanup(on_cleanup) - { - kout << "NetworkDevice initialized.\r"; - - MUST_PASS(out && in && on_cleanup); - } - - NetworkDevice::~NetworkDevice() - { - MUST_PASS(fCleanup); - - kout << "NetworkDevice cleanup.\r"; - - if (fCleanup) - fCleanup(); - } -} // namespace NeOS diff --git a/dev/Kernel/NewKit/Array.h b/dev/Kernel/NewKit/Array.h deleted file mode 100644 index 54c09636..00000000 --- a/dev/Kernel/NewKit/Array.h +++ /dev/null @@ -1,65 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -namespace NeOS -{ - template - class Array final - { - public: - explicit Array() = default; - ~Array() = default; - - Array& operator=(const Array&) = default; - Array(const Array&) = default; - - T& operator[](const SizeT& at) - { - MUST_PASS(at < this->Count()); - return fArray[at]; - } - - Boolean Empty() - { - return this->Count() > 0; - } - - const SizeT Capacity() - { - return N; - } - - const SizeT Count() - { - return N; - } - - const T* CData() - { - return fArray; - } - - operator bool() - { - return !Empty(); - } - - private: - T fArray[N]; - }; - - template - auto make_list(ValueType val) - { - return Array{val}; - } -} // namespace NeOS diff --git a/dev/Kernel/NewKit/ArrayList.h b/dev/Kernel/NewKit/ArrayList.h deleted file mode 100644 index 06763b5a..00000000 --- a/dev/Kernel/NewKit/ArrayList.h +++ /dev/null @@ -1,63 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -namespace NeOS -{ - template - class ArrayList final - { - public: - explicit ArrayList(T* list, SizeT length) - : fList(reinterpret_cast(list)) - { - } - - ~ArrayList() = default; - - ArrayList& operator=(const ArrayList&) = default; - ArrayList(const ArrayList&) = default; - - T* Data() - { - return fList; - } - - const T* CData() - { - return fList; - } - - T& operator[](int index) const - { - MUST_PASS(index < this->Count()); - return fList[index]; - } - - operator bool() - { - return fList; - } - - SizeT Count() const - { - return fLen; - } - - private: - T* fList{nullptr}; - SizeT fLen{0}; - }; - - template - ArrayList make_list(ValueType val) - { - return ArrayList{val}; - } -} // namespace NeOS diff --git a/dev/Kernel/NewKit/Atom.h b/dev/Kernel/NewKit/Atom.h deleted file mode 100644 index 3979b0d1..00000000 --- a/dev/Kernel/NewKit/Atom.h +++ /dev/null @@ -1,47 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ -#pragma once - -#include - -namespace NeOS -{ - template - class Atom final - { - public: - explicit Atom() = default; - ~Atom() = default; - - public: - Atom& operator=(const Atom&) = delete; - Atom(const Atom&) = delete; - - public: - T operator[](Size bit) - { - return (fArrayOfAtoms & (1 << bit)); - } - - void operator|(Size bit) - { - fArrayOfAtoms |= (1 << bit); - } - - friend Boolean operator==(Atom& atomic, const T& idx) - { - return atomic[idx] == idx; - } - - friend Boolean operator!=(Atom& atomic, const T& idx) - { - return atomic[idx] == idx; - } - - private: - T fArrayOfAtoms; - }; -} // namespace NeOS diff --git a/dev/Kernel/NewKit/Crc32.h b/dev/Kernel/NewKit/Crc32.h deleted file mode 100644 index c3e14413..00000000 --- a/dev/Kernel/NewKit/Crc32.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * ======================================================== - * - * NeKernel - * Date Added: 13/02/2023 - * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - * - * ======================================================== - */ - -#ifndef CRC32_H -#define CRC32_H - -#include - -#define kCrcCnt (256) - -namespace NeOS -{ - UInt32 ke_calculate_crc32(const Char* crc, Int32 len) noexcept; -} // namespace NeOS - -#endif // !CRC32_H diff --git a/dev/Kernel/NewKit/CxxAbi.h b/dev/Kernel/NewKit/CxxAbi.h deleted file mode 100644 index e6d83e07..00000000 --- a/dev/Kernel/NewKit/CxxAbi.h +++ /dev/null @@ -1,28 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ -#pragma once - -#include - -#ifndef __TOOLCHAINKIT__ - -#define kAtExitMacDestructors (128) - -struct atexit_func_entry_t -{ - void (*destructor_func)(void*); - void* obj_ptr; - void* dso_handle; -}; - -typedef unsigned uarch_t; - -namespace cxxabiv1 -{ - typedef void* __guard; -} - -#endif // __GNUC__ diff --git a/dev/Kernel/NewKit/Defines.h b/dev/Kernel/NewKit/Defines.h deleted file mode 100644 index 0b0b97e5..00000000 --- a/dev/Kernel/NewKit/Defines.h +++ /dev/null @@ -1,200 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -#define NEWKIT_VERSION_STR "1.1.0" -#define NEWKIT_VERSION_BCD 0x01100 - -#ifndef __cplusplus -#error NeOS compiles with a C++ compiler. -#endif - -#if __cplusplus <= 201703L -#define char8_t char -#endif - -#ifdef __has_feature -#if !__has_feature(cxx_nullptr) -#if !__has_nullptr -#error !!! You must at least have nullptr featured on your C++ compiler. !!! -#endif -#endif -#endif - -/// @brief The **Kernel** namespace where it's API resides. -namespace NeOS -{ - using voidPtr = void*; - using VoidPtr = void*; - using nullPtr = decltype(nullptr); - using NullPtr = decltype(nullptr); - - using Int = int; - using Int32 = int; - using UShort = unsigned short; - using UInt16 = unsigned short; - using Short = short; - using Int16 = short; - using UInt = unsigned int; - using UInt32 = unsigned int; - using Long = __INT64_TYPE__; - using Int64 = __INT64_TYPE__; - using ULong = __UINT64_TYPE__; - using UInt64 = __UINT64_TYPE__; - using Boolean = bool; - using Bool = bool; - using Char = char; - using UChar = unsigned char; - using UInt8 = unsigned char; - - using SSize = Int64; - using SSizeT = Int64; - using Size = __SIZE_TYPE__; - using SizeT = __SIZE_TYPE__; - using IntPtr = __INTPTR_TYPE__; - using UIntPtr = __UINTPTR_TYPE__; - using IntFast = __INT_FAST32_TYPE__; - using IntFast64 = __INT_FAST64_TYPE__; - using PtrDiff = __PTRDIFF_TYPE__; - - using SInt16 = Int16; - using SInt32 = Int32; - using SInt64 = Int64; - - typedef UIntPtr* Ptr64; - typedef UInt32* Ptr32; - typedef UInt8* Ptr8; - - using Utf8Char = char8_t; - using Utf16Char = char16_t; - using WideChar = wchar_t; - using Utf32Char = char32_t; - - using LongDouble = long double; - using Double = double; - using Float = float; - - typedef UInt32 PhysicalAddressKind; - typedef UIntPtr VirtualAddressKind; - - using Void = void; - - using Lba = UInt64; - - using Char16 = char16_t; - - enum class Endian : UInt8 - { - kEndianInvalid, - kEndianBig, - kEndianLittle, - kEndianMixed, - kEndianCount - }; - - /// @brief Forward object. - /// @tparam Args the object type. - /// @param arg the object. - /// @return object's rvalue - template - inline Args&& forward(Args& arg) - { - return static_cast(arg); - } - - /// @brief Move object. - /// @tparam Args the object type. - /// @param arg the object. - /// @return object's rvalue - template - inline Args&& move(Args&& arg) - { - return static_cast(arg); - } - - /// @brief Encoding interface, used as a proxy to convert T to Char* - /// Used to cast A to B or B to A. - class ICodec - { - public: - explicit ICodec() = default; - virtual ~ICodec() = default; - - ICodec& operator=(const ICodec&) = default; - ICodec(const ICodec&) = default; - - public: - /// @brief Convert type to bytes. - /// @tparam T the type. - /// @param type (a1) the data. - /// @return a1 as Char* - template - Char* AsBytes(T type) noexcept - { - return nullptr; - } - - /// @brief Construct from type to class. - /// @tparam T the type to convert. - /// @param type (a1) the data. - /// @return a1 as Char* - template - OutputClass* Construct(Char* type) noexcept - { - FactoryClass class_fac; - return class_fac.template From(type); - } - - /// @brief Convert T class to Y class. - /// @tparam T the class type of type. - /// @tparam Y the result class. - /// @param type the class to cast. - /// @return the class as Y. - template - Y As(T type) noexcept - { - if (type.template IsSerializable()) - { - return reinterpret_cast(type); - } - - return type.template As(); - } - }; - - /// \brief Scheduler interface, represents a scheduler object. - /// @note This is used to schedule tasks, such as threads, drivers, user threads, etc. - class ISchedulable - { - public: - explicit ISchedulable() = default; - virtual ~ISchedulable() = default; - - ISchedulable& operator=(const ISchedulable&) = default; - ISchedulable(const ISchedulable&) = default; - - /// @brief Is this object only accepting user tasks? - virtual const Bool IsUser() - { - return NO; - } - - /// @brief Is this object only accepting kernel tasks? - virtual const Bool IsKernel() - { - return NO; - } - - /// @brief Is this object offloading to another CPU? - virtual const Bool HasMP() - { - return NO; - } - }; -} // namespace NeOS diff --git a/dev/Kernel/NewKit/ErrorOr.h b/dev/Kernel/NewKit/ErrorOr.h deleted file mode 100644 index 7c879cc8..00000000 --- a/dev/Kernel/NewKit/ErrorOr.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * ======================================================== - * - * NeKernel - * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - * - * ======================================================== - */ - -#pragma once - -#include -#include - -namespace NeOS -{ - using ErrorT = UInt; - - template - class ErrorOr final - { - public: - ErrorOr() = default; - ~ErrorOr() = default; - - public: - explicit ErrorOr(Int32 err) - : mId(err) - { - } - - explicit ErrorOr(nullPtr Null) - { - } - - explicit ErrorOr(T* Class) - : mRef(Class) - { - } - - explicit ErrorOr(T Class) - : mRef(Class) - { - } - - ErrorOr& operator=(const ErrorOr&) = default; - ErrorOr(const ErrorOr&) = default; - - ErrorOr& operator=(const Ref& refErr) - { - mRef = refErr; - return *this; - } - - Ref& Leak() - { - return mRef; - } - - Int32 Error() - { - return mId; - } - - operator bool() - { - return mRef; - } - - BOOL HasError() - { - return this->mId > 0; - } - - private: - Ref mRef; - UInt32 mId{0}; - }; - - using ErrorOrAny = ErrorOr; - -} // namespace NeOS diff --git a/dev/Kernel/NewKit/Function.h b/dev/Kernel/NewKit/Function.h deleted file mode 100644 index d25c06c1..00000000 --- a/dev/Kernel/NewKit/Function.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef _INC_FUNCTION_H__ -#define _INC_FUNCTION_H__ - -#include - -namespace NeOS -{ - template - class Function final - { - public: - Function() = default; - - public: - explicit Function(T (*Fn)(Args... args)) - : fFn(Fn) - { - } - - ~Function() = default; - - Function& operator=(const Function&) = default; - Function(const Function&) = default; - - template - T operator()(Args... args) - { - return fFn(args...); - } - - template - T Call(Args... args) - { - return fFn(args...); - } - - operator bool() - { - return fFn; - } - - bool operator!() - { - return !fFn; - } - - private: - T(*fFn) - (Args... args); - }; -} // namespace NeOS - -#endif // !_INC_FUNCTION_H__ diff --git a/dev/Kernel/NewKit/Json.h b/dev/Kernel/NewKit/Json.h deleted file mode 100644 index 7b53fa4a..00000000 --- a/dev/Kernel/NewKit/Json.h +++ /dev/null @@ -1,151 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -// last-rev: 30/01/24 - -#include -#include -#include -#include -#include - -#define kMaxJsonPath 8196 -#define kJSONLen 256 -#define kJSONNull "[]" - -namespace NeOS -{ - /// @brief JavaScript object class - class Json final - { - public: - explicit Json() - { - auto len = kJSONLen; - KString key = KString(len); - key += kJSONNull; - - this->AsKey() = key; - this->AsValue() = key; - } - - explicit Json(SizeT lhsLen, SizeT rhsLen) - : fKey(lhsLen), fValue(rhsLen) - { - } - - ~Json() = default; - - NE_COPY_DEFAULT(Json); - - const Bool& IsUndefined() - { - return fUndefined; - } - - private: - Bool fUndefined; // is this instance undefined? - KString fKey; - KString fValue; - - public: - /// @brief returns the key of the json - /// @return the key as string view. - KString& AsKey() - { - return fKey; - } - - /// @brief returns the value of the json. - /// @return the key as string view. - KString& AsValue() - { - return fValue; - } - - static Json kNull; - }; - - /// @brief Json stream reader helper. - struct JsonStreamReader final - { - STATIC Json In(const Char* full_array) - { - auto start_val = '{'; - auto end_val = '}'; - Boolean probe_value = false; - - if (full_array[0] != start_val) - { - if (full_array[0] != '[') - return Json::kNull; - - start_val = '['; - end_val = ']'; - - probe_value = true; - } - - SizeT len = rt_string_len(full_array); - - SizeT key_len = 0; - SizeT value_len = 0; - - Json type(kMaxJsonPath, kMaxJsonPath); - - for (SizeT i = 1; i < len; ++i) - { - if (full_array[i] == '\r' || - full_array[i] == '\n') - continue; - - if (probe_value) - { - if (full_array[i] == end_val || - full_array[i] == ',') - { - probe_value = false; - - ++value_len; - } - else - { - type.AsValue().Data()[value_len] = full_array[i]; - - ++value_len; - } - } - else - { - if (start_val == '[') - continue; - - if (full_array[i] == ':') - { - probe_value = true; - type.AsKey().Data()[key_len] = 0; - ++key_len; - } - else - { - type.AsKey().Data()[key_len] = full_array[i]; - - ++key_len; - } - } - } - - type.AsValue().Data()[value_len] = 0; - - return type; - } - }; - - using JsonStream = Stream; -} // namespace NeOS diff --git a/dev/Kernel/NewKit/KString.h b/dev/Kernel/NewKit/KString.h deleted file mode 100644 index e7525a9c..00000000 --- a/dev/Kernel/NewKit/KString.h +++ /dev/null @@ -1,94 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include -#include -#include - -#define cMinimumStringSize 8196 - -namespace NeOS -{ - /// @brief Kernel string class, not dynamic. - class KString final - { - public: - explicit KString() - { - fDataSz = cMinimumStringSize; - - fData = new Char[fDataSz]; - MUST_PASS(fData); - - rt_set_memory(fData, 0, fDataSz); - } - - explicit KString(const SizeT& Sz) - : fDataSz(Sz) - { - MUST_PASS(Sz > 1); - - fData = new Char[Sz]; - MUST_PASS(fData); - - rt_set_memory(fData, 0, Sz); - } - - ~KString() - { - if (fData) - { - delete[] fData; - fData = nullptr; - } - } - - NE_COPY_DEFAULT(KString); - - Char* Data(); - const Char* CData() const; - Size Length() const; - - bool operator==(const Char* rhs) const; - bool operator!=(const Char* rhs) const; - - bool operator==(const KString& rhs) const; - bool operator!=(const KString& rhs) const; - - KString& operator+=(const Char* rhs); - KString& operator+=(const KString& rhs); - - operator bool() - { - return fData; - } - - bool operator!() - { - return fData; - } - - private: - Char* fData{nullptr}; - Size fDataSz{0}; - Size fCur{0}; - - friend class KStringBuilder; - }; - - struct KStringBuilder final - { - static ErrorOr Construct(const Char* data); - static const Char* FromBool(const Char* fmt, bool n); - static const Char* Format(const Char* fmt, const Char* from); - static bool Equals(const Char* lhs, const Char* rhs); - static bool Equals(const WideChar* lhs, const WideChar* rhs); - }; -} // namespace NeOS diff --git a/dev/Kernel/NewKit/KernelPanic.h b/dev/Kernel/NewKit/KernelPanic.h deleted file mode 100644 index 11f9a05d..00000000 --- a/dev/Kernel/NewKit/KernelPanic.h +++ /dev/null @@ -1,74 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -namespace NeOS -{ - void ke_runtime_check(bool expr, const Char* file, const Char* line); -} - -#define MUST_PASS_COMPILER(EXPR, MSG) static_assert(EXPR, MSG) - -#ifdef TRY -#undef TRY -#endif - -#define TRY(X) \ - { \ - auto fn = X; \ - if ((fn()) == NO) \ - { \ - MUST_PASS(NO); \ - } \ - } - -#ifdef __MUST_PASS -#undef __MUST_PASS -#endif - -#define __MUST_PASS(EXPR, FILE, LINE) \ - NeOS::ke_runtime_check(EXPR, FILE, STRINGIFY(LINE)) - -#ifdef __DEBUG__ -#define MUST_PASS(EXPR) __MUST_PASS((EXPR), __FILE__, __LINE__) -#define assert(EXPR) MUST_PASS(EXPR) -#else -#define MUST_PASS(EXPR) (NeOS::Void)(EXPR) -#define assert(EXPR) (NeOS::Void)(EXPR) -#endif - -enum RUNTIME_CHECK -{ - RUNTIME_CHECK_FAILED = 1111, - RUNTIME_CHECK_POINTER, - RUNTIME_CHECK_EXPRESSION, - RUNTIME_CHECK_FILE, - RUNTIME_CHECK_IPC, - RUNTIME_CHECK_TLS, - RUNTIME_CHECK_HANDSHAKE, - RUNTIME_CHECK_ACPI, - RUNTIME_CHECK_INVALID_PRIVILEGE, - RUNTIME_CHECK_PROCESS, - RUNTIME_CHECK_BAD_BEHAVIOR, - RUNTIME_CHECK_BOOTSTRAP, - RUNTIME_CHECK_UNEXCPECTED, - RUNTIME_CHECK_FILESYSTEM, - RUNTIME_CHECK_VIRTUAL_OUT_OF_MEM, - RUNTIME_CHECK_PAGE, - RUNTIME_CHECK_INVALID, - RUNTIME_CHECK_COUNT, -}; - -typedef enum RUNTIME_CHECK RTL_RUNTIME_CHECK; - -namespace NeOS -{ - void ke_panic(const Int32& id, const Char* message = nullptr); -} // namespace NeOS diff --git a/dev/Kernel/NewKit/Macros.h b/dev/Kernel/NewKit/Macros.h deleted file mode 100644 index 637a2a30..00000000 --- a/dev/Kernel/NewKit/Macros.h +++ /dev/null @@ -1,149 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#ifndef KIB -#define KIB(X) (NeOS::UInt64)((X) / 1024) -#endif - -#ifndef kib_cast -#define kib_cast(X) (NeOS::UInt64)((X)*1024) -#endif - -#ifndef MIB -#define MIB(X) (NeOS::UInt64)((NeOS::UInt64)KIB(X) / 1024) -#endif - -#ifndef mib_cast -#define mib_cast(X) (NeOS::UInt64)((NeOS::UInt64)kib_cast(X) * 1024) -#endif - -#ifndef GIB -#define GIB(X) (NeOS::UInt64)((NeOS::UInt64)MIB(X) / 1024) -#endif - -#ifndef gib_cast -#define gib_cast(X) (NeOS::UInt64)((NeOS::UInt64)mib_cast(X) * 1024) -#endif - -#ifndef TIB -#define TIB(X) (NeOS::UInt64)((NeOS::UInt64)GIB(X) / 1024) -#endif - -#ifndef tib_cast -#define tib_cast(X) ((NeOS::UInt64)gib_cast(X) * 1024) -#endif - -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(a) \ - (((sizeof(a) / sizeof(*(a))) / \ - (static_cast(!(sizeof(a) % sizeof(*(a))))))) -#endif - -#define DEPRECATED ATTRIBUTE(deprecated) - -#ifndef ALIGN -#define ALIGN(X) __attribute__((aligned(X))) -#endif // #ifndef ALIGN - -#ifndef ATTRIBUTE -#define ATTRIBUTE(...) __attribute__((__VA_ARGS__)) -#endif // #ifndef ATTRIBUTE - -#ifndef __NE_VER__ -#define __NE_VER__ (2024) -#endif // !__NE_VER__ - -#ifndef EXTERN -#define EXTERN extern -#endif - -#ifndef EXTERN_C -#define EXTERN_C extern "C" -#endif - -#ifndef MAKE_ENUM -#define MAKE_ENUM(NAME) \ - enum NAME \ - { -#endif - -#ifndef END_ENUM -#define END_ENUM() \ - } \ - ; -#endif - -#ifndef MAKE_STRING_ENUM -#define MAKE_STRING_ENUM(NAME) \ - namespace NAME \ - { -#endif - -#ifndef ENUM_STRING -#define ENUM_STRING(NAME, VAL) inline constexpr const char* e##NAME = VAL -#endif - -#ifndef END_STRING_ENUM -#define END_STRING_ENUM() } -#endif - -#ifndef RTL_ALLOCA -#define RTL_ALLOCA(sz) __builtin_alloca(sz) -#endif // #ifndef RTL_ALLOCA - -#ifndef CANT_REACH -#define CANT_REACH() __builtin_unreachable() -#endif - -#define kInvalidAddress 0xFBFBFBFBFBFBFBFB -#define kBadAddress 0x0000000000000000 -#define kMaxAddr 0xFFFFFFFFFFFFFFFF -#define kPathLen 0x100 - -#define PACKED ATTRIBUTE(packed) -#define NO_EXEC ATTRIBUTE(noexec) - -#define EXTERN extern -#define STATIC static - -#define CONST const - -#define STRINGIFY(X) #X -#define NE_UNUSED(X) ((NeOS::Void)X) - -#ifndef RGB -#define RGB(R, G, B) (NeOS::UInt32)(R | G << 0x8 | B << 0x10) -#endif // !RGB - -#ifdef __NE_AMD64__ -#define dbg_break_point() asm volatile("int $3") -#else -#define dbg_break_point() ((void)0) -#endif - -#define RTL_ENDIAN(address, value) \ - (((reinterpret_cast(address)[0]) == (value)) \ - ? (NeOS::Endian::kEndianBig) \ - : (NeOS::Endian::kEndianLittle)) - -#define Yes true -#define No false - -#define YES true -#define NO false - -#define TRUE true -#define FALSE false - -#define BOOL NeOS::Boolean - -#ifdef RTL_INIT_OBJECT -#undef RTL_INIT_OBJECT -#endif // ifdef RTL_INIT_OBJECT - -#define RTL_INIT_OBJECT(OBJ, TYPE, ...) TYPE OBJ = TYPE(__VA_ARGS__) diff --git a/dev/Kernel/NewKit/MutableArray.h b/dev/Kernel/NewKit/MutableArray.h deleted file mode 100644 index bfb432de..00000000 --- a/dev/Kernel/NewKit/MutableArray.h +++ /dev/null @@ -1,239 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ -#pragma once - -#include -#include -#include - -#define TRY_FIND_NODE(NAME, NODE) \ - auto* NAME = NODE; \ - while (NAME) \ - { \ - if (NAME->fIndex == Index) \ - return NAME->fVal; \ - NAME = NAME->fNext; \ - } - -#define TRY_FIND_NODE2(NAME, NODE) \ - auto* NAME = NODE; \ - while (NAME) \ - { \ - if (NAME->fIndex == Index) \ - return Ref{NAME->fVal}; \ - NAME = NAME->fNext; \ - } - -#define TRY_REMOVE_NODE(NODE) \ - if (NODE && NODE->fIndex == Index) \ - { \ - NODE->fUsed = false; \ - NODE->fIndex = 0; \ - \ - return true; \ - } - -// FIXME: this is a shitty algorithm, which is consumer hungry. -// Remove and occurences of that, and remove that class. -namespace NeOS -{ - template - class MutableArray; - - template - class NullableMutableArray; - - template - class MutableLinkedList - { - public: - T fVal; - SizeT fIndex{0}; - Boolean fUsed{false}; - - MutableLinkedList* fPrev{nullptr}; - MutableLinkedList* fNext{nullptr}; - }; - - template - class NullableMutableArray - { - public: - // explicit this. - explicit NullableMutableArray() - : fFirstNode(new MutableLinkedList()) - { - } - - /* - * We free all the nodes allocated by the array - * and store the next one inside "NextIt" - */ - - virtual ~NullableMutableArray() - { - auto* It = fFirstNode; - MutableLinkedList* NextIt = nullptr; - - while (It) - { - NextIt = It->fNext; - delete It; - - It = NextIt; - } - } - - NullableMutableArray& operator=(const NullableMutableArray&) = default; - NullableMutableArray(const NullableMutableArray&) = default; - - operator bool() - { - return Count() > 1; - } - - public: - T operator[](const SizeT& Index) const - { - TRY_FIND_NODE(first, fFirstNode); - TRY_FIND_NODE(last, fLastNode); - - return _PlaceHolderValue; - } - - SizeT Count() const - { - return fNodeCount; - } - - public: - Boolean Remove(const SizeT& Index) - { - TRY_REMOVE_NODE(fFirstNode); - TRY_REMOVE_NODE(fLastNode); - - return false; - } - - Boolean Add(const T val) - { - auto* iterationNode = fFirstNode; - MUST_PASS(iterationNode); - - while (iterationNode) - { - if (!iterationNode->fUsed) - { - iterationNode->fVal = val; - iterationNode->fIndex = 0; - - iterationNode->fUsed = true; - - ++fNodeCount; - - return true; - } - - iterationNode = iterationNode->fNext; - } - - return false; - } - - private: - /* Avoid useless lookups */ - MutableLinkedList* fLastNode{nullptr}; - MutableLinkedList* fFirstNode{nullptr}; - - /* Number of nodes inside of this dynamic array. */ - NeOS::SizeT fNodeCount{0}; - - private: - // don't remove that - friend MutableArray; - }; - - template - class MutableArray : public NullableMutableArray - { - public: - // explicit this. - explicit MutableArray() = default; - virtual ~MutableArray() = default; - - NE_COPY_DEFAULT(MutableArray) - - public: - Boolean Add(const T val) - { - auto* iterationNode = fFirstNode; - - if (!iterationNode) - { - fFirstNode = new MutableLinkedList(); - iterationNode = fFirstNode; - } - - MUST_PASS(iterationNode); - - while (iterationNode) - { - if (!iterationNode->fUsed) - { - iterationNode->fVal = val; - iterationNode->fIndex = 0; - - iterationNode->fUsed = true; - - ++fNodeCount; - - return true; - } - - iterationNode = iterationNode->fNext; - } - - return false; - } - - public: - Ref operator[](const SizeT& Index) const - { - TRY_FIND_NODE2(first, fFirstNode); - TRY_FIND_NODE2(last, fLastNode); - - return {}; - } - - SizeT Count() const - { - return fNodeCount; - } - - bool Contains(T& value) noexcept - { - MutableLinkedList* first = fFirstNode; - - while (first) - { - if (first->fVal == value && first->fUsed) - return true; - - first = first->fNext; - } - - return false; - } - - private: - /* Avoid useless lookups */ - MutableLinkedList* fLastNode{nullptr}; - MutableLinkedList* fFirstNode{nullptr}; - - /* Number of nodes inside of this dynamic array. */ - NeOS::SizeT fNodeCount{0}; - }; -} // namespace NeOS diff --git a/dev/Kernel/NewKit/New.h b/dev/Kernel/NewKit/New.h deleted file mode 100644 index 5e1545db..00000000 --- a/dev/Kernel/NewKit/New.h +++ /dev/null @@ -1,20 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -/// @note compatible with tk too. -typedef __SIZE_TYPE__ size_t; - -void* operator new(size_t ptr); -void* operator new[](size_t ptr); - -void operator delete(void* ptr); -void operator delete(void* ptr, unsigned long); -void operator delete[](void* ptr); diff --git a/dev/Kernel/NewKit/NewKit.h b/dev/Kernel/NewKit/NewKit.h deleted file mode 100644 index 69d39824..00000000 --- a/dev/Kernel/NewKit/NewKit.h +++ /dev/null @@ -1,20 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/dev/Kernel/NewKit/OwnPtr.h b/dev/Kernel/NewKit/OwnPtr.h deleted file mode 100644 index 169f16d9..00000000 --- a/dev/Kernel/NewKit/OwnPtr.h +++ /dev/null @@ -1,94 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -namespace NeOS -{ - template - class OwnPtr; - - template - class NonNullRefPtr; - - template - class OwnPtr final - { - public: - OwnPtr() - { - } - ~OwnPtr() - { - this->Delete(); - } - - OwnPtr& operator=(const OwnPtr&) = default; - OwnPtr(const OwnPtr&) = default; - - public: - template - bool New(Args&&... arg) - { - if (fCls) - { - return false; - } - - fCls = new T(arg...); - return fCls; - } - - void Delete() - { - if (fCls) - delete fCls; - - fCls = nullptr; - } - - T* operator->() const - { - return fCls; - }; - T* Raw() - { - return fCls; - } - - Ref AsRef() - { - return Ref(fCls); - } - - operator bool() - { - return fCls; - } - bool operator!() - { - return !fCls; - } - - private: - T* fCls; - }; - - template - OwnPtr make_ptr(Args... args) - { - OwnPtr ret; - ret.template New(forward(args)...); - MUST_PASS(ret); - - return ret; - } -} // namespace NeOS diff --git a/dev/Kernel/NewKit/PageMgr.h b/dev/Kernel/NewKit/PageMgr.h deleted file mode 100644 index 3d8e1f9a..00000000 --- a/dev/Kernel/NewKit/PageMgr.h +++ /dev/null @@ -1,81 +0,0 @@ -// a way to create and find our pages. -// I'm thinking about a separate way of getting a paged area. - -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include - -namespace NeOS -{ - class PageMgr; - - class PTEWrapper final - { - public: - explicit PTEWrapper(Boolean Rw = false, Boolean User = false, Boolean ExecDisable = false, UIntPtr Address = 0); - - ~PTEWrapper(); - - PTEWrapper& operator=(const PTEWrapper&) = default; - PTEWrapper(const PTEWrapper&) = default; - - public: - const UIntPtr VirtualAddress(); - - Void NoExecute(const bool enable = false); - Bool NoExecute(); - - operator bool() - { - return fVirtAddr; - } - - bool Reclaim(); - bool Shareable(); - bool Present(); - bool Access(); - - private: - Boolean fRw; - Boolean fUser; - Boolean fExecDisable; - UIntPtr fVirtAddr; - Boolean fCache; - Boolean fShareable; - Boolean fWt; - Boolean fPresent; - Boolean fAccessed; - - private: - friend class PageMgr; - friend class Pmm; - }; - - struct PageMgr final - { - public: - PageMgr() = default; - ~PageMgr() = default; - - PageMgr& operator=(const PageMgr&) = default; - PageMgr(const PageMgr&) = default; - - public: - PTEWrapper Request(Boolean Rw, Boolean User, Boolean ExecDisable, SizeT Sz); - bool Free(Ref& wrapper); - - private: - void FlushTLB(); - - private: - friend PTEWrapper; - friend class Pmm; - }; -} // namespace NeOS diff --git a/dev/Kernel/NewKit/Pair.h b/dev/Kernel/NewKit/Pair.h deleted file mode 100644 index 05a95ff3..00000000 --- a/dev/Kernel/NewKit/Pair.h +++ /dev/null @@ -1,14 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -namespace NeOS -{ - class Pair; -} // namespace NeOS diff --git a/dev/Kernel/NewKit/Pmm.h b/dev/Kernel/NewKit/Pmm.h deleted file mode 100644 index 97bdc0eb..00000000 --- a/dev/Kernel/NewKit/Pmm.h +++ /dev/null @@ -1,44 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include - -namespace NeOS -{ - class Pmm; - class PTEWrapper; - - class Pmm final - { - public: - explicit Pmm(); - ~Pmm(); - - Pmm& operator=(const Pmm&) = delete; - Pmm(const Pmm&) = default; - - Ref RequestPage(Boolean user = false, Boolean readWrite = false); - Boolean FreePage(Ref refPage); - - Boolean ToggleRw(Ref refPage, Boolean enable = true); - Boolean TogglePresent(Ref refPage, Boolean enable = true); - Boolean ToggleUser(Ref refPage, Boolean enable = true); - Boolean ToggleShare(Ref refPage, Boolean enable = true); - - /// @brief Get the page manager of this. - Ref& Leak() - { - return fPageMgr; - } - - private: - Ref fPageMgr; - }; -} // namespace NeOS diff --git a/dev/Kernel/NewKit/Ref.h b/dev/Kernel/NewKit/Ref.h deleted file mode 100644 index e41bf3bc..00000000 --- a/dev/Kernel/NewKit/Ref.h +++ /dev/null @@ -1,108 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef _NEWKIT_REF_H_ -#define _NEWKIT_REF_H_ - -#include -#include -#include - -namespace NeOS -{ - template - class Ref final - { - public: - Ref() = default; - - ~Ref() - { - if (mm_is_valid_heap(fClass)) - delete fClass; - } - - public: - Ref(T* cls) - : fClass(cls) - { - } - - Ref(T cls) - : fClass(&cls) - { - } - - Ref& operator=(T ref) - { - if (!fClass) - return *this; - - fClass = &ref; - return *this; - } - - public: - T operator->() const - { - MUST_PASS(*fClass); - return *fClass; - } - - T& Leak() noexcept - { - return *fClass; - } - - T& TryLeak() const noexcept - { - MUST_PASS(*fClass); - return *fClass; - } - - T operator*() - { - return *fClass; - } - - operator bool() noexcept - { - return fClass; - } - - private: - T* fClass{nullptr}; - }; - - template - class NonNullRef final - { - public: - NonNullRef() = delete; - NonNullRef(nullPtr) = delete; - - NonNullRef(T* ref) - : fRef(ref) - { - MUST_PASS(ref); - } - - Ref& operator->() - { - MUST_PASS(fRef); - return fRef; - } - - NonNullRef& operator=(const NonNullRef& ref) = delete; - NonNullRef(const NonNullRef& ref) = default; - - private: - Ref fRef{nullptr}; - }; -} // namespace NeOS - -#endif // ifndef _NEWKIT_REF_H_ diff --git a/dev/Kernel/NewKit/Stream.h b/dev/Kernel/NewKit/Stream.h deleted file mode 100644 index 541d3389..00000000 --- a/dev/Kernel/NewKit/Stream.h +++ /dev/null @@ -1,58 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include - -namespace NeOS -{ - template - class Stream final - { - public: - explicit Stream(Ref ref) - : fStream(ref) - { - } - - ~Stream() = default; - - Stream& operator=(const Stream&) = default; - Stream(const Stream&) = default; - - template - friend Stream& operator>>(Stream& Ks, Ref& Buf) - { - Ks.fKind = Ks.fStream->In(Buf); - return *Ks; - } - - template - friend Stream& operator<<(Stream& Ks, Ref& Buf) - { - Ks.fKind = Buf; - Ks.fStream->Out(Buf.Leak()); - return *Ks; - } - - Ref& AsStreamTrait() - { - return fStream; - } - - Ref& AsType() - { - return fKind; - } - - private: - Ref fStream; - Ref fKind; - }; -} // namespace NeOS diff --git a/dev/Kernel/NewKit/Utils.h b/dev/Kernel/NewKit/Utils.h deleted file mode 100644 index 3df823ef..00000000 --- a/dev/Kernel/NewKit/Utils.h +++ /dev/null @@ -1,30 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -namespace NeOS -{ - Int rt_copy_memory(const voidPtr src, voidPtr dst, Size len); - Int rt_move_memory(const voidPtr src, voidPtr dst, Size len); - voidPtr rt_set_memory(voidPtr dst, UInt32 val, Size len); - void rt_zero_memory(voidPtr pointer, Size len); - Int rt_string_cmp(const Char* src, const Char* cmp, Size len); - const Char* rt_alloc_string(const Char* text); - Size rt_string_len(const Char* str); - Size rt_string_len(const Char* str, SizeT _len); - Boolean rt_to_string(Char* str_out, UInt64 base, Int32 limit); - Boolean rt_is_newln(Char chr); - Boolean rt_is_space(Char chr); - Int32 rt_is_alnum(Int32 character); - Int rt_to_uppercase(Int c); - Int rt_to_lower(Int c); - voidPtr rt_string_in_string(const Char* in, const Char* needle); - char* rt_string_has_char(Char* str, const Char chr); -} // namespace NeOS diff --git a/dev/Kernel/NewKit/Variant.h b/dev/Kernel/NewKit/Variant.h deleted file mode 100644 index 82be6636..00000000 --- a/dev/Kernel/NewKit/Variant.h +++ /dev/null @@ -1,72 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -namespace NeOS -{ - class Variant final - { - public: - enum class VariantKind - { - kString, - kBlob, - kNull, - kJson, - kXML, - }; - - public: - explicit Variant() = delete; - - public: - NE_COPY_DEFAULT(Variant); - - ~Variant() = default; - - public: - explicit Variant(KString* stringView) - : fPtr((VoidPtr)stringView), fKind(VariantKind::kString) - { - } - - explicit Variant(Json* json) - : fPtr((VoidPtr)json), fKind(VariantKind::kJson) - { - } - - explicit Variant(nullPtr ptr) - : fPtr(ptr), fKind(VariantKind::kNull) - { - } - - explicit Variant(VoidPtr ptr) - : fPtr(ptr), fKind(VariantKind::kBlob) - { - } - - public: - const Char* ToString(); - VoidPtr Leak(); - - template - T* As() - { - return reinterpret_cast(fPtr); - } - - VariantKind& Kind(); - - private: - voidPtr fPtr{nullptr}; - VariantKind fKind{VariantKind::kNull}; - }; -} // namespace NeOS diff --git a/dev/Kernel/SignalKit/Signals.h b/dev/Kernel/SignalKit/Signals.h deleted file mode 100644 index 09d392f6..00000000 --- a/dev/Kernel/SignalKit/Signals.h +++ /dev/null @@ -1,22 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -typedef NeOS::UInt32 SignalKind; - -#define SIGKILL 0 -#define SIGPAUS 1 -#define SIGEXEC 2 -#define SIGTRAP 3 -#define SIGABRT 4 -#define SIGCONT 5 - -#define SIGBREK 666 -#define SIGATCH 661 -#define SIGDTCH 662 \ No newline at end of file diff --git a/dev/Kernel/StorageKit/AHCI.h b/dev/Kernel/StorageKit/AHCI.h deleted file mode 100644 index 43e81ba0..00000000 --- a/dev/Kernel/StorageKit/AHCI.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -namespace NeOS -{ - class AHCIDeviceInterface NE_DEVICE - { - public: - explicit AHCIDeviceInterface(void (*out)(IDeviceObject* self, MountpointInterface* out), - void (*in)(IDeviceObject* self, MountpointInterface* in), - void (*cleanup)(void)); - - virtual ~AHCIDeviceInterface() override; - - public: - AHCIDeviceInterface& operator=(const AHCIDeviceInterface&) = default; - AHCIDeviceInterface(const AHCIDeviceInterface&) = default; - - const Char* Name() const override; - - const UInt16& GetPortsImplemented() - { - return this->fPortsImplemented; - } - - Void SetPortsImplemented(const UInt16& pi) - { - MUST_PASS(pi > 0); - this->fPortsImplemented = pi; - } - - const UInt32& GetIndex() - { - return this->fDriveIndex; - } - - Void SetIndex(const UInt32& drv) - { - MUST_PASS(MountpointInterface::kDriveIndexInvalid != drv); - this->fDriveIndex = drv; - } - - private: - Void (*fCleanup)(Void) = {nullptr}; - UInt16 fPortsImplemented{0U}; - UInt32 fDriveIndex{0U}; - }; - - UInt16 sk_init_ahci_device(BOOL atapi); - ErrorOr sk_acquire_ahci_device(Int32 drv_index); -} // namespace NeOS diff --git a/dev/Kernel/StorageKit/ATA.h b/dev/Kernel/StorageKit/ATA.h deleted file mode 100644 index 5698fe85..00000000 --- a/dev/Kernel/StorageKit/ATA.h +++ /dev/null @@ -1,39 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include -#include - -namespace NeOS -{ - /// @brief ATA device interface type. - class ATADeviceInterface : public IDeviceObject - { - public: - explicit ATADeviceInterface(void (*Out)(IDeviceObject*, MountpointInterface* outpacket), - void (*In)(IDeviceObject*, MountpointInterface* inpacket), - void (*Cleanup)(void)); - - virtual ~ATADeviceInterface(); - - public: - ATADeviceInterface& operator<<(MountpointInterface* Data) override; - ATADeviceInterface& operator>>(MountpointInterface* Data) override; - - public: - ATADeviceInterface& operator=(const ATADeviceInterface&) = default; - ATADeviceInterface(const ATADeviceInterface&) = default; - - const Char* Name() const override; - - private: - void (*fCleanup)(void) = {nullptr}; - }; -} // namespace NeOS diff --git a/dev/Kernel/StorageKit/NVME.h b/dev/Kernel/StorageKit/NVME.h deleted file mode 100644 index 22300726..00000000 --- a/dev/Kernel/StorageKit/NVME.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include - -namespace NeOS -{ - class NVMEDeviceInterface final NE_DEVICE - { - public: - explicit NVMEDeviceInterface(Void (*out)(IDeviceObject*, MountpointInterface* out_packet), - Void (*in)(IDeviceObject*, MountpointInterface* in_packet), - Void (*cleanup)(Void)); - - ~NVMEDeviceInterface() override; - - public: - NE_COPY_DEFAULT(NVMEDeviceInterface); - - const Char* Name() const override; - - public: - OwnPtr operator()(UInt32 dma_low, UInt32 dma_high, SizeT dma_sz); - - private: - Void (*fCleanup)(Void) = {nullptr}; - }; -} // namespace NeOS diff --git a/dev/Kernel/StorageKit/PRDT.h b/dev/Kernel/StorageKit/PRDT.h deleted file mode 100644 index 40ba11e0..00000000 --- a/dev/Kernel/StorageKit/PRDT.h +++ /dev/null @@ -1,36 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -#define kPrdtTransferSize (sizeof(NeOS::UShort)) - -namespace NeOS -{ - /// @brief Tranfer information about PRD. - enum kPRDTTransfer - { - kPRDTTransferInProgress, - kPRDTTransferIsDone, - kPRDTTransferCount, - }; - - /// @brief Physical Region Descriptor Table. - struct PRDT - { - UInt32 fPhysAddress; - UInt32 fSectorCount; - UInt8 fEndBit; - }; - - void construct_prdt(Ref& prd); - - EXTERN_C Int32 kPRDTTransferStatus; -} // namespace NeOS diff --git a/dev/Kernel/StorageKit/SCSI.h b/dev/Kernel/StorageKit/SCSI.h deleted file mode 100644 index beb8256b..00000000 --- a/dev/Kernel/StorageKit/SCSI.h +++ /dev/null @@ -1,11 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -extern const scsi_packet_type<12> kCDRomPacketTemplate; diff --git a/dev/Kernel/StorageKit/StorageKit.h b/dev/Kernel/StorageKit/StorageKit.h deleted file mode 100644 index a0f1a2d1..00000000 --- a/dev/Kernel/StorageKit/StorageKit.h +++ /dev/null @@ -1,22 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#define kDriveSectorSizeHDD (512U) -#define kDriveSectorSizeSSD (512U) -#define kDriveSectorSizeOptical (2048) - -namespace NeOS -{ - template - class IDeviceObject; - - class NVMEDeviceInterface; - class AHCIDeviceInterface; - class ATADeviceInterface; - class SCSIDeviceInterface; -} // namespace NeOS diff --git a/dev/Kernel/SystemKit/SwapDisk.h b/dev/Kernel/SystemKit/SwapDisk.h deleted file mode 100644 index 11cc6332..00000000 --- a/dev/Kernel/SystemKit/SwapDisk.h +++ /dev/null @@ -1,46 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2024-2025 Amlal EL Mahrouss Labs, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include - -#define kSwapBlockMaxSize (mib_cast(16)) -#define kSwapPageFile "/boot/pagefile.sys" - -/// @file SwapDisk.h -/// @brief Virtual memory swap disk. - -namespace NeOS -{ - struct SWAP_DISK_HEADER; - - /// @brief This class is a disk swap delegate for any data. available as a syscall too. - class SwapDisk final - { - public: - explicit SwapDisk() = default; - ~SwapDisk() = default; - - NE_COPY_DEFAULT(SwapDisk); - - BOOL Write(const Char* fork_name, const SizeT fork_name_len, SWAP_DISK_HEADER* data, const SizeT data_len); - SWAP_DISK_HEADER* Read(const Char* fork_name, const SizeT fork_name_len, const SizeT data_len); - }; - - typedef struct SWAP_DISK_HEADER - { - UInt32 fMagic; - SizeT fHeaderSz; - UInt64 fTeamID; - UInt64 fProcessID; - UInt64 fVirtualAddress; - SizeT fBlobSz; - Char fBlob[]; - } PACKED SWAP_DISK_HEADER; -} // namespace NeOS diff --git a/dev/Kernel/amd64-ci.make b/dev/Kernel/amd64-ci.make deleted file mode 100644 index 534e896c..00000000 --- a/dev/Kernel/amd64-ci.make +++ /dev/null @@ -1,79 +0,0 @@ -################################################## -# (c) Amlal EL Mahrouss, all rights reserved. -# This is the neoskrnl's makefile. -################################################## - -CXX = x86_64-w64-mingw32-g++ -LD = x86_64-w64-mingw32-ld -CCFLAGS = -fshort-wchar -c -D__NE_AMD64__ -mno-red-zone -fno-rtti -fno-exceptions -std=c++20 -D__NE_SUPPORT_NX__ -O0 -I../Vendor -D__FSKIT_INCLUDES_NEFS__ -D__NEOSKRNL__ -D__HAVE_NE_APIS__ -D__FREESTANDING__ -D__NE_VIRTUAL_MEMORY_SUPPORT__ -D__NE_AUTO_FORMAT__ -D__NE__ -I./ -I../ -I../zba - -ASM = nasm - -DISK_DRV = - -ifneq ($(ATA_PIO_SUPPORT), ) -DISK_DRV = -D__ATA_PIO__ -endif - -ifneq ($(ATA_DMA_SUPPORT), ) -DISK_DRV = -D__ATA_DMA__ -endif - -ifneq ($(AHCI_SUPPORT), ) -DISK_DRV = -D__AHCI__ -endif - -ifneq ($(DEBUG_SUPPORT), ) -DEBUG_MACRO = -D__DEBUG__ -endif - -COPY = cp - -# Add assembler, linker, and object files variables. -ASMFLAGS = -f win64 - -# Kernel subsystem is 17 and entrypoint is hal_init_platform -LDFLAGS = -e hal_init_platform --subsystem=17 --image-base 0x4000000 -LDOBJ = obj/*.obj - -# This file is the Kernel, responsible of task, memory, driver, sci, disk and device management. -KERNEL_IMG = neoskrnl.exe - -.PHONY: error -error: - @echo "=== ERROR ===" - @echo "=> Use a specific target." - -MOVEALL=./MoveAll.X64.sh -WINDRES=x86_64-w64-mingw32-windres - -.PHONY: newos-amd64-epm -newos-amd64-epm: clean - $(WINDRES) KernelRsrc.rsrc -O coff -o KernelRsrc.obj - $(CXX) $(CCFLAGS) $(DISK_DRV) $(DEBUG_MACRO) $(wildcard src/*.cc) $(wildcard HALKit/AMD64/PCI/*.cc) $(wildcard src/Network/*.cc) $(wildcard src/Storage/*.cc) $(wildcard src/FS/*.cc) $(wildcard HALKit/AMD64/Storage/*.cc) $(wildcard HALKit/AMD64/*.cc) $(wildcard src/System/*.cc) $(wildcard HALKit/AMD64/*.s) - $(ASM) $(ASMFLAGS) HALKit/AMD64/HalInterruptAPI.asm - $(ASM) $(ASMFLAGS) HALKit/AMD64/HalCommonAPI.asm - $(ASM) $(ASMFLAGS) HALKit/AMD64/HalBoot.asm - $(ASM) $(ASMFLAGS) HALKit/AMD64/HalUtils.asm - $(MOVEALL) - -OBJCOPY=x86_64-w64-mingw32-objcopy - -.PHONY: link-amd64-epm -link-amd64-epm: - $(LD) $(LDFLAGS) $(LDOBJ) -o $(KERNEL_IMG) - -.PHONY: all -all: newos-amd64-epm link-amd64-epm - @echo "Kernel => OK." - -.PHONY: help -help: - @echo "=== HELP ===" - @echo "all: Build Kernel and link it." - @echo "link-amd64-epm: Link Kernel for EPM based disks." - @echo "newos-amd64-epm: Build Kernel for EPM based disks." - -.PHONY: clean -clean: - rm -f $(LDOBJ) $(wildcard *.o) $(KERNEL_IMG) diff --git a/dev/Kernel/amd64-desktop.make b/dev/Kernel/amd64-desktop.make deleted file mode 100644 index 534e896c..00000000 --- a/dev/Kernel/amd64-desktop.make +++ /dev/null @@ -1,79 +0,0 @@ -################################################## -# (c) Amlal EL Mahrouss, all rights reserved. -# This is the neoskrnl's makefile. -################################################## - -CXX = x86_64-w64-mingw32-g++ -LD = x86_64-w64-mingw32-ld -CCFLAGS = -fshort-wchar -c -D__NE_AMD64__ -mno-red-zone -fno-rtti -fno-exceptions -std=c++20 -D__NE_SUPPORT_NX__ -O0 -I../Vendor -D__FSKIT_INCLUDES_NEFS__ -D__NEOSKRNL__ -D__HAVE_NE_APIS__ -D__FREESTANDING__ -D__NE_VIRTUAL_MEMORY_SUPPORT__ -D__NE_AUTO_FORMAT__ -D__NE__ -I./ -I../ -I../zba - -ASM = nasm - -DISK_DRV = - -ifneq ($(ATA_PIO_SUPPORT), ) -DISK_DRV = -D__ATA_PIO__ -endif - -ifneq ($(ATA_DMA_SUPPORT), ) -DISK_DRV = -D__ATA_DMA__ -endif - -ifneq ($(AHCI_SUPPORT), ) -DISK_DRV = -D__AHCI__ -endif - -ifneq ($(DEBUG_SUPPORT), ) -DEBUG_MACRO = -D__DEBUG__ -endif - -COPY = cp - -# Add assembler, linker, and object files variables. -ASMFLAGS = -f win64 - -# Kernel subsystem is 17 and entrypoint is hal_init_platform -LDFLAGS = -e hal_init_platform --subsystem=17 --image-base 0x4000000 -LDOBJ = obj/*.obj - -# This file is the Kernel, responsible of task, memory, driver, sci, disk and device management. -KERNEL_IMG = neoskrnl.exe - -.PHONY: error -error: - @echo "=== ERROR ===" - @echo "=> Use a specific target." - -MOVEALL=./MoveAll.X64.sh -WINDRES=x86_64-w64-mingw32-windres - -.PHONY: newos-amd64-epm -newos-amd64-epm: clean - $(WINDRES) KernelRsrc.rsrc -O coff -o KernelRsrc.obj - $(CXX) $(CCFLAGS) $(DISK_DRV) $(DEBUG_MACRO) $(wildcard src/*.cc) $(wildcard HALKit/AMD64/PCI/*.cc) $(wildcard src/Network/*.cc) $(wildcard src/Storage/*.cc) $(wildcard src/FS/*.cc) $(wildcard HALKit/AMD64/Storage/*.cc) $(wildcard HALKit/AMD64/*.cc) $(wildcard src/System/*.cc) $(wildcard HALKit/AMD64/*.s) - $(ASM) $(ASMFLAGS) HALKit/AMD64/HalInterruptAPI.asm - $(ASM) $(ASMFLAGS) HALKit/AMD64/HalCommonAPI.asm - $(ASM) $(ASMFLAGS) HALKit/AMD64/HalBoot.asm - $(ASM) $(ASMFLAGS) HALKit/AMD64/HalUtils.asm - $(MOVEALL) - -OBJCOPY=x86_64-w64-mingw32-objcopy - -.PHONY: link-amd64-epm -link-amd64-epm: - $(LD) $(LDFLAGS) $(LDOBJ) -o $(KERNEL_IMG) - -.PHONY: all -all: newos-amd64-epm link-amd64-epm - @echo "Kernel => OK." - -.PHONY: help -help: - @echo "=== HELP ===" - @echo "all: Build Kernel and link it." - @echo "link-amd64-epm: Link Kernel for EPM based disks." - @echo "newos-amd64-epm: Build Kernel for EPM based disks." - -.PHONY: clean -clean: - rm -f $(LDOBJ) $(wildcard *.o) $(KERNEL_IMG) diff --git a/dev/Kernel/arm64-desktop.make b/dev/Kernel/arm64-desktop.make deleted file mode 100644 index 1b3521d5..00000000 --- a/dev/Kernel/arm64-desktop.make +++ /dev/null @@ -1,64 +0,0 @@ -################################################## -# (c) Amlal EL Mahrouss, all rights reserved. -# This is the microKernel makefile. -################################################## - -CC = clang++ -LD = lld-link -CCFLAGS = -fshort-wchar -c -ffreestanding -MMD -mno-red-zone -D__NE_ARM64__ -fno-rtti -fno-exceptions -I./ \ - -target aarch64-unknown-windows \ - -std=c++20 -O3 -D__NEOSKRNL__ -D__NE_MINIMAL_OS__ -D__NE_NO_BUILTIN__ -D__HAVE_NE_APIS__ -D__NE__ -I../ - -ASM = clang++ - -DISKDRIVER = -D__USE_FLASH_MEM__ - -ifneq ($(DEBUG_SUPPORT), ) -DEBUG = -D__DEBUG__ -endif - -COPY = cp - -LDFLAGS = -subsystem:efi_application -entry:hal_init_platform /nodefaultlib -LDOBJ = obj/*.obj - -# This file is the Kernel, responsible of task management and memory. -KERNEL = neoskrnl.exe - -.PHONY: error -error: - @echo "=== ERROR ===" - @echo "=> Use a specific target." - -MOVEALL=./MoveAll.ARM64.sh - -.PHONY: newos-arm64-epm -newos-arm64-epm: clean - $(CC) $(CCFLAGS) $(DISKDRIVER) $(DEBUG) $(wildcard src/*.cc) \ - $(wildcard src/FS/*.cc) $(wildcard HALKit/ARM64/Storage/*.cc) \ - $(wildcard HALKit/ARM64/PCI/*.cc) $(wildcard src/Network/*.cc) $(wildcard src/Storage/*.cc) \ - $(wildcard HALKit/ARM64/*.cc) $(wildcard HALKit/ARM64/*.cpp) \ - $(wildcard HALKit/ARM64/*.s) $(wildcard HALKit/ARM64/APM/*.cc) - - $(MOVEALL) - -OBJCOPY=x86_64-w64-mingw32-objcopy - -.PHONY: link-arm64-epm -link-arm64-epm: - $(LD) $(LDFLAGS) $(LDOBJ) /out:$(KERNEL) - -.PHONY: all -all: newos-arm64-epm link-arm64-epm - @echo "Kernel => OK." - -.PHONY: help -help: - @echo "=== HELP ===" - @echo "all: Build Kernel and link it." - @echo "link-arm64-epm: Link Kernel for EPM based disks." - @echo "newos-arm64-epm: Build Kernel for EPM based disks." - -.PHONY: clean -clean: - rm -f $(LDOBJ) $(wildcard *.o) $(KERNEL) diff --git a/dev/Kernel/arm64-mobile.make b/dev/Kernel/arm64-mobile.make deleted file mode 100644 index 1b3521d5..00000000 --- a/dev/Kernel/arm64-mobile.make +++ /dev/null @@ -1,64 +0,0 @@ -################################################## -# (c) Amlal EL Mahrouss, all rights reserved. -# This is the microKernel makefile. -################################################## - -CC = clang++ -LD = lld-link -CCFLAGS = -fshort-wchar -c -ffreestanding -MMD -mno-red-zone -D__NE_ARM64__ -fno-rtti -fno-exceptions -I./ \ - -target aarch64-unknown-windows \ - -std=c++20 -O3 -D__NEOSKRNL__ -D__NE_MINIMAL_OS__ -D__NE_NO_BUILTIN__ -D__HAVE_NE_APIS__ -D__NE__ -I../ - -ASM = clang++ - -DISKDRIVER = -D__USE_FLASH_MEM__ - -ifneq ($(DEBUG_SUPPORT), ) -DEBUG = -D__DEBUG__ -endif - -COPY = cp - -LDFLAGS = -subsystem:efi_application -entry:hal_init_platform /nodefaultlib -LDOBJ = obj/*.obj - -# This file is the Kernel, responsible of task management and memory. -KERNEL = neoskrnl.exe - -.PHONY: error -error: - @echo "=== ERROR ===" - @echo "=> Use a specific target." - -MOVEALL=./MoveAll.ARM64.sh - -.PHONY: newos-arm64-epm -newos-arm64-epm: clean - $(CC) $(CCFLAGS) $(DISKDRIVER) $(DEBUG) $(wildcard src/*.cc) \ - $(wildcard src/FS/*.cc) $(wildcard HALKit/ARM64/Storage/*.cc) \ - $(wildcard HALKit/ARM64/PCI/*.cc) $(wildcard src/Network/*.cc) $(wildcard src/Storage/*.cc) \ - $(wildcard HALKit/ARM64/*.cc) $(wildcard HALKit/ARM64/*.cpp) \ - $(wildcard HALKit/ARM64/*.s) $(wildcard HALKit/ARM64/APM/*.cc) - - $(MOVEALL) - -OBJCOPY=x86_64-w64-mingw32-objcopy - -.PHONY: link-arm64-epm -link-arm64-epm: - $(LD) $(LDFLAGS) $(LDOBJ) /out:$(KERNEL) - -.PHONY: all -all: newos-arm64-epm link-arm64-epm - @echo "Kernel => OK." - -.PHONY: help -help: - @echo "=== HELP ===" - @echo "all: Build Kernel and link it." - @echo "link-arm64-epm: Link Kernel for EPM based disks." - @echo "newos-arm64-epm: Build Kernel for EPM based disks." - -.PHONY: clean -clean: - rm -f $(LDOBJ) $(wildcard *.o) $(KERNEL) diff --git a/dev/Kernel/doc/EPM.pdf b/dev/Kernel/doc/EPM.pdf deleted file mode 100644 index a73834cd..00000000 Binary files a/dev/Kernel/doc/EPM.pdf and /dev/null differ diff --git a/dev/Kernel/doc/Specs.md b/dev/Kernel/doc/Specs.md deleted file mode 100644 index 2cdee1f0..00000000 --- a/dev/Kernel/doc/Specs.md +++ /dev/null @@ -1,63 +0,0 @@ -=================================== - -# 0: General Information - -=================================== - -- ABI and Format: PEF/PE32+. -- Kernel architecture: Portable hybrid Kernel. -- Language: C++/(Assembly (AMD64, X64000, X86S, ARM64, POWER, RISCV)) - -=================================== - -# 1: The Kernel - -=================================== - -- Drive/Device Abstraction. -- SMP, Preemptive Multi Threading. -- Separation of Files/Devices. -- Networking. -- Hardware Abstraction Layer. -- Native Filesystem support (NeFS, FAT32 and ffs2). -- Program Loaders interfaces. -- TLS (Thread Local Storage) support. -- BinaryMutex, Locks, Timers. -- Canary mechanisms. -- Dynamic Sys. -- Cross Platform. -- Permission Selectors. - -=================================== - -# 2: The Filesystem - -=================================== - -- Catalog object with associated forks. -- Large storage support. -- Long file names. -- UNIX path style. - -================================== - -# 3: Common naming conventions: - -================================== - -- Kernel -> ke_init_x -- RunTime -> rt_copy_mem -- Hal -> hal_foo_bar -- Class methods -> Class::FooBar - -=================================== - -# 4: The BootZ - -=================================== - -- Capable of booting from a network drive. -- Loads a PE file which is the Kernel. -- Sanity checks, based on the number of sections. -- Handover compliant. -- Does check for a valid partition (useful in the case of recovering) diff --git a/dev/Kernel/doc/TodoList.md b/dev/Kernel/doc/TodoList.md deleted file mode 100644 index 0b17dc39..00000000 --- a/dev/Kernel/doc/TodoList.md +++ /dev/null @@ -1,25 +0,0 @@ -# TODO list - -- We need preemptive multi-threading. [ X ] -- We then need sync primitives. [ X ] -- We also need a system library for the OS. [ X ] -- We need a bootloader for AMD64 [ X ] - - Implement Boot Services [ X ] - - Design Handover [ X ] - - Load Kernel into memory [ X ] - - Fix bug in Kernel loader, which causes a 06 #UD. [ X ] - - Load Kernel [ X ] - - Add IDT [ X ] - - AHCI driver [ WiP ] -- Context switch x87/SSE/AVX registers [ X ] -- Framebuffer [ X ] -- ATA support [ X ] -- Make installer [ X ] - -Status: - -BootZ: Need to boot from EPM partition. [ X ] -
-neoskrnl: New Filesystem is done. [ X ] - -**Refer to Jira please!** diff --git a/dev/Kernel/obj/.hgkeep b/dev/Kernel/obj/.hgkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Kernel/power64-cb.make b/dev/Kernel/power64-cb.make deleted file mode 100644 index 83ab3235..00000000 --- a/dev/Kernel/power64-cb.make +++ /dev/null @@ -1,4 +0,0 @@ -################################################## -# (c) Amlal EL Mahrouss, all rights reserved. -# This is the microKernel makefile. -################################################## diff --git a/dev/Kernel/riscv64-cb.make b/dev/Kernel/riscv64-cb.make deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Kernel/src/ACPIFactoryInterface.cc b/dev/Kernel/src/ACPIFactoryInterface.cc deleted file mode 100644 index eaa97052..00000000 --- a/dev/Kernel/src/ACPIFactoryInterface.cc +++ /dev/null @@ -1,101 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include - -namespace NeOS -{ - /// @brief Finds a descriptor table inside ACPI XSDT. - ErrorOr ACPIFactoryInterface::Find(const Char* signature) - { - MUST_PASS(this->fRsdp); - - if (!signature) - return ErrorOr{-1}; - - if (*signature == 0) - return ErrorOr{-1}; - - RSDP* rsp_ptr = reinterpret_cast(this->fRsdp); - - if (rsp_ptr->Revision <= 1) - return ErrorOr{-1}; - - RSDT* xsdt = reinterpret_cast(rsp_ptr->RsdtAddress); - - Int64 num = (xsdt->Length - sizeof(SDT)) / sizeof(Int64); - - /*** - crucial to avoid underflows. - */ - if (num < 1) - { - /// stop here, we should have entries... - ke_panic(RUNTIME_CHECK_ACPI); - return ErrorOr{-1}; - } - - this->fEntries = num; - - kout << "ACPI: Number of entries: " << number(this->fEntries) << kendl; - kout << "ACPI: Revision: " << number(xsdt->Revision) << kendl; - kout << "ACPI: Signature: " << xsdt->Signature << kendl; - kout << "ACPI: Address of XSDT: " << hex_number((UIntPtr)xsdt) << kendl; - - const short cAcpiSignatureLength = 4; - - for (Size index = 0; index < this->fEntries; ++index) - { - SDT* sdt = reinterpret_cast(xsdt->AddressArr[index]); - - kout << "ACPI: Checksum: " << number(sdt->Checksum) << kendl; - kout << "ACPI: Revision: " << number(sdt->Revision) << kendl; - - for (short signature_index = 0; signature_index < cAcpiSignatureLength; ++signature_index) - { - if (sdt->Signature[signature_index] != signature[signature_index]) - break; - - if (signature_index == (cAcpiSignatureLength - 1)) - { - kout << "ACPI: SDT Signature: " << sdt->Signature << kendl; - kout << "ACPI: SDT OEM ID: " << sdt->OemId << kendl; - return ErrorOr(reinterpret_cast(xsdt->AddressArr[index])); - } - } - } - - return ErrorOr{-1}; - } - - /*** - @brief Checksum on SDT header. - @param checksum the header to checksum - @param len the length of it. - */ - bool ACPIFactoryInterface::Checksum(const Char* checksum, SSizeT len) - { - if (len == 0) - return 1; - - char chr = 0; - - for (int index = 0; index < len; ++index) - { - chr += checksum[index]; - } - - return chr == 0; - } - - ErrorOr ACPIFactoryInterface::operator[](const Char* signature) - { - return this->Find(signature); - } -} // namespace NeOS diff --git a/dev/Kernel/src/Array.cc b/dev/Kernel/src/Array.cc deleted file mode 100644 index 29baf162..00000000 --- a/dev/Kernel/src/Array.cc +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include diff --git a/dev/Kernel/src/ArrayList.cc b/dev/Kernel/src/ArrayList.cc deleted file mode 100644 index f7221b19..00000000 --- a/dev/Kernel/src/ArrayList.cc +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include diff --git a/dev/Kernel/src/Atom.cc b/dev/Kernel/src/Atom.cc deleted file mode 100644 index 92620c27..00000000 --- a/dev/Kernel/src/Atom.cc +++ /dev/null @@ -1,10 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -// @file Atom.cpp -// @brief Atomic primitives diff --git a/dev/Kernel/src/BinaryMutex.cc b/dev/Kernel/src/BinaryMutex.cc deleted file mode 100644 index 4fdaa8f4..00000000 --- a/dev/Kernel/src/BinaryMutex.cc +++ /dev/null @@ -1,74 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -namespace NeOS -{ - /***********************************************************************************/ - /// @brief Unlocks the semaphore. - /***********************************************************************************/ - Bool BinaryMutex::Unlock() noexcept - { - if (fLockingProcess) - { - fLockingProcess = UserProcess(); - fLockingProcess.Status = ProcessStatusKind::kFrozen; - return Yes; - } - - return No; - } - - /***********************************************************************************/ - /// @brief Locks process in the semaphore. - /***********************************************************************************/ - Bool BinaryMutex::Lock(UserProcess& process) - { - if (!process || fLockingProcess) - return No; - - fLockingProcess = process; - - return Yes; - } - - /***********************************************************************************/ - /// @brief Checks if process is locked. - /***********************************************************************************/ - Bool BinaryMutex::IsLocked() const - { - return fLockingProcess.Status == ProcessStatusKind::kRunning; - } - - /***********************************************************************************/ - /// @brief Try lock or wait. - /***********************************************************************************/ - Bool BinaryMutex::LockOrWait(UserProcess& process, TimerInterface* timer) - { - if (timer == nullptr) - return No; - - this->Lock(process); - - timer->Wait(); - - return this->Lock(process); - } - - /***********************************************************************************/ - /// @brief Wait for process **sec** until we check if it's free. - /// @param sec seconds. - /***********************************************************************************/ - BOOL BinaryMutex::WaitForProcess(const Int16& sec) noexcept - { - HardwareTimer hw_timer(rtl_seconds(sec)); - hw_timer.Wait(); - - return !this->IsLocked(); - } -} // namespace NeOS diff --git a/dev/Kernel/src/BitMapMgr.cc b/dev/Kernel/src/BitMapMgr.cc deleted file mode 100644 index 18b1a156..00000000 --- a/dev/Kernel/src/BitMapMgr.cc +++ /dev/null @@ -1,195 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -#ifdef __NE_AMD64__ -#include -#elif defined(__NE_ARM64__) -#include -#endif - -#include -#include - -#define kBitMapMagic (0x10210U) -#define kBitMapPadSize (mib_cast(16)) - -#define kBitMapMagIdx (0U) -#define kBitMapSizeIdx (1U) -#define kBitMapUsedIdx (2U) - -namespace NeOS -{ - namespace HAL - { - namespace Detail - { - /// \brief Proxy Interface to allocate a bitmap. - class IBitMapProxy final - { - public: - explicit IBitMapProxy() = default; - ~IBitMapProxy() = default; - - NE_COPY_DELETE(IBitMapProxy); - - auto IsBitMap(VoidPtr page_ptr) -> Bool - { - if (!page_ptr) - return No; - - UIntPtr* ptr_bit_set = reinterpret_cast(page_ptr); - - if (!ptr_bit_set[kBitMapMagIdx] || - ptr_bit_set[kBitMapMagIdx] != kBitMapMagic) - return No; - - return Yes; - } - - auto FreeBitMap(VoidPtr page_ptr) -> Bool - { - if (this->IsBitMap(page_ptr) == No) - return No; - - UIntPtr* ptr_bit_set = reinterpret_cast(page_ptr); - - ptr_bit_set[kBitMapMagIdx] = kBitMapMagic; - ptr_bit_set[kBitMapUsedIdx] = No; - - this->GetBitMapStatus(ptr_bit_set); - - return Yes; - } - - UInt32 MakeMMFlags(Bool wr, Bool user) - { - UInt32 flags = kMMFlagsPresent; - - if (wr) - flags |= kMMFlagsWr; - - if (user) - flags |= kMMFlagsUser; - - return flags; - } - - /// @brief Iterate over availables pages for a free one. - /// @return The new address which was found. - auto FindBitMap(VoidPtr base_ptr, SizeT size, Bool wr, Bool user) -> VoidPtr - { - if (!size) - return nullptr; - - VoidPtr base = reinterpret_cast(((UIntPtr)base_ptr) + kPageSize); - - static SizeT biggest_block = 0UL; - - while (YES) - { - UIntPtr* ptr_bit_set = reinterpret_cast(base); - - if (ptr_bit_set[kBitMapMagIdx] == kBitMapMagic && - ptr_bit_set[kBitMapSizeIdx] == size) - { - if (ptr_bit_set[kBitMapUsedIdx] == No) - { - ptr_bit_set[kBitMapSizeIdx] = size; - ptr_bit_set[kBitMapUsedIdx] = Yes; - - this->GetBitMapStatus(ptr_bit_set); - - UInt32 flags = this->MakeMMFlags(wr, user); - mm_map_page(ptr_bit_set, ptr_bit_set, flags); - - if (biggest_block < size) - biggest_block = size; - - return (VoidPtr)ptr_bit_set; - } - } - else if (ptr_bit_set[kBitMapMagIdx] != kBitMapMagic) - { - ptr_bit_set[kBitMapMagIdx] = kBitMapMagic; - ptr_bit_set[kBitMapSizeIdx] = size; - ptr_bit_set[kBitMapUsedIdx] = Yes; - - this->GetBitMapStatus(ptr_bit_set); - - UInt32 flags = this->MakeMMFlags(wr, user); - mm_map_page(ptr_bit_set, ptr_bit_set, flags); - - if (biggest_block < size) - biggest_block = size; - - return (VoidPtr)ptr_bit_set; - } - - base = reinterpret_cast(reinterpret_cast(base) + ((ptr_bit_set[kBitMapMagIdx] != kBitMapMagic) ? (size) : ptr_bit_set[kBitMapSizeIdx])); - } - - return nullptr; - } - - /// @brief Print Bitmap status - auto GetBitMapStatus(UIntPtr* ptr_bit_set) -> Void - { - if (!this->IsBitMap(ptr_bit_set)) - { - kout << "Not a BitMap: " << hex_number((UIntPtr)ptr_bit_set) << kendl; - return; - } - - kout << "Magic Number: " << hex_number(ptr_bit_set[kBitMapMagIdx]) << kendl; - kout << "Is Allocated: " << (ptr_bit_set[kBitMapUsedIdx] ? "Yes" : "No") << kendl; - kout << "Size of BitMap (B): " << number(ptr_bit_set[kBitMapSizeIdx]) << kendl; - kout << "Size of BitMap (KIB): " << number(KIB(ptr_bit_set[kBitMapSizeIdx])) << kendl; - kout << "Size of BitMap (MIB): " << number(MIB(ptr_bit_set[kBitMapSizeIdx])) << kendl; - kout << "Size of BitMap (GIB): " << number(GIB(ptr_bit_set[kBitMapSizeIdx])) << kendl; - kout << "Size of BitMap (TIB): " << number(TIB(ptr_bit_set[kBitMapSizeIdx])) << kendl; - kout << "Address Of BitMap Header: " << hex_number((UIntPtr)ptr_bit_set) << kendl; - } - }; - } // namespace Detail - - auto mm_is_bitmap(VoidPtr ptr) -> Bool - { - Detail::IBitMapProxy bitmp; - return bitmp.IsBitMap(ptr); - } - - /// @brief Allocate a new page to be used by the OS. - /// @param wr read/write bit. - /// @param user user bit. - /// @return a new bitmap allocated pointer. - auto mm_alloc_bitmap(Boolean wr, Boolean user, SizeT size, Bool is_page) -> VoidPtr - { - VoidPtr ptr_new = nullptr; - Detail::IBitMapProxy bitmp; - - ptr_new = bitmp.FindBitMap(kKernelBitMpStart, size, wr, user); - - MUST_PASS(ptr_new); - - return (UIntPtr*)ptr_new; - } - - /// @brief Free Bitmap, and mark it as absent. - /// @param ptr the pointer to free. - auto mm_free_bitmap(VoidPtr ptr) -> Bool - { - if (!ptr) - return No; - - Detail::IBitMapProxy bitmp; - Bool ret = bitmp.FreeBitMap(ptr); - - return ret; - } - } // namespace HAL -} // namespace NeOS diff --git a/dev/Kernel/src/CodeMgr.cc b/dev/Kernel/src/CodeMgr.cc deleted file mode 100644 index c639155d..00000000 --- a/dev/Kernel/src/CodeMgr.cc +++ /dev/null @@ -1,28 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include - -namespace NeOS -{ - /***********************************************************************************/ - /// @brief Executes a new process from a function. Kernel code only. - /// @note This sets up a new stack, anything on the main function that calls the Kernel will not be accessible. - /// @param main the start of the process. - /// @return if the process was started or not. - /***********************************************************************************/ - - ProcessID rtl_create_process(rtl_main_kind main, const Char* process_name) noexcept - { - if (!process_name || - *process_name == 0) - return kProcessInvalidID; - - return UserProcessScheduler::The().Spawn(process_name, reinterpret_cast(main), nullptr); - } -} // namespace NeOS diff --git a/dev/Kernel/src/Crc32.cc b/dev/Kernel/src/Crc32.cc deleted file mode 100644 index 98821602..00000000 --- a/dev/Kernel/src/Crc32.cc +++ /dev/null @@ -1,82 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -// @file CRC32.cpp -// @brief Check sequence implementation. - -namespace NeOS -{ - /// @brief The CRC32 seed table. - UInt32 kCrcTbl[kCrcCnt] = { - 0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, 0xC79A971FL, - 0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, 0x8AD958CFL, 0x78B2DBCCL, - 0x6BE22838L, 0x9989AB3BL, 0x4D43CFD0L, 0xBF284CD3L, 0xAC78BF27L, - 0x5E133C24L, 0x105EC76FL, 0xE235446CL, 0xF165B798L, 0x030E349BL, - 0xD7C45070L, 0x25AFD373L, 0x36FF2087L, 0xC494A384L, 0x9A879FA0L, - 0x68EC1CA3L, 0x7BBCEF57L, 0x89D76C54L, 0x5D1D08BFL, 0xAF768BBCL, - 0xBC267848L, 0x4E4DFB4BL, 0x20BD8EDEL, 0xD2D60DDDL, 0xC186FE29L, - 0x33ED7D2AL, 0xE72719C1L, 0x154C9AC2L, 0x061C6936L, 0xF477EA35L, - 0xAA64D611L, 0x580F5512L, 0x4B5FA6E6L, 0xB93425E5L, 0x6DFE410EL, - 0x9F95C20DL, 0x8CC531F9L, 0x7EAEB2FAL, 0x30E349B1L, 0xC288CAB2L, - 0xD1D83946L, 0x23B3BA45L, 0xF779DEAEL, 0x05125DADL, 0x1642AE59L, - 0xE4292D5AL, 0xBA3A117EL, 0x4851927DL, 0x5B016189L, 0xA96AE28AL, - 0x7DA08661L, 0x8FCB0562L, 0x9C9BF696L, 0x6EF07595L, 0x417B1DBCL, - 0xB3109EBFL, 0xA0406D4BL, 0x522BEE48L, 0x86E18AA3L, 0x748A09A0L, - 0x67DAFA54L, 0x95B17957L, 0xCBA24573L, 0x39C9C670L, 0x2A993584L, - 0xD8F2B687L, 0x0C38D26CL, 0xFE53516FL, 0xED03A29BL, 0x1F682198L, - 0x5125DAD3L, 0xA34E59D0L, 0xB01EAA24L, 0x42752927L, 0x96BF4DCCL, - 0x64D4CECFL, 0x77843D3BL, 0x85EFBE38L, 0xDBFC821CL, 0x2997011FL, - 0x3AC7F2EBL, 0xC8AC71E8L, 0x1C661503L, 0xEE0D9600L, 0xFD5D65F4L, - 0x0F36E6F7L, 0x61C69362L, 0x93AD1061L, 0x80FDE395L, 0x72966096L, - 0xA65C047DL, 0x5437877EL, 0x4767748AL, 0xB50CF789L, 0xEB1FCBADL, - 0x197448AEL, 0x0A24BB5AL, 0xF84F3859L, 0x2C855CB2L, 0xDEEEDFB1L, - 0xCDBE2C45L, 0x3FD5AF46L, 0x7198540DL, 0x83F3D70EL, 0x90A324FAL, - 0x62C8A7F9L, 0xB602C312L, 0x44694011L, 0x5739B3E5L, 0xA55230E6L, - 0xFB410CC2L, 0x092A8FC1L, 0x1A7A7C35L, 0xE811FF36L, 0x3CDB9BDDL, - 0xCEB018DEL, 0xDDE0EB2AL, 0x2F8B6829L, 0x82F63B78L, 0x709DB87BL, - 0x63CD4B8FL, 0x91A6C88CL, 0x456CAC67L, 0xB7072F64L, 0xA457DC90L, - 0x563C5F93L, 0x082F63B7L, 0xFA44E0B4L, 0xE9141340L, 0x1B7F9043L, - 0xCFB5F4A8L, 0x3DDE77ABL, 0x2E8E845FL, 0xDCE5075CL, 0x92A8FC17L, - 0x60C37F14L, 0x73938CE0L, 0x81F80FE3L, 0x55326B08L, 0xA759E80BL, - 0xB4091BFFL, 0x466298FCL, 0x1871A4D8L, 0xEA1A27DBL, 0xF94AD42FL, - 0x0B21572CL, 0xDFEB33C7L, 0x2D80B0C4L, 0x3ED04330L, 0xCCBBC033L, - 0xA24BB5A6L, 0x502036A5L, 0x4370C551L, 0xB11B4652L, 0x65D122B9L, - 0x97BAA1BAL, 0x84EA524EL, 0x7681D14DL, 0x2892ED69L, 0xDAF96E6AL, - 0xC9A99D9EL, 0x3BC21E9DL, 0xEF087A76L, 0x1D63F975L, 0x0E330A81L, - 0xFC588982L, 0xB21572C9L, 0x407EF1CAL, 0x532E023EL, 0xA145813DL, - 0x758FE5D6L, 0x87E466D5L, 0x94B49521L, 0x66DF1622L, 0x38CC2A06L, - 0xCAA7A905L, 0xD9F75AF1L, 0x2B9CD9F2L, 0xFF56BD19L, 0x0D3D3E1AL, - 0x1E6DCDEEL, 0xEC064EEDL, 0xC38D26C4L, 0x31E6A5C7L, 0x22B65633L, - 0xD0DDD530L, 0x0417B1DBL, 0xF67C32D8L, 0xE52CC12CL, 0x1747422FL, - 0x49547E0BL, 0xBB3FFD08L, 0xA86F0EFCL, 0x5A048DFFL, 0x8ECEE914L, - 0x7CA56A17L, 0x6FF599E3L, 0x9D9E1AE0L, 0xD3D3E1ABL, 0x21B862A8L, - 0x32E8915CL, 0xC083125FL, 0x144976B4L, 0xE622F5B7L, 0xF5720643L, - 0x07198540L, 0x590AB964L, 0xAB613A67L, 0xB831C993L, 0x4A5A4A90L, - 0x9E902E7BL, 0x6CFBAD78L, 0x7FAB5E8CL, 0x8DC0DD8FL, 0xE330A81AL, - 0x115B2B19L, 0x020BD8EDL, 0xF0605BEEL, 0x24AA3F05L, 0xD6C1BC06L, - 0xC5914FF2L, 0x37FACCF1L, 0x69E9F0D5L, 0x9B8273D6L, 0x88D28022L, - 0x7AB90321L, 0xAE7367CAL, 0x5C18E4C9L, 0x4F48173DL, 0xBD23943EL, - 0xF36E6F75L, 0x0105EC76L, 0x12551F82L, 0xE03E9C81L, 0x34F4F86AL, - 0xC69F7B69L, 0xD5CF889DL, 0x27A40B9EL, 0x79B737BAL, 0x8BDCB4B9L, - 0x988C474DL, 0x6AE7C44EL, 0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, - 0xAD7D5351L}; - - /// @brief Calculate CRC32 of p - /// @param p the data to compute. - /// @param len the length of the data. - /// @return CRC32 of **p**. - UInt32 ke_calculate_crc32(const Char* p, Int32 len) noexcept - { - UInt32 crc = 0xffffffff; - - while (--len > 0) - crc = kCrcTbl[((UInt8)crc ^ *(p++))] ^ (crc >> 8); - - return ~crc; - } -} // namespace NeOS diff --git a/dev/Kernel/src/CxxAbi-AMD64.cc b/dev/Kernel/src/CxxAbi-AMD64.cc deleted file mode 100644 index f0e57077..00000000 --- a/dev/Kernel/src/CxxAbi-AMD64.cc +++ /dev/null @@ -1,90 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifdef __NE_AMD64__ - -#include -#include -#include - -atexit_func_entry_t __atexit_funcs[kAtExitMacDestructors]; - -uarch_t __atexit_func_count; - -/// @brief dynamic shared object Handle. -NeOS::UIntPtr __dso_handle; - -EXTERN_C NeOS::Void __cxa_pure_virtual(void* self) -{ - kout << "object: " << NeOS::number(reinterpret_cast(self)); - kout << ", has unimplemented virtual functions.\r"; -} - -EXTERN_C void ___chkstk_ms(void) -{ -} - -EXTERN_C int atexit(void (*f)(void*), void* arg, void* dso) -{ - if (__atexit_func_count >= kAtExitMacDestructors) - return 1; - - __atexit_funcs[__atexit_func_count].destructor_func = f; - __atexit_funcs[__atexit_func_count].obj_ptr = arg; - __atexit_funcs[__atexit_func_count].dso_handle = dso; - - __atexit_func_count++; - - return 0; -} - -EXTERN_C void __cxa_finalize(void* f) -{ - uarch_t i = __atexit_func_count; - if (!f) - { - while (i--) - { - if (__atexit_funcs[i].destructor_func) - { - (*__atexit_funcs[i].destructor_func)(__atexit_funcs[i].obj_ptr); - }; - } - - return; - } - - while (i--) - { - if (__atexit_funcs[i].destructor_func) - { - (*__atexit_funcs[i].destructor_func)(__atexit_funcs[i].obj_ptr); - __atexit_funcs[i].destructor_func = 0; - }; - } -} - -namespace cxxabiv1 -{ - EXTERN_C int __cxa_guard_acquire(__guard* g) - { - (void)g; - return 0; - } - - EXTERN_C int __cxa_guard_release(__guard* g) - { - *(char*)g = 1; - return 0; - } - - EXTERN_C void __cxa_guard_abort(__guard* g) - { - (void)g; - } -} // namespace cxxabiv1 - -#endif // ifdef __NE_AMD64__ diff --git a/dev/Kernel/src/CxxAbi-ARM64.cc b/dev/Kernel/src/CxxAbi-ARM64.cc deleted file mode 100644 index b52be160..00000000 --- a/dev/Kernel/src/CxxAbi-ARM64.cc +++ /dev/null @@ -1,107 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifdef __NE_ARM64__ - -#include -#include -#include - -atexit_func_entry_t __atexit_funcs[kAtExitMacDestructors]; - -uarch_t __atexit_func_count; - -/// @brief dynamic shared object Handle. -NeOS::UIntPtr __dso_handle; - -EXTERN_C void __chkstk(void) -{ -} - -EXTERN_C int atexit(void (*f)(void*), void* arg, void* dso) -{ - if (__atexit_func_count >= kAtExitMacDestructors) - return 1; - - __atexit_funcs[__atexit_func_count].destructor_func = f; - __atexit_funcs[__atexit_func_count].obj_ptr = arg; - __atexit_funcs[__atexit_func_count].dso_handle = dso; - - __atexit_func_count++; - - return 0; -} - -EXTERN_C void __cxa_finalize(void* f) -{ - uarch_t i = __atexit_func_count; - if (!f) - { - while (i--) - { - if (__atexit_funcs[i].destructor_func) - { - (*__atexit_funcs[i].destructor_func)(__atexit_funcs[i].obj_ptr); - }; - } - - return; - } - - while (i--) - { - if (__atexit_funcs[i].destructor_func) - { - (*__atexit_funcs[i].destructor_func)(__atexit_funcs[i].obj_ptr); - __atexit_funcs[i].destructor_func = 0; - }; - } -} - -namespace cxxabiv1 -{ - EXTERN_C int __cxa_guard_acquire(__guard* g) - { - (void)g; - return 0; - } - - EXTERN_C int __cxa_guard_release(__guard* g) - { - *(char*)g = 1; - return 0; - } - - EXTERN_C void __cxa_guard_abort(__guard* g) - { - (void)g; - } -} // namespace cxxabiv1 - -EXTERN_C NeOS::Void _purecall(void* self) -{ - kout << "object: " << NeOS::number(reinterpret_cast(self)); - kout << ", has unimplemented virtual functions.\r"; -} - -EXTERN_C NeOS::Void _Init_thread_footer(NeOS::Int* thread_obj) -{ - NE_UNUSED(thread_obj); -} - -EXTERN_C NeOS::Void _Init_thread_epoch(NeOS::Void) -{ - NE_UNUSED(0); -} - -EXTERN_C NeOS::Void _Init_thread_header(NeOS::Int* thread_obj) -{ - NE_UNUSED(0); -} - -EXTERN_C NeOS::Int _tls_index = 0UL; - -#endif // ifdef __NE_ARM64__ diff --git a/dev/Kernel/src/Defines.cc b/dev/Kernel/src/Defines.cc deleted file mode 100644 index c29afcf4..00000000 --- a/dev/Kernel/src/Defines.cc +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include diff --git a/dev/Kernel/src/DeviceMgr.cc b/dev/Kernel/src/DeviceMgr.cc deleted file mode 100644 index 760d17d9..00000000 --- a/dev/Kernel/src/DeviceMgr.cc +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include diff --git a/dev/Kernel/src/DriveMgr+IO.cc b/dev/Kernel/src/DriveMgr+IO.cc deleted file mode 100644 index 8381087f..00000000 --- a/dev/Kernel/src/DriveMgr+IO.cc +++ /dev/null @@ -1,96 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -/************************************************************* - * - * File: DriveMgr+IO.cc - * Purpose: Filesystem to mountpoint interface. - * Date: 3/26/24 - * - * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - * - *************************************************************/ - -/// Useful macros. - -#define rtl_nefs_write(DRV, TRAITS, MP) (MP->DRV()).fOutput(TRAITS) -#define rtl_nefs_read(DRV, TRAITS, MP) (MP->DRV()).fInput(TRAITS) - -namespace NeOS -{ - /// @brief Read from newfs disk. - /// @param Mnt mounted interface. - /// @param DrvTrait drive info - /// @param DrvIndex drive index. - /// @return - Int32 fs_ifs_read(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex) - { - if (!Mnt) - return 1; - - DrvTrait.fPacket.fPacketGood = false; - - switch (DrvIndex) - { - case MountpointInterface::kDriveIndexA: { - rtl_nefs_read(A, DrvTrait.fPacket, Mnt); - break; - } - case MountpointInterface::kDriveIndexB: { - rtl_nefs_read(B, DrvTrait.fPacket, Mnt); - break; - } - case MountpointInterface::kDriveIndexC: { - rtl_nefs_read(C, DrvTrait.fPacket, Mnt); - break; - } - case MountpointInterface::kDriveIndexD: { - rtl_nefs_read(D, DrvTrait.fPacket, Mnt); - break; - } - } - - return DrvTrait.fPacket.fPacketGood; - } - - /// @brief Write to newfs disk. - /// @param Mnt mounted interface. - /// @param DrvTrait drive info - /// @param DrvIndex drive index. - /// @return - Int32 fs_ifs_write(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex) - { - if (!Mnt) - return 1; - - DrvTrait.fPacket.fPacketGood = false; - - switch (DrvIndex) - { - case MountpointInterface::kDriveIndexA: { - rtl_nefs_write(A, DrvTrait.fPacket, Mnt); - break; - } - case MountpointInterface::kDriveIndexB: { - rtl_nefs_write(B, DrvTrait.fPacket, Mnt); - break; - } - case MountpointInterface::kDriveIndexC: { - rtl_nefs_write(C, DrvTrait.fPacket, Mnt); - break; - } - case MountpointInterface::kDriveIndexD: { - rtl_nefs_write(D, DrvTrait.fPacket, Mnt); - break; - } - } - - return DrvTrait.fPacket.fPacketGood; - } -} // namespace NeOS \ No newline at end of file diff --git a/dev/Kernel/src/DriveMgr.cc b/dev/Kernel/src/DriveMgr.cc deleted file mode 100644 index 27c082ed..00000000 --- a/dev/Kernel/src/DriveMgr.cc +++ /dev/null @@ -1,235 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include -#include -#include -#include - -/***********************************************************************************/ -/// @file DriveMgr.cc -/// @brief Drive Manager of kernel. -/***********************************************************************************/ - -namespace NeOS -{ -#if defined(__ATA_PIO__) || defined(__ATA_DMA__) - STATIC UInt16 kATAIO = 0U; - STATIC UInt8 kATAMaster = 0U; -#endif - -#if defined(__AHCI__) - STATIC UInt16 kAHCIPortsImplemented = 0UL; -#endif - - /// @brief reads from an ATA drive. - /// @param pckt Packet structure (fPacketContent must be non null) - /// @return - Void io_drv_input(DriveTrait::DrivePacket pckt) - { -#ifdef __AHCI__ - drv_std_read(pckt.fPacketLba, (Char*)pckt.fPacketContent, kAHCISectorSize, pckt.fPacketSize); -#elif defined(__ATA_PIO__) || defined(__ATA_DMA__) - drv_std_read(pckt.fPacketLba, kATAIO, kATAMaster, (Char*)pckt.fPacketContent, kATASectorSize, pckt.fPacketSize); -#endif - } - - /// @brief Writes to an ATA drive. - /// @param pckt the packet to write. - /// @return - Void io_drv_output(DriveTrait::DrivePacket pckt) - { - if (pckt.fPacketReadOnly) - { - pckt.fPacketGood = NO; - return; - } - -#ifdef __AHCI__ - drv_std_write(pckt.fPacketLba, (Char*)pckt.fPacketContent, kAHCISectorSize, pckt.fPacketSize); -#elif defined(__ATA_PIO__) || defined(__ATA_DMA__) - drv_std_write(pckt.fPacketLba, kATAIO, kATAMaster, (Char*)pckt.fPacketContent, kATASectorSize, pckt.fPacketSize); -#endif - } - - /// @brief Executes a disk check on the ATA drive. - /// @param pckt the packet to read. - /// @return - Void io_drv_init(DriveTrait::DrivePacket pckt) - { -#if defined(__ATA_PIO__) || defined(__ATA_DMA__) - kATAMaster = 0; - kATAIO = 0; - - kATAMaster = YES; - kATAIO = ATA_PRIMARY_IO; - - if (drv_std_init(kATAIO, kATAMaster, kATAIO, kATAMaster)) - { - pckt.fPacketGood = YES; - return; - } - - kATAMaster = NO; - kATAIO = ATA_SECONDARY_IO; - - if (!drv_std_init(kATAIO, kATAMaster, kATAIO, kATAMaster)) - { - pckt.fPacketGood = YES; - return; - } - - pckt.fPacketGood = YES; -#elif defined(__AHCI__) - kAHCIPortsImplemented = 0; - - if (!drv_std_init(kAHCIPortsImplemented)) - { - return; - } - - pckt.fPacketGood = YES; -#endif // if defined(__ATA_PIO__) || defined (__ATA_DMA__) - } - -/// @brief Gets the drive kind (ATA, SCSI, AHCI...) -/// @param void no arguments. -/// @return no arguments. -#ifdef __ATA_PIO__ - const Char* io_drv_kind(Void) - { - return "ATA-PIO"; - } -#endif -#ifdef __ATA_DMA__ - const Char* io_drv_kind(Void) - { - return "ATA-DMA"; - } -#endif -#ifdef __AHCI__ - const Char* io_drv_kind(Void) - { - return "AHCI"; - } -#endif -#ifdef __NE_MINIMAL_OS__ - const Char* io_drv_kind(Void) - { - return "Not Loaded"; - } -#endif - - /// @brief Unimplemented drive function. - /// @param pckt the packet to read. - Void io_drv_unimplemented(DriveTrait::DrivePacket pckt) noexcept - { - NE_UNUSED(pckt); - } - - /// @brief Makes a new drive. - /// @return the new blank drive. - DriveTrait io_construct_blank_drive() noexcept - { - DriveTrait trait; - - constexpr auto kBlankDrive = "/media/blank/"; - - rt_copy_memory((VoidPtr)kBlankDrive, trait.fName, rt_string_len(kBlankDrive)); - trait.fKind = kInvalidDrive; - - trait.fInput = io_drv_unimplemented; - trait.fOutput = io_drv_unimplemented; - trait.fVerify = io_drv_unimplemented; - trait.fInit = io_drv_unimplemented; - trait.fDriveKind = io_drv_kind; - - kout << "Construct: " << trait.fName << "\r"; - - return trait; - } - - namespace Detail - { - Void io_detect_drive(DriveTrait& trait) - { - trait.fInit(trait.fPacket); - - EPM_PART_BLOCK block_struct; - - trait.fPacket.fPacketLba = kEPMBootBlockLba; - trait.fPacket.fPacketSize = sizeof(EPM_PART_BLOCK); - trait.fPacket.fPacketContent = &block_struct; - - rt_copy_memory((VoidPtr) "fs/detect-packet", trait.fPacket.fPacketMime, - rt_string_len("fs/detect-packet")); - - trait.fInput(trait.fPacket); - - if (rt_string_cmp(((EPM_PART_BLOCK*)trait.fPacket.fPacketContent)->Magic, kEPMMagic, kEPMMagicLength) == 0) - { - trait.fPacket.fPacketReadOnly = NO; - trait.fKind = kMassStorageDrive | kEPMDrive; - - kout << "Disk is EPM.\r"; - - trait.fSectorSz = block_struct.SectorSz; - trait.fLbaEnd = block_struct.LbaEnd; - trait.fLbaStart = block_struct.LbaStart; - } - else - { - trait.fPacket.fPacketReadOnly = YES; - trait.fKind = kMassStorageDrive | kUnformattedDrive | kReadOnlyDrive; - - if (block_struct.Name[0] == 0 || - !rt_is_alnum(block_struct.Name[0])) - { - kout << "Disk partition is empty (Read Only)\r"; - } - else - { - kout << "Scheme Found: " << block_struct.Name << kendl; - } - } - - rt_copy_memory((VoidPtr) "*/*", trait.fPacket.fPacketMime, - rt_string_len("*/*")); - - trait.fPacket.fPacketLba = 0; - trait.fPacket.fPacketSize = 0UL; - trait.fPacket.fPacketContent = nullptr; - } - } // namespace Detail - - /// @brief Fetches the main drive. - /// @return the new drive. (returns kEPMDrive if EPM formatted) - DriveTrait io_construct_main_drive() noexcept - { - DriveTrait trait; - - constexpr auto kMainDrive = "/media/sda/"; - - rt_copy_memory((VoidPtr)kMainDrive, trait.fName, rt_string_len(kMainDrive)); - - MUST_PASS(trait.fName[0] != 0); - - trait.fVerify = io_drv_unimplemented; - trait.fOutput = io_drv_output; - trait.fInput = io_drv_input; - trait.fInit = io_drv_init; - trait.fDriveKind = io_drv_kind; - - kout << "Detecting partition scheme of: " << trait.fName << ".\r"; - - Detail::io_detect_drive(trait); - - return trait; - } -} // namespace NeOS diff --git a/dev/Kernel/src/ErrorOr.cc b/dev/Kernel/src/ErrorOr.cc deleted file mode 100644 index 7a55715c..00000000 --- a/dev/Kernel/src/ErrorOr.cc +++ /dev/null @@ -1,12 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -/***********************************************************************************/ -/// @file ErrorOr.cc /// -/// @brief ErrorOr container class. /// -/***********************************************************************************/ diff --git a/dev/Kernel/src/FS/HPFS.cc b/dev/Kernel/src/FS/HPFS.cc deleted file mode 100644 index a3b1cab5..00000000 --- a/dev/Kernel/src/FS/HPFS.cc +++ /dev/null @@ -1,22 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifdef __FSKIT_INCLUDES_HPFS__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif // ifdef __FSKIT_INCLUDES_HPFS__ diff --git a/dev/Kernel/src/FS/NeFS+FileMgr.cc b/dev/Kernel/src/FS/NeFS+FileMgr.cc deleted file mode 100644 index 0ac6384d..00000000 --- a/dev/Kernel/src/FS/NeFS+FileMgr.cc +++ /dev/null @@ -1,245 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -#ifndef __NE_MINIMAL_OS__ -#ifdef __FSKIT_INCLUDES_NEFS__ - -/// @brief NeFS File manager. -/// BUGS: 0 - -namespace NeOS -{ - /// @brief C++ constructor - NeFileSystemMgr::NeFileSystemMgr() - { - NeFileSystemParser* mParser = new NeFileSystemParser(); - MUST_PASS(mParser); - - kout << "We are done allocating NeFileSystemParser...\r"; - } - - NeFileSystemMgr::~NeFileSystemMgr() - { - if (mParser) - { - kout << "Destroying NeFileSystemParser...\r"; - mm_delete_class(&mParser); - } - } - - /// @brief Removes a node from the filesystem. - /// @param path The filename - /// @return If it was deleted or not. - bool NeFileSystemMgr::Remove(_Input const Char* path) - { - if (path == nullptr || *path == 0) - return false; - - return mParser->RemoveCatalog(path); - } - - /// @brief Creates a node with the specified. - /// @param path The filename path. - /// @return The Node pointer. - NodePtr NeFileSystemMgr::Create(_Input const Char* path) - { - return node_cast(mParser->CreateCatalog(path)); - } - - /// @brief Creates a node with is a directory. - /// @param path The filename path. - /// @return The Node pointer. - NodePtr NeFileSystemMgr::CreateDirectory(const Char* path) - { - return node_cast(mParser->CreateCatalog(path, 0, kNeFSCatalogKindDir)); - } - - /// @brief Creates a node with is a alias. - /// @param path The filename path. - /// @return The Node pointer. - NodePtr NeFileSystemMgr::CreateAlias(const Char* path) - { - return node_cast(mParser->CreateCatalog(path, 0, kNeFSCatalogKindAlias)); - } - - /// @brief Creates a node with is a page file. - /// @param path The filename path. - /// @return The Node pointer. - NodePtr NeFileSystemMgr::CreateSwapFile(const Char* path) - { - return node_cast(mParser->CreateCatalog(path, 0, kNeFSCatalogKindPage)); - } - - /// @brief Gets the root directory. - /// @return - const Char* NeFileSystemHelper::Root() - { - return kNeFSRoot; - } - - /// @brief Gets the up-dir directory. - /// @return - const Char* NeFileSystemHelper::UpDir() - { - return kNeFSUpDir; - } - - /// @brief Gets the separator character. - /// @return - const Char NeFileSystemHelper::Separator() - { - return kNeFSSeparator; - } - - /// @brief Gets the metafile character. - /// @return - const Char NeFileSystemHelper::MetaFile() - { - return kNeFSMetaFilePrefix; - } - - /// @brief Opens a new file. - /// @param path - /// @param r - /// @return - _Output NodePtr NeFileSystemMgr::Open(_Input const Char* path, _Input const Char* r) - { - if (!path || *path == 0) - return nullptr; - - if (!r || *r == 0) - return nullptr; - - auto catalog = mParser->GetCatalog(path); - - return node_cast(catalog); - } - - /// @brief Writes to a catalog's fork. - /// @param node the node ptr. - /// @param data the data. - /// @param flags the size. - /// @return - Void NeFileSystemMgr::Write(_Input NodePtr node, _Input VoidPtr data, _Input Int32 flags, _Input SizeT size) - { - if (!node) - return; - if (!size) - return; - - constexpr auto kDataForkName = kNeFSDataFork; - this->Write(kDataForkName, node, data, flags, size); - } - - /// @brief Read from filesystem fork. - /// @param node the catalog node. - /// @param flags the flags with it. - /// @param sz the size to read. - /// @return - _Output VoidPtr NeFileSystemMgr::Read(_Input NodePtr node, _Input Int32 flags, _Input SizeT size) - { - if (!node) - return nullptr; - if (!size) - return nullptr; - - constexpr auto kDataForkName = kNeFSDataFork; - return this->Read(kDataForkName, node, flags, size); - } - - Void NeFileSystemMgr::Write(_Input const Char* name, - _Input NodePtr node, - _Input VoidPtr data, - _Input Int32 flags, - _Input SizeT size) - { - if (!size || - size > kNeFSForkSize) - return; - - if (!data) - return; - - NE_UNUSED(flags); - - if ((reinterpret_cast(node))->Kind == kNeFSCatalogKindFile) - mParser->WriteCatalog(reinterpret_cast(node)->Name, (flags & kFileFlagRsrc ? true : false), data, size, - name); - } - - _Output VoidPtr NeFileSystemMgr::Read(_Input const Char* name, - _Input NodePtr node, - _Input Int32 flags, - _Input SizeT sz) - { - if (sz > kNeFSForkSize) - return nullptr; - - if (!sz) - return nullptr; - - NE_UNUSED(flags); - - if ((reinterpret_cast(node))->Kind == kNeFSCatalogKindFile) - return mParser->ReadCatalog(reinterpret_cast(node), (flags & kFileFlagRsrc ? true : false), sz, - name); - - return nullptr; - } - - /// @brief Seek from Catalog. - /// @param node - /// @param off - /// @retval true always returns false, this is unimplemented. - /// @retval false always returns this, it is unimplemented. - - _Output Bool NeFileSystemMgr::Seek(NodePtr node, SizeT off) - { - if (!node || off == 0) - return false; - - return mParser->Seek(reinterpret_cast(node), off); - } - - /// @brief Tell where the catalog is. - /// @param node - /// @retval true always returns false, this is unimplemented. - /// @retval false always returns this, it is unimplemented. - - _Output SizeT NeFileSystemMgr::Tell(NodePtr node) - { - if (!node) - return kNPos; - - return mParser->Tell(reinterpret_cast(node)); - } - - /// @brief Rewinds the catalog. - /// @param node - /// @retval true always returns false, this is unimplemented. - /// @retval false always returns this, it is unimplemented. - - _Output Bool NeFileSystemMgr::Rewind(NodePtr node) - { - if (!node) - return false; - - return this->Seek(node, 0); - } - - /// @brief Returns the filesystem parser. - /// @return the Filesystem parser class. - _Output NeFileSystemParser* NeFileSystemMgr::GetParser() noexcept - { - return mParser; - } -} // namespace NeOS - -#endif // ifdef __FSKIT_INCLUDES_NEFS__ -#endif // ifndef __NE_MINIMAL_OS__ diff --git a/dev/Kernel/src/FS/NeFS.cc b/dev/Kernel/src/FS/NeFS.cc deleted file mode 100644 index 2742b03d..00000000 --- a/dev/Kernel/src/FS/NeFS.cc +++ /dev/null @@ -1,1065 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifdef __FSKIT_INCLUDES_NEFS__ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace NeOS; - -#ifdef __NE_NO_BUILTIN__ -/***********************************************************************************/ -/** - Define those external symbols, to make the editor shutup -*/ -/***********************************************************************************/ - -/***********************************************************************************/ -/// @brief get sector count. -/***********************************************************************************/ -NeOS::SizeT drv_get_sector_count(); - -/***********************************************************************************/ -/// @brief get device size. -/***********************************************************************************/ -NeOS::SizeT drv_get_size(); - -#endif - -///! BUGS: 0 - -/***********************************************************************************/ -/// This file implements the New extended File System. -/// New extended File System implements a B-Tree based algortihm. -/// / -/// /Path1/ /ath2/ -/// /readme.rtf /ListContents.pef /readme.lnk <-- symlink. -/// /Path1/readme.rtf -/***********************************************************************************/ - -STATIC MountpointInterface kMountpoint; - -/***********************************************************************************/ -/// @brief Creates a new fork inside the New filesystem partition. -/// @param catalog it's catalog -/// @param the_fork the fork itself. -/// @return the fork -/***********************************************************************************/ -_Output BOOL NeFileSystemParser::CreateFork(_Input NEFS_FORK_STRUCT& the_fork) -{ - if (the_fork.ForkName[0] != 0 && - the_fork.CatalogName[0] != 0 && - the_fork.DataSize > 0) - { - auto catalog = this->GetCatalog(the_fork.CatalogName); - - if (!catalog) - return NO; - - Lba lba = catalog->DataFork; - - kout << "Fork LBA: " << hex_number(lba) << kendl; - - if (lba < kNeFSCatalogStartAddress) - return NO; - - auto& drv = kMountpoint.A(); - - Lba lba_prev = lba; - - NEFS_FORK_STRUCT prev_fork; - NEFS_FORK_STRUCT cur_fork; - - /// do not check for anything. Loop until we get what we want, that is a free fork zone. - while (drv.fPacket.fPacketGood) - { - drv.fPacket.fPacketLba = lba; - drv.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT); - drv.fPacket.fPacketContent = &cur_fork; - - drv.fInput(drv.fPacket); - - kout << "Next fork: " << hex_number(cur_fork.NextSibling) << kendl; - - if (cur_fork.Flags & kNeFSFlagCreated) - { - kout << "Error: Fork does exists.\r"; - - /// sanity check. - if (KStringBuilder::Equals(cur_fork.ForkName, the_fork.ForkName) && - KStringBuilder::Equals(cur_fork.CatalogName, the_fork.CatalogName)) - break; - - lba_prev = lba; - lba = cur_fork.NextSibling; - - prev_fork = cur_fork; - } - else - { - /// This is a check that we have, in order to link the previous fork - /// entry. - if (lba >= kNeFSCatalogStartAddress) - { - drv.fPacket.fPacketLba = lba_prev; - drv.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT); - drv.fPacket.fPacketContent = &prev_fork; - - prev_fork.NextSibling = lba; - - /// write to disk. - drv.fOutput(drv.fPacket); - } - - break; - } - } - - the_fork.Flags |= kNeFSFlagCreated; - the_fork.DataOffset = lba - sizeof(NEFS_FORK_STRUCT); - the_fork.PreviousSibling = lba_prev; - the_fork.NextSibling = the_fork.DataOffset - the_fork.DataSize; - - drv.fPacket.fPacketLba = lba; - drv.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT); - drv.fPacket.fPacketContent = &the_fork; - - kout << "Allocating fork block...\r"; - - // drv.fOutput(drv.fPacket); - - fs_ifs_write(&kMountpoint, drv, MountpointInterface::kDriveIndexA); - - /// log what we have now. - kout << "Fork offset is at: " << hex_number(the_fork.DataOffset) - << kendl; - - kout << "Wrote fork metadata at: " << hex_number(lba) << kendl; - - return YES; - } - - return NO; -} - -/***********************************************************************************/ -/// @brief Find fork inside filesystem. -/// @param catalog the catalog. -/// @param name the fork name. -/// @return the newly found fork. -/***********************************************************************************/ -_Output NEFS_FORK_STRUCT* NeFileSystemParser::FindFork(_Input NEFS_CATALOG_STRUCT* catalog, - _Input const Char* name, - _Input Boolean is_data) -{ - auto& drive = kMountpoint.A(); - NEFS_FORK_STRUCT* the_fork = nullptr; - - Lba lba = is_data ? catalog->DataFork : catalog->ResourceFork; - - while (lba != 0) - { - drive.fPacket.fPacketLba = lba; - drive.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT); - drive.fPacket.fPacketContent = (VoidPtr)the_fork; - - rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime, 16); - - if (auto res = - fs_ifs_read(&kMountpoint, drive, this->mDriveIndex); - res) - { - switch (res) - { - case 1: - err_global_get() = kErrorDiskReadOnly; - break; - case 2: - err_global_get() = kErrorDiskIsFull; - break; - case 3: - err_global_get() = kErrorNoSuchDisk; - break; - - default: - break; - } - return nullptr; - } - - if (KStringBuilder::Equals(the_fork->ForkName, name)) - { - break; - } - - lba = the_fork->NextSibling; - } - - return the_fork; -} - -/***********************************************************************************/ -/// @brief Simpler factory to create a catalog (assumes you want to create a -/// file.) -/// @param name -/// @return catalog pointer. -/***********************************************************************************/ -_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char* name) -{ - return this->CreateCatalog(name, 0, kNeFSCatalogKindFile); -} - -/***********************************************************************************/ -/// @brief Creates a new catalog into the disk. -/// @param name the catalog name. -/// @param flags the flags of the catalog. -/// @param kind the catalog kind. -/// @return catalog pointer. -/***********************************************************************************/ -_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char* name, - _Input const Int32& flags, - _Input const Int32& kind) -{ - kout << "CreateCatalog(*...*)\r"; - - Lba out_lba = 0UL; - - kout << "Checking for path separator...\r"; - - /// a directory should have a slash in the end. - if (kind == kNeFSCatalogKindDir && - name[rt_string_len(name) - 1] != NeFileSystemHelper::Separator()) - return nullptr; - - /// a file shouldn't have a slash in the end. - if (kind != kNeFSCatalogKindDir && - name[rt_string_len(name) - 1] == NeFileSystemHelper::Separator()) - return nullptr; - - NEFS_CATALOG_STRUCT* catalog_copy = this->FindCatalog(name, out_lba); - - if (catalog_copy) - { - kout << "Catalog already exists: " << name << ".\r"; - err_global_get() = kErrorFileExists; - - delete catalog_copy; - catalog_copy = nullptr; - - return nullptr; - } - - Char parent_name[kNeFSCatalogNameLen] = {0}; - - for (SizeT indexName = 0UL; indexName < rt_string_len(name); ++indexName) - { - parent_name[indexName] = name[indexName]; - } - - if (*parent_name == 0) - { - kout << "Parent name is NUL.\r"; - err_global_get() = kErrorFileNotFound; - return nullptr; - } - - /// Locate parent catalog, to then allocate right after it. - - for (SizeT index_fill = 0; index_fill < rt_string_len(name); ++index_fill) - { - parent_name[index_fill] = name[index_fill]; - } - - SizeT index_reverse_copy = rt_string_len(parent_name); - - // zero character it. - parent_name[--index_reverse_copy] = 0; - - // mandatory / character, zero it. - parent_name[--index_reverse_copy] = 0; - - while (parent_name[index_reverse_copy] != NeFileSystemHelper::Separator()) - { - parent_name[index_reverse_copy] = 0; - --index_reverse_copy; - } - - NEFS_CATALOG_STRUCT* catalog = this->FindCatalog(parent_name, out_lba); - - auto& drive = kMountpoint.A(); - - constexpr auto kNeFSCatalogPadding = 4; - - if (catalog && catalog->Kind == kNeFSCatalogKindFile) - { - kout << "Parent is a file.\r"; - delete catalog; - - return nullptr; - } - else if (!catalog) - { - Char part_block[sizeof(NEFS_ROOT_PARTITION_BLOCK)] = {0}; - - drive.fPacket.fPacketContent = part_block; - drive.fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); - drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress; - - drive.fInput(drive.fPacket); - - NEFS_ROOT_PARTITION_BLOCK* blk_nefs = (NEFS_ROOT_PARTITION_BLOCK*)part_block; - out_lba = blk_nefs->StartCatalog; - } - - if (drive.fPacket.fPacketReadOnly) - return nullptr; - - NEFS_CATALOG_STRUCT* child_catalog = new NEFS_CATALOG_STRUCT(); - - child_catalog->Checksum = 0; - child_catalog->ResourceForkSize = 0UL; - child_catalog->DataForkSize = 0UL; - child_catalog->CatalogFlags = kNeFSStatusUnlocked; - child_catalog->NextSibling = out_lba; - child_catalog->PrevSibling = out_lba; - child_catalog->Kind = kind; - child_catalog->Flags |= kNeFSFlagCreated; - child_catalog->CatalogFlags = flags; - - SizeT i = rt_string_len(name); - - // get rid pf \0 - --i; - - if (kind == kNeFSCatalogKindDir) - --i; - - while (name[i] != '/') - --i; - - rt_copy_memory((VoidPtr)(name + i), (VoidPtr)child_catalog->Name, - rt_string_len(name)); - - NEFS_CATALOG_STRUCT temporary_catalog{}; - - Lba start_free = out_lba; - - rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime, - rt_string_len("fs/nefs-packet")); - - Char buf_part_block[sizeof(NEFS_ROOT_PARTITION_BLOCK)] = {0}; - - drive.fPacket.fPacketContent = buf_part_block; - drive.fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); - drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress; - - drive.fInput(drive.fPacket); - - NEFS_ROOT_PARTITION_BLOCK* part_block = (NEFS_ROOT_PARTITION_BLOCK*)buf_part_block; - - drive.fPacket.fPacketContent = &temporary_catalog; - drive.fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT); - drive.fPacket.fPacketLba = start_free; - - drive.fInput(drive.fPacket); - - if (part_block->FreeCatalog < 1) - { - delete child_catalog; - child_catalog = nullptr; - - return nullptr; - } - - kout << "Start finding catalog to allocate or empty space...\r"; - - while (start_free >= part_block->StartCatalog) - { - // ========================== // - // Allocate catalog now... - // ========================== // - if ((temporary_catalog.Flags & kNeFSFlagCreated) == 0) - { - child_catalog->NextSibling = - start_free + (sizeof(NEFS_CATALOG_STRUCT) * kNeFSCatalogPadding); - - drive.fPacket.fPacketContent = &temporary_catalog; - drive.fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT); - drive.fPacket.fPacketLba = start_free; - - drive.fOutput(drive.fPacket); - - child_catalog->DataFork = part_block->DiskSize - start_free; - child_catalog->ResourceFork = child_catalog->DataFork; - - drive.fPacket.fPacketContent = child_catalog; - drive.fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT); - drive.fPacket.fPacketLba = start_free; - - drive.fOutput(drive.fPacket); - - // Get NeFS partition's block. - - drive.fPacket.fPacketContent = buf_part_block; - drive.fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); - drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress; - - drive.fInput(drive.fPacket); - - part_block->FreeSectors -= 1; - part_block->CatalogCount += 1; - part_block->FreeCatalog -= 1; - - drive.fOutput(drive.fPacket); - - kout << "Create new catalog with flags: " - << hex_number(child_catalog->Flags) << kendl; - kout << "Create new catalog with name: " << child_catalog->Name - << kendl; - - delete catalog; - catalog = nullptr; - - NEFS_CATALOG_STRUCT* found_catalog = new NEFS_CATALOG_STRUCT(); - rt_copy_memory(&temporary_catalog, found_catalog, sizeof(NEFS_CATALOG_STRUCT)); - - return found_catalog; - } - else if ((temporary_catalog.Flags & kNeFSFlagCreated) && - KStringBuilder::Equals(temporary_catalog.Name, name)) - { - rt_copy_memory(&temporary_catalog, child_catalog, sizeof(NEFS_CATALOG_STRUCT)); - - return child_catalog; - } - - start_free = start_free + (sizeof(NEFS_CATALOG_STRUCT) * kNeFSCatalogPadding); - - drive.fPacket.fPacketContent = &temporary_catalog; - drive.fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT); - drive.fPacket.fPacketLba = start_free; - - drive.fInput(drive.fPacket); - } - - delete catalog; - return nullptr; -} - -/// @brief Make a EPM+NeFS drive out of the disk. -/// @param drive The drive to write on. -/// @return If it was sucessful, see err_global_get(). -bool NeFileSystemParser::Format(_Input _Output DriveTrait* drive, _Input const Lba endLba, _Input const Int32 flags, const Char* part_name) -{ - if (*part_name == 0 || - endLba == 0) - return false; - - // verify disk. - drive->fVerify(drive->fPacket); - - rt_copy_memory((VoidPtr) "fs/nefs-packet", drive->fPacket.fPacketMime, - rt_string_len("fs/nefs-packet")); - - // if disk isn't good, then error out. - if (false == drive->fPacket.fPacketGood) - { - err_global_get() = kErrorDiskIsCorrupted; - return false; - } - - Char fs_buf[sizeof(NEFS_ROOT_PARTITION_BLOCK)] = {0}; - - Lba start = kNeFSRootCatalogStartAddress; - - drive->fPacket.fPacketContent = fs_buf; - drive->fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); - drive->fPacket.fPacketLba = start; - - drive->fInput(drive->fPacket); - - if (flags & kNeFSPartitionTypeBoot) - { - // make it bootable when needed. - Char buf_epm[kNeFSSectorSz] = {0}; - - EPM_PART_BLOCK* epm_boot = (EPM_PART_BLOCK*)buf_epm; - - // Write a new EPM entry. - - constexpr auto kFsName = "NeFS"; - constexpr auto kBlockName = "ZkaOS:"; - - rt_copy_memory(reinterpret_cast(const_cast(kFsName)), epm_boot->Fs, rt_string_len(kFsName)); - - epm_boot->FsVersion = kNeFSVersionInteger; - epm_boot->LbaStart = start; - epm_boot->SectorSz = kNeFSSectorSz; - - rt_copy_memory(reinterpret_cast(const_cast(kBlockName)), epm_boot->Name, rt_string_len(kBlockName)); - rt_copy_memory(reinterpret_cast(const_cast(kEPMMagic)), epm_boot->Magic, rt_string_len(kEPMMagic)); - - Lba outEpmLba = kEPMBootBlockLba; - - Char buf[kNeFSSectorSz]; - - Lba prevStart = 0; - SizeT cnt = 0; - - while (drive->fPacket.fPacketGood) - { - drive->fPacket.fPacketContent = buf; - drive->fPacket.fPacketSize = sizeof(EPM_PART_BLOCK); - drive->fPacket.fPacketLba = outEpmLba; - - drive->fInput(drive->fPacket); - - if (buf[0] == 0) - { - epm_boot->LbaStart = prevStart; - - if (epm_boot->LbaStart) - epm_boot->LbaStart = outEpmLba; - - epm_boot->LbaEnd = endLba; - epm_boot->NumBlocks = cnt; - - drive->fPacket.fPacketContent = buf_epm; - drive->fPacket.fPacketSize = sizeof(EPM_PART_BLOCK); - drive->fPacket.fPacketLba = outEpmLba; - - drive->fOutput(drive->fPacket); - - break; - } - else - { - prevStart = ((EPM_PART_BLOCK*)buf)->LbaStart + ((EPM_PART_BLOCK*)buf)->LbaEnd; - } - - outEpmLba += sizeof(EPM_PART_BLOCK); - ++cnt; - } - } - - // disk isnt faulty and data has been fetched. - while (drive->fPacket.fPacketGood) - { - NEFS_ROOT_PARTITION_BLOCK* part_block = (NEFS_ROOT_PARTITION_BLOCK*)fs_buf; - - // check for an empty partition here. - if (part_block->PartitionName[0] == 0 && - rt_string_cmp(part_block->Ident, kNeFSIdent, kNeFSIdentLen)) - { - // partition is free and valid. - - part_block->Version = kNeFSVersionInteger; - - const auto kNeFSUntitledHD = part_name; - - rt_copy_memory((VoidPtr)kNeFSIdent, (VoidPtr)part_block->Ident, - kNeFSIdentLen); - - rt_copy_memory((VoidPtr)kNeFSUntitledHD, (VoidPtr)part_block->PartitionName, - rt_string_len(kNeFSUntitledHD)); - - SizeT catalogCount = 0UL; - - SizeT sectorCount = drv_get_sector_count(); - SizeT diskSize = drv_get_size(); - - part_block->Kind = kNeFSPartitionTypeStandard; - part_block->StartCatalog = kNeFSCatalogStartAddress; - part_block->Flags = kNeFSPartitionTypeStandard; - part_block->CatalogCount = sectorCount / sizeof(NEFS_CATALOG_STRUCT); - part_block->FreeSectors = sectorCount / sizeof(NEFS_CATALOG_STRUCT); - part_block->SectorCount = sectorCount; - part_block->DiskSize = diskSize; - part_block->FreeCatalog = sectorCount / sizeof(NEFS_CATALOG_STRUCT); - - drive->fPacket.fPacketContent = fs_buf; - drive->fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); - drive->fPacket.fPacketLba = kNeFSRootCatalogStartAddress; - - drive->fOutput(drive->fPacket); - - kout << "drive kind: " << drive->fDriveKind() << kendl; - - kout << "partition name: " << part_block->PartitionName << kendl; - kout << "start: " << hex_number(part_block->StartCatalog) << kendl; - kout << "number of catalogs: " << hex_number(part_block->CatalogCount) << kendl; - kout << "free catalog: " << hex_number(part_block->FreeCatalog) << kendl; - kout << "free sectors: " << hex_number(part_block->FreeSectors) << kendl; - kout << "sector size: " << hex_number(part_block->SectorSize) << kendl; - - // write the root catalog. - this->CreateCatalog(kNeFSRoot, 0, kNeFSCatalogKindDir); - - return true; - } - - kout << "partition block already exists.\r"; - - start += part_block->DiskSize; - - drive->fPacket.fPacketContent = fs_buf; - drive->fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); - drive->fPacket.fPacketLba = start; - - drive->fInput(drive->fPacket); - } - - return false; -} - -/// @brief Writes the data fork into a specific catalog. -/// @param catalog the catalog itself -/// @param data the data. -/// @return if the catalog w rote the contents successfully. -bool NeFileSystemParser::WriteCatalog(_Input const Char* catalog_name, Bool is_rsrc_fork, _Input VoidPtr data, _Input SizeT size_of_data, _Input const Char* fork_name) -{ - if (size_of_data < 1) - return No; - - auto buf = new UInt8[size_of_data]; - rt_set_memory(buf, 0, size_of_data); - - rt_copy_memory(data, buf, size_of_data); - - auto& drive = kMountpoint.A(); - - rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime, - rt_string_len("fs/nefs-packet")); - - auto catalog = this->GetCatalog(catalog_name); - - if (!catalog) - { - delete[] buf; - buf = nullptr; - return NO; - } - - auto startFork = (!is_rsrc_fork) ? catalog->DataFork - : catalog->ResourceFork; - - delete catalog; - catalog = nullptr; - - NEFS_FORK_STRUCT* fork_data_input = new NEFS_FORK_STRUCT(); - NEFS_FORK_STRUCT prev_fork{}; - - kout << hex_number(startFork) << kendl; - - // sanity check of the fork position as the condition to run the loop. - while (startFork >= kNeFSCatalogStartAddress) - { - drive.fPacket.fPacketContent = fork_data_input; - drive.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT); - drive.fPacket.fPacketLba = startFork; - - drive.fInput(drive.fPacket); - - kout << hex_number(fork_data_input->DataSize) << kendl; - kout << hex_number(size_of_data) << kendl; - kout << hex_number(fork_data_input->Flags) << kendl; - kout << fork_name << kendl; - kout << fork_data_input->ForkName << kendl; - kout << fork_data_input->CatalogName << kendl; - kout << catalog_name << kendl; - - if ((fork_data_input->Flags & kNeFSFlagCreated) && - KStringBuilder::Equals(fork_data_input->ForkName, fork_name) && - KStringBuilder::Equals(fork_data_input->CatalogName, catalog_name) && - fork_data_input->DataSize == size_of_data) - { - // ===================================================== // - // Store the blob now. - // ===================================================== // - - drive.fPacket.fPacketContent = buf; - drive.fPacket.fPacketSize = size_of_data; - drive.fPacket.fPacketLba = fork_data_input->DataOffset; - - kout << "data offset: " << hex_number(fork_data_input->DataOffset) << kendl; - - drive.fOutput(drive.fPacket); - - kout << "wrote data at offset: " << hex_number(fork_data_input->DataOffset) << kendl; - - delete fork_data_input; - delete[] buf; - - return true; - } - - // stumble upon a fork, store it. - - prev_fork = *fork_data_input; - - startFork = fork_data_input->NextSibling; - } - - delete[] buf; - delete fork_data_input; - - return false; -} - -/// @brief -/// @param catalog_name the catalog name. -/// @return the newly found catalog. -_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::FindCatalog(_Input const Char* catalog_name, - Lba& out_lba, - Bool search_hidden, - Bool local_search) -{ - if (!catalog_name || - *catalog_name == 0) - return nullptr; - - NEFS_ROOT_PARTITION_BLOCK part{0}; - auto& drive = kMountpoint.A(); - - rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime, - rt_string_len("fs/nefs-packet")); - - drive.fPacket.fPacketContent = ∂ - drive.fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); - drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress; - - drive.fInput(drive.fPacket); - - auto start_catalog_lba = kNeFSCatalogStartAddress; - const auto kStartCatalogList = start_catalog_lba; - - if (!KStringBuilder::Equals(catalog_name, NeFileSystemHelper::Root()) && local_search) - { - Char parent_name[kNeFSCatalogNameLen] = {0}; - - for (SizeT indexFill = 0; indexFill < rt_string_len(catalog_name); ++indexFill) - { - parent_name[indexFill] = catalog_name[indexFill]; - } - - SizeT indexReverseCopy = rt_string_len(parent_name); - - // zero character. - parent_name[--indexReverseCopy] = 0; - - // mandatory '/' character. - parent_name[--indexReverseCopy] = 0; - - while (parent_name[indexReverseCopy] != NeFileSystemHelper::Separator()) - { - parent_name[indexReverseCopy] = 0; - --indexReverseCopy; - } - - NEFS_CATALOG_STRUCT* parent_catalog = this->FindCatalog(parent_name, out_lba); - - if (parent_catalog && - !KStringBuilder::Equals(parent_name, NeFileSystemHelper::Root())) - { - start_catalog_lba = parent_catalog->NextSibling; - - delete parent_catalog; - parent_catalog = nullptr; - - local_search = YES; - } - else if (parent_catalog) - { - start_catalog_lba = parent_catalog->NextSibling; - - local_search = YES; - - delete parent_catalog; - parent_catalog = nullptr; - } - else if (!parent_catalog) - { - return nullptr; - } - } - - NEFS_CATALOG_STRUCT temporary_catalog{}; - - SizeT i = rt_string_len(catalog_name); - - // get rid of \0 - --i; - - if (catalog_name[i] == '/') - --i; - - while (catalog_name[i] != '/') - --i; - - const Char* tmp_name = (catalog_name + i); - -kNeFSSearchThroughCatalogList: - while (drive.fPacket.fPacketGood) - { - drive.fPacket.fPacketLba = start_catalog_lba; - drive.fPacket.fPacketContent = &temporary_catalog; - drive.fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT); - - drive.fInput(drive.fPacket); - - if (KStringBuilder::Equals(tmp_name, temporary_catalog.Name)) - { - if (temporary_catalog.Status == kNeFSStatusLocked && - !search_hidden) - { - err_global_get() = kErrorFileLocked; - - goto NeFSContinueSearch; - } - - /// ignore unallocated catalog, break - if (!(temporary_catalog.Flags & kNeFSFlagCreated)) - { - err_global_get() = kErrorFileNotFound; - - goto NeFSContinueSearch; - } - - kout << "Found available catalog at: " << hex_number(start_catalog_lba) << kendl; - kout << "Found available catalog at: " << temporary_catalog.Name << kendl; - - NEFS_CATALOG_STRUCT* catalog_ptr = new NEFS_CATALOG_STRUCT(); - rt_copy_memory(&temporary_catalog, catalog_ptr, sizeof(NEFS_CATALOG_STRUCT)); - - out_lba = start_catalog_lba; - return catalog_ptr; - } - - NeFSContinueSearch: - start_catalog_lba = temporary_catalog.NextSibling; - - if (start_catalog_lba < part.StartCatalog) - break; - } - - if (local_search) - { - local_search = false; - start_catalog_lba = part.StartCatalog; - - goto kNeFSSearchThroughCatalogList; - } - - err_global_get() = kErrorFileNotFound; - - out_lba = 0UL; - - return nullptr; -} - -/// @brief Get catalog from filesystem. -/// @param name the catalog's name/ -/// @return -_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::GetCatalog(_Input const Char* name) -{ - Lba unused = 0; - return this->FindCatalog(name, unused, YES); -} - -/// @brief Closes a catalog, (frees it). -/// @param catalog the catalog to close. -/// @return -_Output Boolean NeFileSystemParser::CloseCatalog(_Input _Output NEFS_CATALOG_STRUCT* catalog) -{ - if (!catalog) - return false; - - delete catalog; - catalog = nullptr; - - return true; -} - -/// @brief Mark catalog as removed. -/// @param catalog The catalog structure. -/// @return if the catalog was removed or not. -_Output Boolean NeFileSystemParser::RemoveCatalog(_Input const Char* catalog_name) -{ - if (!catalog_name || - KStringBuilder::Equals(catalog_name, NeFileSystemHelper::Root())) - { - err_global_get() = kErrorInternal; - return false; - } - - Lba out_lba = 0; - auto catalog = this->FindCatalog(catalog_name, out_lba); - - if (out_lba >= kNeFSCatalogStartAddress || - catalog->Flags & kNeFSFlagCreated) - { - catalog->Flags &= (~kNeFSFlagCreated); - catalog->Flags |= kNeFSFlagDeleted; - - auto& drive = kMountpoint.A(); - - rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime, - rt_string_len("fs/nefs-packet")); - - drive.fPacket.fPacketLba = out_lba; // the catalog position. - drive.fPacket.fPacketSize = - sizeof(NEFS_CATALOG_STRUCT); // size of catalog. roughly the sector size. - drive.fPacket.fPacketContent = catalog; // the catalog itself. - - drive.fOutput(drive.fPacket); // send packet. - - Char partitionBlockBuf[sizeof(NEFS_ROOT_PARTITION_BLOCK)] = {0}; - - drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress; - drive.fPacket.fPacketContent = partitionBlockBuf; - drive.fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); - - drive.fInput(drive.fPacket); - - NEFS_ROOT_PARTITION_BLOCK* part_block = - reinterpret_cast(partitionBlockBuf); - - --part_block->CatalogCount; - ++part_block->FreeSectors; - - drive.fOutput(drive.fPacket); - - return true; - } - - delete catalog; - catalog = nullptr; - - return false; -} - -/// ***************************************************************** /// -/// Reading,Seek,Tell are unimplemented on catalogs, refer to forks I/O instead. -/// ***************************************************************** /// - -/***********************************************************************************/ -/// @brief Read the catalog data fork. -/// @param catalog -/// @param dataSz -/// @return -/***********************************************************************************/ - -VoidPtr NeFileSystemParser::ReadCatalog(_Input _Output NEFS_CATALOG_STRUCT* catalog, - _Input Bool is_rsrc_fork, - _Input SizeT dataSz, - _Input const Char* forkName) -{ - if (!catalog) - { - err_global_get() = kErrorInvalidData; - return nullptr; - } - - Lba dataForkLba = (!is_rsrc_fork) ? catalog->DataFork : catalog->ResourceFork; - Size dataForkSize = (!is_rsrc_fork) ? catalog->DataForkSize : catalog->ResourceForkSize; - - kout << "catalog " << catalog->Name - << ", fork: " << hex_number(dataForkLba) << kendl; - - NEFS_FORK_STRUCT* fs_buf = new NEFS_FORK_STRUCT(); - auto& drive = kMountpoint.A(); - - rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime, - rt_string_len("fs/nefs-packet")); - - NEFS_FORK_STRUCT* fs_fork_data = nullptr; - - while (dataForkLba > kNeFSCatalogStartAddress) - { - drive.fPacket.fPacketLba = dataForkLba; - drive.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT); - drive.fPacket.fPacketContent = fs_buf; - - drive.fInput(drive.fPacket); - - fs_fork_data = fs_buf; - - kout << "ForkName: " << fs_fork_data->ForkName << kendl; - kout << "CatalogName: " << fs_fork_data->CatalogName << kendl; - - if (KStringBuilder::Equals(forkName, fs_fork_data->ForkName) && - KStringBuilder::Equals(catalog->Name, fs_fork_data->CatalogName)) - break; - - dataForkLba = fs_fork_data->NextSibling; - } - - if (dataForkLba < kNeFSCatalogStartAddress) - { - delete fs_buf; - return nullptr; - } - - return fs_fork_data; -} - -/***********************************************************************************/ -/// @brief Seek in the data fork. -/// @param catalog the catalog offset. -/// @param off where to seek. -/// @return if the seeking was successful. -/***********************************************************************************/ - -bool NeFileSystemParser::Seek(_Input _Output NEFS_CATALOG_STRUCT* catalog, SizeT off) -{ - err_global_get() = kErrorUnimplemented; - return false; -} - -/***********************************************************************************/ -/// @brief Tell where we are inside the data fork. -/// @param catalog -/// @return The position on the file. -/***********************************************************************************/ - -SizeT NeFileSystemParser::Tell(_Input _Output NEFS_CATALOG_STRUCT* catalog) -{ - err_global_get() = kErrorUnimplemented; - return 0; -} - -namespace NeOS::NeFS -{ - /***********************************************************************************/ - /// @brief Construct NeFS drives. - /***********************************************************************************/ - Boolean fs_init_nefs(Void) noexcept - { - kout << "Creating main disk...\r"; - - kMountpoint.A() = io_construct_main_drive(); - - if (kMountpoint.A().fPacket.fPacketReadOnly == YES) - ke_panic(RUNTIME_CHECK_FILESYSTEM, "Main filesystem cannot be mounted."); - - return YES; - } -} // namespace NeOS::NeFS - -#endif // ifdef __FSKIT_INCLUDES_NEFS__ diff --git a/dev/Kernel/src/FileMgr.cc b/dev/Kernel/src/FileMgr.cc deleted file mode 100644 index b803253d..00000000 --- a/dev/Kernel/src/FileMgr.cc +++ /dev/null @@ -1,52 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -/// @file FileMgr.cc -//! @brief File System Manager API. - -namespace NeOS -{ - STATIC IFilesystemMgr* kMountedFilesystem = nullptr; - - /// @brief FilesystemMgr getter. - /// @return The mounted filesystem. - _Output IFilesystemMgr* IFilesystemMgr::GetMounted() - { - return kMountedFilesystem; - } - - /// @brief Unmount filesystem. - /// @return The unmounted filesystem. - _Output IFilesystemMgr* IFilesystemMgr::Unmount() - { - if (kMountedFilesystem) - { - auto mount = kMountedFilesystem; - kMountedFilesystem = nullptr; - - return mount; - } - - return nullptr; - } - - /// @brief Mount filesystem. - /// @param mount_ptr The filesystem to mount. - /// @return if it succeeded true, otherwise false. - _Output Bool IFilesystemMgr::Mount(_Input IFilesystemMgr* mount_ptr) - { - if (mount_ptr != nullptr) - { - kMountedFilesystem = mount_ptr; - return Yes; - } - - return No; - } -} // namespace NeOS diff --git a/dev/Kernel/src/GUIDWizard.cc b/dev/Kernel/src/GUIDWizard.cc deleted file mode 100644 index 96e15d85..00000000 --- a/dev/Kernel/src/GUIDWizard.cc +++ /dev/null @@ -1,72 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: GUIDWizard.cc - Purpose: GUID helper code - - Revision History: - -------------------------------------------- */ - -#include -#include - -// begin of ascii 'readable' characters. (A, C, C, 1, 2) -#define kUUIDAsciiBegin 47 -// @brief Size of UUID. -#define kUUIDSize 37 - -namespace CFKit::XRN::Version1 -{ - auto cf_make_sequence(const ArrayList& uuidSeq) -> Ref - { - GUIDSequence* seq = new GUIDSequence(); - MUST_PASS(seq); - - Ref seq_ref{seq}; - - seq_ref.Leak()->fMs1 = uuidSeq[0]; - seq_ref.Leak()->fMs2 = uuidSeq[1]; - seq_ref.Leak()->fMs3 = uuidSeq[2]; - seq_ref.Leak()->fMs4[0] = uuidSeq[3]; - seq_ref.Leak()->fMs4[1] = uuidSeq[4]; - seq_ref.Leak()->fMs4[2] = uuidSeq[5]; - seq_ref.Leak()->fMs4[3] = uuidSeq[6]; - seq_ref.Leak()->fMs4[4] = uuidSeq[7]; - seq_ref.Leak()->fMs4[5] = uuidSeq[8]; - seq_ref.Leak()->fMs4[6] = uuidSeq[9]; - seq_ref.Leak()->fMs4[7] = uuidSeq[10]; - - return seq_ref; - } - - // @brief Tries to make a guid out of a string. - // This function is not complete for now - auto cf_try_guid_to_string(Ref& seq) -> ErrorOr> - { - Char buf[kUUIDSize]; - - for (SizeT index = 0; index < 16; ++index) - { - buf[index] = seq.Leak()->u8[index] + kUUIDAsciiBegin; - } - - for (SizeT index = 16; index < 24; ++index) - { - buf[index] = seq.Leak()->u16[index] + kUUIDAsciiBegin; - } - - for (SizeT index = 24; index < 28; ++index) - { - buf[index] = seq.Leak()->u32[index] + kUUIDAsciiBegin; - } - - auto view = KStringBuilder::Construct(buf); - - if (view) - return ErrorOr>{view.Leak()}; - - return ErrorOr>{-1}; - } -} // namespace CFKit::XRN::Version1 diff --git a/dev/Kernel/src/GUIDWrapper.cc b/dev/Kernel/src/GUIDWrapper.cc deleted file mode 100644 index cd4a6aa3..00000000 --- a/dev/Kernel/src/GUIDWrapper.cc +++ /dev/null @@ -1,11 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -namespace CFKit::XRN -{ -} diff --git a/dev/Kernel/src/HardwareThreadScheduler.cc b/dev/Kernel/src/HardwareThreadScheduler.cc deleted file mode 100644 index 70502d40..00000000 --- a/dev/Kernel/src/HardwareThreadScheduler.cc +++ /dev/null @@ -1,225 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include - -/***********************************************************************************/ -///! @file HardwareThreadScheduler.cc -///! @brief This file handles multi processing in the Kernel. -///! @brief Multi processing is needed for multi-tasking operations. -/***********************************************************************************/ - -namespace NeOS -{ - /***********************************************************************************/ - /// @note Those symbols are needed in order to switch and validate the stack. - /***********************************************************************************/ - - EXTERN_C Bool hal_check_stack(HAL::StackFramePtr frame); - EXTERN_C Bool mp_register_process(HAL::StackFramePtr frame, ProcessID pid); - - STATIC HardwareThreadScheduler kHardwareThreadScheduler; - - ///! A HardwareThread class takes care of it's owned hardware thread. - ///! It has a stack for it's core. - - /***********************************************************************************/ - ///! @brief C++ constructor. - /***********************************************************************************/ - HardwareThread::HardwareThread() = default; - - /***********************************************************************************/ - ///! @brief C++ destructor. - /***********************************************************************************/ - HardwareThread::~HardwareThread() = default; - - /***********************************************************************************/ - //! @brief returns the id of the thread. - /***********************************************************************************/ - const ThreadID& HardwareThread::ID() noexcept - { - return fID; - } - - /***********************************************************************************/ - //! @brief returns the kind of thread we have. - /***********************************************************************************/ - const ThreadKind& HardwareThread::Kind() noexcept - { - return fKind; - } - - /***********************************************************************************/ - //! @brief is the thread busy? - //! @return whether the thread is busy or not. - /***********************************************************************************/ - Bool HardwareThread::IsBusy() noexcept - { - STATIC Int64 busy_timer = 0U; - constexpr Int64 kTimeoutMax = 0x1000000; // an arbitrary value used to tell if the timeout hasn't been reached yet. - - if (fBusy && (busy_timer > kTimeoutMax)) - { - busy_timer = 0U; - fBusy = No; - - return No; - } - - ++busy_timer; - - return fBusy; - } - - /***********************************************************************************/ - /// @brief Get processor stack frame. - /***********************************************************************************/ - - HAL::StackFramePtr HardwareThread::StackFrame() noexcept - { - MUST_PASS(this->fStack); - return this->fStack; - } - - Void HardwareThread::Busy(const Bool busy) noexcept - { - this->fBusy = busy; - } - - HardwareThread::operator bool() - { - return this->fStack && !this->fBusy; - } - - /***********************************************************************************/ - /// @brief Wakeup the processor. - /***********************************************************************************/ - - Void HardwareThread::Wake(const bool wakeup) noexcept - { - this->fWakeup = wakeup; - } - - /***********************************************************************************/ - /// @brief Switch to hardware thread. - /// @param stack the new hardware thread. - /// @retval true stack was changed, code is running. - /// @retval false stack is invalid, previous code is running. - /***********************************************************************************/ - Bool HardwareThread::Switch(VoidPtr image_ptr, Ptr8 stack_ptr, HAL::StackFramePtr frame, const ThreadID& pid) - { - if (this->IsBusy()) - return NO; - - this->fStack = frame; - this->fPID = pid; - - this->fStack->BP = reinterpret_cast(image_ptr); - this->fStack->SP = reinterpret_cast(stack_ptr); - - Bool ret = mp_register_process(fStack, this->fPID); - - if (ret) - this->Busy(YES); - - return ret; - } - - /***********************************************************************************/ - ///! @brief Tells if processor is waked up. - /***********************************************************************************/ - bool HardwareThread::IsWakeup() noexcept - { - return this->fWakeup; - } - - /***********************************************************************************/ - ///! @brief Constructor and destructors. - ///! @brief Default constructor. - /***********************************************************************************/ - - HardwareThreadScheduler::HardwareThreadScheduler() = default; - - /***********************************************************************************/ - ///! @brief Default destructor. - /***********************************************************************************/ - HardwareThreadScheduler::~HardwareThreadScheduler() = default; - - /***********************************************************************************/ - /// @brief Shared singleton function - /***********************************************************************************/ - HardwareThreadScheduler& HardwareThreadScheduler::The() - { - return kHardwareThreadScheduler; - } - - /***********************************************************************************/ - /// @brief Get Stack Frame of AP. - /***********************************************************************************/ - HAL::StackFramePtr HardwareThreadScheduler::Leak() noexcept - { - return fThreadList[fCurrentThread].fStack; - } - - /***********************************************************************************/ - /** - * Get Hardware thread at index. - * @param idx the index - * @return the reference to the hardware thread. - */ - /***********************************************************************************/ - Ref HardwareThreadScheduler::operator[](const SizeT& idx) - { - if (idx == 0) - { - if (fThreadList[idx].Kind() != kAPSystemReserved) - { - fThreadList[idx].fKind = kAPBoot; - } - } - else if (idx >= kMaxAPInsideSched) - { - static HardwareThread* kFakeThread = nullptr; - return {kFakeThread}; - } - - return &fThreadList[idx]; - } - - /***********************************************************************************/ - /** - * Check if thread pool isn't empty. - * @return - */ - /***********************************************************************************/ - HardwareThreadScheduler::operator bool() noexcept - { - return !fThreadList.Empty(); - } - - /***********************************************************************************/ - /** - * Reverse operator bool - * @return - */ - /***********************************************************************************/ - bool HardwareThreadScheduler::operator!() noexcept - { - return fThreadList.Empty(); - } - - /***********************************************************************************/ - /// @brief Returns the amount of core present. - /// @return the number of APs. - /***********************************************************************************/ - SizeT HardwareThreadScheduler::Capacity() noexcept - { - return fThreadList.Count(); - } -} // namespace NeOS diff --git a/dev/Kernel/src/IDylibObject.cc b/dev/Kernel/src/IDylibObject.cc deleted file mode 100644 index 30a76af9..00000000 --- a/dev/Kernel/src/IDylibObject.cc +++ /dev/null @@ -1,15 +0,0 @@ -/* - * ======================================================== - * - * neoskrnl - * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - * - * ======================================================== - */ - -#include -#include - -#include - -using namespace NeOS; diff --git a/dev/Kernel/src/IPEFDylibObject.cc b/dev/Kernel/src/IPEFDylibObject.cc deleted file mode 100644 index e994ad29..00000000 --- a/dev/Kernel/src/IPEFDylibObject.cc +++ /dev/null @@ -1,111 +0,0 @@ -/* - * ======================================================== - * - * neoskrnl - * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - * - * ======================================================== - */ - -#include -#include -#include -#include -#include -#include - -/* ------------------------------------------- - - Revision History: - - 01/02/24: Reworked dll ABI, expect a rtl_init_dylib and - rtl_fini_dylib (amlel) - - 15/02/24: Breaking changes, changed the name of the - routines. (amlel) - - 07/28/24: Replace rt_library_free with rtl_fini_dylib - - 10/8/24: FIX: Fix log comment. - - ------------------------------------------- */ - -using namespace NeOS; - -/***********************************************************************************/ -/// @file IPEFDylibObject.cc -/// @brief PEF's Dylib runtime. -/***********************************************************************************/ - -/***********************************************************************************/ -/** @brief Library initializer. */ -/***********************************************************************************/ - -EXTERN_C IDylibRef rtl_init_dylib(UserProcess& process) -{ - IDylibRef dll_obj = tls_new_class(); - - if (!dll_obj) - { - process.Crash(); - return nullptr; - } - - dll_obj->Mount(new IPEFDylibObject::DLL_TRAITS()); - - if (!dll_obj->Get()) - { - tls_delete_class(dll_obj); - dll_obj = nullptr; - - process.Crash(); - - return nullptr; - } - - dll_obj->Get()->ImageObject = - process.Image.fBlob; - - if (!dll_obj->Get()->ImageObject) - { - delete dll_obj->Get(); - - tls_delete_class(dll_obj); - dll_obj = nullptr; - - process.Crash(); - - return nullptr; - } - - dll_obj->Get()->ImageEntrypointOffset = - dll_obj->Load(kPefStart, rt_string_len(kPefStart, 0), kPefCode); - - return dll_obj; -} - -/***********************************************************************************/ -/** @brief Frees the dll_obj. */ -/** @note Please check if the dll_obj got freed! */ -/** @param dll_obj The dll_obj to free. */ -/** @param successful Reports if successful or not. */ -/***********************************************************************************/ - -EXTERN_C Void rtl_fini_dylib(UserProcess& process, IDylibRef dll_obj, BOOL* successful) -{ - MUST_PASS(successful); - - // sanity check (will also trigger a bug check if this fails) - if (dll_obj == nullptr) - { - *successful = false; - process.Crash(); - } - - delete dll_obj->Get(); - delete dll_obj; - - dll_obj = nullptr; - - *successful = true; -} diff --git a/dev/Kernel/src/IndexableProperty.cc b/dev/Kernel/src/IndexableProperty.cc deleted file mode 100644 index 404cddc3..00000000 --- a/dev/Kernel/src/IndexableProperty.cc +++ /dev/null @@ -1,57 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include - -/// @brief File indexer API for fast path access. -/// BUGS: 0 - -#define kMaxLenIndexer (256U) - -namespace NeOS -{ - namespace Indexer - { - IndexProperty& IndexableProperty::Leak() noexcept - { - return fIndex; - } - - Void IndexableProperty::AddFlag(Int16 flag) - { - fFlags |= flag; - } - - Void IndexableProperty::RemoveFlag(Int16 flag) - { - fFlags &= flag; - } - - Int16 IndexableProperty::HasFlag(Int16 flag) - { - return fFlags & flag; - } - - /// @brief Index a file into the indexer instance. - /// @param filename filesystem path to access. - /// @param filenameLen used bytes in path. - /// @param indexer the filesystem indexer. - /// @return none, check before if indexer can be claimed (using indexer.HasFlag(kIndexerClaimed)). - Void fs_index_file(const Char* filename, SizeT filenameLen, IndexableProperty& indexer) - { - if (!indexer.HasFlag(kIndexerClaimed)) - { - indexer.AddFlag(kIndexerClaimed); - rt_copy_memory((VoidPtr)indexer.Leak().Path, (VoidPtr)filename, filenameLen); - - kout << "FSKit: Indexed new file: " << filename << kendl; - } - } - } // namespace Indexer -} // namespace NeOS diff --git a/dev/Kernel/src/Json.cc b/dev/Kernel/src/Json.cc deleted file mode 100644 index 48567b5f..00000000 --- a/dev/Kernel/src/Json.cc +++ /dev/null @@ -1,10 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -/// @brief Undefined object, is null in length. -RTL_INIT_OBJECT(NeOS::Json::kNull, NeOS::Json); diff --git a/dev/Kernel/src/KString.cc b/dev/Kernel/src/KString.cc deleted file mode 100644 index d96ef38c..00000000 --- a/dev/Kernel/src/KString.cc +++ /dev/null @@ -1,218 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -/// @file KString.cc -/// @brief Kernel String manipulation file. - -namespace NeOS -{ - Char* KString::Data() - { - return this->fData; - } - - const Char* KString::CData() const - { - return const_cast(this->fData); - } - - Size KString::Length() const - { - return this->fDataSz; - } - - bool KString::operator==(const KString& rhs) const - { - if (rhs.Length() != this->Length()) - return false; - - for (Size index = 0; index < this->Length(); ++index) - { - if (rhs.fData[index] != this->fData[index]) - return false; - } - - return true; - } - - bool KString::operator==(const Char* rhs) const - { - if (rt_string_len(rhs) != this->Length()) - return false; - - for (Size index = 0; index < rt_string_len(rhs); ++index) - { - if (rhs[index] != this->fData[index]) - return false; - } - - return true; - } - - bool KString::operator!=(const KString& rhs) const - { - if (rhs.Length() != this->Length()) - return false; - - for (Size index = 0; index < rhs.Length(); ++index) - { - if (rhs.fData[index] == this->fData[index]) - return false; - } - - return true; - } - - bool KString::operator!=(const Char* rhs) const - { - if (rt_string_len(rhs) != this->Length()) - return false; - - for (Size index = 0; index < rt_string_len(rhs); ++index) - { - if (rhs[index] == this->fData[index]) - return false; - } - - return true; - } - - ErrorOr KStringBuilder::Construct(const Char* data) - { - if (!data || *data == 0) - return {}; - - KString* view = new KString(rt_string_len(data)); - (*view) += data; - - return ErrorOr(*view); - } - - const Char* KStringBuilder::FromBool(const Char* fmt, bool i) - { - if (!fmt) - return ("?"); - - const Char* boolean_expr = i ? "YES" : "NO"; - Char* ret = (Char*)RTL_ALLOCA((sizeof(char) * i) ? 4 : 5 + rt_string_len(fmt)); - - if (!ret) - return ("?"); - - const auto fmt_len = rt_string_len(fmt); - const auto res_len = rt_string_len(boolean_expr); - - for (Size idx = 0; idx < fmt_len; ++idx) - { - if (fmt[idx] == '%') - { - SizeT result_cnt = idx; - - for (auto y_idx = idx; y_idx < res_len; ++y_idx) - { - ret[result_cnt] = boolean_expr[y_idx]; - ++result_cnt; - } - - break; - } - - ret[idx] = fmt[idx]; - } - - return ret; - } - - bool KStringBuilder::Equals(const Char* lhs, const Char* rhs) - { - if (rt_string_len(rhs) != rt_string_len(lhs)) - return false; - - for (Size index = 0; index < rt_string_len(rhs); ++index) - { - if (rhs[index] != lhs[index]) - return false; - } - - return true; - } - - bool KStringBuilder::Equals(const WideChar* lhs, const WideChar* rhs) - { - for (Size index = 0; rhs[index] != 0; ++index) - { - if (rhs[index] != lhs[index]) - return false; - } - - return true; - } - - const Char* KStringBuilder::Format(const Char* fmt, const Char* fmt2) - { - if (!fmt || !fmt2) - return ("?"); - - Char* ret = - (Char*)RTL_ALLOCA(sizeof(char) * (rt_string_len(fmt2) + rt_string_len(fmt))); - - if (!ret) - return ("?"); - - const auto len = rt_string_len(fmt); - - for (Size idx = 0; idx < len; ++idx) - { - if (fmt[idx] == '%' && idx < rt_string_len(fmt) && fmt[idx] == 's') - { - Size result_cnt = idx; - - for (Size y_idx = 0; y_idx < rt_string_len(fmt2); ++y_idx) - { - ret[result_cnt] = fmt2[y_idx]; - ++result_cnt; - } - } - - ret[idx] = fmt[idx]; - } - - return ret; - } - - STATIC void rt_string_append(Char* lhs, const Char* rhs, Int32 cur) - { - SizeT sz_rhs = rt_string_len(rhs); - SizeT rhs_i = 0; - - for (; rhs_i < sz_rhs; ++rhs_i) - { - lhs[rhs_i + cur] = rhs[rhs_i]; - } - } - - KString& KString::operator+=(const Char* rhs) - { - rt_string_append(this->fData, rhs, this->fCur); - this->fCur += rt_string_len(rhs); - - return *this; - } - - KString& KString::operator+=(const KString& rhs) - { - if (rt_string_len(rhs.fData) > this->Length()) - return *this; - - rt_string_append(this->fData, const_cast(rhs.fData), this->fCur); - this->fCur += rt_string_len(const_cast(rhs.fData)); - - return *this; - } -} // namespace NeOS diff --git a/dev/Kernel/src/LPC.cc b/dev/Kernel/src/LPC.cc deleted file mode 100644 index b6b2e11b..00000000 --- a/dev/Kernel/src/LPC.cc +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -namespace NeOS -{ - STATIC Bool kRaiseOnBugCheck = false; - - /// @brief Does a system wide bug check. - /// @param void no params. - /// @return if error-free: false, otherwise true. - Boolean err_bug_check(void) noexcept - { - if (kRaiseOnBugCheck) - { - ke_panic(RUNTIME_CHECK_BAD_BEHAVIOR); - } - - return No; - } - - /// @brief Tells if we should raise a bug check not. - /// @param void - /// @return void - Void err_bug_check_raise(Void) noexcept - { - kRaiseOnBugCheck = true; - } -} // namespace NeOS diff --git a/dev/Kernel/src/LockDelegate.cc b/dev/Kernel/src/LockDelegate.cc deleted file mode 100644 index df62c6f3..00000000 --- a/dev/Kernel/src/LockDelegate.cc +++ /dev/null @@ -1,12 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -namespace NeOS -{ - /// @note Leave it empty for now. -} // namespace NeOS diff --git a/dev/Kernel/src/MemoryMgr.cc b/dev/Kernel/src/MemoryMgr.cc deleted file mode 100644 index 4e13ea15..00000000 --- a/dev/Kernel/src/MemoryMgr.cc +++ /dev/null @@ -1,289 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include -#include -#include -#include - -/* ------------------------------------------- - - Revision History: - 10/8/24: FIX: Fix useless long name, alongside a new WR (WriteRead) field. - 20/10/24: Fix mm_new_ and mm_delete_ APIs inside MemoryMgr.h header. (amlal) - 27/01/25: Reworked code as the memory manager. - - ------------------------------------------- */ - -//! @file MemoryMgr.cc -//! @brief Heap algorithm that serves as the main memory manager. - -#define kKernelHeapMagic (0xD4D75) -#define kKernelHeapAlignSz (__BIGGEST_ALIGNMENT__) - -namespace NeOS -{ - /// @brief Contains data structures and algorithms for the heap. - namespace Detail - { - struct PACKED HEAP_INFORMATION_BLOCK; - - /// @brief Kernel heap information block. - /// Located before the address bytes. - /// | HIB | CLASS/STRUCT/DATA TYPES... | - struct PACKED HEAP_INFORMATION_BLOCK final - { - ///! @brief 32-bit value which contains the magic number of the heap. - UInt32 fMagic : 24; - - ///! @brief Is the heap present? - UInt8 fPresent : 1; - - /// @brief Is this value writable? - UInt8 fWriteRead : 1; - - /// @brief Is this value owned by the user? - UInt8 fUser : 1; - - /// @brief Is this a page pointer? - UInt8 fPage : 1; - - /// @brief 32-bit CRC checksum. - UInt32 fCRC32; - - /// @brief 64-bit Allocation flags. - UInt16 fFlags; - - /// @brief 64-bit pointer size. - SizeT fSize; - - /// @brief 64-bit target offset pointer. - UIntPtr fOffset; - - /// @brief Padding bytes for header. - UInt8 fPadding[kKernelHeapAlignSz]; - }; - - /// @brief Check for heap address validity. - /// @param heap_ptr The address_ptr to check. - /// @return Bool if the pointer is valid or not. - _Output auto mm_check_heap_address(VoidPtr heap_ptr) -> Bool - { - if (!heap_ptr) - return false; - - auto base_heap = ((IntPtr)heap_ptr) - sizeof(Detail::HEAP_INFORMATION_BLOCK); - - /// Add that check in case we're having an integer underflow. /// - - if (base_heap < 0) - { - return false; - } - - return true; - } - - typedef HEAP_INFORMATION_BLOCK* HEAP_INFORMATION_BLOCK_PTR; - } // namespace Detail - - /// @brief Declare a new size for ptr_heap. - /// @param ptr_heap the pointer. - /// @return Newly allocated heap header. - _Output auto mm_realloc_heap(VoidPtr ptr_heap, SizeT new_sz) -> VoidPtr - { - if (Detail::mm_check_heap_address(ptr_heap) == No) - return nullptr; - - if (!ptr_heap || new_sz < 1) - return nullptr; - - kout << "This function is not implemented by NeOSKrnl, please use the BSD's realloc instead.\r"; - ke_panic(RUNTIME_CHECK_INVALID); - - return nullptr; - } - - /// @brief Allocate chunk of memory. - /// @param sz Size of pointer - /// @param wr Read Write bit. - /// @param user User enable bit. - /// @return The newly allocated pointer. - _Output VoidPtr mm_new_heap(const SizeT sz, const bool wr, const bool user) - { - auto sz_fix = sz; - - if (sz_fix == 0) - return nullptr; - - sz_fix += sizeof(Detail::HEAP_INFORMATION_BLOCK); - - PageMgr heap_mgr; - auto wrapper = heap_mgr.Request(wr, user, No, sz_fix); - - Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr = - reinterpret_cast( - wrapper.VirtualAddress() + sizeof(Detail::HEAP_INFORMATION_BLOCK)); - - heap_info_ptr->fSize = sz_fix; - heap_info_ptr->fMagic = kKernelHeapMagic; - heap_info_ptr->fCRC32 = 0; // dont fill it for now. - heap_info_ptr->fOffset = reinterpret_cast(heap_info_ptr) + sizeof(Detail::HEAP_INFORMATION_BLOCK); - heap_info_ptr->fPage = No; - heap_info_ptr->fWriteRead = wr; - heap_info_ptr->fUser = user; - heap_info_ptr->fPresent = Yes; - - rt_set_memory(heap_info_ptr->fPadding, 0, kKernelHeapAlignSz); - - auto result = reinterpret_cast(heap_info_ptr->fOffset); - - kout << "Registered heap address: " << hex_number(reinterpret_cast(heap_info_ptr)) << kendl; - - return result; - } - - /// @brief Makes a page heap. - /// @param heap_ptr the pointer to make a page heap. - /// @return kErrorSuccess if successful, otherwise an error code. - _Output Int32 mm_make_page(VoidPtr heap_ptr) - { - if (Detail::mm_check_heap_address(heap_ptr) == No) - return kErrorHeapNotPresent; - - Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr = - reinterpret_cast( - (UIntPtr)heap_ptr - sizeof(Detail::HEAP_INFORMATION_BLOCK)); - - if (!heap_info_ptr) - return kErrorHeapNotPresent; - - heap_info_ptr->fPage = true; - - kout << "Registered page address: " << hex_number(reinterpret_cast(heap_info_ptr)) << kendl; - - return kErrorSuccess; - } - - /// @brief Overwrites and set the flags of a heap header. - /// @param heap_ptr the pointer to update. - /// @param flags the flags to set. - _Output Int32 mm_make_flags(VoidPtr heap_ptr, UInt64 flags) - { - if (Detail::mm_check_heap_address(heap_ptr) == No) - return kErrorHeapNotPresent; - - Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr = - reinterpret_cast( - (UIntPtr)heap_ptr - sizeof(Detail::HEAP_INFORMATION_BLOCK)); - - if (!heap_info_ptr) - return kErrorHeapNotPresent; - - heap_info_ptr->fFlags = flags; - - return kErrorSuccess; - } - - /// @brief Gets the flags of a heap header. - /// @param heap_ptr the pointer to get. - _Output UInt64 mm_get_flags(VoidPtr heap_ptr) - { - Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr = - reinterpret_cast( - (UIntPtr)heap_ptr - sizeof(Detail::HEAP_INFORMATION_BLOCK)); - - if (!heap_info_ptr) - return kErrorHeapNotPresent; - - return heap_info_ptr->fFlags; - } - - /// @brief Declare pointer as free. - /// @param heap_ptr the pointer. - /// @return - _Output Int32 mm_delete_heap(VoidPtr heap_ptr) - { - if (Detail::mm_check_heap_address(heap_ptr) == No) - return kErrorHeapNotPresent; - - Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr = - reinterpret_cast( - (UIntPtr)(heap_ptr) - sizeof(Detail::HEAP_INFORMATION_BLOCK)); - - if (heap_info_ptr && heap_info_ptr->fMagic == kKernelHeapMagic) - { - if (!heap_info_ptr->fPresent) - { - return kErrorHeapNotPresent; - } - - heap_info_ptr->fSize = 0UL; - heap_info_ptr->fPresent = No; - heap_info_ptr->fOffset = 0; - heap_info_ptr->fCRC32 = 0; - heap_info_ptr->fWriteRead = No; - heap_info_ptr->fUser = No; - heap_info_ptr->fMagic = 0; - - PTEWrapper page_wrapper(No, No, No, reinterpret_cast(heap_info_ptr) - sizeof(Detail::HEAP_INFORMATION_BLOCK)); - Ref pte_address{page_wrapper}; - - PageMgr heap_mgr; - heap_mgr.Free(pte_address); - - kout << "Address has been successfully freed." << kendl; - - return kErrorSuccess; - } - - return kErrorInternal; - } - - /// @brief Check if pointer is a valid Kernel pointer. - /// @param heap_ptr the pointer - /// @return if it exists. - _Output Boolean mm_is_valid_heap(VoidPtr heap_ptr) - { - if (heap_ptr && HAL::mm_is_bitmap(heap_ptr)) - { - Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr = - reinterpret_cast( - (UIntPtr)(heap_ptr) - sizeof(Detail::HEAP_INFORMATION_BLOCK)); - - return (heap_info_ptr && heap_info_ptr->fPresent && heap_info_ptr->fMagic == kKernelHeapMagic); - } - - return No; - } - - /// @brief Protect the heap with a CRC value. - /// @param heap_ptr HIB pointer. - /// @return if it valid: point has crc now., otherwise fail. - _Output Boolean mm_protect_heap(VoidPtr heap_ptr) - { - if (heap_ptr) - { - Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr = - reinterpret_cast( - (UIntPtr)heap_ptr - sizeof(Detail::HEAP_INFORMATION_BLOCK)); - - /// if valid, present and is heap header, then compute crc32 - if (heap_info_ptr && heap_info_ptr->fPresent && kKernelHeapMagic == heap_info_ptr->fMagic) - { - heap_info_ptr->fCRC32 = - ke_calculate_crc32((Char*)heap_info_ptr->fOffset, heap_info_ptr->fSize); - - return Yes; - } - } - - return No; - } -} // namespace NeOS diff --git a/dev/Kernel/src/MutableArray.cc b/dev/Kernel/src/MutableArray.cc deleted file mode 100644 index 8464a283..00000000 --- a/dev/Kernel/src/MutableArray.cc +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include diff --git a/dev/Kernel/src/Network/IPAddr.cc b/dev/Kernel/src/Network/IPAddr.cc deleted file mode 100644 index 6f523086..00000000 --- a/dev/Kernel/src/Network/IPAddr.cc +++ /dev/null @@ -1,129 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -namespace NeOS -{ - Char* RawIPAddress::Address() - { - return fAddr; - } - - RawIPAddress::RawIPAddress(char bytes[4]) - { - rt_copy_memory(bytes, fAddr, 4); - } - - BOOL RawIPAddress::operator==(const RawIPAddress& ipv4) - { - for (Size index = 0; index < 4; ++index) - { - if (ipv4.fAddr[index] != fAddr[index]) - return false; - } - - return true; - } - - BOOL RawIPAddress::operator!=(const RawIPAddress& ipv4) - { - for (Size index = 0; index < 4; ++index) - { - if (ipv4.fAddr[index] == fAddr[index]) - return false; - } - - return true; - } - - Char& RawIPAddress::operator[](const Size& index) - { - kout << "[RawIPAddress::operator[]] Fetching Index...\r"; - - static char IP_PLACEHOLDER = '0'; - if (index > 4) - return IP_PLACEHOLDER; - - return fAddr[index]; - } - - RawIPAddress6::RawIPAddress6(char bytes[8]) - { - rt_copy_memory(bytes, fAddr, 8); - } - - char& RawIPAddress6::operator[](const Size& index) - { - kout << "[RawIPAddress6::operator[]] Fetching Index...\r"; - - static char IP_PLACEHOLDER = '0'; - if (index > 8) - return IP_PLACEHOLDER; - - return fAddr[index]; - } - - bool RawIPAddress6::operator==(const RawIPAddress6& ipv6) - { - for (SizeT index = 0; index < 8; ++index) - { - if (ipv6.fAddr[index] != fAddr[index]) - return false; - } - - return true; - } - - bool RawIPAddress6::operator!=(const RawIPAddress6& ipv6) - { - for (SizeT index = 0; index < 8; ++index) - { - if (ipv6.fAddr[index] == fAddr[index]) - return false; - } - - return true; - } - - ErrorOr IPFactory::ToKString(Ref& ipv6) - { - auto str = KStringBuilder::Construct(ipv6.Leak().Address()); - return str; - } - - ErrorOr IPFactory::ToKString(Ref& ipv4) - { - auto str = KStringBuilder::Construct(ipv4.Leak().Address()); - return str; - } - - bool IPFactory::IpCheckVersion4(const Char* ip) - { - if (!ip) - return NO; - - Int32 cnter = 0; - - for (SizeT base = 0; base < rt_string_len(ip); ++base) - { - if (ip[base] == '.') - { - cnter = 0; - } - else - { - if (cnter == 3) - return false; - - ++cnter; - } - } - - return true; - } -} // namespace NeOS diff --git a/dev/Kernel/src/Network/IPCAddr.cc b/dev/Kernel/src/Network/IPCAddr.cc deleted file mode 100644 index 75a54a36..00000000 --- a/dev/Kernel/src/Network/IPCAddr.cc +++ /dev/null @@ -1,32 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - ------------------------------------------- */ - -#include -#include -#include - -namespace NeOS -{ - bool IPC_ADDR::operator==(const IPC_ADDR& addr) noexcept - { - return addr.UserProcessID == this->UserProcessID && addr.UserProcessTeam == this->UserProcessTeam; - } - - bool IPC_ADDR::operator==(IPC_ADDR& addr) noexcept - { - return addr.UserProcessID == this->UserProcessID && addr.UserProcessTeam == this->UserProcessTeam; - } - - bool IPC_ADDR::operator!=(const IPC_ADDR& addr) noexcept - { - return addr.UserProcessID != this->UserProcessID || addr.UserProcessTeam != this->UserProcessTeam; - } - - bool IPC_ADDR::operator!=(IPC_ADDR& addr) noexcept - { - return addr.UserProcessID != this->UserProcessID || addr.UserProcessTeam != this->UserProcessTeam; - } -} // namespace NeOS diff --git a/dev/Kernel/src/Network/IPCMsg.cc b/dev/Kernel/src/Network/IPCMsg.cc deleted file mode 100644 index f5bec6f7..00000000 --- a/dev/Kernel/src/Network/IPCMsg.cc +++ /dev/null @@ -1,125 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include - -namespace NeOS -{ - /// @internal internal use for IPC system only. - /// @brief The internal sanitize function. - Bool ipc_int_sanitize_packet(IPC_MSG* pckt) - { - auto endian = RTL_ENDIAN(pckt, ((Char*)pckt)[0]); - - switch (endian) - { - case Endian::kEndianBig: { - if (pckt->IpcEndianess == kIPCLittleEndian) - goto ipc_check_failed; - - break; - } - case Endian::kEndianLittle: { - if (pckt->IpcEndianess == kIPCBigEndian) - goto ipc_check_failed; - - break; - } - case Endian::kEndianMixed: { - if (pckt->IpcEndianess == kIPCMixedEndian) - goto ipc_check_failed; - - break; - } - default: - goto ipc_check_failed; - } - - if (pckt->IpcFrom == pckt->IpcTo || - pckt->IpcPacketSize > kIPCMsgSize) - { - goto ipc_check_failed; - } - - return pckt->IpcPacketSize > 1 && pckt->IpcHeaderMagic == kIPCHeaderMagic; - - ipc_check_failed: - err_local_get() = kErrorIPC; - return false; - } - - /// @brief Sanitize packet function - /// @retval true packet is correct. - /// @retval false packet is incorrect and process has crashed. - Bool ipc_sanitize_packet(IPC_MSG* pckt) - { - if (!pckt || - !ipc_int_sanitize_packet(pckt)) - { - return false; - } - - return true; - } - - /// @brief Construct packet function - /// @retval true packet is correct. - /// @retval false packet is incorrect and process has crashed. - Bool ipc_construct_packet(_Output IPC_MSG** pckt_in) - { - // don't act if it's not even valid. - if (!pckt_in) - return false; - - if (!*pckt_in) - *pckt_in = new IPC_MSG(); - - MUST_PASS(*pckt_in); - - if (*pckt_in) - { - const auto endianess = RTL_ENDIAN((*pckt_in), ((Char*)(*pckt_in))[0]); - - (*pckt_in)->IpcHeaderMagic = kIPCHeaderMagic; - - (*pckt_in)->IpcEndianess = static_cast(endianess); - (*pckt_in)->IpcPacketSize = sizeof(IPC_MSG); - - (*pckt_in)->IpcTo.UserProcessID = 0; - (*pckt_in)->IpcTo.UserProcessTeam = 0; - - (*pckt_in)->IpcFrom.UserProcessID = 0; - (*pckt_in)->IpcFrom.UserProcessTeam = 0; - - return Yes; - } - - return No; - } - - /// @brief Pass message from **src** to **target** - /// @param src Source message. - /// @param target Target message. - Bool IPC_MSG::Pass(IPC_MSG* src, IPC_MSG* target) noexcept - { - if (src && target && (target != src)) - { - if (src->IpcMsgSz > target->IpcMsgSz) - return No; - - if (target->IpcMsgSz > src->IpcMsgSz) - return No; - - rt_copy_memory(src->IpcData, target->IpcData, src->IpcMsgSz); - - return Yes; - } - - return No; - } -} // namespace NeOS diff --git a/dev/Kernel/src/Network/MACAddressGetter.cc b/dev/Kernel/src/Network/MACAddressGetter.cc deleted file mode 100644 index 627bcd34..00000000 --- a/dev/Kernel/src/Network/MACAddressGetter.cc +++ /dev/null @@ -1,15 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -namespace NeOS -{ - Array& MacAddressGetter::AsBytes() - { - return this->fMacAddress; - } -} // namespace NeOS diff --git a/dev/Kernel/src/Network/NetworkDevice.cc b/dev/Kernel/src/Network/NetworkDevice.cc deleted file mode 100644 index f2971265..00000000 --- a/dev/Kernel/src/Network/NetworkDevice.cc +++ /dev/null @@ -1,35 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -namespace NeOS -{ - /// \brief Getter for fNetworkName. - const Char* NetworkDevice::Name() const - { - return this->fNetworkName; - } - - /// \brief Setter for fNetworkName. - Boolean NetworkDevice::Name(const Char* devnam) - { - if (devnam == nullptr) - return NO; - - if (*devnam == 0) - return NO; - - if (rt_string_len(devnam) > cNetworkNameLen) - return NO; - - rt_copy_memory((VoidPtr)devnam, - (VoidPtr)this->fNetworkName, rt_string_len(devnam)); - - return YES; - } -} // namespace NeOS diff --git a/dev/Kernel/src/New+Delete.cc b/dev/Kernel/src/New+Delete.cc deleted file mode 100644 index 1e0a3421..00000000 --- a/dev/Kernel/src/New+Delete.cc +++ /dev/null @@ -1,50 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -void* operator new[](size_t sz) -{ - if (sz == 0) - ++sz; - - return NeOS::mm_new_heap(sz, true, false); -} - -void* operator new(size_t sz) -{ - if (sz == 0) - ++sz; - - return NeOS::mm_new_heap(sz, true, false); -} - -void operator delete[](void* ptr) -{ - if (ptr == nullptr) - return; - - NeOS::mm_delete_heap(ptr); -} - -void operator delete(void* ptr) -{ - if (ptr == nullptr) - return; - - NeOS::mm_delete_heap(ptr); -} - -void operator delete(void* ptr, size_t sz) -{ - if (ptr == nullptr) - return; - - NE_UNUSED(sz); - - NeOS::mm_delete_heap(ptr); -} diff --git a/dev/Kernel/src/OwnPtr.cc b/dev/Kernel/src/OwnPtr.cc deleted file mode 100644 index e4d529aa..00000000 --- a/dev/Kernel/src/OwnPtr.cc +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include diff --git a/dev/Kernel/src/PEFCodeMgr.cc b/dev/Kernel/src/PEFCodeMgr.cc deleted file mode 100644 index 426a1e26..00000000 --- a/dev/Kernel/src/PEFCodeMgr.cc +++ /dev/null @@ -1,268 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include -#include -#include -#include -#include -#include - -/// @brief PEF stack size symbol. -#define kPefStackSizeSymbol "__PEFSizeOfReserveStack" -#define kPefHeapSizeSymbol "__PEFSizeOfReserveHeap" -#define kPefNameSymbol "__PEFProgramName" - -namespace NeOS -{ - namespace Detail - { - /***********************************************************************************/ - /// @brief Get the PEF platform signature according to the compiled architecture. - /***********************************************************************************/ - UInt32 ldr_get_platform(void) noexcept - { -#if defined(__NE_32X0__) - return kPefArch32x0; -#elif defined(__NE_64X0__) - return kPefArch64x0; -#elif defined(__NE_AMD64__) - return kPefArchAMD64; -#elif defined(__NE_PPC64__) - return kPefArchPowerPC; -#elif defined(__NE_ARM64__) - return kPefArchARM64; -#else - return kPefArchInvalid; -#endif // __32x0__ || __64x0__ || __x86_64__ - } - } // namespace Detail - - /***********************************************************************************/ - /// @brief PEF loader constructor w/ blob. - /// @param blob file blob. - /***********************************************************************************/ - PEFLoader::PEFLoader(const VoidPtr blob) - : fCachedBlob(blob) - { - MUST_PASS(fCachedBlob); - fBad = false; - } - - /***********************************************************************************/ - /// @brief PEF loader constructor. - /// @param path the filesystem path. - /***********************************************************************************/ - PEFLoader::PEFLoader(const Char* path) - : fCachedBlob(nullptr), fBad(false), fFatBinary(false) - { - fFile.New(const_cast(path), kRestrictRB); - fPath = KStringBuilder::Construct(path).Leak(); - - auto kPefHeader = "PEF_CONTAINER"; - - fCachedBlob = fFile->Read(kPefHeader, mib_cast(16)); - - PEFContainer* container = reinterpret_cast(fCachedBlob); - - if (container->Cpu == Detail::ldr_get_platform() && - container->Magic[0] == kPefMagic[0] && - container->Magic[1] == kPefMagic[1] && - container->Magic[2] == kPefMagic[2] && - container->Magic[3] == kPefMagic[3] && - container->Magic[4] == kPefMagic[4] && container->Abi == kPefAbi) - { - return; - } - else if (container->Magic[4] == kPefMagic[0] && - container->Magic[3] == kPefMagic[1] && - container->Magic[2] == kPefMagic[2] && - container->Magic[1] == kPefMagic[3] && - container->Magic[0] == kPefMagic[4] && container->Abi == kPefAbi) - { - /// This is a fat binary. - this->fFatBinary = true; - return; - } - - fBad = true; - - if (fCachedBlob) - mm_delete_heap(fCachedBlob); - - kout << "PEFLoader: warn: Executable format error!\r"; - - fCachedBlob = nullptr; - } - - /***********************************************************************************/ - /// @brief PEF destructor. - /***********************************************************************************/ - PEFLoader::~PEFLoader() - { - if (fCachedBlob) - mm_delete_heap(fCachedBlob); - - fFile.Delete(); - } - - /***********************************************************************************/ - /// @brief Finds the symbol according to it's name. - /// @param name name of symbol. - /// @param kind kind of symbol we want. - /***********************************************************************************/ - VoidPtr PEFLoader::FindSymbol(const Char* name, Int32 kind) - { - if (!fCachedBlob || fBad || !name) - return nullptr; - - PEFContainer* container = reinterpret_cast(fCachedBlob); - - auto blob = fFile->Read(name, mib_cast(16)); - - PEFCommandHeader* container_header = reinterpret_cast(blob); - - constexpr auto cMangleCharacter = '$'; - const Char* cContainerKinds[] = {".code64", ".data64", ".zero64", nullptr}; - - ErrorOr error_or_symbol; - - switch (kind) - { - case kPefCode: { - error_or_symbol = KStringBuilder::Construct(cContainerKinds[0]); // code symbol. - break; - } - case kPefData: { - error_or_symbol = KStringBuilder::Construct(cContainerKinds[1]); // data symbol. - break; - } - case kPefZero: { - error_or_symbol = KStringBuilder::Construct(cContainerKinds[2]); // block starting symbol. - break; - } - default: - return nullptr; // prevent that from the kernel's mode perspective, let that happen if it were - // a user process. - } - - Char* unconst_symbol = const_cast(name); - - for (SizeT i = 0UL; i < rt_string_len(unconst_symbol, kPefNameLen); ++i) - { - if (unconst_symbol[i] == ' ') - { - unconst_symbol[i] = cMangleCharacter; - } - } - - error_or_symbol.Leak().Leak() += name; - - for (SizeT index = 0; index < container->Count; ++index) - { - if (KStringBuilder::Equals(container_header->Name, - error_or_symbol.Leak().Leak().CData())) - { - if (container_header->Kind == kind) - { - if (container_header->Cpu != Detail::ldr_get_platform()) - { - if (!this->fFatBinary) - { - mm_delete_heap(blob); - return nullptr; - } - } - - Char* container_blob_value = new Char[container_header->Size]; - - rt_copy_memory((VoidPtr)((Char*)blob + sizeof(PEFCommandHeader)), container_blob_value, container_header->Size); - mm_delete_heap(blob); - - kout << "PEFLoader: INFO: Load stub: " << container_header->Name << "!\r"; - - return container_blob_value; - } - } - } - - mm_delete_heap(blob); - return nullptr; - } - - /// @brief Finds the executable entrypoint. - /// @return - ErrorOr PEFLoader::FindStart() - { - if (auto sym = this->FindSymbol(kPefStart, kPefCode); sym) - return ErrorOr(sym); - - return ErrorOr(kErrorExecutable); - } - - /// @brief Tells if the executable is loaded or not. - /// @return - bool PEFLoader::IsLoaded() noexcept - { - return !fBad && fCachedBlob; - } - - const Char* PEFLoader::Path() - { - return fPath.Leak().CData(); - } - - const Char* PEFLoader::AsString() - { -#ifdef __32x0__ - return "32x0 PEF executable."; -#elif defined(__64x0__) - return "64x0 PEF executable."; -#elif defined(__x86_64__) - return "x86_64 PEF executable."; -#elif defined(__aarch64__) - return "AARCH64 PEF executable."; -#elif defined(__powerpc64__) - return "POWER64 PEF executable."; -#else - return "???? PEF executable."; -#endif // __32x0__ || __64x0__ || __x86_64__ || __powerpc64__ - } - - const Char* PEFLoader::MIME() - { - return kPefApplicationMime; - } - - ErrorOr PEFLoader::GetBlob() - { - return ErrorOr{this->fCachedBlob}; - } - - namespace Utils - { - ProcessID rtl_create_process(PEFLoader& exec, const Int32& process_kind) noexcept - { - auto errOrStart = exec.FindStart(); - - if (errOrStart.Error() != kErrorSuccess) - return kProcessInvalidID; - - auto id = UserProcessScheduler::The().Spawn(reinterpret_cast(exec.FindSymbol(kPefNameSymbol, kPefData)), errOrStart.Leak().Leak(), exec.GetBlob().Leak().Leak()); - - if (id != kProcessInvalidID) - { - UserProcessScheduler::The().CurrentTeam().AsArray()[id].Kind = process_kind; - UserProcessScheduler::The().CurrentTeam().AsArray()[id].StackSize = *(UIntPtr*)exec.FindSymbol(kPefStackSizeSymbol, kPefData); - UserProcessScheduler::The().CurrentTeam().AsArray()[id].MemoryLimit = *(UIntPtr*)exec.FindSymbol(kPefHeapSizeSymbol, kPefData); - } - - return id; - } - } // namespace Utils -} // namespace NeOS diff --git a/dev/Kernel/src/PRDT.cc b/dev/Kernel/src/PRDT.cc deleted file mode 100644 index 9ea3e70b..00000000 --- a/dev/Kernel/src/PRDT.cc +++ /dev/null @@ -1,24 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include -#include - -namespace NeOS -{ - /***********************************************************************************/ - /// @brief constructs a new PRD. - /// @param prd PRD reference. - /// @note This doesnt construct a valid, please fill it by yourself. - /***********************************************************************************/ - void construct_prdt(Ref& prd) - { - prd.Leak().fPhysAddress = 0x0; - prd.Leak().fSectorCount = 0x0; - prd.Leak().fEndBit = 0x0; - } -} // namespace NeOS diff --git a/dev/Kernel/src/PageMgr.cc b/dev/Kernel/src/PageMgr.cc deleted file mode 100644 index eb7c7e03..00000000 --- a/dev/Kernel/src/PageMgr.cc +++ /dev/null @@ -1,110 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -#ifdef __NE_AMD64__ -#include -#elif defined(__NE_ARM64__) -#include -#endif // ifdef __NE_AMD64__ || defined(__NE_ARM64__) - -namespace NeOS -{ - PTEWrapper::PTEWrapper(Boolean Rw, Boolean User, Boolean ExecDisable, UIntPtr VirtAddr) - : fRw(Rw), - fUser(User), - fExecDisable(ExecDisable), - fVirtAddr(VirtAddr), - fCache(false), - fShareable(false), - fWt(false), - fPresent(true), - fAccessed(false) - { - } - - PTEWrapper::~PTEWrapper() = default; - - /// @brief Flush virtual address. - /// @param VirtAddr - Void PageMgr::FlushTLB() - { -#ifndef __NE_MINIMAL_OS__ - hal_flush_tlb(); -#endif // !__NE_MINIMAL_OS__ - } - - /// @brief Reclaim freed page. - /// @return - Bool PTEWrapper::Reclaim() - { - if (!this->fPresent) - { - this->fPresent = true; - return true; - } - - return false; - } - - /// @brief Request a PTE. - /// @param Rw r/w? - /// @param User user mode? - /// @param ExecDisable disable execution on page? - /// @return - PTEWrapper PageMgr::Request(Boolean Rw, Boolean User, Boolean ExecDisable, SizeT Sz) - { - // Store PTE wrapper right after PTE. - VoidPtr ptr = NeOS::HAL::mm_alloc_bitmap(Rw, User, Sz, false); - - return PTEWrapper{Rw, User, ExecDisable, reinterpret_cast(ptr)}; - } - - /// @brief Disable BitMap. - /// @param wrapper the wrapper. - /// @return If the page bitmap was cleared or not. - Bool PageMgr::Free(Ref& wrapper) - { - if (!NeOS::HAL::mm_free_bitmap((VoidPtr)wrapper.Leak().VirtualAddress())) - return false; - - return true; - } - - /// @brief Virtual PTE address. - /// @return The virtual address of the page. - const UIntPtr PTEWrapper::VirtualAddress() - { - return (fVirtAddr); - } - - Bool PTEWrapper::Shareable() - { - return fShareable; - } - - Bool PTEWrapper::Present() - { - return fPresent; - } - - Bool PTEWrapper::Access() - { - return fAccessed; - } - - Void PTEWrapper::NoExecute(const bool enable) - { - fExecDisable = enable; - } - - Bool PTEWrapper::NoExecute() - { - return fExecDisable; - } -} // namespace NeOS diff --git a/dev/Kernel/src/Pmm.cc b/dev/Kernel/src/Pmm.cc deleted file mode 100644 index b3d5e79e..00000000 --- a/dev/Kernel/src/Pmm.cc +++ /dev/null @@ -1,98 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -#if defined(__NE_ARM64__) -#include -#endif // defined(__NE_ARM64__) - -#if defined(__NE_AMD64__) -#include -#endif // defined(__NE_AMD64__) - -namespace NeOS -{ - /***********************************************************************************/ - /// @brief Pmm constructor. - /***********************************************************************************/ - Pmm::Pmm() - : fPageMgr() - { - kout << "[PMM] Allocate PageMemoryMgr"; - } - - Pmm::~Pmm() = default; - - /***********************************************************************************/ - /// @param If this returns Null pointer, enter emergency mode. - /// @param user is this a user page? - /// @param readWrite is it r/w? - /***********************************************************************************/ - Ref Pmm::RequestPage(Boolean user, Boolean readWrite) - { - PTEWrapper pt = fPageMgr.Leak().Request(user, readWrite, false, kPageSize); - - if (pt.fPresent) - { - kout << "[PMM]: Allocation failed.\r"; - return {}; - } - - return Ref(pt); - } - - Boolean Pmm::FreePage(Ref PageRef) - { - if (!PageRef) - return false; - - PageRef.Leak().fPresent = false; - - return true; - } - - Boolean Pmm::TogglePresent(Ref PageRef, Boolean Enable) - { - if (!PageRef) - return false; - - PageRef.Leak().fPresent = Enable; - - return true; - } - - Boolean Pmm::ToggleUser(Ref PageRef, Boolean Enable) - { - if (!PageRef) - return false; - - PageRef.Leak().fRw = Enable; - - return true; - } - - Boolean Pmm::ToggleRw(Ref PageRef, Boolean Enable) - { - if (!PageRef) - return false; - - PageRef.Leak().fRw = Enable; - - return true; - } - - Boolean Pmm::ToggleShare(Ref PageRef, Boolean Enable) - { - if (!PageRef) - return false; - - PageRef.Leak().fShareable = Enable; - - return true; - } -} // namespace NeOS diff --git a/dev/Kernel/src/Property.cc b/dev/Kernel/src/Property.cc deleted file mode 100644 index 8f3b5314..00000000 --- a/dev/Kernel/src/Property.cc +++ /dev/null @@ -1,45 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -namespace CFKit -{ - /***********************************************************************************/ - /// @brief Destructor. - /***********************************************************************************/ - Property::~Property() = default; - - /***********************************************************************************/ - /// @brief Constructor. - /***********************************************************************************/ - Property::Property() = default; - - /***********************************************************************************/ - /// @brief Check if property's name equals to name. - /// @param name string to check. - /***********************************************************************************/ - Bool Property::StringEquals(KString& name) - { - return this->fName && this->fName == name; - } - - /***********************************************************************************/ - /// @brief Gets the key (name) of property. - /***********************************************************************************/ - KString& Property::GetKey() - { - return this->fName; - } - - /***********************************************************************************/ - /// @brief Gets the value of the property. - /***********************************************************************************/ - PropertyId& Property::GetValue() - { - return fValue; - } -} // namespace CFKit diff --git a/dev/Kernel/src/Ref.cc b/dev/Kernel/src/Ref.cc deleted file mode 100644 index 6fadb033..00000000 --- a/dev/Kernel/src/Ref.cc +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include diff --git a/dev/Kernel/src/SoftwareTimer.cc b/dev/Kernel/src/SoftwareTimer.cc deleted file mode 100644 index 5e4214e9..00000000 --- a/dev/Kernel/src/SoftwareTimer.cc +++ /dev/null @@ -1,39 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -/// @brief SoftwareTimer class, meant to be generic. - -using namespace NeOS; - -SoftwareTimer::SoftwareTimer(Int64 seconds) - : fWaitFor(seconds) -{ - fDigitalTimer = new IntPtr(); - MUST_PASS(fDigitalTimer); -} - -SoftwareTimer::~SoftwareTimer() -{ - delete fDigitalTimer; - fDigitalTimer = nullptr; - - fWaitFor = 0; -} - -BOOL SoftwareTimer::Wait() noexcept -{ - if (fWaitFor < 1) - return NO; - - while (*fDigitalTimer < (*fDigitalTimer + fWaitFor)) - { - ++(*fDigitalTimer); - } - - return YES; -} diff --git a/dev/Kernel/src/Storage/AHCIDeviceInterface.cc b/dev/Kernel/src/Storage/AHCIDeviceInterface.cc deleted file mode 100644 index 8d987ab5..00000000 --- a/dev/Kernel/src/Storage/AHCIDeviceInterface.cc +++ /dev/null @@ -1,36 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -using namespace NeOS; - -/// @brief Class constructor -/// @param Out Drive output -/// @param In Drive input -/// @param Cleanup Drive cleanup. -AHCIDeviceInterface::AHCIDeviceInterface(void (*out)(IDeviceObject* self, MountpointInterface* outpacket), - void (*in)(IDeviceObject* self, MountpointInterface* inpacket), - void (*cleanup)(void)) - : IDeviceObject(out, in), fCleanup(cleanup) -{ -} - -/// @brief Class desctructor -AHCIDeviceInterface::~AHCIDeviceInterface() -{ - MUST_PASS(fCleanup); - - if (fCleanup) - fCleanup(); -} - -/// @brief Returns the name of the device interface. -/// @return it's name as a string. -const Char* AHCIDeviceInterface::Name() const -{ - return "/dev/sda{}"; -} diff --git a/dev/Kernel/src/Storage/ATADeviceInterface.cc b/dev/Kernel/src/Storage/ATADeviceInterface.cc deleted file mode 100644 index 9f1a0068..00000000 --- a/dev/Kernel/src/Storage/ATADeviceInterface.cc +++ /dev/null @@ -1,88 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -using namespace NeOS; - -/// @brief Class constructor -/// @param Out Drive output -/// @param In Drive input -/// @param Cleanup Drive cleanup. -ATADeviceInterface::ATADeviceInterface( - void (*Out)(IDeviceObject*, MountpointInterface* outpacket), - void (*In)(IDeviceObject*, MountpointInterface* inpacket), - void (*Cleanup)(void)) - : IDeviceObject(Out, In), fCleanup(Cleanup) -{ -} - -/// @brief Class desctructor -ATADeviceInterface::~ATADeviceInterface() -{ - MUST_PASS(fCleanup); - if (fCleanup) - fCleanup(); -} - -/// @brief Returns the name of the device interface. -/// @return it's name as a string. -const Char* ATADeviceInterface::Name() const -{ - return "/dev/hda{}"; -} - -/// @brief Output operator. -/// @param Data -/// @return -ATADeviceInterface& ATADeviceInterface::operator<<(MountpointInterface* Data) -{ - if (!Data) - return *this; - - for (SizeT driveCount = 0; driveCount < kDriveMaxCount; ++driveCount) - { - auto interface = Data->GetAddressOf(driveCount); - if ((interface) && rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) == 0) - { - continue; - } - else if ((interface) && - rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) != 0) - { - return *this; - } - } - - return (ATADeviceInterface&)IDeviceObject::operator<<( - Data); -} - -/// @brief Input operator. -/// @param Data -/// @return -ATADeviceInterface& ATADeviceInterface::operator>>(MountpointInterface* Data) -{ - if (!Data) - return *this; - - for (SizeT driveCount = 0; driveCount < kDriveMaxCount; ++driveCount) - { - auto interface = Data->GetAddressOf(driveCount); - if ((interface) && rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) == 0) - { - continue; - } - else if ((interface) && - rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) != 0) - { - return *this; - } - } - - return (ATADeviceInterface&)IDeviceObject::operator>>( - Data); -} diff --git a/dev/Kernel/src/Storage/NVMEDeviceInterface.cc b/dev/Kernel/src/Storage/NVMEDeviceInterface.cc deleted file mode 100644 index 3e2c2c53..00000000 --- a/dev/Kernel/src/Storage/NVMEDeviceInterface.cc +++ /dev/null @@ -1,28 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -namespace NeOS -{ - NVMEDeviceInterface::NVMEDeviceInterface(void (*out)(IDeviceObject*, MountpointInterface* outpacket), - void (*in)(IDeviceObject*, MountpointInterface* inpacket), - void (*cleanup)(void)) - : IDeviceObject(out, in), fCleanup(cleanup) - { - } - - NVMEDeviceInterface::~NVMEDeviceInterface() - { - if (fCleanup) - fCleanup(); - } - - const Char* NVMEDeviceInterface::Name() const - { - return ("/dev/nvme{}"); - } -} // namespace NeOS diff --git a/dev/Kernel/src/Storage/SCSIDeviceInterface.cc b/dev/Kernel/src/Storage/SCSIDeviceInterface.cc deleted file mode 100644 index cc625cdb..00000000 --- a/dev/Kernel/src/Storage/SCSIDeviceInterface.cc +++ /dev/null @@ -1,11 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -///! @brief ATAPI SCSI packet. -const scsi_packet_type<12> kCDRomPacketTemplate = {0x43, 0, 1, 0, 0, 0, - 0, 12, 0x40, 0, 0}; diff --git a/dev/Kernel/src/Stream.cc b/dev/Kernel/src/Stream.cc deleted file mode 100644 index 8d060556..00000000 --- a/dev/Kernel/src/Stream.cc +++ /dev/null @@ -1,12 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: Stream.cc - Purpose: Stream object - - Revision History: - -------------------------------------------- */ - -#include diff --git a/dev/Kernel/src/System/SwapDisk.cc b/dev/Kernel/src/System/SwapDisk.cc deleted file mode 100644 index 921ea86d..00000000 --- a/dev/Kernel/src/System/SwapDisk.cc +++ /dev/null @@ -1,47 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025 Amlal EL Mahrouss Labs, all rights reserved. - -------------------------------------------- */ - -#include -#include - -namespace NeOS -{ - BOOL SwapDisk::Write(const Char* fork_name, const SizeT fork_name_len, SWAP_DISK_HEADER* data, const SizeT data_len) - { - if (!fork_name || !fork_name_len) - return NO; - - if (data_len > kSwapBlockMaxSize) - return NO; - - if (!data) - return NO; - - FileStream file(kSwapPageFile, "wb"); - - auto ret = file.Write(fork_name, data, sizeof(SWAP_DISK_HEADER) + data_len); - - if (ret.Error()) - return NO; - - return YES; - } - - SWAP_DISK_HEADER* SwapDisk::Read(const Char* fork_name, const SizeT fork_name_len, const SizeT data_len) - { - if (!fork_name || !fork_name_len) - return nullptr; - - if (data_len > kSwapBlockMaxSize) - return nullptr; - - FileStream file(kSwapPageFile, "rb"); - - VoidPtr blob = file.Read(fork_name, sizeof(SWAP_DISK_HEADER) + data_len); - - return (SWAP_DISK_HEADER*)blob; - } -} // namespace NeOS diff --git a/dev/Kernel/src/ThreadLocalStorage.cc b/dev/Kernel/src/ThreadLocalStorage.cc deleted file mode 100644 index b25b4288..00000000 --- a/dev/Kernel/src/ThreadLocalStorage.cc +++ /dev/null @@ -1,67 +0,0 @@ -/* - * ======================================================== - * - * neoskrnl - * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - * - * ======================================================== - */ - -#include -#include -#include -#include - -/***********************************************************************************/ -/// @bugs: 0 -/// @file ThreadLocalStorage.cc -/// @brief Process Thread Local Storage. -/***********************************************************************************/ - -using namespace NeOS; - -/** - * @brief Checks for cookie inside the TIB. - * @param tib_ptr the TIB to check. - * @return if the cookie is enabled, true; false otherwise - */ - -Boolean tls_check_tib(THREAD_INFORMATION_BLOCK* tib_ptr) -{ - if (!tib_ptr || - !tib_ptr->Record) - return false; - - ICodec encoder; - const Char* tib_as_bytes = encoder.AsBytes(tib_ptr); - - kout << "TLS: Validating the TIB...\r"; - - return tib_as_bytes[kCookieMag0Idx] == kCookieMag0 && tib_as_bytes[kCookieMag1Idx] == kCookieMag1 && - tib_as_bytes[kCookieMag2Idx] == kCookieMag2; -} - -/** - * @brief System call implementation of the TLS check. - * @param tib_ptr The TIB record. - * @return if the TIB record is valid or not. - */ -EXTERN_C Bool tls_check_syscall_impl(NeOS::VoidPtr tib_ptr) noexcept -{ - if (!tib_ptr) - { - kout << "TLS: Failed because of an invalid TIB...\r"; - return No; - } - - THREAD_INFORMATION_BLOCK* tib = reinterpret_cast(tib_ptr); - - if (!tls_check_tib(tib)) - { - kout << "TLS: Failed because of an invalid TIB...\r"; - return No; - } - - kout << "TLS Pass.\r"; - return Yes; -} diff --git a/dev/Kernel/src/Timer.cc b/dev/Kernel/src/Timer.cc deleted file mode 100644 index 5df81134..00000000 --- a/dev/Kernel/src/Timer.cc +++ /dev/null @@ -1,19 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -///! BUGS: 0 -///! @file Timer.cc -///! @brief Software Timer implementation - -using namespace NeOS; - -/// @brief Unimplemented as it is an interface. -BOOL TimerInterface::Wait() noexcept -{ - return NO; -} diff --git a/dev/Kernel/src/User.cc b/dev/Kernel/src/User.cc deleted file mode 100644 index 3c23c59e..00000000 --- a/dev/Kernel/src/User.cc +++ /dev/null @@ -1,195 +0,0 @@ -/* - * ======================================================== - * - * NeKernel - * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - * - * File: User.cc - * Purpose: User class, used to provide authentication and security. - * - * ======================================================== - */ - -#include -#include -#include -#include -#include - -#define kStdUserType (0xEE) -#define kSuperUserType (0xEF) - -/// @file User.cc -/// @brief Multi-user support. - -namespace NeOS -{ - namespace Detail - { - //////////////////////////////////////////////////////////// - /// \brief Constructs a password by hashing the password. - /// \param password password to hash. - /// \return the hashed password - //////////////////////////////////////////////////////////// - const Int32 cred_construct_token(Char* password, const Char* in_password, User* user, SizeT length) - { - if (!password || !user) - return 1; - - kout << "cred_construct_token: Hashing user password...\r"; - - for (SizeT i_pass = 0UL; i_pass < length; ++i_pass) - { - const Char cur_chr = in_password[i_pass]; - - if (cur_chr == 0) - break; - - password[i_pass] = cur_chr | (user->IsStdUser() ? kStdUserType : kSuperUserType); - } - - kout << "cred_construct_token: Hashed user password.\r"; - - return 0; - } - } // namespace Detail - - //////////////////////////////////////////////////////////// - /// @brief User ring constructor. - //////////////////////////////////////////////////////////// - User::User(const Int32& sel, const Char* user_name) - : mUserRing((UserRingKind)sel) - { - MUST_PASS(sel >= 0); - rt_copy_memory((VoidPtr)user_name, this->mUserName, rt_string_len(user_name)); - } - - //////////////////////////////////////////////////////////// - /// @brief User ring constructor. - //////////////////////////////////////////////////////////// - User::User(const UserRingKind& ring_kind, const Char* user_name) - : mUserRing(ring_kind) - { - rt_copy_memory((VoidPtr)user_name, this->mUserName, rt_string_len(user_name)); - } - - //////////////////////////////////////////////////////////// - /// @brief User destructor class. - //////////////////////////////////////////////////////////// - User::~User() = default; - - Bool User::Save(const UserPublicKey password_to_fill) noexcept - { - if (!password_to_fill || - *password_to_fill == 0) - return No; - - SizeT len = rt_string_len(password_to_fill); - - UserPublicKey password = new UserPublicKeyType[len]; - - MUST_PASS(password); - - rt_set_memory(password, 0, len); - - // fill data first, generate hash. - // return false on error. - - rt_copy_memory((VoidPtr)password_to_fill, password, len); - - if (!Detail::cred_construct_token(password, password_to_fill, this, len)) - { - delete[] password; - password = nullptr; - - return No; - } - - // then store password. - - rt_copy_memory(password, this->mUserKey, rt_string_len(password_to_fill)); - - delete[] password; - password = nullptr; - - kout << "User::Save: Saved password successfully...\r"; - - return Yes; - } - - Bool User::Matches(const UserPublicKey password_to_fill) noexcept - { - if (!password_to_fill || - *password_to_fill) - return No; - - SizeT len = rt_string_len(password_to_fill); - - Char* password = new Char[len]; - MUST_PASS(password); - - // fill data first, generate hash. - // return false on error. - - rt_copy_memory((VoidPtr)password_to_fill, password, len); - - if (!Detail::cred_construct_token(password, password_to_fill, this, len)) - { - delete[] password; - password = nullptr; - - return No; - } - - kout << "User::Matches: Validating hashed passwords...\r"; - - // now check if the password matches. - if (rt_string_cmp(password, this->mUserKey, rt_string_len(this->mUserKey)) == 0) - { - kout << "User::Matches: Password matches.\r"; - return Yes; - } - - kout << "User::Matches: Password doesn't match.\r"; - return No; - } - - Bool User::operator==(const User& lhs) - { - return lhs.mUserRing == this->mUserRing; - } - - Bool User::operator!=(const User& lhs) - { - return lhs.mUserRing != this->mUserRing; - } - - //////////////////////////////////////////////////////////// - /// @brief Returns the user's name. - //////////////////////////////////////////////////////////// - - Char* User::Name() noexcept - { - return this->mUserName; - } - - //////////////////////////////////////////////////////////// - /// @brief Returns the user's ring. - /// @return The king of ring the user is attached to. - //////////////////////////////////////////////////////////// - - const UserRingKind& User::Ring() noexcept - { - return this->mUserRing; - } - - Bool User::IsStdUser() noexcept - { - return this->Ring() == UserRingKind::kRingStdUser; - } - - Bool User::IsSuperUser() noexcept - { - return this->Ring() == UserRingKind::kRingSuperUser; - } -} // namespace NeOS diff --git a/dev/Kernel/src/UserProcessScheduler.cc b/dev/Kernel/src/UserProcessScheduler.cc deleted file mode 100644 index 1087ac6b..00000000 --- a/dev/Kernel/src/UserProcessScheduler.cc +++ /dev/null @@ -1,621 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - FILE: UserProcessScheduler.cc - PURPOSE: Low level/Ring-3 Process scheduler. - -------------------------------------------- */ - -/***********************************************************************************/ -/// @file UserProcessScheduler.cc -/// @brief Low level/Ring-3 process scheduler. -/***********************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -///! BUGS: 0 - -namespace NeOS -{ - /***********************************************************************************/ - /// @brief Exit Code global variable. - /***********************************************************************************/ - - STATIC UInt32 kLastExitCode = 0U; - - /***********************************************************************************/ - /// @brief External reference of the thread scheduler. - /***********************************************************************************/ - - STATIC UserProcessScheduler kProcessScheduler; - - UserProcess::UserProcess() = default; - UserProcess::~UserProcess() = default; - - /// @brief Gets the last exit code. - /// @note Not thread-safe. - /// @return Int32 the last exit code. - - const UInt32& sched_get_exit_code(void) noexcept - { - return kLastExitCode; - } - - /***********************************************************************************/ - /// @brief Crashes the current process. - /***********************************************************************************/ - - Void UserProcess::Crash() - { - if (this->Status != ProcessStatusKind::kRunning) - return; - - kout << this->Name << ": crashed, error id: " << number(kErrorProcessFault) << kendl; - this->Exit(kErrorProcessFault); - } - - /***********************************************************************************/ - /// @brief boolean operator, check status. - /***********************************************************************************/ - - UserProcess::operator bool() - { - return this->Status == ProcessStatusKind::kRunning; - } - - /***********************************************************************************/ - /// @brief Gets the local last exit code. - /// @note Not thread-safe. - /// @return Int32 the last exit code. - /***********************************************************************************/ - - const UInt32& UserProcess::GetExitCode() noexcept - { - return this->fLastExitCode; - } - - /***********************************************************************************/ - /// @brief Error code variable getter. - /***********************************************************************************/ - - Int32& UserProcess::GetLocalCode() noexcept - { - return this->fLocalCode; - } - - /***********************************************************************************/ - /// @brief Wakes process header. - /// @param should_wakeup if the program shall wakeup or not. - /***********************************************************************************/ - - Void UserProcess::Wake(const Bool should_wakeup) - { - this->Status = - should_wakeup ? ProcessStatusKind::kRunning : ProcessStatusKind::kFrozen; - } - - /***********************************************************************************/ - /** @brief Allocate pointer to track list. */ - /***********************************************************************************/ - - ErrorOr UserProcess::New(const SizeT& sz, const SizeT& pad_amount) - { -#ifdef __NE_VIRTUAL_MEMORY_SUPPORT__ - auto vm_register = hal_read_cr3(); - hal_write_cr3(this->VMRegister); - - auto ptr = mm_new_heap(sz + pad_amount, Yes, Yes); - - hal_write_cr3(vm_register); -#else - auto ptr = mm_new_heap(sz + pad_amount, Yes, Yes); -#endif - - if (!this->ProcessMemoryHeap) - { - this->ProcessMemoryHeap = new ProcessMemoryHeapList(); - - this->ProcessMemoryHeap->MemoryEntryPad = pad_amount; - this->ProcessMemoryHeap->MemoryEntrySize = sz; - - this->ProcessMemoryHeap->MemoryEntry = ptr; - - this->ProcessMemoryHeap->MemoryPrev = nullptr; - this->ProcessMemoryHeap->MemoryNext = nullptr; - } - else - { - ProcessMemoryHeapList* entry = this->ProcessMemoryHeap; - ProcessMemoryHeapList* prev_entry = nullptr; - - while (entry) - { - if (entry->MemoryEntry == nullptr) - break; // chose to break here, when we get an already allocated memory entry for our needs. - - prev_entry = entry; - entry = entry->MemoryNext; - } - - entry->MemoryNext = new ProcessMemoryHeapList(); - entry->MemoryNext->MemoryEntry = ptr; - - entry->MemoryNext->MemoryPrev = entry; - entry->MemoryNext->MemoryNext = nullptr; - } - - this->UsedMemory += sz; - - return ErrorOr(ptr); - } - - /***********************************************************************************/ - /// @brief Gets the name of the current process. - /***********************************************************************************/ - - const Char* UserProcess::GetName() noexcept - { - return this->Name; - } - - /***********************************************************************************/ - /// @brief Gets the owner of the process. - /***********************************************************************************/ - - const User* UserProcess::GetOwner() noexcept - { - return this->Owner; - } - - /// @brief UserProcess status getter. - const ProcessStatusKind& UserProcess::GetStatus() noexcept - { - return this->Status; - } - - /***********************************************************************************/ - /** - @brief Affinity is the time slot allowed for the process. - */ - /***********************************************************************************/ - - const AffinityKind& UserProcess::GetAffinity() noexcept - { - return this->Affinity; - } - - /***********************************************************************************/ - /** - @brief Exit process method. - @param exit_code The process's exit code. - */ - /***********************************************************************************/ - - Void UserProcess::Exit(const Int32& exit_code) - { - this->Status = exit_code > 0 ? ProcessStatusKind::kKilled : ProcessStatusKind::kFrozen; - this->fLastExitCode = exit_code; - - kLastExitCode = exit_code; - - auto memory_heap_list = this->ProcessMemoryHeap; - -#ifdef __NE_VIRTUAL_MEMORY_SUPPORT__ - auto pd = hal_read_cr3(); - hal_write_cr3(this->VMRegister); -#endif - - // Deleting memory lists. Make sure to free all of them. - while (memory_heap_list) - { - if (memory_heap_list->MemoryEntry) - { - MUST_PASS(mm_delete_heap(memory_heap_list->MemoryEntry)); - } - -#ifdef __NE_VIRTUAL_MEMORY_SUPPORT__ - hal_write_cr3(pd); -#endif - - auto next = memory_heap_list->MemoryNext; - - mm_delete_heap(memory_heap_list); - - memory_heap_list = next; - } - - //! Free the memory's page directory. - HAL::mm_free_bitmap(this->VMRegister); - - //! Delete image if not done already. - if (this->Image.fCode && mm_is_valid_heap(this->Image.fCode)) - mm_delete_heap(this->Image.fCode); - - if (this->Image.fBlob && mm_is_valid_heap(this->Image.fBlob)) - mm_delete_heap(this->Image.fBlob); - - if (this->StackFrame && mm_is_valid_heap(this->StackFrame)) - mm_delete_heap((VoidPtr)this->StackFrame); - - this->Image.fBlob = nullptr; - this->Image.fCode = nullptr; - this->StackFrame = nullptr; - - if (this->Kind == kExectuableDylibKind) - { - Bool success = false; - - rtl_fini_dylib(*this, reinterpret_cast(this->DylibDelegate), &success); - - if (!success) - { - ke_panic(RUNTIME_CHECK_PROCESS); - } - - this->DylibDelegate = nullptr; - } - - if (this->StackReserve) - mm_delete_heap(reinterpret_cast(this->StackReserve)); - - this->ProcessId = 0; - this->Status = ProcessStatusKind::kFinished; - - --this->ProcessParentTeam->mProcessCount; - - delete this; - } - - /***********************************************************************************/ - /// @brief Add process to team. - /// @param process the process *Ref* class. - /// @return the process index inside the team. - /***********************************************************************************/ - - ProcessID UserProcessScheduler::Spawn(const Char* name, VoidPtr code, VoidPtr image) - { - ProcessID pid = this->mTeam.mProcessCount; - - if (pid > kSchedProcessLimitPerTeam) - { - return kErrorProcessFault; - } - - ++this->mTeam.mProcessCount; - - UserProcess& process = this->mTeam.mProcessList[pid]; - - process.Image.fCode = code; - process.Image.fBlob = image; - - rt_copy_memory(reinterpret_cast(const_cast(name)), process.Name, rt_string_len(name)); - -#ifdef __NE_VIRTUAL_MEMORY_SUPPORT__ - process.VMRegister = new PDE(); - - if (!process.VMRegister) - { - process.Crash(); - return kErrorProcessFault; - } - - UInt32 flags = HAL::kMMFlagsPresent; - flags |= HAL::kMMFlagsWr; - flags |= HAL::kMMFlagsUser; - - HAL::mm_map_page((VoidPtr)process.VMRegister, process.VMRegister, flags); -#endif // __NE_VIRTUAL_MEMORY_SUPPORT__ - - process.StackFrame = new HAL::StackFrame(); - - if (!process.StackFrame) - { - process.Crash(); - return kErrorProcessFault; - } - -#ifdef __NE_VIRTUAL_MEMORY_SUPPORT__ - flags = HAL::kMMFlagsPresent; - flags |= HAL::kMMFlagsWr; - flags |= HAL::kMMFlagsUser; - - HAL::mm_map_page((VoidPtr)process.StackFrame, process.StackFrame, flags); -#endif // __NE_VIRTUAL_MEMORY_SUPPORT__ - - // React according to process kind. - switch (process.Kind) - { - case UserProcess::kExectuableDylibKind: { - process.DylibDelegate = rtl_init_dylib(process); - MUST_PASS(process.DylibDelegate); - } - default: { - kout << "Unknown process kind: " << hex_number(process.Kind) << kendl; - break; - } - } - - process.StackReserve = new UInt8[process.StackSize]; - rt_set_memory(process.StackReserve, 0, process.StackSize); - - if (!process.StackReserve) - { - process.Crash(); - return kErrorProcessFault; - } - -#ifdef __NE_VIRTUAL_MEMORY_SUPPORT__ - flags = HAL::kMMFlagsPresent; - flags |= HAL::kMMFlagsWr; - flags |= HAL::kMMFlagsUser; - - HAL::mm_map_page((VoidPtr)process.StackReserve, process.StackReserve, flags); -#endif // __NE_VIRTUAL_MEMORY_SUPPORT__ - - process.ProcessParentTeam = &mTeam; - - process.ProcessId = pid; - process.Status = ProcessStatusKind::kStarting; - process.PTime = (UIntPtr)AffinityKind::kStandard; - - kout << "PID: " << number(process.ProcessId) << kendl; - kout << "Name: " << process.Name << kendl; - - return pid; - } - - /***********************************************************************************/ - /// @brief Retrieves the singleton of the process scheduler. - /***********************************************************************************/ - - UserProcessScheduler& UserProcessScheduler::The() - { - return kProcessScheduler; - } - - /***********************************************************************************/ - - /// @brief Remove process from the team. - /// @param process_id process slot inside team. - /// @retval true process was removed. - /// @retval false process doesn't exist in team. - - /***********************************************************************************/ - - const Bool UserProcessScheduler::Remove(ProcessID process_id) - { - // check if process is within range. - if (process_id > mTeam.mProcessList.Count()) - return No; - - mTeam.mProcessList[process_id].Exit(0); - - return Yes; - } - - /// @brief Is it a user scheduler? - - const Bool UserProcessScheduler::IsUser() - { - return Yes; - } - - /// @brief Is it a kernel scheduler? - - const Bool UserProcessScheduler::IsKernel() - { - return No; - } - - /// @brief Is it a SMP scheduler? - - const Bool UserProcessScheduler::HasMP() - { - return Yes; - } - - /***********************************************************************************/ - /// @brief Run User scheduler object. - /// @return Process count executed within a team. - /***********************************************************************************/ - - const SizeT UserProcessScheduler::Run() noexcept - { - SizeT process_index = 0UL; //! we store this guy to tell the scheduler how many - //! things we have scheduled. - - if (mTeam.mProcessCount < 1) - { - kout << "UserProcessScheduler::Run(): This team doesn't have any process!\r"; - return 0UL; - } - for (; process_index < mTeam.AsArray().Capacity(); ++process_index) - { - auto& process = mTeam.AsArray()[process_index]; - - //! check if the process needs to be run. - if (UserProcessHelper::CanBeScheduled(process)) - { - // Set current process header. - this->CurrentProcess() = process; - - process.PTime = static_cast(process.Affinity); - - kout << "Switch to: '" << process.Name << "'.\r"; - - // tell helper to find a core to schedule on. - BOOL ret = UserProcessHelper::Switch(process.Image.fCode, &process.StackReserve[process.StackSize - 1], process.StackFrame, - process.ProcessId); - - if (!ret) - { - if (process.Affinity == AffinityKind::kRealTime) - continue; - - kout << "The process: " << process.Name << ", is not valid! Crashing it...\r"; - - process.Crash(); - } - } - else - { - --process.PTime; - } - } - - return process_index; - } - - /// @brief Gets the current scheduled team. - /// @return - UserProcessTeam& UserProcessScheduler::CurrentTeam() - { - return mTeam; - } - - /// @internal - - /// @brief Gets current running process. - /// @return - Ref& UserProcessScheduler::CurrentProcess() - { - return mTeam.AsRef(); - } - - /// @brief Current proccess id getter. - /// @return UserProcess ID integer. - ErrorOr UserProcessHelper::TheCurrentPID() - { - if (!kProcessScheduler.CurrentProcess()) - return ErrorOr{kErrorProcessFault}; - - kout << "UserProcessHelper::TheCurrentPID: Leaking ProcessId...\r"; - return ErrorOr{kProcessScheduler.CurrentProcess().Leak().ProcessId}; - } - - /// @brief Check if process can be schedulded. - /// @param process the process reference. - /// @retval true can be schedulded. - /// @retval false cannot be schedulded. - Bool UserProcessHelper::CanBeScheduled(const UserProcess& process) - { - if (process.Status == ProcessStatusKind::kKilled || - process.Status == ProcessStatusKind::kFinished || - process.Status == ProcessStatusKind::kStarting || - process.Status == ProcessStatusKind::kFrozen) - return No; - - if (process.Status == ProcessStatusKind::kInvalid) - return No; - - if (!process.Image.fCode) - return No; - - if (!process.Name[0]) - return No; - - // real time processes shouldn't wait that much. - if (process.Affinity == AffinityKind::kRealTime) - return Yes; - - return process.PTime < 1; - } - - /***********************************************************************************/ - /** - * @brief Start scheduling current AP. - */ - /***********************************************************************************/ - - SizeT UserProcessHelper::StartScheduling() - { - return kProcessScheduler.Run(); - } - - /***********************************************************************************/ - /** - * \brief Does a context switch in a CPU. - * \param the_stack the stackframe of the running app. - * \param new_pid the process's PID. - */ - /***********************************************************************************/ - - Bool UserProcessHelper::Switch(VoidPtr image, UInt8* stack, HAL::StackFramePtr frame_ptr, const PID& new_pid) - { - for (SizeT index = 0UL; index < HardwareThreadScheduler::The().Capacity(); ++index) - { - if (HardwareThreadScheduler::The()[index].Leak()->Kind() == kAPInvalid || - HardwareThreadScheduler::The()[index].Leak()->Kind() == kAPBoot) - continue; - - // A fallback is a special core for real-time tasks which needs immediate execution. - if (HardwareThreadScheduler::The()[index].Leak()->Kind() == kAPRealTime) - { - if (UserProcessScheduler::The().CurrentTeam().AsArray()[new_pid].Affinity != AffinityKind::kRealTime) - continue; - - if (HardwareThreadScheduler::The()[index].Leak()->Switch(image, stack, frame_ptr, new_pid)) - { - PTime prev_ptime = HardwareThreadScheduler::The()[index].Leak()->fPTime; - - HardwareThreadScheduler::The()[index].Leak()->fPTime = UserProcessScheduler::The().CurrentTeam().AsArray()[new_pid].PTime; - - PID prev_pid = UserProcessHelper::TheCurrentPID(); - UserProcessHelper::TheCurrentPID().Leak().Leak() = new_pid; - - return YES; - } - - continue; - } - - if (UserProcessScheduler::The().CurrentTeam().AsArray()[new_pid].Affinity == AffinityKind::kRealTime) - continue; - - //////////////////////////////////////////////////////////// - /// Prepare task switch. /// - //////////////////////////////////////////////////////////// - - Bool ret = HardwareThreadScheduler::The()[index].Leak()->Switch(image, stack, frame_ptr, new_pid); - - //////////////////////////////////////////////////////////// - /// Rollback on fail. /// - //////////////////////////////////////////////////////////// - - if (!ret) - continue; - - UserProcessHelper::TheCurrentPID().Leak().Leak() = new_pid; - - HardwareThreadScheduler::The()[index].Leak()->fPTime = UserProcessScheduler::The().CurrentTeam().AsArray()[new_pid].PTime; - HardwareThreadScheduler::The()[index].Leak()->Wake(YES); - - return Yes; - } - - return No; - } - - //////////////////////////////////////////////////////////// - /// @brief this checks if any process is on the team. - //////////////////////////////////////////////////////////// - UserProcessScheduler::operator bool() - { - return mTeam.AsArray().Count() > 0; - } - - //////////////////////////////////////////////////////////// - /// @brief this checks if no process is on the team. - //////////////////////////////////////////////////////////// - Bool UserProcessScheduler::operator!() - { - return mTeam.AsArray().Count() == 0; - } -} // namespace NeOS diff --git a/dev/Kernel/src/UserProcessTeam.cc b/dev/Kernel/src/UserProcessTeam.cc deleted file mode 100644 index e0533ef1..00000000 --- a/dev/Kernel/src/UserProcessTeam.cc +++ /dev/null @@ -1,59 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -/***********************************************************************************/ -/// @file UserProcessTeam.cc -/// @brief Process teams implementation. -/***********************************************************************************/ - -#include - -namespace NeOS -{ - UserProcessTeam::UserProcessTeam() - { - for (SizeT i = 0U; i < this->mProcessList.Count(); ++i) - { - this->mProcessList[i] = UserProcess(); - this->mProcessList[i].PTime = 0; - this->mProcessList[i].Status = ProcessStatusKind::kKilled; - } - - this->mProcessCount = 0UL; - } - - /***********************************************************************************/ - /// @brief UserProcess list array getter. - /// @return The list of process to schedule. - /***********************************************************************************/ - - Array& UserProcessTeam::AsArray() - { - return this->mProcessList; - } - - /***********************************************************************************/ - /// @brief Get team ID. - /// @return The team's ID. - /***********************************************************************************/ - - ProcessID& UserProcessTeam::Id() noexcept - { - return this->mTeamId; - } - - /***********************************************************************************/ - /// @brief Get current process getter as Ref. - /// @return The current process header. - /***********************************************************************************/ - - Ref& UserProcessTeam::AsRef() - { - return this->mCurrentProcess; - } -} // namespace NeOS - -// last rev 05-03-24 diff --git a/dev/Kernel/src/Utils.cc b/dev/Kernel/src/Utils.cc deleted file mode 100644 index a362099a..00000000 --- a/dev/Kernel/src/Utils.cc +++ /dev/null @@ -1,224 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -namespace NeOS -{ - Int32 rt_string_cmp(const Char* src, const Char* cmp, Size size) - { - Int32 counter = 0; - - for (Size index = 0; index < size; ++index) - { - if (src[index] != cmp[index]) - ++counter; - } - - return counter; - } - - Void rt_zero_memory(voidPtr pointer, Size len) - { - rt_set_memory(pointer, 0, len); - } - - SizeT rt_string_len(const Char* str, SizeT _len) - { - SizeT len{0}; - - do - { - if (len > _len) - { - return _len; - } - - ++len; - } while (str[len] != '\0'); - - return len; - } - - Size rt_string_len(const Char* ptr) - { - SizeT cnt{0}; - - while (ptr[cnt] != 0) - ++cnt; - - return cnt; - } - - voidPtr rt_set_memory(voidPtr src, UInt32 value, Size len) - { - UInt32* start = reinterpret_cast(src); - - while (len) - { - *start = value; - ++start; - --len; - } - - return (voidPtr)start; - } - - Int rt_move_memory(const voidPtr src, voidPtr dst, Size len) - { - Char* srcChr = reinterpret_cast(src); - Char* dstChar = reinterpret_cast(dst); - SizeT index = 0; - - while (index < len) - { - dstChar[index] = srcChr[index]; - srcChr[index] = 0; - - ++index; - } - - return 0; - } - - Int rt_copy_memory(const voidPtr src, voidPtr dst, Size len) - { - char* srcChr = reinterpret_cast(src); - char* dstChar = reinterpret_cast(dst); - Size index = 0; - - while (index < len) - { - dstChar[index] = srcChr[index]; - ++index; - } - - dstChar[index] = 0; - - return index; - } - - const Char* rt_alloc_string(const Char* src) - { - const Char* string = new Char[rt_string_len(src) + 1]; - - if (!string) - return nullptr; - - voidPtr v_src = reinterpret_cast(const_cast(src)); - voidPtr v_dst = reinterpret_cast(const_cast(string)); - - rt_copy_memory(v_src, v_dst, rt_string_len(src) + 1); - - return string; - } - - Int32 rt_to_uppercase(Int32 character) - { - if (character >= 'a' && character <= 'z') - return character - 0x20; - - return character; - } - - Int32 rt_is_alnum(Int32 character) - { - return (character >= 'a' && character <= 'z') || (character >= 'A' && character <= 'Z') || (character >= '0' && character <= '9'); - } - - Int32 rt_to_lower(Int32 character) - { - if (character >= 'A' && character <= 'Z') - return character + 0x20; - - return character; - } - - Boolean rt_is_space(Char chr) - { - return chr == ' '; - } - - Boolean rt_is_newln(Char chr) - { - return chr == '\n'; - } - - VoidPtr rt_string_in_string(const Char* in, const Char* needle) - { - for (SizeT i = 0; i < rt_string_len(in); ++i) - { - if (rt_string_cmp(in + i, needle, rt_string_len(needle)) == 0) - return reinterpret_cast(const_cast(in + i)); - } - - return nullptr; - } - - Char rt_to_char(UInt64 base, Int32 limit) - { - const Char kNumbers[17] = "0123456789ABCDEF"; - return kNumbers[base % limit]; - } - - Bool rt_to_string(Char* str, UInt64 base, Int32 limit) - { -#ifdef __NE_AMD64__ - auto i = 0; - - auto final_number = base; - - auto mult = 1; - auto elems = 0L; - - base /= 10; - - while (base > 0) - { - elems++; - mult *= 10; - base /= 10; - } - - while (elems > -1) - { - final_number = (final_number % mult) * 10 + final_number / mult; - str[i] = rt_to_char(final_number, limit); - - --elems; - ++i; - } -#endif - - return YES; - } - - /// @brief Checks for a string start at the character. - - Char* rt_string_has_char(Char* str, const Char chr) - { - while (*str != chr) - { - ++str; - - if (*str == 0) - return nullptr; - } - - return str; - } -} // namespace NeOS - -EXTERN_C void* memset(void* dst, int c, long long unsigned int len) -{ - return NeOS::rt_set_memory(dst, c, len); -} - -EXTERN_C void* memcpy(void* dst, const void* src, long long unsigned int len) -{ - NeOS::rt_copy_memory(const_cast(src), dst, len); - return dst; -} diff --git a/dev/Kernel/src/Variant.cc b/dev/Kernel/src/Variant.cc deleted file mode 100644 index cfa29d3a..00000000 --- a/dev/Kernel/src/Variant.cc +++ /dev/null @@ -1,41 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -namespace NeOS -{ - const Char* Variant::ToString() - { - switch (fKind) - { - case VariantKind::kXML: - return ("Class:{XML}"); - case VariantKind::kJson: - return ("Class:{Json}"); - case VariantKind::kString: - return ("Class:{String}"); - case VariantKind::kBlob: - return ("Class:{Blob}"); - case VariantKind::kNull: - return ("Class:{Null}"); - default: - return ("Class:{Unknown}"); - } - } - - /// @brief Return variant's kind. - Variant::VariantKind& Variant::Kind() - { - return this->fKind; - } - - /// @brief Leak variant's instance. - VoidPtr Variant::Leak() - { - return this->fPtr; - } -} // namespace NeOS diff --git a/dev/LibSCI/CompilerHint.h b/dev/LibSCI/CompilerHint.h deleted file mode 100644 index 01ecb35f..00000000 --- a/dev/LibSCI/CompilerHint.h +++ /dev/null @@ -1,25 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef SCI_HINT_H -#define SCI_HINT_H - -#ifdef __TK__ -#pragma compiler(hint_manifest) -#endif - -#define _Input -#define _Output - -#define _Optional - -#define _StrictCheckInput -#define _StrictCheckOutput - -#define _InOut -#define _StrictInOut - -#endif // ifndef SCI_HINT_H diff --git a/dev/LibSCI/FileMgr.h b/dev/LibSCI/FileMgr.h deleted file mode 100644 index 2e256bfb..00000000 --- a/dev/LibSCI/FileMgr.h +++ /dev/null @@ -1,10 +0,0 @@ -/* ------------------------------------------- - -Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -File: Finder.h -Purpose: FileMgr Interface. - -------------------------------------------- */ - -#pragma once \ No newline at end of file diff --git a/dev/LibSCI/GPU.h b/dev/LibSCI/GPU.h deleted file mode 100644 index a29eae00..00000000 --- a/dev/LibSCI/GPU.h +++ /dev/null @@ -1,78 +0,0 @@ -/* ------------------------------------------- - -Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -File: GPU.h -Purpose: GPU/FB System Calls. - -------------------------------------------- */ - -#ifndef SCI_GPU_H -#define SCI_GPU_H - -#include - -/// ------------------------------------------------------------------------------------------ // -/// @brief Graphics Processor API. -/// ------------------------------------------------------------------------------------------ // - -struct GPUCmdEntry; -struct GPUCmdEntryTraits; - -typedef VoidPtr GPUObject; - -/// ------------------------------------------------------------------------------------------ // -/// @brief Command structure type. -/// ------------------------------------------------------------------------------------------ // - -struct GPUCmdEntry -{ - VoidPtr Data{nullptr}; - SizeT DataSz{0}; - SizeT Layer{0}; - BOOL IsGPGPUData{NO}; -}; - -struct GPUCmdEntryTraits final -{ - GPUCmdEntry* Cmd{nullptr}; - - BOOL isGPGPUData() - { - return this->isValid() && this->Cmd->IsGPGPUData; - } - - BOOL isBackBuffer() - { - return this->Cmd->Layer > 0; - } - - BOOL isValid() - { - return this->Cmd->Data && (this->Cmd->DataSz > 0) && (MmGetHeapFlags(this->Cmd->Data) != ~0); - } -}; - -IMPORT_C BOOL GPUListDevices(const Char** list, SizeT cnt); - -IMPORT_C GPUObject GPUFindByDeviceName(_Input const Char* device_name); - -IMPORT_C GPUObject GPUQueryInfo(_Input const GPUObject* gpu_handle, VoidPtr* out, SizeT out_sz); - -IMPORT_C SInt32 GPUDisposeDevice(GPUObject gpu_handle, Bool cancel_all, Bool flush_all); - -IMPORT_C SInt32 GPUSendCmdBufferListWithCnt(GPUObject gpu_handle, GPUCmdEntry** cmd_list, SizeT cmd_list_cnt); - -// ------------------------------------------------------------------------------------------ // -// @brief Framebuffer API. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C SInt32 FBAcquireBuffer(GPUObject* out, SInt32 width, SInt32 height); - -IMPORT_C SInt32 FBDisposeBuffer(GPUObject* in); - -IMPORT_C SInt32 FBGetColorProfile(GPUObject in); - -IMPORT_C SInt32 FBQueryInfo(GPUObject handle, VoidPtr* info_ptr, SizeT* info_sz); - -#endif // ifndef SCI_GPU_H diff --git a/dev/LibSCI/LPC.h b/dev/LibSCI/LPC.h deleted file mode 100644 index 8631f3de..00000000 --- a/dev/LibSCI/LPC.h +++ /dev/null @@ -1,56 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -/// @file LPC.h -/// @brief Local Process Code type and values. - -#define err_local_ok() (kLastError == kErrorSuccess) -#define err_local_fail() (kLastError != kErrorSuccess) -#define err_local_get() (kLastError) - -typedef SInt32 ErrObject; - -inline constexpr ErrObject kErrorSuccess = 0; -inline constexpr ErrObject kErrorExecutable = 33; -inline constexpr ErrObject kErrorExecutableLib = 34; -inline constexpr ErrObject kErrorFileNotFound = 35; -inline constexpr ErrObject kErrorDirectoryNotFound = 36; -inline constexpr ErrObject kErrorDiskReadOnly = 37; -inline constexpr ErrObject kErrorDiskIsFull = 38; -inline constexpr ErrObject kErrorProcessFault = 39; -inline constexpr ErrObject kErrorSocketHangUp = 40; -inline constexpr ErrObject kErrorThreadLocalStorage = 41; -inline constexpr ErrObject kErrorMath = 42; -inline constexpr ErrObject kErrorNoNetwork = 43; -inline constexpr ErrObject kErrorHeapOutOfMemory = 44; -inline constexpr ErrObject kErrorNoSuchDisk = 45; -inline constexpr ErrObject kErrorFileExists = 46; -inline constexpr ErrObject kErrorFormatFailed = 47; -inline constexpr ErrObject kErrorNetworkTimeout = 48; -inline constexpr ErrObject kErrorInternal = 49; -inline constexpr ErrObject kErrorForkAlreadyExists = 50; -inline constexpr ErrObject kErrorOutOfTeamSlot = 51; -inline constexpr ErrObject kErrorHeapNotPresent = 52; -inline constexpr ErrObject kErrorNoEntrypoint = 53; -inline constexpr ErrObject kErrorDiskIsCorrupted = 54; -inline constexpr ErrObject kErrorDisk = 55; -inline constexpr ErrObject kErrorInvalidData = 56; -inline constexpr ErrObject kErrorAsync = 57; -inline constexpr ErrObject kErrorNonBlocking = 58; -inline constexpr ErrObject kErrorIPC = 59; -inline constexpr ErrObject kErrorSign = 60; -inline constexpr ErrObject kErrorInvalidCreds = 61; -inline constexpr ErrObject kErrorCDTrayBroken = 62; -inline constexpr ErrObject kErrorUnrecoverableDisk = 63; -inline constexpr ErrObject kErrorFileLocked = 64; -inline constexpr ErrObject kErrorUnimplemented = -1; - -/// @brief The last error reported by the system to the process. -IMPORT_C ErrObject kLastError; diff --git a/dev/LibSCI/Macros.h b/dev/LibSCI/Macros.h deleted file mode 100644 index 4e4bff9a..00000000 --- a/dev/LibSCI/Macros.h +++ /dev/null @@ -1,93 +0,0 @@ -/* ------------------------------------------- - -Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -File: Macros.h -Purpose: LibSCI Macros header. - -------------------------------------------- */ - -#pragma once - -/***********************************************************************************/ -/// @file LibSCI/Macros.h -/// @brief Macros and core types. -/***********************************************************************************/ - -#include - -#define ATTRIBUTE(X) __attribute__((X)) - -#define IMPORT_CXX extern "C++" -#define IMPORT_C extern "C" - -#define DEPRECATED ATTRIBUTE(deprecated) - -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 - -#define FILE_MAX_LEN 256 - -#ifndef BOOL -#define BOOL bool -#endif - -typedef bool Bool; -typedef bool Boolean; -typedef void Void; - -#ifndef __cplusplus -#define true 1 -#define false 0 -#endif - -#define YES true -#define NO false - -typedef __UINT64_TYPE__ UInt64; -typedef __UINT32_TYPE__ UInt32; -typedef __UINT16_TYPE__ UInt16; -typedef __UINT8_TYPE__ UInt8; - -typedef __SIZE_TYPE__ SizeT; - -typedef __INT64_TYPE__ SInt64; -typedef __INT32_TYPE__ SInt32; -typedef __INT16_TYPE__ SInt16; -typedef __INT8_TYPE__ SInt8; - -typedef void* VoidPtr; -typedef __UINTPTR_TYPE__ UIntPtr; -typedef char Char; - -#ifdef __cplusplus -typedef decltype(nullptr) nullPtr; -typedef nullPtr NullPtr; - -#define SCI_COPY_DELETE(KLASS) \ - KLASS& operator=(const KLASS&) = delete; \ - KLASS(const KLASS&) = delete; - -#define SCI_COPY_DEFAULT(KLASS) \ - KLASS& operator=(const KLASS&) = default; \ - KLASS(const KLASS&) = default; - -#define SCI_MOVE_DELETE(KLASS) \ - KLASS& operator=(KLASS&&) = delete; \ - KLASS(KLASS&&) = delete; - -#define SCI_MOVE_DEFAULT(KLASS) \ - KLASS& operator=(KLASS&&) = default; \ - KLASS(KLASS&&) = default; - -#endif - -IMPORT_C void _rtl_assert(Bool expr, const Char* origin); - -#define MUST_PASS(X) _rtl_assert(X, __FILE__) - -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(a) \ - (((sizeof(a) / sizeof(*(a))) / \ - (static_cast(!(sizeof(a) % sizeof(*(a))))))) -#endif \ No newline at end of file diff --git a/dev/LibSCI/SCI.h b/dev/LibSCI/SCI.h deleted file mode 100644 index 97af9ffc..00000000 --- a/dev/LibSCI/SCI.h +++ /dev/null @@ -1,352 +0,0 @@ -/* ------------------------------------------- - -Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -File: SCI.h -Purpose: System Call Interface. - -------------------------------------------- */ - -#ifndef SCI_SCI_H -#define SCI_SCI_H - -#include - -// ------------------------------------------------------------------------------------------ // -/// @brief Types API. -// ------------------------------------------------------------------------------------------ // - -typedef VoidPtr SCIObject; - -typedef SCIObject IOObject; -typedef IOObject FSObject; -typedef SCIObject DLLObject; -typedef SCIObject ThreadObject; -typedef SCIObject SocketObject; - -// ------------------------------------------------------------------------------------------ // -/// @brief Dynamic Loader API. -// ------------------------------------------------------------------------------------------ // - -/// @brief Get function which is part of the DLL. -/// @param symbol the symbol to look for -/// @param dll_handle the DLL handle. -/// @return the proc pointer. -IMPORT_C SCIObject LdrGetDLLSymbolFromHandle(_Input const Char* symbol, _Input SCIObject dll_handle); - -/// @brief Open DLL handle. -/// @param path -/// @param drv -/// @return -IMPORT_C SCIObject LdrOpenDLLHandle(_Input const Char* path, _Input const Char* drive_letter); - -/// @brief Close DLL handle -/// @param dll_handle -/// @return -IMPORT_C Void LdrCloseDLLHandle(_Input SCIObject* dll_handle); - -// ------------------------------------------------------------------------------------------ // -// File API. -// ------------------------------------------------------------------------------------------ // - -/// @brief Opens a file from a drive. -/// @param fs_path the filesystem path. -/// @param drive_letter drive name, use NULL to use default drive location. -/// @return the file descriptor of the file. -IMPORT_C SCIObject IoOpenFile(const Char* fs_path, const Char* drive_letter); - -/// @brief Closes a file and flushes its content. -/// @param file_desc the file descriptor. -/// @return Function doesn't return a type. -IMPORT_C Void IoCloseFile(_Input SCIObject file_desc); - -/// @brief Write data to a file. -/// @param file_desc the file descriptor. -/// @param out_data the data to write. -/// @param sz_data the size of the data to write. -/// @return the number of bytes written. -IMPORT_C UInt32 IoWriteFile(_Input SCIObject file_desc, _Output VoidPtr out_data, SizeT sz_data); - -/// @brief Read data from a file. -/// @param file_desc the file descriptor. -/// @param out_data the data to read. -/// @param sz_data the size of the data to read. -IMPORT_C UInt32 IoReadFile(_Input SCIObject file_desc, _Output VoidPtr* out_data, SizeT sz_data); - -/// @brief Rewind the file pointer to the beginning of the file. -/// @param file_desc the file descriptor. -/// @return the number of bytes read. -IMPORT_C UInt64 IoRewindFile(_Input SCIObject file_desc); - -/// @brief Tell the current position of the file pointer. -/// @param file_desc the file descriptor. -/// @return the current position of the file pointer. -IMPORT_C UInt64 IoTellFile(_Input SCIObject file_desc); - -/// @brief Seek file offset from file descriptor. -IMPORT_C UInt64 IoSeekFile(_Input SCIObject file_desc, UInt64 file_offset); - -// ------------------------------------------------------------------------ -// Process API. -// ------------------------------------------------------------------------ - -/// @brief Spawns a Thread Information Block and Global Information Block inside the current process. -/// @param process_id Target Process ID, must be valid. -/// @return > 0 error ocurred or already present, = 0 success. -IMPORT_C UInt32 RtlSpawnIB(UIntPtr process_id); - -/// @brief Spawns a process with a unique pid (stored as UIntPtr). -/// @param process_path process filesystem path. -/// @return > 0 process was created. -IMPORT_C UIntPtr RtlSpawnProcess(const Char* process_path, SizeT argc, Char** argv, Char** envp, SizeT envp_len); - -/// @brief Exits a process with an exit_code. -/// @return if it has succeeded true, otherwise false. -IMPORT_C Bool RtlExitProcess(UIntPtr handle, UIntPtr exit_code); - -/// @brief Get current PID of process. -/// @return Current process ID. -IMPORT_C UIntPtr RtlCurrentPID(Void); - -// ------------------------------------------------------------------------ -// Memory Manager API. -// ------------------------------------------------------------------------ - -/// @brief Creates a new heap from the process's address space. -/// @param len the length of it. -/// @param flags the flags of it. -/// @return heap pointer. -IMPORT_C VoidPtr MmCreateHeap(_Input SizeT len, _Input UInt32 flags); - -/// @brief Destroys the pointer -/// @param heap the heap itself. -/// @return void. -IMPORT_C Void MmDestroyHeap(_Input VoidPtr heap); - -/// @brief Change protection flags of a memory region. -IMPORT_C Void MmSetHeapFlags(_Input VoidPtr heap, _Input UInt32 flags); - -/// @brief Change protection flags of a memory region. -IMPORT_C UInt32 MmGetHeapFlags(_Input VoidPtr heap); - -/// @brief Fill memory region with CRC32. -IMPORT_C UInt32 MmFillCRC32Heap(_Input VoidPtr heap); - -/// @brief Copy memory region. -IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len); - -/// @brief Compare memory regions. -IMPORT_C SInt64 MmCmpMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len); - -/// @brief Fill memory region. -IMPORT_C VoidPtr MmFillMemory(_Input VoidPtr dest, _Input SizeT len, _Input UInt8 value); - -/// @brief Compare string regions. -IMPORT_C SInt64 MmStrCmp(_Input const Char* dest, _Input const Char* src); - -/// @brief Get length of string. -IMPORT_C SInt64 MmStrLen(const Char* str); - -// ------------------------------------------------------------------------ -// @brief Error API. -// ------------------------------------------------------------------------ - -IMPORT_C SInt32 ErrGetLastError(Void); - -// ------------------------------------------------------------------------ -// @brief Threading API. -// ------------------------------------------------------------------------ - -/// @brief Exit the current thread. -/// @param exit_code the exit code. -IMPORT_C Void ThrExitCurrentThread(_Input SInt32 exit_code); - -/// @brief Exit the main thread. -/// @param exit_code the exit code. -IMPORT_C Void ThrExitMainThread(_Input SInt32 exit_code); - -/// @brief Exit a thread. -/// @param thread the thread to exit. -/// @param exit_code the exit code. -IMPORT_C Void ThrExitThread(_Input ThreadObject thread, _Input SInt32 exit_code); - -/// @brief Thread procedure function type. -typedef Void (*thread_proc_kind)(int argc, char** argv); - -/// @brief Creates a thread. -/// @param procedure the thread procedure. -/// @param argument_count number of arguments inside that thread. -/// @param flags Thread flags. -/// @return the thread object. -IMPORT_C ThreadObject ThrCreateThread(thread_proc_kind procedure, SInt32 argument_count, SInt32 flags); - -/// @brief Yields the current thread. -/// @param thread the thread to yield. -IMPORT_C Void ThrYieldThread(ThreadObject thrd); - -/// @brief Joins a thread. -/// @param thread the thread to join. -IMPORT_C Void ThrJoinThread(ThreadObject thrd); - -/// @brief Detach a thread. -/// @param thread the thread to detach. -IMPORT_C Void ThrDetachThread(ThreadObject thrd); - -// ------------------------------------------------------------------------ -// @brief Drive Management API. -// ------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------ // -/// @brief Get the default drive letter. -/// @param void. -/// @return the drive letter. -// ------------------------------------------------------------------------------------------ // -IMPORT_C Char* DrvGetDefaultDriveLetter(Void); - -// ------------------------------------------------------------------------------------------ // -/// @brief Get the drive letter from a path. -/// @param path the path. -/// @return the drive letter. -// ------------------------------------------------------------------------------------------ // -IMPORT_C Char* DrvGetDriveLetterFromPath(_Input const Char* path); - -// ------------------------------------------------------------------------------------------ // -/// @brief Get a mounted drive from a letter. -/// @param letter the letter (A..Z). -/// @return the drive object. -// ------------------------------------------------------------------------------------------ // -IMPORT_C SCIObject DrvGetMountedDrive(_Input const Char letter); - -// ------------------------------------------------------------------------------------------ // -/// @brief Mount a drive. -/// @param path the path to mount. -/// @param letter the letter to mount. -// ------------------------------------------------------------------------------------------ // -IMPORT_C Void DrvMountDrive(_Input const Char* path, _Input const Char* letter); - -// ------------------------------------------------------------------------------------------ // -/// @brief Unmount a drive. -/// @param letter the letter to unmount. -// ------------------------------------------------------------------------------------------ // -IMPORT_C Void DrvUnmountDrive(_Input const Char letter); - -// ------------------------------------------------------------------------ -// Event handling API, use to listen to OS specific events. -// ------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------ // -/// @brief Add an event listener. -/// @param event_name the event name. -/// @param listener the listener to add. -/// @return the event listener. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C Void EvtAddListener(_Input const Char* event_name, _Input SCIObject listener); - -// ------------------------------------------------------------------------------------------ // -/// @brief Remove an event listener. -/// @param event_name the event name. -/// @param listener the listener to remove. -/// @return the event listener. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C Void EvtRemoveListener(_Input const Char* event_name, _Input SCIObject listener); - -// ------------------------------------------------------------------------------------------ // -/// @brief Dispatch an event. -/// @param event_name the event name. -/// @param event_data the event data. -/// @return the event data. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C VoidPtr EvtDispatchEvent(_Input const Char* event_name, _Input VoidPtr event_data); - -// ------------------------------------------------------------------------------------------ // -// Power API. -// ------------------------------------------------------------------------------------------ // - -enum -{ - kPowerCodeShutdown, - kPowerCodeReboot, - kPowerCodeSleep, - kPowerCodeWake, - kPowerCodeCount, -}; - -IMPORT_C SInt32 PwrReadCode(_Output SInt32& code); - -IMPORT_C SInt32 PwrSendCode(_Output SInt32& code); - -// ------------------------------------------------------------------------------------------ // -// CD-ROM API. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C SInt32 CdEjectDrive(_Input const Char drv_letter); - -IMPORT_C SInt32 CdOpenTray(Void); - -IMPORT_C SInt32 CdCloseTray(Void); - -// ------------------------------------------------------------------------------------------ // -// Console API. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C SInt32 ConOut(IOObject file /* nullptr to direct to stdout */, const Char* fmt, ...); - -IMPORT_C SInt32 ConIn(IOObject file /* nullptr to direct to stdout */, const Char* fmt, ...); - -IMPORT_C IOObject ConCreate(Void); - -IMPORT_C SInt32 ConRelease(IOObject); - -IMPORT_C IOObject ConGet(const Char* path); - -// ------------------------------------------------------------------------------------------ // -// @brief Scheduler/Debug API. -// ------------------------------------------------------------------------------------------ // - -typedef SInt32 AffinityKind; -typedef UInt64 PID; - -IMPORT_C SInt32 SchedAffinity(PID, SInt32 req, AffinityKind* local); - -IMPORT_C SInt32 SchedTrace(PID, SInt32 req, VoidPtr address, VoidPtr data); - -IMPORT_C SInt32 SchedKill(PID, SInt32 req); - -IMPORT_C SInt32 SchedBreakPoint(Void); - -// ------------------------------------------------------------------------------------------ // -// @brief Filesystem API. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C BOOL FsCopy(const char* path, const char* dst); -IMPORT_C BOOL FsMove(const char* path, const char* dst); - -IMPORT_C BOOL FsExists(const char* path); - -IMPORT_C BOOL FsCreateDir(const char* path); -IMPORT_C BOOL FsCreateFile(const char* path); -IMPORT_C BOOL FsCreateAlias(const char* path, const char* from); - -// ------------------------------------------------------------------------------------------ // -// @brief Format API. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C Char* StrFmt(const Char* fmt, ...); - -// ------------------------------------------------------------------------------------------ // -// @brief Message API. -// ------------------------------------------------------------------------------------------ // - -IMPORT_C SInt32 MsgFree(VoidPtr handle); -IMPORT_C SInt32 MsgShow(VoidPtr handle); - -/// @note fmt could be any POSIX argument, or the extended ones (%$, %{}) -IMPORT_C SInt32 MsgSend(VoidPtr handle, const Char* fmt, ...); -IMPORT_C SInt32 MsgAlloc(VoidPtr handle); - -IMPORT_C VoidPtr kWarnMsg, kInfoMsg, kErrorMsg; - -#endif // ifndef SCI_SCI_H diff --git a/dev/LibSCI/doc/LibSCI.drawio b/dev/LibSCI/doc/LibSCI.drawio deleted file mode 100644 index 132eacc1..00000000 --- a/dev/LibSCI/doc/LibSCI.drawio +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dev/LibSCI/libsci.json b/dev/LibSCI/libsci.json deleted file mode 100644 index 8b54828d..00000000 --- a/dev/LibSCI/libsci.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compiler_path": "x86_64-w64-mingw32-g++", - "compiler_std": "c++20", - "headers_path": ["../", "./"], - "sources_path": ["src/*.cc", "src/*.o"], - "output_name": "libSCI.dylib", - "compiler_flags": [ - "-fPIC", - "-ffreestanding", - "-shared", - "-fno-rtti", - "-fno-exceptions", - "-Wl,--subsystem=17" - ], - "cpp_macros": [ - "kSCIVersion=0x0100", - "kSCIVersionHighest=0x0100", - "kSCIVersionLowest=0x0100" - ] -} diff --git a/dev/LibSCI/src/GPU.cc b/dev/LibSCI/src/GPU.cc deleted file mode 100644 index b3442db8..00000000 --- a/dev/LibSCI/src/GPU.cc +++ /dev/null @@ -1,10 +0,0 @@ -/* ------------------------------------------- - -Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -File: GPU.cc -Purpose: GPU Interface. - -------------------------------------------- */ - -#include diff --git a/dev/LibSCI/src/LPC.cc b/dev/LibSCI/src/LPC.cc deleted file mode 100644 index e0d2897d..00000000 --- a/dev/LibSCI/src/LPC.cc +++ /dev/null @@ -1,10 +0,0 @@ -/* ------------------------------------------- - -Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -File: LPC.cc -Purpose: Local Procedure Codes. - -------------------------------------------- */ - -#include diff --git a/dev/LibSCI/src/LibSCI+IO.asm b/dev/LibSCI/src/LibSCI+IO.asm deleted file mode 100644 index 1d6ee83c..00000000 --- a/dev/LibSCI/src/LibSCI+IO.asm +++ /dev/null @@ -1,50 +0,0 @@ -;; /* -;; * ======================================================== -;; * -;; * LibSCI -;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. -;; * -;; * ======================================================== -;; */ - -[bits 64] - -section .text - -global sci_syscall_arg_1 -global sci_syscall_arg_2 -global sci_syscall_arg_3 -global sci_syscall_arg_4 - -sci_syscall_arg_1: - mov r8, rcx - syscall - ret - -sci_syscall_arg_2: - mov r8, rcx - mov r9, rdx - syscall - ret - -sci_syscall_arg_3: - mov rbx, r8 - - mov r8, rcx - mov r9, rdx - mov r10, rbx - - syscall - ret - -sci_syscall_arg_4: - mov rbx, r8 - mov rax, r9 - - mov r8, rcx - mov r9, rdx - mov r10, rbx - mov r11, rax - - syscall - ret diff --git a/dev/LibSCI/src/Makefile b/dev/LibSCI/src/Makefile deleted file mode 100644 index eb655ed5..00000000 --- a/dev/LibSCI/src/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -################################################## -# (c) Amlal EL Mahrouss, all rights reserved. -# This is the bootloader makefile. -################################################## - -ASM=nasm -FLAGS=-f win64 - -.PHONY: error -error: - @echo "==> Invalid rule." - @echo "==> Use sci_asm_io_ instead." - -.PHONY: sci_asm_io_x64 -sci_asm_io_x64: - $(ASM) $(FLAGS) LibSCI+IO.asm -o LibSCI+IO.o diff --git a/dev/LibSCI/src/SCI.cc b/dev/LibSCI/src/SCI.cc deleted file mode 100644 index 3fe7b0f8..00000000 --- a/dev/LibSCI/src/SCI.cc +++ /dev/null @@ -1,45 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include - -/// @file LibSCI.cc -/// @brief Source file for the memory functions of the LibSCI. - -/// @brief Copy memory region. -IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len) -{ - if (!len || - !dest || - !src) - { - return nullptr; - } - - for (SizeT i = 0; i < len; i++) - { - ((Char*)dest)[i] = ((Char*)src)[i]; - } - - return dest; -} - -/// @brief Fill memory region with **value**. -IMPORT_C VoidPtr MmFillMemory(_Input VoidPtr dest, _Input SizeT len, _Input UInt8 value) -{ - if (!len || - !dest) - { - return nullptr; - } - - for (SizeT i = 0; i < len; i++) - { - ((Char*)dest)[i] = value; - } - - return dest; -} diff --git a/dev/Mod/ACPI/ACPI.h b/dev/Mod/ACPI/ACPI.h deleted file mode 100644 index a4fe2b0e..00000000 --- a/dev/Mod/ACPI/ACPI.h +++ /dev/null @@ -1,90 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef __ACPI__ -#define __ACPI__ - -/** - https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html -*/ - -#include - -#define SDT_OBJECT : public NeOS::SDT - -namespace NeOS -{ - 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 ACPI_ADDRESS_SPACE_KIND : UInt8 - { - eSystemMemory = 0, - eSystemIO = 1, - ePci = 2, - eController = 3, - eSmBus = 4, - eCount = 5, - eInvalid = 0xFF, - }; - - class PACKED ACPI_ADDRESS final - { - public: - UInt8 AddressSpaceId; - UInt8 RegisterBitWidth; - UInt8 RegisterBitOffset; - UInt8 Reserved; - UIntPtr Address; - }; - - class PACKED RSDT final - { - 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 NeOS - -#endif // !__ACPI__ diff --git a/dev/Mod/ACPI/ACPIFactoryInterface.h b/dev/Mod/ACPI/ACPIFactoryInterface.h deleted file mode 100644 index d398b2b7..00000000 --- a/dev/Mod/ACPI/ACPIFactoryInterface.h +++ /dev/null @@ -1,59 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef __MOD_ACPI_H__ -#define __MOD_ACPI_H__ - -#include -#include -#include -#include -#include -#include - -namespace NeOS -{ - class PowerFactory; - class ACPIFactoryInterface; - - typedef ACPIFactoryInterface PowerFactoryInterface; - - class ACPIFactoryInterface final NE_POWER_FACTORY - { - public: - explicit ACPIFactoryInterface(voidPtr rsp_ptr); - ~ACPIFactoryInterface() = default; - - ACPIFactoryInterface& operator=(const ACPIFactoryInterface&) = default; - ACPIFactoryInterface(const ACPIFactoryInterface&) = default; - - public: - Bool 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); - - private: - VoidPtr fRsdp{nullptr}; // pointer to root descriptor. - SSizeT fEntries{0UL}; // number of entries, -1 tells that no invalid entries were - // found. - }; -} // namespace NeOS - -#endif // !__MOD_ACPI_H__ diff --git a/dev/Mod/AHCI/.gitkeep b/dev/Mod/AHCI/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Mod/AHCI/AHCI.h b/dev/Mod/AHCI/AHCI.h deleted file mode 100644 index 0b8971e2..00000000 --- a/dev/Mod/AHCI/AHCI.h +++ /dev/null @@ -1,370 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: AHCI.h - Purpose: AHCI protocol defines. - - Revision History: - - 03/02/24: Added file (amlel) - -------------------------------------------- */ - -#pragma once - -#include -#include - -/// @file AHCI.h -/// @brief AHCI support. - -#define kAHCISectorSize (512) - -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 - NeOS::UInt8 FisType; // FIS_TYPE_REG_H2D - - NeOS::UInt8 PortMul : 4; // Port multiplier - NeOS::UInt8 Reserved0 : 3; // Reserved - NeOS::UInt8 CmdOrCtrl : 1; // 1: Command, 0: Control - - NeOS::UInt8 Command; // Command register - NeOS::UInt8 FeatureLow; // Feature register, 7:0 - - // DWORD 1 - NeOS::UInt8 Lba0; // LBA low register, 7:0 - NeOS::UInt8 Lba1; // LBA mid register, 15:8 - NeOS::UInt8 Lba2; // LBA high register, 23:16 - NeOS::UInt8 Device; // Device register - - // DWORD 2 - NeOS::UInt8 Lba3; // LBA register, 31:24 - NeOS::UInt8 Lba4; // LBA register, 39:32 - NeOS::UInt8 Lba5; // LBA register, 47:40 - NeOS::UInt8 FeatureHigh; // Feature register, 15:8 - - // DWORD 3 - NeOS::UInt8 CountLow; // Count register, 7:0 - NeOS::UInt8 CountHigh; // Count register, 15:8 - NeOS::UInt8 Icc; // Isochronous command completion - NeOS::UInt8 Control; // Control register - - // DWORD 4 - NeOS::UInt8 Reserved1[4]; // Reserved -} FisRegH2D; - -typedef struct FisRegD2H final -{ - // DWORD 0 - NeOS::UInt8 FisType; // FIS_TYPE_REG_D2H - - NeOS::UInt8 PortMul : 4; // Port multiplier - NeOS::UInt8 Reserved0 : 2; // Reserved - NeOS::UInt8 IE : 1; // Interrupt bit - NeOS::UInt8 Reserved1 : 1; // Reserved - - NeOS::UInt8 Status; // Status register - NeOS::UInt8 Error; // Error register - - // DWORD 1 - NeOS::UInt8 Lba0; // LBA low register, 7:0 - NeOS::UInt8 Lba1; // LBA mid register, 15:8 - NeOS::UInt8 Lba2; // LBA high register, 23:16 - NeOS::UInt8 Device; // Device register - - // DWORD 2 - NeOS::UInt8 Lba3; // LBA register, 31:24 - NeOS::UInt8 Lba4; // LBA register, 39:32 - NeOS::UInt8 Lba5; // LBA register, 47:40 - NeOS::UInt8 Rsv2; // Reserved - - // DWORD 3 - NeOS::UInt8 CountLow; // Count register, 7:0 - NeOS::UInt8 CountHigh; // Count register, 15:8 - NeOS::UInt8 Rsv3[2]; // Reserved - - // DWORD 4 - NeOS::UInt8 Rsv4[4]; // Reserved -} FisRegD2H; - -typedef struct FisData final -{ - // DWORD 0 - NeOS::UInt8 FisType; // FIS_TYPE_DATA - - NeOS::UInt8 PortMul : 4; // Port multiplier - NeOS::UInt8 Reserved0 : 4; // Reserved - - NeOS::UInt8 Reserved1[2]; // Reserved - - // DWORD 1 ~ N - NeOS::UInt32 Data[1]; // Payload -} FisData; - -typedef struct FisPioSetup final -{ - // DWORD 0 - NeOS::UInt8 FisType; // FIS_TYPE_PIO_SETUP - - NeOS::UInt8 PortMul : 4; // Port multiplier - NeOS::UInt8 Reserved0 : 1; // Reserved - NeOS::UInt8 DTD : 1; // Data transfer direction, 1 - device to host - NeOS::UInt8 IE : 1; // Interrupt bit - NeOS::UInt8 Reserved1 : 1; - - NeOS::UInt8 Status; // Status register - NeOS::UInt8 Error; // Error register - - // DWORD 1 - NeOS::UInt8 Lba0; // LBA low register, 7:0 - NeOS::UInt8 Lba1; // LBA mid register, 15:8 - NeOS::UInt8 Lba2; // LBA high register, 23:16 - NeOS::UInt8 Device; // Device register - - // DWORD 2 - NeOS::UInt8 Lba3; // LBA register, 31:24 - NeOS::UInt8 Lba4; // LBA register, 39:32 - NeOS::UInt8 Lba5; // LBA register, 47:40 - NeOS::UInt8 Rsv2; // Reserved - - // DWORD 3 - NeOS::UInt8 CountLow; // Count register, 7:0 - NeOS::UInt8 CountHigh; // Count register, 15:8 - NeOS::UInt8 Rsv3; // Reserved - NeOS::UInt8 EStatus; // New value of status register - - // DWORD 4 - NeOS::UInt16 TranferCount; // Transfer count - NeOS::UInt8 Rsv4[2]; // Reserved -} FisPioSetup; - -typedef struct FisDmaSetup final -{ - // DWORD 0 - NeOS::UInt8 FisType; // FIS_TYPE_DMA_SETUP - - NeOS::UInt8 PortMul : 4; // Port multiplier - NeOS::UInt8 Reserved0 : 1; // Reserved - NeOS::UInt8 DTD : 1; // Data transfer direction, 1 - device to host - NeOS::UInt8 IE : 1; // Interrupt bit - NeOS::UInt8 AutoEnable : 1; // Auto-activate. Specifies if DMA Activate FIS is needed - - NeOS::UInt8 Reserved1[2]; // Reserved - - // DWORD 1&2 - volatile NeOS::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 - NeOS::UInt32 Rsvd; // More reserved - - // DWORD 4 - NeOS::UInt32 DmabufOffset; // Byte offset into buffer. First 2 bits must be 0 - - // DWORD 5 - NeOS::UInt32 TransferCount; // Number of bytes to transfer. Bit 0 must be 0 - - // DWORD 6 - NeOS::UInt32 Reserved3; // Reserved -} FisDmaSetup; - -typedef struct FisDevBits final -{ - // DWORD 0 - NeOS::UInt8 FisType; // FIS_TYPE_DMA_SETUP (A1h) - - NeOS::UInt8 Reserved0 : 5; // Reserved - NeOS::UInt8 R0 : 1; - NeOS::UInt8 IE : 1; - NeOS::UInt8 N : 1; - - NeOS::UInt8 StatusLow : 3; - NeOS::UInt8 R1 : 1; - NeOS::UInt8 StatusHigh : 3; - - NeOS::UInt8 R2 : 1; - NeOS::UInt8 Error; - - // DWORD 1 - NeOS::UInt32 Act; -} FisDevBits; - -/// \brief Enable AHCI device bit in GHC register. -#ifndef kSATAGHC_AE -#define kSATAGHC_AE (31) -#endif //! ifndef kSATAGHC_AE - -typedef struct HbaPort final -{ - NeOS::UInt32 Clb; // 0x00, command list base address, 1K-byte aligned - NeOS::UInt32 Clbu; // 0x04, command list base address upper 32 bits - NeOS::UInt32 Fb; // 0x08, FIS base address, 256-byte aligned - NeOS::UInt32 Fbu; // 0x0C, FIS base address upper 32 bits - NeOS::UInt32 Is; // 0x10, interrupt status - NeOS::UInt32 Ie; // 0x14, interrupt enable - NeOS::UInt32 Cmd; // 0x18, command and status - NeOS::UInt32 Reserved0; // 0x1C, Reserved - NeOS::UInt32 Tfd; // 0x20, task file data - NeOS::UInt32 Sig; // 0x24, signature - NeOS::UInt32 Ssts; // 0x28, SATA status (SCR0:SStatus) - NeOS::UInt32 Sctl; // 0x2C, SATA control (SCR2:SControl) - NeOS::UInt32 Serr; // 0x30, SATA error (SCR1:SError) - NeOS::UInt32 Sact; // 0x34, SATA active (SCR3:SActive) - NeOS::UInt32 Ci; // 0x38, command issue - NeOS::UInt32 Sntf; // 0x3C, SATA notification (SCR4:SNotification) - NeOS::UInt32 Fbs; // 0x40, FIS-based switch control - NeOS::UInt32 Reserved1[11]; // 0x44 ~ 0x6F, Reserved - NeOS::UInt32 Vendor[4]; // 0x70 ~ 0x7F, vendor specific -} HbaPort; - -typedef struct HbaMem final -{ - // 0x00 - 0x2B, Generic Host Control - NeOS::UInt32 Cap; // 0x00, Host capability - NeOS::UInt32 Ghc; // 0x04, Global host control - NeOS::UInt32 Is; // 0x08, Interrupt status - NeOS::UInt32 Pi; // 0x0C, Port implemented - NeOS::UInt32 Vs; // 0x10, Version - NeOS::UInt32 Ccc_ctl; // 0x14, Command completion coalescing control - NeOS::UInt32 Ccc_pts; // 0x18, Command completion coalescing ports - NeOS::UInt32 Em_loc; // 0x1C, Enclosure management location - NeOS::UInt32 Em_ctl; // 0x20, Enclosure management control - NeOS::UInt32 Cap2; // 0x24, Host capabilities extended - NeOS::UInt32 Bohc; // 0x28, BIOS/OS handoff control and status - - NeOS::UInt8 Resv0[0xA0 - 0x2C]; - NeOS::UInt8 Vendor[0x100 - 0xA0]; - - HbaPort Ports[1]; // 1 ~ 32, 32 is the max ahci devices per controller. -} HbaMem; - -typedef struct HbaCmdHeader final -{ - // DW0 - union { - struct - { - NeOS::UInt8 Cfl : 5; // Command FIS length in DWORDS, 2 ~ 16 - NeOS::UInt8 Atapi : 1; // ATAPI - NeOS::UInt8 Write : 1; // Write, 1: H2D, 0: D2H - NeOS::UInt8 Prefetchable : 1; // Prefetchable - - NeOS::UInt8 Reset : 1; // Reset - NeOS::UInt8 BIST : 1; // BIST - NeOS::UInt8 Clear : 1; // Clear busy upon R_OK - NeOS::UInt8 Reserved0 : 1; // Reserved - NeOS::UInt8 Pmp : 4; // Port multiplier port - }; - NeOS::UInt16 Flags; - }; - - NeOS::UInt16 Prdtl; // Physical region descriptor table length in entries - NeOS::UInt32 Prdbc; // Physical region descriptor byte count transferred - - NeOS::UInt32 Ctba; // Command table descriptor base address - NeOS::UInt32 Ctbau; // Command table descriptor base address upper 32 bits - - NeOS::UInt32 Rsv[4]; -} ATTRIBUTE(packed, aligned(32)) HbaCmdHeader; - -typedef struct HbaFis final -{ - // 0x00 - FisDmaSetup Dsfis; // DMA Setup FIS - NeOS::UInt8 Pad0[4]; - // 0x20 - FisPioSetup Psfis; // PIO Setup FIS - NeOS::UInt8 Pad1[12]; - // 0x40 - FisRegD2H Rfis; // Register – Device to Host FIS - NeOS::UInt8 Pad2[4]; - // 0x58 - FisDevBits Sdbfis; // Set Device Bit FIS - // 0x60 - NeOS::UInt8 Ufis[64]; - // 0xA0 - NeOS::UInt8 Rsv[0x100 - 0xA0]; -} HbaFis; - -typedef struct HbaPrdtEntry final -{ - NeOS::UInt32 Dba; // Data base address - NeOS::UInt32 Dbau; // Data base address upper 32 bits - NeOS::UInt32 Reserved0; // Reserved - // DW3 - NeOS::UInt32 Dbc : 22; // Byte count, 4M max - NeOS::UInt32 Reserved1 : 9; // Reserved - NeOS::UInt32 Ie : 1; // Interrupt on completion -} HbaPrdtEntry; - -typedef struct HbaCmdTbl final -{ - NeOS::UInt8 Cfis[64]; // Command FIS - NeOS::UInt8 Acmd[16]; // ATAPI command, 12 or 16 bytes - NeOS::UInt8 Rsv[48]; // Reserved - struct HbaPrdtEntry Prdt[]; // Physical region descriptor table entries, 0 ~ 65535 -} HbaCmdTbl; - -/// @brief Initializes an AHCI disk. -/// @param PortsImplemented the amount of port that have been detected. -/// @return -NeOS::Boolean drv_std_init(NeOS::UInt16& PortsImplemented); - -NeOS::Boolean drv_std_detected(NeOS::Void); - -/// @brief Read from AHCI disk. -/// @param lba -/// @param buf -/// @param sector_sz -/// @param buf_sz -/// @return -NeOS::Void drv_std_read(NeOS::UInt64 lba, NeOS::Char* buf, NeOS::SizeT sector_sz, NeOS::SizeT buf_sz); - -/// @brief Write to AHCI disk. -/// @param lba -/// @param buf -/// @param sector_sz -/// @param buf_sz -/// @return -NeOS::Void drv_std_write(NeOS::UInt64 lba, NeOS::Char* buf, NeOS::SizeT sector_sz, NeOS::SizeT buf_sz); - -/// @brief Gets the sector count from AHCI disk. -NeOS::SizeT drv_get_sector_count(); - -/// @brief Gets the AHCI disk size. -NeOS::SizeT drv_get_size(); - -/// @brief Checks if the drive has completed the command. -BOOL drv_is_ready(void); - -/* EOF */ diff --git a/dev/Mod/APM/APM.h b/dev/Mod/APM/APM.h deleted file mode 100644 index 1cb55fdc..00000000 --- a/dev/Mod/APM/APM.h +++ /dev/null @@ -1,37 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -namespace NeOS -{ - typedef Int32 APMPowerCmd; - - enum - { - kAPMPowerCommandInvalid = 0x00, - kAPMPowerCommandStop = 0x01, - kAPMPowerCommandStart = 0x02, - kAPMPowerCommandSleep = 0x04, - kAPMPowerCommandWakeup = 0x06, - kAPMPowerCommandShutdown = 0x07, - kAPMPowerCommandReboot = 0x08, - }; - - /// @brief Send a APM command into it's own DMA space. - /// @param base_dma the DMA base address. - /// @param cmd the command. - /// @return status code. - EXTERN_C Int32 apm_send_dma_command(Ptr64 register_addr, APMPowerCmd value); - - /// @brief Send a APM command into it's own IO space. - /// @param base_dma the IO base port. - /// @param cmd the command. - /// @return status code. - EXTERN_C Int32 apm_send_io_command(UInt16 cmd, APMPowerCmd value); -} // namespace NeOS diff --git a/dev/Mod/ATA/ATA.h b/dev/Mod/ATA/ATA.h deleted file mode 100644 index 374b8b5d..00000000 --- a/dev/Mod/ATA/ATA.h +++ /dev/null @@ -1,155 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: Defines.h - Purpose: ATA header. - - Revision History: - - 03/02/24: Added file (amlel) - -------------------------------------------- */ - -#pragma once - -#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_REG_SET_FEATURES 0xEF - -#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__) - -NeOS::Boolean drv_std_init(NeOS::UInt16 in_bus, NeOS::UInt8 drive, NeOS::UInt16& out_bus, NeOS::UInt8& out_master); - -NeOS::Boolean drv_std_detected(NeOS::Void); - -NeOS::Void drv_std_select(NeOS::UInt16 bus); - -NeOS::Boolean drv_std_wait_io(NeOS::UInt16 io); - -NeOS::Void drv_std_read(NeOS::UInt64 lba, NeOS::UInt16 io, NeOS::UInt8 is_master, NeOS::Char* buf, NeOS::SizeT sec_sz, NeOS::SizeT buf_sz); - -NeOS::Void drv_std_write(NeOS::UInt64 lba, NeOS::UInt16 io, NeOS::UInt8 is_master, NeOS::Char* buf, NeOS::SizeT sec_sz, NeOS::SizeT buf_sz); - -/// @brief get sector count. -NeOS::SizeT drv_get_sector_count(); - -/// @brief get device size. -NeOS::SizeT drv_get_size(); - -#endif // ifdef __NEOSKRNL__ \ No newline at end of file diff --git a/dev/Mod/CoreGfx/AccessibilityMgr.h b/dev/Mod/CoreGfx/AccessibilityMgr.h deleted file mode 100644 index 58054a89..00000000 --- a/dev/Mod/CoreGfx/AccessibilityMgr.h +++ /dev/null @@ -1,41 +0,0 @@ -/* ------------------------------------------- - - Copyright Amlal EL Mahrouss. - -------------------------------------------- */ - -#ifndef GFX_MGR_ACCESSIBILITY_H -#define GFX_MGR_ACCESSIBILITY_H - -#include -#include -#include -#include -#include - -namespace FB -{ - using namespace NeOS; - - /// @brief common User interface class. - class UIAccessibilty final - { - explicit UIAccessibilty() = default; - ~UIAccessibilty() = default; - - public: - NE_COPY_DELETE(UIAccessibilty); - - static Int64 Width() noexcept - { - return kHandoverHeader->f_GOP.f_Width; - } - - static Int64 Height() noexcept - { - return kHandoverHeader->f_GOP.f_Height; - } - }; -} // namespace FB - -#endif // !GFX_MGR_ACCESSIBILITY_H_ diff --git a/dev/Mod/CoreGfx/FBMgr.h b/dev/Mod/CoreGfx/FBMgr.h deleted file mode 100644 index 57a781ad..00000000 --- a/dev/Mod/CoreGfx/FBMgr.h +++ /dev/null @@ -1,150 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -#define fb_init() NeOS::SizeT kCGCursor = 0 - -#define fb_color(R, G, B) RGB(R, G, B) - -#define fb_get_clear_clr() fb_color(0x20, 0x20, 0x20) - -#define fb_clear() kCGCursor = 0 - -#ifdef __NE_AMD64__ -/// @brief Performs Alpha drawing on the framebuffer. -#define FBDrawBitMapInRegionA(reg_ptr, height, width, base_x, base_y) \ - for (NeOS::SizeT i = base_x; i < (width + base_x); ++i) \ - { \ - for (NeOS::SizeT u = base_y; u < (height + base_y); ++u) \ - { \ - *(((NeOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ - 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ - i + \ - 4 * u))) |= (reg_ptr)[kCGCursor]; \ - \ - ++kCGCursor; \ - } \ - } - -/// @brief Performs drawing on the framebuffer. -#define FBDrawBitMapInRegion(reg_ptr, height, width, base_x, base_y) \ - for (NeOS::SizeT i = base_x; i < (width + base_x); ++i) \ - { \ - for (NeOS::SizeT u = base_y; u < (height + base_y); ++u) \ - { \ - *(((NeOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ - 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ - i + \ - 4 * u))) = (reg_ptr)[kCGCursor]; \ - \ - ++kCGCursor; \ - } \ - } - -#define FBDrawBitMapInRegionToRgn(_Rgn, reg_ptr, height, width, base_x, base_y) \ - for (NeOS::SizeT i = base_x; i < (width + base_x); ++i) \ - { \ - for (NeOS::SizeT u = base_y; u < (height + base_y); ++u) \ - { \ - *(((NeOS::UInt32*)(_Rgn + \ - 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ - i + \ - 4 * u))) = (reg_ptr)[kCGCursor]; \ - \ - ++kCGCursor; \ - } \ - } - -/// @brief Cleans a resource. -#define CGClearRegion(height, width, base_x, base_y) \ - for (NeOS::SizeT i = base_x; i < (width + base_x); ++i) \ - { \ - for (NeOS::SizeT u = base_y; u < (height + base_y); ++u) \ - { \ - *(((volatile NeOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ - 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ - i + \ - 4 * u))) = fb_get_clear_clr(); \ - } \ - } - -/// @brief Draws inside a zone. -#define FBDrawInRegion(_Clr, height, width, base_x, base_y) \ - for (NeOS::SizeT x_base = base_x; x_base < (width + base_x); ++x_base) \ - { \ - for (NeOS::SizeT y_base = base_y; y_base < (height + base_y); ++y_base) \ - { \ - *(((volatile NeOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ - 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ - x_base + \ - 4 * y_base))) = _Clr; \ - } \ - } - -/// @brief Draws inside a zone. -#define FBDrawInRegionToRgn(_Rgn, _Clr, height, width, base_x, base_y) \ - for (NeOS::SizeT x_base = base_x; x_base < (width + base_x); ++x_base) \ - { \ - for (NeOS::SizeT y_base = base_y; y_base < (height + base_y); ++y_base) \ - { \ - *(((volatile NeOS::UInt32*)(_Rgn + \ - 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ - x_base + \ - 4 * y_base))) = _Clr[kCGCursor]; \ - ++kCGCursor; \ - } \ - } - -#define FBDrawInRegionA(_Clr, height, width, base_x, base_y) \ - for (NeOS::SizeT x_base = base_x; x_base < (width + base_x); ++x_base) \ - { \ - for (NeOS::SizeT y_base = base_y; y_base < (height + base_y); ++y_base) \ - { \ - *(((volatile NeOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ - 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ - x_base + \ - 4 * y_base))) |= _Clr; \ - } \ - } -#else -#define FBDrawBitMapInRegionA(reg_ptr, height, width, base_x, base_y) -#define FBDrawBitMapInRegion(reg_ptr, height, width, base_x, base_y) -#define FBDrawBitMapInRegionToRgn(_Rgn, reg_ptr, height, width, base_x, base_y) -#define CGClearRegion(height, width, base_x, base_y) -#define FBDrawInRegion(_Clr, height, width, base_x, base_y) -#define FBDrawInRegionToRgn(_Rgn, _Clr, height, width, base_x, base_y) -#define FBDrawInRegionA(_Clr, height, width, base_x, base_y) -#define FBDrawBitMapInRegionA(reg_ptr, height, width, base_x, base_y) -#define FBDrawBitMapInRegion(reg_ptr, height, width, base_x, base_y) -#define FBDrawBitMapInRegionToRgn(_Rgn, reg_ptr, height, width, base_x, base_y) -#define CGClearRegion(height, width, base_x, base_y) -#define FBDrawInRegion(_Clr, height, width, base_x, base_y) -#define FBDrawInRegionToRgn(_Rgn, _Clr, height, width, base_x, base_y) -#define FBDrawInRegionA(_Clr, height, width, base_x, base_y) -#endif // __NE_AMD64__ - -#ifndef GFX_MGR_ACCESSIBILITY_H -#include -#endif // ifndef GFX_MGR_ACCESSIBILITY_H - -namespace FB -{ - struct FB_CONTROL_BLOCK; - - inline void fb_clear_video() noexcept - { - fb_init(); - - FBDrawInRegion(fb_get_clear_clr(), FB::UIAccessibilty::Height(), FB::UIAccessibilty::Width(), - 0, 0); - - fb_clear(); - } - -} // namespace FB \ No newline at end of file diff --git a/dev/Mod/CoreGfx/MathMgr.h b/dev/Mod/CoreGfx/MathMgr.h deleted file mode 100644 index 7e85c0dc..00000000 --- a/dev/Mod/CoreGfx/MathMgr.h +++ /dev/null @@ -1,29 +0,0 @@ -/* ------------------------------------------- - - Copyright Amlal EL Mahrouss. - -------------------------------------------- */ - -#pragma once - -/// @file MathMgr.h -/// @brief Linear interpolation implementation. - -namespace UI -{ -#ifdef NE_GFX_MGR_USE_DOUBLE - typedef double fb_real_t; -#else - typedef float fb_real_t; -#endif - - /// @brief Linear interpolation equation solver. - /// @param from where to start - /// @param to to which value. - /// @param stat - /// @return Linear interop value. - inline fb_real_t fb_math_lerp(fb_real_t to, fb_real_t from, fb_real_t stat) - { - return (from) + (to - from) * stat; - } -} // namespace UI \ No newline at end of file diff --git a/dev/Mod/CoreGfx/TextMgr.h b/dev/Mod/CoreGfx/TextMgr.h deleted file mode 100644 index a3c1af24..00000000 --- a/dev/Mod/CoreGfx/TextMgr.h +++ /dev/null @@ -1,178 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include - -#define kFontSizeX 8 -#define kFontSizeY 8 -#define kFontNOFChars 128 - -inline const NeOS::UInt8 kFontBitmap[kFontNOFChars][kFontSizeX] = { - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0000 (nul) - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0001 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0002 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0003 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0004 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0005 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0006 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0007 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0008 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0009 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000A - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000B - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000C - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000D - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000E - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000F - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0010 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0011 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0012 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0013 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0014 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0015 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0016 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0017 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0018 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0019 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001A - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001B - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001C - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001D - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001E - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001F - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0020 (space) - {0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00}, // U+0021 (!) - {0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0022 (") - {0x36, 0x36, 0x7F, 0x36, 0x7F, 0x36, 0x36, 0x00}, // U+0023 (#) - {0x0C, 0x3E, 0x03, 0x1E, 0x30, 0x1F, 0x0C, 0x00}, // U+0024 ($) - {0x00, 0x63, 0x33, 0x18, 0x0C, 0x66, 0x63, 0x00}, // U+0025 (%) - {0x1C, 0x36, 0x1C, 0x6E, 0x3B, 0x33, 0x6E, 0x00}, // U+0026 (&) - {0x06, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0027 (') - {0x18, 0x0C, 0x06, 0x06, 0x06, 0x0C, 0x18, 0x00}, // U+0028 (() - {0x06, 0x0C, 0x18, 0x18, 0x18, 0x0C, 0x06, 0x00}, // U+0029 ()) - {0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00}, // U+002A (*) - {0x00, 0x0C, 0x0C, 0x3F, 0x0C, 0x0C, 0x00, 0x00}, // U+002B (+) - {0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x06}, // U+002C (,) - {0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00}, // U+002D (-) - {0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x00}, // U+002E (.) - {0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x00}, // U+002F (/) - {0x3E, 0x63, 0x73, 0x7B, 0x6F, 0x67, 0x3E, 0x00}, // U+0030 (0) - {0x0C, 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x3F, 0x00}, // U+0031 (1) - {0x1E, 0x33, 0x30, 0x1C, 0x06, 0x33, 0x3F, 0x00}, // U+0032 (2) - {0x1E, 0x33, 0x30, 0x1C, 0x30, 0x33, 0x1E, 0x00}, // U+0033 (3) - {0x38, 0x3C, 0x36, 0x33, 0x7F, 0x30, 0x78, 0x00}, // U+0034 (4) - {0x3F, 0x03, 0x1F, 0x30, 0x30, 0x33, 0x1E, 0x00}, // U+0035 (5) - {0x1C, 0x06, 0x03, 0x1F, 0x33, 0x33, 0x1E, 0x00}, // U+0036 (6) - {0x3F, 0x33, 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x00}, // U+0037 (7) - {0x1E, 0x33, 0x33, 0x1E, 0x33, 0x33, 0x1E, 0x00}, // U+0038 (8) - {0x1E, 0x33, 0x33, 0x3E, 0x30, 0x18, 0x0E, 0x00}, // U+0039 (9) - {0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x00}, // U+003A (:) - {0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x06}, // U+003B (;) - {0x18, 0x0C, 0x06, 0x03, 0x06, 0x0C, 0x18, 0x00}, // U+003C (<) - {0x00, 0x00, 0x3F, 0x00, 0x00, 0x3F, 0x00, 0x00}, // U+003D (=) - {0x06, 0x0C, 0x18, 0x30, 0x18, 0x0C, 0x06, 0x00}, // U+003E (>) - {0x1E, 0x33, 0x30, 0x18, 0x0C, 0x00, 0x0C, 0x00}, // U+003F (?) - {0x3E, 0x63, 0x7B, 0x7B, 0x7B, 0x03, 0x1E, 0x00}, // U+0040 (@) - {0x0C, 0x1E, 0x33, 0x33, 0x3F, 0x33, 0x33, 0x00}, // U+0041 (A) - {0x3F, 0x66, 0x66, 0x3E, 0x66, 0x66, 0x3F, 0x00}, // U+0042 (B) - {0x3C, 0x66, 0x03, 0x03, 0x03, 0x66, 0x3C, 0x00}, // U+0043 (C) - {0x1F, 0x36, 0x66, 0x66, 0x66, 0x36, 0x1F, 0x00}, // U+0044 (D) - {0x7F, 0x46, 0x16, 0x1E, 0x16, 0x46, 0x7F, 0x00}, // U+0045 (E) - {0x7F, 0x46, 0x16, 0x1E, 0x16, 0x06, 0x0F, 0x00}, // U+0046 (F) - {0x3C, 0x66, 0x03, 0x03, 0x73, 0x66, 0x7C, 0x00}, // U+0047 (G) - {0x33, 0x33, 0x33, 0x3F, 0x33, 0x33, 0x33, 0x00}, // U+0048 (H) - {0x1E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+0049 (I) - {0x78, 0x30, 0x30, 0x30, 0x33, 0x33, 0x1E, 0x00}, // U+004A (J) - {0x67, 0x66, 0x36, 0x1E, 0x36, 0x66, 0x67, 0x00}, // U+004B (K) - {0x0F, 0x06, 0x06, 0x06, 0x46, 0x66, 0x7F, 0x00}, // U+004C (L) - {0x63, 0x77, 0x7F, 0x7F, 0x6B, 0x63, 0x63, 0x00}, // U+004D (M) - {0x63, 0x67, 0x6F, 0x7B, 0x73, 0x63, 0x63, 0x00}, // U+004E (N) - {0x1C, 0x36, 0x63, 0x63, 0x63, 0x36, 0x1C, 0x00}, // U+004F (O) - {0x3F, 0x66, 0x66, 0x3E, 0x06, 0x06, 0x0F, 0x00}, // U+0050 (P) - {0x1E, 0x33, 0x33, 0x33, 0x3B, 0x1E, 0x38, 0x00}, // U+0051 (Q) - {0x3F, 0x66, 0x66, 0x3E, 0x36, 0x66, 0x67, 0x00}, // U+0052 (R) - {0x1E, 0x33, 0x07, 0x0E, 0x38, 0x33, 0x1E, 0x00}, // U+0053 (S) - {0x3F, 0x2D, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+0054 (T) - {0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x3F, 0x00}, // U+0055 (U) - {0x33, 0x33, 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x00}, // U+0056 (V) - {0x63, 0x63, 0x63, 0x6B, 0x7F, 0x77, 0x63, 0x00}, // U+0057 (W) - {0x63, 0x63, 0x36, 0x1C, 0x1C, 0x36, 0x63, 0x00}, // U+0058 (X) - {0x33, 0x33, 0x33, 0x1E, 0x0C, 0x0C, 0x1E, 0x00}, // U+0059 (Y) - {0x7F, 0x63, 0x31, 0x18, 0x4C, 0x66, 0x7F, 0x00}, // U+005A (Z) - {0x1E, 0x06, 0x06, 0x06, 0x06, 0x06, 0x1E, 0x00}, // U+005B ([) - {0x03, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x40, 0x00}, // U+005C (\) - {0x1E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1E, 0x00}, // U+005D (]) - {0x08, 0x1C, 0x36, 0x63, 0x00, 0x00, 0x00, 0x00}, // U+005E (^) - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF}, // U+005F (_) - {0x0C, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0060 (`) - {0x00, 0x00, 0x1E, 0x30, 0x3E, 0x33, 0x6E, 0x00}, // U+0061 (a) - {0x07, 0x06, 0x06, 0x3E, 0x66, 0x66, 0x3B, 0x00}, // U+0062 (b) - {0x00, 0x00, 0x1E, 0x33, 0x03, 0x33, 0x1E, 0x00}, // U+0063 (c) - {0x38, 0x30, 0x30, 0x3e, 0x33, 0x33, 0x6E, 0x00}, // U+0064 (d) - {0x00, 0x00, 0x1E, 0x33, 0x3f, 0x03, 0x1E, 0x00}, // U+0065 (e) - {0x1C, 0x36, 0x06, 0x0f, 0x06, 0x06, 0x0F, 0x00}, // U+0066 (f) - {0x00, 0x00, 0x6E, 0x33, 0x33, 0x3E, 0x30, 0x1F}, // U+0067 (g) - {0x07, 0x06, 0x36, 0x6E, 0x66, 0x66, 0x67, 0x00}, // U+0068 (h) - {0x0C, 0x00, 0x0E, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+0069 (i) - {0x30, 0x00, 0x30, 0x30, 0x30, 0x33, 0x33, 0x1E}, // U+006A (j) - {0x07, 0x06, 0x66, 0x36, 0x1E, 0x36, 0x67, 0x00}, // U+006B (k) - {0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+006C (l) - {0x00, 0x00, 0x33, 0x7F, 0x7F, 0x6B, 0x63, 0x00}, // U+006D (m) - {0x00, 0x00, 0x1F, 0x33, 0x33, 0x33, 0x33, 0x00}, // U+006E (n) - {0x00, 0x00, 0x1E, 0x33, 0x33, 0x33, 0x1E, 0x00}, // U+006F (o) - {0x00, 0x00, 0x3B, 0x66, 0x66, 0x3E, 0x06, 0x0F}, // U+0070 (p) - {0x00, 0x00, 0x6E, 0x33, 0x33, 0x3E, 0x30, 0x78}, // U+0071 (q) - {0x00, 0x00, 0x3B, 0x6E, 0x66, 0x06, 0x0F, 0x00}, // U+0072 (r) - {0x00, 0x00, 0x3E, 0x03, 0x1E, 0x30, 0x1F, 0x00}, // U+0073 (s) - {0x08, 0x0C, 0x3E, 0x0C, 0x0C, 0x2C, 0x18, 0x00}, // U+0074 (t) - {0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x6E, 0x00}, // U+0075 (u) - {0x00, 0x00, 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x00}, // U+0076 (v) - {0x00, 0x00, 0x63, 0x6B, 0x7F, 0x7F, 0x36, 0x00}, // U+0077 (w) - {0x00, 0x00, 0x63, 0x36, 0x1C, 0x36, 0x63, 0x00}, // U+0078 (x) - {0x00, 0x00, 0x33, 0x33, 0x33, 0x3E, 0x30, 0x1F}, // U+0079 (y) - {0x00, 0x00, 0x3F, 0x19, 0x0C, 0x26, 0x3F, 0x00}, // U+007A (z) - {0x38, 0x0C, 0x0C, 0x07, 0x0C, 0x0C, 0x38, 0x00}, // U+007B ({) - {0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00}, // U+007C (|) - {0x07, 0x0C, 0x0C, 0x38, 0x0C, 0x0C, 0x07, 0x00}, // U+007D (}) - {0x6E, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+007E (~) - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // U+007F - -}; - -inline NeOS::Void fb_render_string_for_bitmap(const NeOS::UInt8* bitmap, const NeOS::SizeT& x_sz, const NeOS::SizeT& y_sz, NeOS::Int32& x_dst, NeOS::Int32& y_dst, NeOS::Int32& color) -{ - NeOS::Int32 x, y; - NeOS::Int32 set; - - x = 0; - y = 0; - set = 0; - - for (; y < y_sz; ++y) - { - for (x = 0; x < x_sz; ++x) - { - set = bitmap[x] & (1 << y); - - if (set) - { - FBDrawInRegion(color, 1, 1, ((x_dst) + x), ((y_dst) + y)); - } - } - } -} - -inline NeOS::Void fb_render_string(const NeOS::Char* text, NeOS::Int32 x_dst, NeOS::Int32 y_dst, NeOS::Int32 color) -{ - for (NeOS::SizeT i = 0; text[i] != 0; ++i) - { - fb_render_string_for_bitmap(&kFontBitmap[text[i]][0], kFontSizeX, kFontSizeY, x_dst, y_dst, color); - y_dst += kFontSizeY; - } -} diff --git a/dev/Mod/GPRS/.keepme b/dev/Mod/GPRS/.keepme deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Mod/HPET/.gitkeep b/dev/Mod/HPET/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Mod/HPET/Defines.h b/dev/Mod/HPET/Defines.h deleted file mode 100644 index c916703a..00000000 --- a/dev/Mod/HPET/Defines.h +++ /dev/null @@ -1,42 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: HPET.h - Purpose: HPET builtin. - - Revision History: - -------------------------------------------- */ - -#pragma once - -#include -#include - -namespace NeOS -{ - struct PACKED HPETAddressStructure final - { - NeOS::UInt8 AddressSpaceId; // 0 - system memory, 1 - system I/O - NeOS::UInt8 RegisterBitWidth; - NeOS::UInt8 RegisterBitOffset; - NeOS::UInt8 Reserved; - NeOS::UInt64 Address; - }; - - struct PACKED HPETHeader final : public SDT - { - NeOS::UInt8 HardwareRevId; - NeOS::UInt8 ComparatorCount : 5; - NeOS::UInt8 CounterSize : 1; - NeOS::UInt8 Reserved : 1; - NeOS::UInt8 LegacyReplacement : 1; - NeOS::UInt16 PciVendorId; - HPETAddressStructure Address; - NeOS::UInt8 HpetNumber; - NeOS::UInt16 MinimumTick; - NeOS::UInt8 PageProtection; - }; - -} // namespace NeOS diff --git a/dev/Mod/IEEE802/.gitkeep b/dev/Mod/IEEE802/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Mod/LTE/LTE.h b/dev/Mod/LTE/LTE.h deleted file mode 100644 index ef7d49f3..00000000 --- a/dev/Mod/LTE/LTE.h +++ /dev/null @@ -1,40 +0,0 @@ -/* ------------------------------------------- - -Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.. - -File: LTE\LTE.h. -Purpose: LTE Standard Library. - -------------------------------------------- */ - -#ifndef _INC_NETWORK_LTE_H_ -#define _INC_NETWORK_LTE_H_ - -#include -#include - -/// @brief Long Term Evolution I/O routines. - -/// @brief Turn on SIM slot. -NeOS::Boolean lte_turn_on_sim(NeOS::Int32 simSlot); - -/// @brief Turn off SIM slot. -NeOS::Boolean lte_turn_off_sim(NeOS::Int32 simSlot); - -/// @brief Send AT command. -NeOS::Boolean lte_send_at_command(NeOS::Char* buf, - NeOS::Size bufReadSz, - NeOS::Int32 simSlot); - -NeOS::Boolean lte_write_sim_file(NeOS::Char* file, - NeOS::VoidPtr buf, - NeOS::Size bufSz, - NeOS::Size offset, - NeOS::Int32 simSlot); - -NeOS::VoidPtr lte_read_sim_file(NeOS::Char* file, - NeOS::Size bufSz, - NeOS::Size offset, - NeOS::Int32 simSlot); - -#endif // ifndef _INC_NETWORK_LTE_H_ diff --git a/dev/Mod/MBCI/MBCI.h b/dev/Mod/MBCI/MBCI.h deleted file mode 100644 index d20f7934..00000000 --- a/dev/Mod/MBCI/MBCI.h +++ /dev/null @@ -1,100 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef _INC_MODULE_MBCI_H_ -#define _INC_MODULE_MBCI_H_ - -#include -#include - -/** -- VCC (IN) (OUT for MCU) -- CLK (IN) (OUT for MCU) -- ACK (BI) (Contains an Acknowledge Packet Frame) -- D0- (IN) (Starts with the Host Interface Packet Frame) -- D1- (IN) (Starts with the Host Interface Packet Frame) -- D0+ (OUT) (Starts with the Host Interface Packet Frame) -- D1+ (OUT) (Starts with the Host Interface Packet Frame) -- GND (IN) (OUT for MCU) - */ - -#define kMBCIZeroSz (8) - -namespace NeOS -{ - struct IMBCIHost; - - enum - { - kMBCISpeedDeviceInvalid, - kMBCILowSpeedDevice, - kMBCIHighSpeedDevice, - kMBCISpeedDeviceCount, - }; - - /// @brief MBCI Host header. - struct PACKED IMBCIHost final - { - UInt32 Magic; - UInt32 HostId; - UInt16 VendorId; - UInt16 DeviceId; - UInt8 MemoryType; - UInt16 HostType; - UInt16 HostFlags; - UInt8 Error; - UInt32 MMIOTest; - UInt16 State; - UInt8 Status; - UInt8 InterruptEnable; - UInt64 BaseAddressRegister; - UInt64 BaseAddressRegisterSize; - UInt32 CommandIssue; - Char Zero[kMBCIZeroSz]; - }; - - /// @brief MBCI host flags. - enum MBCIHostFlags - { - kMBCIHostFlagsSupportsNothing, // Invalid MBCI device. - kMBCIHostFlagsSupportsAPM, // Advanced Power Management. - kMBCIHostFlagsSupportsDaisyChain, // Is daisy chained. - kMBCIHostFlagsSupportsHWInterrupts, // Has HW interrupts. - kMBCIHostFlagsSupportsDMA, // Has DMA. - kMBCIHostFlagsExtended, // Extended flags table. - }; - - /// @brief MBCI host kind. - enum MBCIHostKind - { - kMBCIHostKindHardDisk, - kMBCIHostKindOpticalDisk, - kMBCIHostKindKeyboardLow, - kMBCIHostKindMouseLow, - kMBCIHostKindMouseHigh, - kMBCIHostKindKeyboardHigh, - kMBCIHostKindNetworkInterface, - kMBCIHostKindDaisyChain, - kMBCIHostKindStartExtended, // Extended vendor table limit. - }; - - enum MBCIHostState - { - kMBCIHostStateInvalid, - kMBCIHostStateReset, - kMBCIHostStateSuccess, - kMBCIHostStateReady, - kMBCIHostStateDmaStart, - kMBCIHostStateDmaEnd, - kMBCIHostStateFail, - kMBCIHostStateCount, - }; - - /// @brief An AuthKey is a context used to decrpy data from an MBCI packet. - typedef UInt64 MBCIAuthKeyType; -} // namespace NeOS - -#endif // ifndef _INC_MODULE_MBCI_H_ diff --git a/dev/Mod/MFlash/MFlash.h b/dev/Mod/MFlash/MFlash.h deleted file mode 100644 index a1846610..00000000 --- a/dev/Mod/MFlash/MFlash.h +++ /dev/null @@ -1,25 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#ifdef NE_USE_MBCI_FLASH - -#include - -NeOS::SizeT drv_get_sector_count(NeOS::Int32 slot); - -NeOS::SizeT drv_get_size(NeOS::Int32 slot); - -NeOS::Void drv_enable_at(NeOS::Int32 slot); - -NeOS::Void drv_disable_at(NeOS::Int32 slot); - -NeOS::Void drv_std_write(NeOS::Int32 slot, NeOS::UInt64 lba, NeOS::Char* buf, NeOS::SizeT sector_sz, NeOS::SizeT buf_sz); - -NeOS::Void drv_std_read(NeOS::Int32 slot, NeOS::UInt64 lba, NeOS::Char* buf, NeOS::SizeT sector_sz, NeOS::SizeT buf_sz); - -#endif // ifdef NE_USE_MBCI_FLASH diff --git a/dev/Mod/NVME/NVME.h b/dev/Mod/NVME/NVME.h deleted file mode 100644 index 5f8608f7..00000000 --- a/dev/Mod/NVME/NVME.h +++ /dev/null @@ -1,113 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - Revision History: - - ??/??/24: Added file (amlel) - 23 Jul 24: Update filename to Defines.h and using NE_ALIGN_NVME for NVME structs. (amlel) - -------------------------------------------- */ - -#ifndef __MODULE_NVME_H__ -#define __MODULE_NVME_H__ - -#include - -/// @file NVME.h -/// @brief NVME driver. - -#define NE_ALIGN_NVME ATTRIBUTE(aligned(sizeof(NeOS::UInt32))) - -namespace NeOS -{ - struct NE_ALIGN_NVME HAL_NVME_BAR_0 final - { - UInt32 fCapabilities; - UInt32 fVersion; - UInt32 fIntMaskSet; - UInt32 fIntMaskClr; - UInt32 fContrlConf; - UInt32 fContrlStat; - UInt32 fAdminQueueAttr; - UInt32 fAdminSubmissionQueue; - UInt32 fAdminCompletionQueue; - }; - - struct NE_ALIGN_NVME HAL_NVME_QUEUE final - { - UInt32 fOpcode; - UInt32 fNSID; - UInt32 fReserved[3]; - UInt32 fMetadataPtr[5]; - UInt32 fDataPtr[9]; - UInt32 CommandSpecific[15]; - }; - - enum - { - kInvalidNVME, - kCreateCompletionQueueNVME = 0x05, - kCreateSubmissionQueueNVME = 0x01, - kIdentifyNVME = 0x06, - kReadNVME = 0x02, - kWriteNVME = 0x01, - kCountNVME = 5, - }; - - /// @brief Creates an admin command for a DMA operation. - template - inline Bool nvme_create_admin_command(HAL_NVME_QUEUE* entry, UInt32 nsid, UInt32 prpTransfer[3], UInt32 startingLba[2], UInt32 lowTransferBlocks) - { - if (entry == nullptr) - return false; - - entry->CommandSpecific[9] = startingLba[0]; - entry->CommandSpecific[10] = startingLba[1]; - - entry->CommandSpecific[11] = lowTransferBlocks; - - entry->CommandSpecific[5] = prpTransfer[0]; - entry->CommandSpecific[6] = prpTransfer[1]; - entry->CommandSpecific[7] = prpTransfer[2]; - - entry->CommandSpecific[0] = nsid; - - return true; - } - - /// @brief Creates an I/O command for a DMA operation. - template - inline Bool nvme_create_io_command(HAL_NVME_QUEUE* entry, UInt64 baseAddress, UInt32 identLoAndQueueSizeHi, UInt32 flagsLoAndQueueComplIdHi, UInt32 identify, Bool provideIdentify = false, Bool namespaceIdentify = false) - { - if (entry == nullptr) - return false; - - if (baseAddress == 0) - return false; - - entry->fOpcode = Opcode; - - entry->CommandSpecific[5] = (baseAddress & 0xFF); - entry->CommandSpecific[6] = static_cast(baseAddress); - - if (!provideIdentify) - { - entry->CommandSpecific[9] = identLoAndQueueSizeHi; - entry->CommandSpecific[10] = flagsLoAndQueueComplIdHi; - } - else - { - entry->CommandSpecific[9] = identify; - - if (namespaceIdentify) - { - entry->CommandSpecific[0] = 1; - } - } - - return true; - } -} // namespace NeOS - -#endif // ifndef __MODULE_NVME_H__ diff --git a/dev/Mod/OHCI/.gitkeep b/dev/Mod/OHCI/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Mod/Pwr/PowerFactory.h b/dev/Mod/Pwr/PowerFactory.h deleted file mode 100644 index 15548198..00000000 --- a/dev/Mod/Pwr/PowerFactory.h +++ /dev/null @@ -1,37 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include -#include -#include - -#define NE_POWER_FACTORY : public PowerFactory - -namespace NeOS -{ - class PowerFactory; - - class PowerFactory - { - public: - explicit PowerFactory() = default; - virtual ~PowerFactory() = default; - - PowerFactory& operator=(const PowerFactory&) = default; - PowerFactory(const PowerFactory&) = default; - - public: - Bool Shutdown() - { - return NO; - }; // shutdown - Void Reboot(){}; // soft-reboot - }; -} // namespace NeOS \ No newline at end of file diff --git a/dev/Mod/ReadMe.md b/dev/Mod/ReadMe.md deleted file mode 100644 index 1261e247..00000000 --- a/dev/Mod/ReadMe.md +++ /dev/null @@ -1,12 +0,0 @@ -# Kernel Modules - -## Brief - -They are pluggable modules for specific hardware support. - -## To-Do - -- [X] AHCI kernel module. -- [X] MBCI kernel module. - -###### Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. All rights reserved. diff --git a/dev/Mod/SCSI/.gitkeep b/dev/Mod/SCSI/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Mod/SCSI/SCSI.h b/dev/Mod/SCSI/SCSI.h deleted file mode 100644 index 156bec90..00000000 --- a/dev/Mod/SCSI/SCSI.h +++ /dev/null @@ -1,15 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -/// @file SCSI.h -/// @brief Serial SCSI driver. - -template -using scsi_packet_type = NeOS::UInt16[PacketBitLen]; diff --git a/dev/Mod/WiFi/.gitkeep b/dev/Mod/WiFi/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Mod/XHCI/.gitkeep b/dev/Mod/XHCI/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Mod/XHCI/Defines.h b/dev/Mod/XHCI/Defines.h deleted file mode 100644 index e3fcce11..00000000 --- a/dev/Mod/XHCI/Defines.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - File: Defines.h - Purpose: XHCI (and backwards) header. - - Revision History: - - 01/02/24: Added file (amlel) - 03/02/24: Update filename to Defines.h (amlel) - -------------------------------------------- */ - -#pragma once - -#include - -using namespace NeOS; - -#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/dev/SCIKit/CompilerHint.h b/dev/SCIKit/CompilerHint.h new file mode 100644 index 00000000..a78e59bf --- /dev/null +++ b/dev/SCIKit/CompilerHint.h @@ -0,0 +1,12 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef SCI_HINT_H +#define SCI_HINT_H + +#include + +#endif // ifndef SCI_HINT_H diff --git a/dev/SCIKit/LPC.h b/dev/SCIKit/LPC.h new file mode 100644 index 00000000..044d272e --- /dev/null +++ b/dev/SCIKit/LPC.h @@ -0,0 +1,56 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +/// @file LPC.h +/// @brief Local Process Code type and values. + +#define err_local_ok() (kLastError == kErrorSuccess) +#define err_local_fail() (kLastError != kErrorSuccess) +#define err_local_get() (kLastError) + +typedef SInt32 ErrObject; + +inline constexpr ErrObject kErrorSuccess = 0; +inline constexpr ErrObject kErrorExecutable = 33; +inline constexpr ErrObject kErrorExecutableLib = 34; +inline constexpr ErrObject kErrorFileNotFound = 35; +inline constexpr ErrObject kErrorDirectoryNotFound = 36; +inline constexpr ErrObject kErrorDiskReadOnly = 37; +inline constexpr ErrObject kErrorDiskIsFull = 38; +inline constexpr ErrObject kErrorProcessFault = 39; +inline constexpr ErrObject kErrorSocketHangUp = 40; +inline constexpr ErrObject kErrorThreadLocalStorage = 41; +inline constexpr ErrObject kErrorMath = 42; +inline constexpr ErrObject kErrorNoNetwork = 43; +inline constexpr ErrObject kErrorHeapOutOfMemory = 44; +inline constexpr ErrObject kErrorNoSuchDisk = 45; +inline constexpr ErrObject kErrorFileExists = 46; +inline constexpr ErrObject kErrorFormatFailed = 47; +inline constexpr ErrObject kErrorNetworkTimeout = 48; +inline constexpr ErrObject kErrorInternal = 49; +inline constexpr ErrObject kErrorForkAlreadyExists = 50; +inline constexpr ErrObject kErrorOutOfTeamSlot = 51; +inline constexpr ErrObject kErrorHeapNotPresent = 52; +inline constexpr ErrObject kErrorNoEntrypoint = 53; +inline constexpr ErrObject kErrorDiskIsCorrupted = 54; +inline constexpr ErrObject kErrorDisk = 55; +inline constexpr ErrObject kErrorInvalidData = 56; +inline constexpr ErrObject kErrorAsync = 57; +inline constexpr ErrObject kErrorNonBlocking = 58; +inline constexpr ErrObject kErrorIPC = 59; +inline constexpr ErrObject kErrorSign = 60; +inline constexpr ErrObject kErrorInvalidCreds = 61; +inline constexpr ErrObject kErrorCDTrayBroken = 62; +inline constexpr ErrObject kErrorUnrecoverableDisk = 63; +inline constexpr ErrObject kErrorFileLocked = 64; +inline constexpr ErrObject kErrorUnimplemented = -1; + +/// @brief The last error reported by the system to the process. +IMPORT_C ErrObject kLastError; diff --git a/dev/SCIKit/Macros.h b/dev/SCIKit/Macros.h new file mode 100644 index 00000000..c7bd61e8 --- /dev/null +++ b/dev/SCIKit/Macros.h @@ -0,0 +1,93 @@ +/* ------------------------------------------- + +Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +File: Macros.h +Purpose: libsci Macros header. + +------------------------------------------- */ + +#pragma once + +/***********************************************************************************/ +/// @file SCIKit/Macros.h +/// @brief Macros and core types. +/***********************************************************************************/ + +#include + +#define ATTRIBUTE(X) __attribute__((X)) + +#define IMPORT_CXX extern "C++" +#define IMPORT_C extern "C" + +#define DEPRECATED ATTRIBUTE(deprecated) + +#define EXIT_SUCCESS 0 +#define EXIT_FAILURE 1 + +#define FILE_MAX_LEN 256 + +#ifndef BOOL +#define BOOL bool +#endif + +typedef bool Bool; +typedef bool Boolean; +typedef void Void; + +#ifndef __cplusplus +#define true 1 +#define false 0 +#endif + +#define YES true +#define NO false + +typedef __UINT64_TYPE__ UInt64; +typedef __UINT32_TYPE__ UInt32; +typedef __UINT16_TYPE__ UInt16; +typedef __UINT8_TYPE__ UInt8; + +typedef __SIZE_TYPE__ SizeT; + +typedef __INT64_TYPE__ SInt64; +typedef __INT32_TYPE__ SInt32; +typedef __INT16_TYPE__ SInt16; +typedef __INT8_TYPE__ SInt8; + +typedef void* VoidPtr; +typedef __UINTPTR_TYPE__ UIntPtr; +typedef char Char; + +#ifdef __cplusplus +typedef decltype(nullptr) nullPtr; +typedef nullPtr NullPtr; + +#define SCI_COPY_DELETE(KLASS) \ + KLASS& operator=(const KLASS&) = delete; \ + KLASS(const KLASS&) = delete; + +#define SCI_COPY_DEFAULT(KLASS) \ + KLASS& operator=(const KLASS&) = default; \ + KLASS(const KLASS&) = default; + +#define SCI_MOVE_DELETE(KLASS) \ + KLASS& operator=(KLASS&&) = delete; \ + KLASS(KLASS&&) = delete; + +#define SCI_MOVE_DEFAULT(KLASS) \ + KLASS& operator=(KLASS&&) = default; \ + KLASS(KLASS&&) = default; + +#endif + +IMPORT_C void _rtl_assert(Bool expr, const Char* origin); + +#define MUST_PASS(X) _rtl_assert(X, __FILE__) + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) \ + (((sizeof(a) / sizeof(*(a))) / \ + (static_cast(!(sizeof(a) % sizeof(*(a))))))) +#endif \ No newline at end of file diff --git a/dev/SCIKit/SCI.h b/dev/SCIKit/SCI.h new file mode 100644 index 00000000..3e769262 --- /dev/null +++ b/dev/SCIKit/SCI.h @@ -0,0 +1,339 @@ +/* ------------------------------------------- + +Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +File: SCI.h +Purpose: System Call Interface. + +------------------------------------------- */ + +#ifndef SCI_SCI_H +#define SCI_SCI_H + +#include + +// ------------------------------------------------------------------------------------------ // +/// @brief Types API. +// ------------------------------------------------------------------------------------------ // + +typedef VoidPtr SCIObject; + +typedef SCIObject IOObject; +typedef IOObject FSObject; +typedef SCIObject DLLObject; +typedef SCIObject ThreadObject; +typedef SCIObject SocketObject; + +// ------------------------------------------------------------------------------------------ // +/// @brief Dynamic Loader API. +// ------------------------------------------------------------------------------------------ // + +/// @brief Get function which is part of the DLL. +/// @param symbol the symbol to look for +/// @param dll_handle the DLL handle. +/// @return the proc pointer. +IMPORT_C SCIObject LdrGetDLLSymbolFromHandle(_Input const Char* symbol, _Input SCIObject dll_handle); + +/// @brief Open DLL handle. +/// @param path +/// @param drv +/// @return +IMPORT_C SCIObject LdrOpenDLLHandle(_Input const Char* path, _Input const Char* drive_letter); + +/// @brief Close DLL handle +/// @param dll_handle +/// @return +IMPORT_C Void LdrCloseDLLHandle(_Input SCIObject* dll_handle); + +// ------------------------------------------------------------------------------------------ // +// File API. +// ------------------------------------------------------------------------------------------ // + +/// @brief Opens a file from a drive. +/// @param fs_path the filesystem path. +/// @param drive_letter drive name, use NULL to use default drive location. +/// @return the file descriptor of the file. +IMPORT_C SCIObject IoOpenFile(const Char* fs_path, const Char* drive_letter); + +/// @brief Closes a file and flushes its content. +/// @param file_desc the file descriptor. +/// @return Function doesn't return a type. +IMPORT_C Void IoCloseFile(_Input SCIObject file_desc); + +/// @brief Write data to a file. +/// @param file_desc the file descriptor. +/// @param out_data the data to write. +/// @param sz_data the size of the data to write. +/// @return the number of bytes written. +IMPORT_C UInt32 IoWriteFile(_Input SCIObject file_desc, _Output VoidPtr out_data, SizeT sz_data); + +/// @brief Read data from a file. +/// @param file_desc the file descriptor. +/// @param out_data the data to read. +/// @param sz_data the size of the data to read. +IMPORT_C UInt32 IoReadFile(_Input SCIObject file_desc, _Output VoidPtr* out_data, SizeT sz_data); + +/// @brief Rewind the file pointer to the beginning of the file. +/// @param file_desc the file descriptor. +/// @return the number of bytes read. +IMPORT_C UInt64 IoRewindFile(_Input SCIObject file_desc); + +/// @brief Tell the current position of the file pointer. +/// @param file_desc the file descriptor. +/// @return the current position of the file pointer. +IMPORT_C UInt64 IoTellFile(_Input SCIObject file_desc); + +/// @brief Seek file offset from file descriptor. +IMPORT_C UInt64 IoSeekFile(_Input SCIObject file_desc, UInt64 file_offset); + +// ------------------------------------------------------------------------ +// Process API. +// ------------------------------------------------------------------------ + +/// @brief Spawns a Thread Information Block and Global Information Block inside the current process. +/// @param process_id Target Process ID, must be valid. +/// @return > 0 error ocurred or already present, = 0 success. +IMPORT_C UInt32 RtlSpawnIB(UIntPtr process_id); + +/// @brief Spawns a process with a unique pid (stored as UIntPtr). +/// @param process_path process filesystem path. +/// @return > 0 process was created. +IMPORT_C UIntPtr RtlSpawnProcess(const Char* process_path, SizeT argc, Char** argv, Char** envp, SizeT envp_len); + +/// @brief Exits a process with an exit_code. +/// @return if it has succeeded true, otherwise false. +IMPORT_C Bool RtlExitProcess(UIntPtr handle, UIntPtr exit_code); + +/// @brief Get current PID of process. +/// @return Current process ID. +IMPORT_C UIntPtr RtlCurrentPID(Void); + +// ------------------------------------------------------------------------ +// Memory Manager API. +// ------------------------------------------------------------------------ + +/// @brief Creates a new heap from the process's address space. +/// @param len the length of it. +/// @param flags the flags of it. +/// @return heap pointer. +IMPORT_C VoidPtr MmCreateHeap(_Input SizeT len, _Input UInt32 flags); + +/// @brief Destroys the pointer +/// @param heap the heap itself. +/// @return void. +IMPORT_C Void MmDestroyHeap(_Input VoidPtr heap); + +/// @brief Change protection flags of a memory region. +IMPORT_C Void MmSetHeapFlags(_Input VoidPtr heap, _Input UInt32 flags); + +/// @brief Change protection flags of a memory region. +IMPORT_C UInt32 MmGetHeapFlags(_Input VoidPtr heap); + +/// @brief Fill memory region with CRC32. +IMPORT_C UInt32 MmFillCRC32Heap(_Input VoidPtr heap); + +/// @brief Copy memory region. +IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len); + +/// @brief Compare memory regions. +IMPORT_C SInt64 MmCmpMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len); + +/// @brief Fill memory region. +IMPORT_C VoidPtr MmFillMemory(_Input VoidPtr dest, _Input SizeT len, _Input UInt8 value); + +/// @brief Compare string regions. +IMPORT_C SInt64 MmStrCmp(_Input const Char* dest, _Input const Char* src); + +/// @brief Get length of string. +IMPORT_C SInt64 MmStrLen(const Char* str); + +// ------------------------------------------------------------------------ +// @brief Error API. +// ------------------------------------------------------------------------ + +IMPORT_C SInt32 ErrGetLastError(Void); + +// ------------------------------------------------------------------------ +// @brief Threading API. +// ------------------------------------------------------------------------ + +/// @brief Exit the current thread. +/// @param exit_code the exit code. +IMPORT_C Void ThrExitCurrentThread(_Input SInt32 exit_code); + +/// @brief Exit the main thread. +/// @param exit_code the exit code. +IMPORT_C Void ThrExitMainThread(_Input SInt32 exit_code); + +/// @brief Exit a thread. +/// @param thread the thread to exit. +/// @param exit_code the exit code. +IMPORT_C Void ThrExitThread(_Input ThreadObject thread, _Input SInt32 exit_code); + +/// @brief Thread procedure function type. +typedef Void (*thread_proc_kind)(int argc, char** argv); + +/// @brief Creates a thread. +/// @param procedure the thread procedure. +/// @param argument_count number of arguments inside that thread. +/// @param flags Thread flags. +/// @return the thread object. +IMPORT_C ThreadObject ThrCreateThread(thread_proc_kind procedure, SInt32 argument_count, SInt32 flags); + +/// @brief Yields the current thread. +/// @param thread the thread to yield. +IMPORT_C Void ThrYieldThread(ThreadObject thrd); + +/// @brief Joins a thread. +/// @param thread the thread to join. +IMPORT_C Void ThrJoinThread(ThreadObject thrd); + +/// @brief Detach a thread. +/// @param thread the thread to detach. +IMPORT_C Void ThrDetachThread(ThreadObject thrd); + +// ------------------------------------------------------------------------ +// @brief Drive Management API. +// ------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------ // +/// @brief Get the default drive letter. +/// @param void. +/// @return the drive letter. +// ------------------------------------------------------------------------------------------ // +IMPORT_C Char* DrvGetDefaultDriveLetter(Void); + +// ------------------------------------------------------------------------------------------ // +/// @brief Get the drive letter from a path. +/// @param path the path. +/// @return the drive letter. +// ------------------------------------------------------------------------------------------ // +IMPORT_C Char* DrvGetDriveLetterFromPath(_Input const Char* path); + +// ------------------------------------------------------------------------------------------ // +/// @brief Get a mounted drive from a letter. +/// @param letter the letter (A..Z). +/// @return the drive object. +// ------------------------------------------------------------------------------------------ // +IMPORT_C SCIObject DrvGetMountedDrive(_Input const Char letter); + +// ------------------------------------------------------------------------------------------ // +/// @brief Mount a drive. +/// @param path the path to mount. +/// @param letter the letter to mount. +// ------------------------------------------------------------------------------------------ // +IMPORT_C Void DrvMountDrive(_Input const Char* path, _Input const Char* letter); + +// ------------------------------------------------------------------------------------------ // +/// @brief Unmount a drive. +/// @param letter the letter to unmount. +// ------------------------------------------------------------------------------------------ // +IMPORT_C Void DrvUnmountDrive(_Input const Char letter); + +// ------------------------------------------------------------------------ +// Event handling API, use to listen to OS specific events. +// ------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------------ // +/// @brief Add an event listener. +/// @param event_name the event name. +/// @param listener the listener to add. +/// @return the event listener. +// ------------------------------------------------------------------------------------------ // + +IMPORT_C Void EvtAddListener(_Input const Char* event_name, _Input SCIObject listener); + +// ------------------------------------------------------------------------------------------ // +/// @brief Remove an event listener. +/// @param event_name the event name. +/// @param listener the listener to remove. +/// @return the event listener. +// ------------------------------------------------------------------------------------------ // + +IMPORT_C Void EvtRemoveListener(_Input const Char* event_name, _Input SCIObject listener); + +// ------------------------------------------------------------------------------------------ // +/// @brief Dispatch an event. +/// @param event_name the event name. +/// @param event_data the event data. +/// @return the event data. +// ------------------------------------------------------------------------------------------ // + +IMPORT_C VoidPtr EvtDispatchEvent(_Input const Char* event_name, _Input VoidPtr event_data); + +// ------------------------------------------------------------------------------------------ // +// Power API. +// ------------------------------------------------------------------------------------------ // + +enum +{ + kPowerCodeShutdown, + kPowerCodeReboot, + kPowerCodeSleep, + kPowerCodeWake, + kPowerCodeCount, +}; + +IMPORT_C SInt32 PwrReadCode(_Output SInt32& code); + +IMPORT_C SInt32 PwrSendCode(_Output SInt32& code); + +// ------------------------------------------------------------------------------------------ // +// CD-ROM API. +// ------------------------------------------------------------------------------------------ // + +IMPORT_C SInt32 CdEjectDrive(_Input const Char drv_letter); + +IMPORT_C SInt32 CdOpenTray(Void); + +IMPORT_C SInt32 CdCloseTray(Void); + +// ------------------------------------------------------------------------------------------ // +// Printer API. +// ------------------------------------------------------------------------------------------ // + +IMPORT_C SInt32 PrintOut(IOObject file /* nullptr to direct to stdout */, const Char* fmt, ...); + +IMPORT_C SInt32 PrintIn(IOObject file /* nullptr to direct to stdout */, const Char* fmt, ...); + +IMPORT_C IOObject PrintCreate(Void); + +IMPORT_C SInt32 PrintRelease(IOObject); + +IMPORT_C IOObject PrintGet(const Char* path); + +// ------------------------------------------------------------------------------------------ // +// @brief Scheduler/Debug API. +// ------------------------------------------------------------------------------------------ // + +typedef SInt32 AffinityKind; +typedef UInt64 PID; + +IMPORT_C SInt32 SchedAffinity(PID, SInt32 req, AffinityKind* local); + +IMPORT_C SInt32 SchedTrace(PID, SInt32 req, VoidPtr address, VoidPtr data); + +IMPORT_C SInt32 SchedKill(PID, SInt32 req); + +IMPORT_C SInt32 SchedBreakPoint(Void); + +// ------------------------------------------------------------------------------------------ // +// @brief Filesystem API. +// ------------------------------------------------------------------------------------------ // + +IMPORT_C BOOL FsCopy(const char* path, const char* dst); +IMPORT_C BOOL FsMove(const char* path, const char* dst); + +IMPORT_C BOOL FsExists(const char* path); + +IMPORT_C BOOL FsCreateDir(const char* path); +IMPORT_C BOOL FsCreateFile(const char* path); +IMPORT_C BOOL FsCreateAlias(const char* path, const char* from); + +// ------------------------------------------------------------------------------------------ // +// @brief Format API. +// ------------------------------------------------------------------------------------------ // + +IMPORT_C Char* StrFmt(const Char* fmt, ...); + +#endif // ifndef SCI_SCI_H diff --git a/dev/SCIKit/doc/LibSCI.drawio b/dev/SCIKit/doc/LibSCI.drawio new file mode 100644 index 00000000..4f566c57 --- /dev/null +++ b/dev/SCIKit/doc/LibSCI.drawio @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/SCIKit/libsci.json b/dev/SCIKit/libsci.json new file mode 100644 index 00000000..8b54828d --- /dev/null +++ b/dev/SCIKit/libsci.json @@ -0,0 +1,20 @@ +{ + "compiler_path": "x86_64-w64-mingw32-g++", + "compiler_std": "c++20", + "headers_path": ["../", "./"], + "sources_path": ["src/*.cc", "src/*.o"], + "output_name": "libSCI.dylib", + "compiler_flags": [ + "-fPIC", + "-ffreestanding", + "-shared", + "-fno-rtti", + "-fno-exceptions", + "-Wl,--subsystem=17" + ], + "cpp_macros": [ + "kSCIVersion=0x0100", + "kSCIVersionHighest=0x0100", + "kSCIVersionLowest=0x0100" + ] +} diff --git a/dev/SCIKit/src/LPC.cc b/dev/SCIKit/src/LPC.cc new file mode 100644 index 00000000..f4433161 --- /dev/null +++ b/dev/SCIKit/src/LPC.cc @@ -0,0 +1,10 @@ +/* ------------------------------------------- + +Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +File: LPC.cc +Purpose: Local Procedure Codes. + +------------------------------------------- */ + +#include diff --git a/dev/SCIKit/src/LibSCI+IO.asm b/dev/SCIKit/src/LibSCI+IO.asm new file mode 100644 index 00000000..769ae513 --- /dev/null +++ b/dev/SCIKit/src/LibSCI+IO.asm @@ -0,0 +1,50 @@ +;; /* +;; * ======================================================== +;; * +;; * libsci +;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. +;; * +;; * ======================================================== +;; */ + +[bits 64] + +section .text + +global sci_syscall_arg_1 +global sci_syscall_arg_2 +global sci_syscall_arg_3 +global sci_syscall_arg_4 + +sci_syscall_arg_1: + mov r8, rcx + syscall + ret + +sci_syscall_arg_2: + mov r8, rcx + mov r9, rdx + syscall + ret + +sci_syscall_arg_3: + mov rbx, r8 + + mov r8, rcx + mov r9, rdx + mov r10, rbx + + syscall + ret + +sci_syscall_arg_4: + mov rbx, r8 + mov rax, r9 + + mov r8, rcx + mov r9, rdx + mov r10, rbx + mov r11, rax + + syscall + ret diff --git a/dev/SCIKit/src/Makefile b/dev/SCIKit/src/Makefile new file mode 100644 index 00000000..f8f9fbe4 --- /dev/null +++ b/dev/SCIKit/src/Makefile @@ -0,0 +1,16 @@ +################################################## +# (c) Amlal EL Mahrouss, all rights reserved. +# This is the bootloader makefile. +################################################## + +ASM=nasm +FLAGS=-f win64 + +.PHONY: error +error: + @echo "==> Invalid rule." + @echo "==> Use sci_asm_io_ instead." + +.PHONY: sci_asm_io_x64 +sci_asm_io_x64: + $(ASM) $(FLAGS) libsci+IO.asm -o libsci+IO.o diff --git a/dev/SCIKit/src/SCI.cc b/dev/SCIKit/src/SCI.cc new file mode 100644 index 00000000..3427ae4e --- /dev/null +++ b/dev/SCIKit/src/SCI.cc @@ -0,0 +1,45 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +/// @file libsci.cc +/// @brief Source file for the memory functions of the libsci. + +/// @brief Copy memory region. +IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len) +{ + if (!len || + !dest || + !src) + { + return nullptr; + } + + for (SizeT i = 0; i < len; i++) + { + ((Char*)dest)[i] = ((Char*)src)[i]; + } + + return dest; +} + +/// @brief Fill memory region with **value**. +IMPORT_C VoidPtr MmFillMemory(_Input VoidPtr dest, _Input SizeT len, _Input UInt8 value) +{ + if (!len || + !dest) + { + return nullptr; + } + + for (SizeT i = 0; i < len; i++) + { + ((Char*)dest)[i] = value; + } + + return dest; +} diff --git a/dev/Tools/.keepme b/dev/Tools/.keepme deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Usr/.keepme b/dev/Usr/.keepme deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Usr/LibCF/Array.h b/dev/Usr/LibCF/Array.h deleted file mode 100644 index c466b0fb..00000000 --- a/dev/Usr/LibCF/Array.h +++ /dev/null @@ -1,71 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -namespace LibCF -{ - template - class CFArray final - { - public: - explicit CFArray() = default; - ~CFArray() = default; - - CFArray& operator=(const CFArray&) = default; - CFArray(const CFArray&) = default; - - T& operator[](const SizeT& at) - { - MUST_PASS(at < this->Count()); - return fArray[at]; - } - - Bool Empty() - { - return this->Count() > 0; - } - - const SizeT Capacity() - { - return N; - } - - const SizeT Count() - { - auto cnt = 0UL; - - for (auto i = 0; i < N; ++i) - { - if (fArray[i]) - ++cnt; - } - - return cnt; - } - - const T* CData() - { - return fArray; - } - - operator bool() - { - return !Empty(); - } - - private: - T fArray[N] = {nullptr}; - }; - - template - auto make_array(ValueType val) - { - return CFArray{val}; - } -} // namespace LibCF diff --git a/dev/Usr/LibCF/Atom.h b/dev/Usr/LibCF/Atom.h deleted file mode 100644 index 26b4f0cd..00000000 --- a/dev/Usr/LibCF/Atom.h +++ /dev/null @@ -1,47 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ -#pragma once - -#include - -namespace LibCF -{ - template - class CFAtom final - { - public: - explicit CFAtom() = default; - ~CFAtom() = default; - - public: - CFAtom& operator=(const CFAtom&) = delete; - CFAtom(const CFAtom&) = delete; - - public: - T operator[](SizeT bit) - { - return (fArrayOfAtoms & (1 << bit)); - } - - void operator|(SizeT bit) - { - fArrayOfAtoms |= (1 << bit); - } - - friend Boolean operator==(CFAtom& atomic, const T& idx) - { - return atomic[idx] == idx; - } - - friend Boolean operator!=(CFAtom& atomic, const T& idx) - { - return atomic[idx] == idx; - } - - private: - T fArrayOfAtoms; - }; -} // namespace LibCF diff --git a/dev/Usr/LibCF/Foundation.cc b/dev/Usr/LibCF/Foundation.cc deleted file mode 100644 index cb11287f..00000000 --- a/dev/Usr/LibCF/Foundation.cc +++ /dev/null @@ -1,48 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024 Amlal El Mahrouss, all rights reserved - -------------------------------------------- */ - -#include - -LibCF::CFRect::operator bool() -{ - return width > 0 && height > 0; -} - -/***********************************************************************************/ -/// @brief returns true if size matches. -/***********************************************************************************/ -BOOL LibCF::CFRect::SizeMatches(LibCF::CFRect& rect) noexcept -{ - return rect.height == height && rect.width == width; -} - -/***********************************************************************************/ -/// @brief returns true if position matches. -/***********************************************************************************/ -BOOL LibCF::CFRect::PositionMatches(LibCF::CFRect& rect) noexcept -{ - return rect.y == y && rect.x == x; -} - -/***********************************************************************************/ -/// @brief Check if point is within the current MLPoint. -/// @param point the current point to check. -/// @retval true if point is within this point. -/// @retval the validations have failed, false otherwise true. -/***********************************************************************************/ -BOOL LibCF::CFPoint::IsWithin(LibCF::CFPoint& withinOf) -{ - return x_1 >= withinOf.x_1 && x_2 <= (withinOf.x_2) && - y_1 >= withinOf.y_1 && y_2 <= (withinOf.y_2); -} - -/***********************************************************************************/ -/// @brief if Point object is correctly set up. -/***********************************************************************************/ -LibCF::CFPoint::operator bool() -{ - return x_1 > x_2 && y_1 > y_2; -} \ No newline at end of file diff --git a/dev/Usr/LibCF/Foundation.h b/dev/Usr/LibCF/Foundation.h deleted file mode 100644 index c0f8fe6c..00000000 --- a/dev/Usr/LibCF/Foundation.h +++ /dev/null @@ -1,78 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - - FILE: Foundation.h - PURPOSE: Foundation header of the CF framework. - -------------------------------------------- */ - -#pragma once - -#include - -namespace LibCF -{ - class CFString; - class CFGUID; - class CFProperty; - class CFObject; - template - class CFRef; - class CFFont; - struct CFPoint; - struct CFRect; - struct CFColor; - -#ifndef __LP64__ - typedef SInt32 CFInteger; - typedef float CFReal; -#else - typedef SInt64 CFInteger; - typedef double CFReal; -#endif - - typedef SInt32 CFInteger32; - typedef SInt64 CFInteger64; - - typedef char CFChar8; - typedef char16_t CFChar16; - - struct CFPoint - { - CFInteger64 x_1{0UL}; - CFInteger64 y_1{0UL}; - - CFInteger64 x_2{0UL}; - CFInteger64 y_2{0UL}; - CFReal ang{0UL}; - - operator bool(); - - /// @brief Check if point is within the current CFPoint. - /// @param point the current point to check. - /// @retval true if point is within this point. - /// @retval validations failed. - bool IsWithin(CFPoint& point); - }; - - struct CFColor final - { - CFInteger64 r, g, b, a{0}; - }; - - struct CFRect final - { - CFInteger64 x{0UL}; - CFInteger64 y{0UL}; - - CFInteger64 width{0UL}; - CFInteger64 height{0UL}; - - operator bool(); - - BOOL SizeMatches(CFRect& rect) noexcept; - BOOL PositionMatches(CFRect& rect) noexcept; - }; -} // namespace LibCF \ No newline at end of file diff --git a/dev/Usr/LibCF/Object.h b/dev/Usr/LibCF/Object.h deleted file mode 100644 index 1f8d185e..00000000 --- a/dev/Usr/LibCF/Object.h +++ /dev/null @@ -1,26 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -#define CF_OBJECT : public LibCF::CFObject - -namespace LibCF -{ - class CFObject; - - class CFObject - { - public: - explicit CFObject() = default; - virtual ~CFObject() = default; - - SCI_COPY_DEFAULT(CFObject); - }; -} // namespace LibCF \ No newline at end of file diff --git a/dev/Usr/LibCF/Property.h b/dev/Usr/LibCF/Property.h deleted file mode 100644 index 51a60be7..00000000 --- a/dev/Usr/LibCF/Property.h +++ /dev/null @@ -1,53 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef _PROPS_H -#define _PROPS_H - -#include -#include - -#define kMaxPropLen (256U) - -namespace LibCF -{ - class CFString; - class CFProperty; - class CFGUID; - - template - class CFArray; - - /// @brief handle to anything (number, ptr, string...) - using CFPropertyId = UIntPtr; - - /// @brief User property class. - /// @example /prop/foo or /prop/bar - class CFProperty final CF_OBJECT - { - public: - CFProperty(); - virtual ~CFProperty(); - - public: - CFProperty& operator=(const CFProperty&) = default; - CFProperty(const CFProperty&) = default; - - Bool StringEquals(CFString& name); - CFPropertyId& GetValue(); - CFString& GetKey(); - - private: - CFString* fName{nullptr}; - CFPropertyId fValue{0UL}; - Ref fGUID{}; - }; - - template - using CFPropertyArray = CFArray; -} // namespace LibCF - -#endif // !CFKIT_PROPS_H diff --git a/dev/Usr/LibCF/Ref.h b/dev/Usr/LibCF/Ref.h deleted file mode 100644 index d170ffe8..00000000 --- a/dev/Usr/LibCF/Ref.h +++ /dev/null @@ -1,110 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef _REF_H_ -#define _REF_H_ - -#include -#include - -namespace LibCF -{ - template - class CFRef; - - template - class CFRef final CF_OBJECT - { - public: - CFRef() = default; - - ~CFRef() - { - if (MmGetHeapFlags(fClass) != -1) - delete fClass; - } - - public: - CFRef(T* cls) - : fClass(cls) - { - } - - CFRef(T cls) - : fClass(&cls) - { - } - - CFRef& operator=(T ref) - { - if (!fClass) - return *this; - - fClass = &ref; - return *this; - } - - public: - T operator->() const - { - MUST_PASS(*fClass); - return *fClass; - } - - T& Leak() noexcept - { - return *fClass; - } - - T& TryLeak() const noexcept - { - MUST_PASS(*fClass); - return *fClass; - } - - T operator*() - { - return *fClass; - } - - operator bool() noexcept - { - return fClass; - } - - private: - T* fClass{nullptr}; - }; - - template - class CFNonNullRef final - { - public: - CFNonNullRef() = delete; - CFNonNullRef(nullPtr) = delete; - - CFNonNullRef(T* ref) - : fRef(ref) - { - MUST_PASS(ref); - } - - CFRef& operator->() - { - MUST_PASS(fRef); - return fRef; - } - - CFNonNullRef& operator=(const CFNonNullRef& ref) = delete; - CFNonNullRef(const CFNonNullRef& ref) = default; - - private: - CFRef fRef{nullptr}; - }; -} // namespace LibCF - -#endif // ifndef _NEWKIT_REF_H_ diff --git a/dev/Usr/LibCF/String.h b/dev/Usr/LibCF/String.h deleted file mode 100644 index 9b83fec6..00000000 --- a/dev/Usr/LibCF/String.h +++ /dev/null @@ -1,20 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include - -namespace LibCF -{ - class CFString; - - class CFString final CF_OBJECT - { - public: - }; -} // namespace LibCF \ No newline at end of file diff --git a/dev/Usr/LibFont/.keep b/dev/Usr/LibFont/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Usr/LibFont/Font.h b/dev/Usr/LibFont/Font.h deleted file mode 100644 index 73b3a285..00000000 --- a/dev/Usr/LibFont/Font.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * - * Copyright (c) 2024 Amlal El Mahrouss - * - */ - -#pragma once - -#include - -#define kCFFontExt ".ttf" - -/// @file Font.h -/// @brief Font parsing using a NeOS True Font. - -namespace LibCF -{ - class CFFont; - - class CFFont - { - public: - explicit CFFont() = default; - virtual ~CFFont() = default; - - protected: - CFRect m_size{}; - CFRect* m_glyphs{nullptr}; - CFInteger32 m_glyphs_cnt{0}; - BOOL m_bold{NO}; - BOOL m_italic{NO}; - - CFFont(const CFFont& fnt) = delete; - CFFont& operator=(const CFFont& fnt) = delete; - - virtual BOOL render_(CFPoint pos, CFChar16 character, CFColor color) = 0; - - virtual void dispose_() - { - m_bold = NO; - m_italic = NO; - - m_size.height = 0; - m_size.width = 0; - - m_glyphs_cnt = 0; - - delete[] m_glyphs; - m_glyphs = nullptr; - - m_size.x = 0; - m_size.y = 0; - } - }; -} // namespace LibCF \ No newline at end of file diff --git a/dev/Usr/LibGUI/.keep b/dev/Usr/LibGUI/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Usr/LibLocale/.keep b/dev/Usr/LibLocale/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/Usr/LibWM/WindowConnection.h b/dev/Usr/LibWM/WindowConnection.h deleted file mode 100644 index 22938130..00000000 --- a/dev/Usr/LibWM/WindowConnection.h +++ /dev/null @@ -1,31 +0,0 @@ - -/* ------------------------------------------- - - Copyright (C) 2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include - -namespace LibCF -{ - class CFWindowConnection_; - - class CFWindowConnection_ CF_OBJECT - { - public: - explicit CFWindowConnection_() = default; - virtual ~CFWindowConnection_() = default; - - SCI_COPY_DEFAULT(CFWindowConnection_); - - constexpr static SInt16 kMaxPeers = 16; - - Char mConnName[256] = {0}; - SInt32 mConnPeersCnt{0}; - CFArray mConnPeers; - }; -} // namespace LibCF \ No newline at end of file diff --git a/dev/boot/BootKit/BitManip.h b/dev/boot/BootKit/BitManip.h new file mode 100644 index 00000000..475d44ed --- /dev/null +++ b/dev/boot/BootKit/BitManip.h @@ -0,0 +1,20 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef __BITMANIP_H__ +#define __BITMANIP_H__ + +/// File: BitManip.h +/// Purpose: Bit manipulation helpers, based on coreboot-dev. + +#define bk_set_bit(X, O) X = (1 << O) | X +#define bk_clear_bit(X, O) X = ~(1 << O) & X +#define bk_toogle(X, O) X = (1 << O) ^ X +#define bk_lsb(X) X = X & -X +#define bk_msb(X) X = -(mp_lsb(X)) & X +#define bk_look_for_bit(X, O) (1 << O) | X + +#endif // ifndef __BITMANIP_H__ diff --git a/dev/boot/BootKit/BootKit.h b/dev/boot/BootKit/BootKit.h new file mode 100644 index 00000000..425c6ed4 --- /dev/null +++ b/dev/boot/BootKit/BootKit.h @@ -0,0 +1,403 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +/***********************************************************************************/ +/// @file BootKit.h +/// @brief Bootloader Application Programming Interface. +/***********************************************************************************/ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +/// include NeFS header and Support header as well. + +#include +#include + +/***********************************************************************************/ +/// Include other APIs. +/***********************************************************************************/ + +#include +#include + +#include + +/***********************************************************************************/ +/// Framebuffer helpers. +/***********************************************************************************/ + +namespace EFI +{ + EXTERN void ThrowError(const WideChar* errorCode, + const WideChar* reason) noexcept; +} // namespace EFI + +namespace Boot +{ + class BootTextWriter; + class BootFileReader; + class BootThread; + class BVersionString; + + typedef Char* PEFImagePtr; + typedef Char* PEImagePtr; + + typedef WideChar CharacterTypeUTF16; + typedef Char CharacterTypeUTF8; + + using namespace NeOS; + + /** + * @brief BootKit Text Writer class + * Writes to UEFI StdOut. + */ + class BootTextWriter final + { + BootTextWriter& _Write(const Long& num); + + public: + BootTextWriter& Write(const Long& num); + BootTextWriter& Write(const Char* str); + BootTextWriter& Write(const CharacterTypeUTF16* str); + BootTextWriter& WriteCharacter(CharacterTypeUTF16 c); + BootTextWriter& Write(const UChar* str); + + template + BootTextWriter& operator<<(T elem) + { + this->Write(elem); + return *this; + } + + public: + explicit BootTextWriter() = default; + ~BootTextWriter() = default; + + public: + BootTextWriter& operator=(const BootTextWriter&) = default; + BootTextWriter(const BootTextWriter&) = default; + }; + + NeOS::SizeT BCopyMem(CharacterTypeUTF16* dest, CharacterTypeUTF16* src, const NeOS::SizeT len); + + NeOS::SizeT BSetMem(CharacterTypeUTF8* src, const CharacterTypeUTF8 byte, const NeOS::SizeT len); + + /// String length functions. + + /// @brief get string length. + NeOS::SizeT BStrLen(const CharacterTypeUTF16* ptr); + + /// @brief set memory with custom value. + NeOS::SizeT BSetMem(CharacterTypeUTF16* src, const CharacterTypeUTF16 byte, const NeOS::SizeT len); + + /** + * @brief BootKit File Reader class + * Reads the Firmware Boot partition and filesystem. + */ + class BootFileReader final + { + public: + explicit BootFileReader(const CharacterTypeUTF16* path, + EfiHandlePtr ImageHandle); + ~BootFileReader(); + + public: + Void ReadAll(SizeT until, SizeT chunk = kib_cast(4), UIntPtr out_address = 0UL); + + enum + { + kOperationOkay, + kNotSupported, + kEmptyDirectory, + kNoSuchEntry, + kIsDirectory, + kTooSmall, + kCount, + }; + + /// @brief error code getter. + /// @return the error code. + Int32& Error(); + + /// @brief blob getter. + /// @return the blob. + VoidPtr Blob(); + + /// @breif Size getter. + /// @return the size of the file. + UInt64& Size(); + + public: + BootFileReader& operator=(const BootFileReader&) = default; + BootFileReader(const BootFileReader&) = default; + + private: + Int32 mErrorCode{kOperationOkay}; + VoidPtr mBlob{nullptr}; + CharacterTypeUTF16 mPath[kPathLen]; + BootTextWriter mWriter; + EfiFileProtocol* mFile{nullptr}; + UInt64 mSizeFile{0}; + EfiFileProtocol* mRootFs; + }; + + typedef UInt8* BlobType; + + class BVersionString final + { + public: + static const CharacterTypeUTF8* The() + { + return BOOTLOADER_VERSION; + } + }; + + /***********************************************************************************/ + /// Provide some useful processor features. + /***********************************************************************************/ + +#ifdef __EFI_x86_64__ + + /*** + * Common processor instructions. + */ + + EXTERN_C void rt_out8(UInt16 port, UInt8 value); + EXTERN_C void rt_out16(UInt16 port, UInt16 value); + EXTERN_C void rt_out32(UInt16 port, UInt32 value); + EXTERN_C UInt8 rt_in8(UInt16 port); + EXTERN_C UInt16 In16(UInt16 port); + EXTERN_C UInt32 rt_in32(UInt16 port); + + EXTERN_C void rt_hlt(); + EXTERN_C void rt_cli(); + EXTERN_C void rt_sti(); + EXTERN_C void rt_cld(); + EXTERN_C void rt_std(); + +#endif // __EFI_x86_64__ + + static inline const UInt32 kRgbRed = 0x000000FF; + static inline const UInt32 kRgbGreen = 0x0000FF00; + static inline const UInt32 kRgbBlue = 0x00FF0000; + static inline const UInt32 kRgbBlack = 0x00000000; + static inline const UInt32 kRgbWhite = 0x00FFFFFF; + +#define kBKBootFileMime "boot-x/file" +#define kBKBootDirMime "boot-x/dir" + + /// @brief BootKit Drive Formatter. + template + class BDiskFormatFactory final + { + public: + /// @brief File entry for **BDiskFormatFactory**. + struct BFileDescriptor final + { + Char fFileName[kNeFSCatalogNameLen]; + Int32 fKind; + }; + + public: + explicit BDiskFormatFactory() = default; + explicit BDiskFormatFactory(BootDev dev) + : fDiskDev(dev) + { + } + + ~BDiskFormatFactory() = default; + + NE_COPY_DELETE(BDiskFormatFactory); + + /// @brief Format disk using partition name and blob. + /// @param Partition part_name the target partition name. + /// @param blob blobs array. + /// @param blob_sz blobs array count. + /// @retval True disk has been formatted. + /// @retval False failed to format. + Boolean Format(const Char* part_name, BFileDescriptor* blob, SizeT blob_sz); + + /// @brief check if partition is good. + Bool IsPartitionValid() noexcept + { + fDiskDev.Leak().mBase = (kNeFSRootCatalogStartAddress); + fDiskDev.Leak().mSize = BootDev::kSectorSize; + + Char buf[BootDev::kSectorSize] = {0}; + + fDiskDev.Read(buf, BootDev::kSectorSize); + + NEFS_ROOT_PARTITION_BLOCK* blockPart = reinterpret_cast(buf); + + BootTextWriter writer; + + for (SizeT indexMag = 0UL; indexMag < kNeFSIdentLen; ++indexMag) + { + if (blockPart->Ident[indexMag] != kNeFSIdent[indexMag]) + return false; + } + + if (blockPart->DiskSize != this->fDiskDev.GetDiskSize() || + blockPart->DiskSize < 1 || + blockPart->SectorSize != BootDev::kSectorSize || + blockPart->Version != kNeFSVersionInteger || + blockPart->StartCatalog == 0) + { + return false; + } + else if (blockPart->PartitionName[0] == 0) + { + return false; + } + + writer.Write(L"BootZ: Partition: ").Write(blockPart->PartitionName).Write(L" is healthy.\r"); + + return true; + } + + private: + /// @brief Write all of the requested catalogs into the filesystem. + /// @param blob the blobs. + /// @param blob_sz the number of blobs to write (n * sizeof(blob_struct)). + /// @param part the NeFS partition block. + Boolean WriteCatalogList(BFileDescriptor* blob, SizeT blob_sz, NEFS_ROOT_PARTITION_BLOCK& part) + { + if (blob_sz < sizeof(NEFS_CATALOG_STRUCT)) + return NO; + + if (!blob) + return NO; + + Lba startLba = part.StartCatalog; + BootTextWriter writer; + + NEFS_CATALOG_STRUCT catalogKind{0}; + + constexpr auto cNeFSCatalogPadding = 4; + + catalogKind.PrevSibling = startLba; + catalogKind.NextSibling = (startLba + sizeof(NEFS_CATALOG_STRUCT) * cNeFSCatalogPadding); + + /// Fill catalog kind. + catalogKind.Kind = blob->fKind; + catalogKind.Flags |= kNeFSFlagCreated; + catalogKind.CatalogFlags = kNeFSStatusUnlocked; + + --part.FreeCatalog; + --part.FreeSectors; + + CopyMem(catalogKind.Name, blob->fFileName, StrLen(blob->fFileName)); + + fDiskDev.Leak().mBase = startLba; + fDiskDev.Leak().mSize = sizeof(NEFS_CATALOG_STRUCT); + + fDiskDev.Write((Char*)&catalogKind, sizeof(NEFS_CATALOG_STRUCT)); + + writer.Write(L"BootZ: Wrote directory: ").Write(blob->fFileName).Write(L"\r"); + + return true; + } + + private: + BootDev fDiskDev; + }; + + /// @brief Format disk. + /// @param part_name partition Name + /// @param blob blos. + /// @param blob_sz n blobs (n * sizeof(blob_struct)). + /// @retval True disk has been formatted. + /// @retval False failed to format. + template + inline Boolean BDiskFormatFactory::Format(const Char* part_name, + BDiskFormatFactory::BFileDescriptor* blob, + SizeT blob_sz) + { + if (!blob || !blob_sz) + return false; /// sanity check + + /// @note A catalog roughly equal to a sector. + + constexpr auto kMinimumDiskSize = kNeFSMinimumDiskSize; // at minimum. + + /// @note also look at EPM headers, for free part blocks. + + if (fDiskDev.GetDiskSize() < kMinimumDiskSize) + { + fb_init(); + + FBDrawBitMapInRegion(zka_no_disk, NE_NO_DISK_WIDTH, NE_NO_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - NE_NO_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - NE_NO_DISK_HEIGHT) / 2); + EFI::ThrowError(L"Drive-Too-Tiny", L"Can't format a NeFS partition here."); + return false; + } + + NEFS_ROOT_PARTITION_BLOCK part{0}; + + CopyMem(part.Ident, kNeFSIdent, kNeFSIdentLen - 1); + CopyMem(part.PartitionName, part_name, StrLen(part_name)); + + part.Version = kNeFSVersionInteger; + part.CatalogCount = blob_sz / sizeof(NEFS_CATALOG_STRUCT); + part.Kind = BootDev::kSectorSize; + part.SectorSize = kATASectorSize; + part.FreeCatalog = fDiskDev.GetSectorsCount() / sizeof(NEFS_CATALOG_STRUCT); + part.SectorCount = fDiskDev.GetSectorsCount(); + part.FreeSectors = fDiskDev.GetSectorsCount(); + part.StartCatalog = kNeFSCatalogStartAddress; + part.DiskSize = fDiskDev.GetDiskSize(); + part.Flags = kNeFSPartitionTypeBoot | kNeFSPartitionTypeStandard; + + fDiskDev.Leak().mBase = kNeFSRootCatalogStartAddress; + fDiskDev.Leak().mSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); + + fDiskDev.Write((Char*)&part, sizeof(NEFS_ROOT_PARTITION_BLOCK)); + + BootTextWriter writer; + + writer << "BootZ: Partition name: " << part.PartitionName << "\r"; + writer << "BootZ: Start: " << part.StartCatalog << "\r"; + writer << "BootZ: Number of catalogs: " << part.CatalogCount << "\r"; + writer << "BootZ: Free catalog: " << part.FreeCatalog << "\r"; + writer << "BootZ: Free sectors: " << part.FreeSectors << "\r"; + writer << "BootZ: Sector size: " << part.SectorSize << "\r"; + +#ifdef BOOTZ_EPM_SUPPORT + EPM_PART_BLOCK epm_boot{0}; + + const auto kFsName = "NeFS"; + const auto kBlockName = "OS"; + + CopyMem(epm_boot.Fs, reinterpret_cast(const_cast(kFsName)), StrLen(kFsName)); + + epm_boot.FsVersion = kNeFSVersionInteger; + epm_boot.LbaStart = kNeFSRootCatalogStartAddress; + epm_boot.LbaEnd = fDiskDev.GetDiskSize(); + epm_boot.SectorSz = part.SectorSize; + epm_boot.Kind = kEPMNeOS; + epm_boot.NumBlocks = part.CatalogCount; + + CopyMem(epm_boot.Name, reinterpret_cast(const_cast(kBlockName)), StrLen(kBlockName)); + CopyMem(epm_boot.Magic, reinterpret_cast(const_cast(kEPMMagic)), StrLen(kEPMMagic)); + + fDiskDev.Leak().mBase = kEPMBootBlockLba; // always always resies at zero block. + fDiskDev.Leak().mSize = sizeof(EPM_PART_BLOCK); + + fDiskDev.Write((Char*)&epm_boot, sizeof(EPM_PART_BLOCK)); + + writer.Write(L"BootZ: Drive has been formatted Successfully.\r"); +#endif + + return YES; + } +} // namespace Boot diff --git a/dev/boot/BootKit/BootThread.h b/dev/boot/BootKit/BootThread.h new file mode 100644 index 00000000..6e48d190 --- /dev/null +++ b/dev/boot/BootKit/BootThread.h @@ -0,0 +1,43 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +namespace Boot +{ + using namespace NeOS; + + class BootThread; + + /// @brief Bootloader Thread class. + class BootThread final + { + public: + explicit BootThread() = delete; + ~BootThread() = default; + + explicit BootThread(NeOS::VoidPtr blob); + + BootThread& operator=(const BootThread&) = default; + BootThread(const BootThread&) = default; + + Int32 Start(HEL::BootInfoHeader* handover, BOOL is_own_stack); + void SetName(const char* name); + const char* GetName(); + bool IsValid(); + + private: + Char fBlobName[256U] = {"BootThread"}; + VoidPtr fStartAddress{nullptr}; + VoidPtr fBlob{nullptr}; + UInt8* fStack{nullptr}; + HEL::BootInfoHeader* fHandover{nullptr}; + }; +} // namespace Boot diff --git a/dev/boot/BootKit/Device.h b/dev/boot/BootKit/Device.h new file mode 100644 index 00000000..acdaa478 --- /dev/null +++ b/dev/boot/BootKit/Device.h @@ -0,0 +1,37 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include + +using namespace NeOS; + +/// @brief Device type. +class Device +{ +public: + explicit Device() = default; + virtual ~Device() = default; + + NE_MOVE_DEFAULT(Device); + + struct Trait + { + SizeT mBase{1024}; + SizeT mSize{1024}; + }; + + virtual Trait& Leak() = 0; + + virtual Device& Read(Char* Buf, const SizeT& SecCount) = 0; + virtual Device& Write(Char* Buf, const SizeT& SecCount) = 0; +}; + +typedef Device BootDevice; +typedef Device NetworkDevice; +typedef Device DiskDevice; diff --git a/dev/boot/BootKit/EPM.h b/dev/boot/BootKit/EPM.h new file mode 100644 index 00000000..cbadd597 --- /dev/null +++ b/dev/boot/BootKit/EPM.h @@ -0,0 +1,9 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include diff --git a/dev/boot/BootKit/HW/ATA.h b/dev/boot/BootKit/HW/ATA.h new file mode 100644 index 00000000..39b66db4 --- /dev/null +++ b/dev/boot/BootKit/HW/ATA.h @@ -0,0 +1,58 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include + +using namespace NeOS; + +class BootDeviceATA final : public Device +{ +public: + enum + { + kPrimary = ATA_PRIMARY_IO, + kSecondary = ATA_SECONDARY_IO, + }; + + explicit BootDeviceATA() noexcept; + ~BootDeviceATA() = default; + + NE_COPY_DELETE(BootDeviceATA); + + enum + { + kSectorSize = kATASectorSize + }; + + struct ATATrait final : public Device::Trait + { + UInt16 mBus{kPrimary}; + UInt8 mMaster{0}; + Boolean mErr{false}; + + operator bool() + { + return !mErr; + } + }; + +public: + operator bool(); + + SizeT GetSectorsCount() noexcept; + SizeT GetDiskSize() noexcept; + + BootDeviceATA& Read(Char* Buf, const SizeT& SecCount) override; + BootDeviceATA& Write(Char* Buf, const SizeT& SecCount) override; + + ATATrait& Leak() override; + +private: + ATATrait mTrait; +}; diff --git a/dev/boot/BootKit/HW/SATA.h b/dev/boot/BootKit/HW/SATA.h new file mode 100644 index 00000000..10868cd9 --- /dev/null +++ b/dev/boot/BootKit/HW/SATA.h @@ -0,0 +1,46 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include + +class BootDeviceSATA final +{ +public: + explicit BootDeviceSATA() noexcept; + ~BootDeviceSATA() = default; + + NE_COPY_DEFAULT(BootDeviceSATA); + + struct SATATrait final + { + NeOS::SizeT mBase{1024}; + NeOS::Boolean mErr{false}; + NeOS::Boolean mDetected{false}; + + operator bool() + { + return !this->mErr; + } + }; + + operator bool() + { + return this->Leak().mDetected; + } + + BootDeviceSATA& Read(NeOS::WideChar* Buf, const NeOS::SizeT& SecCount); + BootDeviceSATA& Write(NeOS::WideChar* Buf, const NeOS::SizeT& SecCount); + + SATATrait& Leak(); + +private: + SATATrait mTrait; +}; + +#define kAHCISectorSz 4096 diff --git a/dev/boot/BootKit/Platform.h b/dev/boot/BootKit/Platform.h new file mode 100644 index 00000000..e9bcfb2f --- /dev/null +++ b/dev/boot/BootKit/Platform.h @@ -0,0 +1,32 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +/** + @file Platform.h + @brief Platform specific code. +*/ + +#ifdef __x86_64__ + +#ifdef __cplusplus +#ifndef EXTERN_C +#define EXTERN_C extern "C" +#endif +#else +#ifndef EXTERN_C +#define EXTERN_C extern +#endif +#endif // __cplusplus + +EXTERN_C void rt_halt(); +EXTERN_C void rt_cli(); +EXTERN_C void rt_sti(); +EXTERN_C void rt_cld(); +EXTERN_C void rt_std(); + +#endif /* ifdef __x86_64__ */ diff --git a/dev/boot/BootKit/Protocol.h b/dev/boot/BootKit/Protocol.h new file mode 100644 index 00000000..3be42e74 --- /dev/null +++ b/dev/boot/BootKit/Protocol.h @@ -0,0 +1,10 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include diff --git a/dev/boot/BootKit/Qr.h b/dev/boot/BootKit/Qr.h new file mode 100644 index 00000000..d51c9c10 --- /dev/null +++ b/dev/boot/BootKit/Qr.h @@ -0,0 +1,973 @@ +#ifndef QR_H +#define QR_H + +#include +#include + +#include +#include +#include +#include + +/// @note the QR code is still code 128, it utilizes the same concept of having it's own character set. + +namespace qr +{ + inline uint8_t min_poly = + 0b11101, /* Minimal polynomial x^8 + x^4 + x^3 + x^2 + 1 */ + generator = 0b10; /* Generator of Galois field */ + + /// @brief galois finite field multiplication. + inline uint8_t gf_mul(uint8_t a, uint8_t b) + { + uint8_t res = 0; + + for (; b; b >>= 1) + { + if (b & 1) + res ^= a; + if (a & 0x80) + a = (a << 1) ^ min_poly; + else + a <<= 1; + } + + return res; + } + + // Size of Ecc block with respect to level and version. 0 version is for + // padding. + constexpr int ECC_CODEWORDS_PER_BLOCK[4][41] = { + {0, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, + 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, + {0, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, + 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28}, + {0, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, + 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, + {0, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, + 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, + }; + + // Number of Ecc blocks with respect to level and version. 0 version is for + // padding. + constexpr int N_ECC_BLOCKS[4][41] = { + {0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, + 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, + 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25}, + {0, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, + 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, + 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49}, + {0, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, + 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, + 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68}, + {0, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, + 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, + 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81}, + }; + + // Positions of central modules of alignment patterns according to version. 0 + // version is for padding. + constexpr int ALIGN_POS[41][7] = { + {}, + {0}, + {6, 18}, + {6, 22}, + {6, 26}, + {6, 30}, + {6, 34}, + {6, 22, 38}, + {6, 24, 42}, + {6, 26, 46}, + {6, 28, 50}, + {6, 30, 54}, + {6, 32, 58}, + {6, 34, 62}, + {6, 26, 46, 66}, + {6, 26, 48, 70}, + {6, 26, 50, 74}, + {6, 30, 54, 78}, + {6, 30, 56, 82}, + {6, 30, 58, 86}, + {6, 34, 62, 90}, + {6, 28, 50, 72, 94}, + {6, 26, 50, 74, 98}, + {6, 30, 54, 78, 102}, + {6, 28, 54, 80, 106}, + {6, 32, 58, 84, 110}, + {6, 30, 58, 86, 114}, + {6, 34, 62, 90, 118}, + {6, 26, 50, 74, 98, 122}, + {6, 30, 54, 78, 102, 126}, + {6, 26, 52, 78, 104, 130}, + {6, 30, 56, 82, 108, 134}, + {6, 34, 60, 86, 112, 138}, + {6, 30, 58, 86, 114, 142}, + {6, 34, 62, 90, 118, 146}, + {6, 30, 54, 78, 102, 126, 150}, + {6, 24, 50, 76, 102, 128, 154}, + {6, 28, 54, 80, 106, 132, 158}, + {6, 32, 58, 84, 110, 136, 162}, + {6, 26, 54, 82, 110, 138, 166}, + {6, 30, 58, 86, 114, 142, 170}, + }; + + // Return n-th bit of arr starting from MSB. + constexpr uint8_t get_bit_r(uint8_t* arr, int n) + { + return (arr[n >> 3] >> (7 - (n & 7))) & 1; + } + + // Add up to 16 bits to arr. Data starts from MSB as well as each byte of an + // array. + constexpr void add_bits(uint16_t data, int n, uint8_t* arr, size_t& pos) + { + while (n--) + { + arr[pos >> 3] |= ((data >> n) & 1) << (7 - (pos & 7)); + ++pos; + } + } + + // Translate char to alphanumeric encoding value, + constexpr int alphanumeric(char c) + { + if (c >= '0' && c <= '9') + return c - '0'; + + if (c >= 'A' && c <= 'Z') + return c - 'A' + 10; + + switch (c) + { + case ' ': + return 36; + case '$': + return 37; + case '%': + return 38; + case '*': + return 39; + case '+': + return 40; + case '-': + return 41; + case '.': + return 42; + case '/': + return 43; + case ':': + return 44; + } + return -1; + } + + // Check if string can be encoded in alphanumeric mode. + constexpr bool is_alphanumeric(const char* str, size_t len) + { + for (size_t i = 0; i < len; ++i) + if (alphanumeric(str[i]) == -1) + return false; + return true; + } + + // Check if string can be encoded in numeric mode. + constexpr bool is_numeric(const char* str, size_t len) + { + for (size_t i = 0; i < len; ++i) + if (str[i] < '0' || str[i] > '9') + return false; + return true; + } + + // Check if string can be encoded in kanji mode. + constexpr bool is_kanji(const char* str, size_t len) + { + for (size_t i = 0; i < len; i += 2) + { + uint16_t val = uint16_t(str[i]) | (uint16_t(str[i + 1]) << 8); + if (val < 0x8140 || val > 0xebbf || (val > 0x9ffc && val < 0xe040)) + return false; + } + return true; + } + + // Reed-Solomon Ecc generator polynomial for the given degree. + constexpr void gf_gen_poly(int degree, uint8_t* poly) + { + SetMem(poly, 0, degree); + + uint8_t root = poly[degree - 1] = 1; + + for (int i = 0; i < degree; ++i) + { + for (int j = 0; j < degree - 1; ++j) + poly[j] = gf_mul(poly[j], root) ^ poly[j + 1]; + poly[degree - 1] = gf_mul(poly[degree - 1], root); + root = (root << 1) ^ ((root >> 7) * 0x11d); + } + } + + // Polynomial division if Galois Field. + constexpr void gf_poly_div(uint8_t* dividend, size_t len, uint8_t* divisor, int degree, uint8_t* result) + { + SetMem(result, 0, degree); + + for (size_t i = 0; i < len; ++i) + { + uint8_t factor = dividend[i] ^ result[0]; + MoveMem(&result[0], &result[1], degree - 1); + result[degree - 1] = 0; + for (int j = 0; j < degree; ++j) + result[j] ^= gf_mul(divisor[j], factor); + } + } + + enum Ecc + { + L, + M, + Q, + H, + }; + + enum Mode + { + M_NUMERIC, + M_ALPHANUMERIC, + M_BYTE, + M_KANJI, + }; + + // Select appropriate encoding mode for string. + constexpr Mode select_mode(const char* str, size_t len) + { + if (is_numeric(str, len)) + return M_NUMERIC; + if (is_alphanumeric(str, len)) + return M_ALPHANUMERIC; + if (is_kanji(str, len)) + return M_KANJI; + return M_BYTE; + } + + // Return size of Character Control Indicator in bits for given version and + // mode. + constexpr int cci(int ver, Mode mode) + { + constexpr int cnt[4][3] = { + {10, 12, 14}, + {9, 11, 13}, + {8, 16, 16}, + {8, 10, 12}, + }; + if (ver < 10) + return cnt[mode][0]; + if (ver < 27) + return cnt[mode][1]; + return cnt[mode][2]; + } + + template + struct Qr + { + private: + friend class QrDelegate; + bool draw(int x, int y) noexcept; + + public: + constexpr auto side_size() const + { + return SIDE; + } + + bool module(int x, int y); + bool encode(const char* str, size_t len, Ecc ecc, int mask = -1); + + private: + bool encode_data(const char* data, size_t len, Ecc ecc, uint8_t* out); + void encode_ecc(uint8_t* data, Ecc ecc, uint8_t* out); + + void add_data(uint8_t* data, uint8_t* patterns); + void add_patterns(); + void add_version(); + void add_format(Ecc ecc, int mask); + void reserve_patterns(uint8_t* out); + + template + void draw_rect(int y, int x, int height, int width, uint8_t* out); + template + void draw_bound(int y, int x, int height, int width, uint8_t* out); + + template + int rule_1_3_score(); + int penalty_score(); + int select_mask(Ecc ecc, uint8_t* patterns); + void apply_mask(int mask, uint8_t* patterns); + + private: + static_assert(V >= 1 && V <= 40, "invalid version"); + static constexpr int SIDE = 17 + V * 4; + static constexpr int N_BITS = SIDE * SIDE; + static constexpr int N_ALIGN = V == 1 ? 0 : V / 7 + 2; + static constexpr int N_ALIGN_BITS = V > 1 ? (N_ALIGN* N_ALIGN - 3) * 25 : 0; + static constexpr int N_TIMING_BITS = + (SIDE - 16) * 2 - (10 * (V > 1 ? N_ALIGN - 2 : 0)); + static constexpr int N_VER_BITS = V > 6 ? 36 : 0; + static constexpr int N_DAT_BITS = + N_BITS - (192 + N_ALIGN_BITS + N_TIMING_BITS + 31 + N_VER_BITS); + static constexpr int N_BYTES = utl::bytes_in_bits(N_BITS); // Actual number of bytes_in_bits + // required to store whole Qr code + static constexpr int N_DAT_BYTES = utl::bytes_in_bits(N_DAT_BITS); // Actual number of bytes_in_bits required to store + // [data + ecc] + static constexpr int N_DAT_CAPACITY = + N_DAT_BITS >> 3; // Capacity of [data + ecc] without remainder bits + private: + /// @brief internal function to retrieve bit from a bitset. + uint8_t get_arr_bit(uint8_t* arr, unsigned bit) const + { + return utl::get_arr_bit(arr, bit); + } + + /// @brief internal function to set bit from a bitset. + void set_arr_bit(uint8_t* arr, unsigned bit) + { + utl::set_arr_bit(arr, bit); + } + + /// @brief internal function to clear bit from a bitset. + void clr_arr_bit(uint8_t* arr, unsigned bit) + { + utl::clr_arr_bit(arr, bit); + } + + uint8_t code[N_BYTES] = {}; + + bool status = false; + }; + + // Get color of a module from left-to-right and top-to-bottom. Black is true. + template + bool Qr::module(int x, int y) + { + return get_arr_bit(code, y * SIDE + x); + } + + /// @brief draw a new QR code. + template + bool Qr::draw(int whereX, int whereY) noexcept + { + if (!this->status) + return false; // it may be invalid. + + fb_init(); + + for (int y = 0; y < (this->side_size()); ++y) + { + for (int x = 0; x < (this->side_size()); ++x) + { + FBDrawInRegion( + (this->module(x, y) ? RGB(00, 00, 00) : RGB(0xFF, 0xFF, 0xFF)), + 1, 1, + x + whereX, y + whereY); + } + } + + fb_clear(); + + return false; + } + + // Create Qr code with given error correction level. If mask == -1, + // then best mask selected automatically. NOTE: Automatic mask is the + // most expensive operation. Takes about 95 % of all computation time. + template + bool Qr::encode(const char* str, size_t len, Ecc ecc, int mask) + { + uint8_t data[N_DAT_BYTES] = {}; + uint8_t data_with_ecc[N_DAT_BYTES] = {}; + uint8_t patterns[N_BYTES] = {}; + + if (!encode_data(str, len, ecc, data)) + { + return status = false; + } + + encode_ecc(data, ecc, data_with_ecc); + + reserve_patterns(patterns); + CopyMem(code, patterns, N_BYTES); + + add_data(data_with_ecc, patterns); + add_patterns(); + add_version(); + + mask = mask != -1 ? mask & 7 : select_mask(ecc, patterns); + + add_format(ecc, mask); + apply_mask(mask, patterns); + + return status = true; + } + + template + bool Qr::encode_data(const char* data, size_t len, Ecc ecc, uint8_t* out) + { + Mode mode = select_mode(data, len); + + size_t n_bits = + (N_DAT_CAPACITY - ECC_CODEWORDS_PER_BLOCK[ecc][V] * N_ECC_BLOCKS[ecc][V]) + << 3; + size_t pos = 0; + + add_bits(1 << mode, 4, out, pos); + add_bits(len, cci(V, mode), out, pos); + + if (mode == M_NUMERIC) + { + const size_t triplets = len / 3; + const size_t triplets_size = triplets * 3; + const size_t rem = len % 3; + const size_t rem_bits = rem == 2 ? 7 : rem == 1 ? 4 + : 0; + const size_t total_size = 10 * triplets + rem_bits; + + if (pos + total_size > n_bits) + return false; + + char buf[4] = {}; + + for (size_t i = 0; i < triplets_size; i += 3) + { + buf[0] = data[i]; + buf[1] = data[i + 1]; + buf[2] = data[i + 2]; + + uint16_t num = StringToLong(buf, NULL, 10); + add_bits(num, 10, out, pos); + } + + if (rem) + { + buf[0] = data[triplets_size]; + buf[1] = data[triplets_size + 1]; + buf[rem] = 0; + + uint16_t num = StringToLong(buf, NULL, 10); + add_bits(num, rem_bits, out, pos); + } + } + else if (mode == M_ALPHANUMERIC) + { + if (pos + 11 * (int(len & ~1ul) / 2) > n_bits) + return false; + + for (int i = 0; i < int(len & ~1ul); i += 2) + { + uint16_t num = alphanumeric(data[i]) * 45 + alphanumeric(data[i + 1]); + add_bits(num, 11, out, pos); + } + if (len & 1) + { + if (pos + 6 > n_bits) + return false; + + add_bits(alphanumeric(data[len - 1]), 6, out, pos); + } + } + else if (mode == M_BYTE) + { + if (pos + len * 8 > n_bits) + return false; + + for (size_t i = 0; i < len; ++i) + add_bits(data[i], 8, out, pos); + } + else + { + if (pos + 13 * (len / 2) > n_bits) + return false; + + for (size_t i = 0; i < len; i += 2) + { + uint16_t val = ((uint8_t)data[i]) | (((uint8_t)data[i + 1]) << 8); + uint16_t res = 0; + val -= val < 0x9FFC ? 0x8140 : 0xC140; + res += val & 0xff; + res += (val >> 8) * 0xc0; + add_bits(res, 13, out, pos); + } + } + + size_t padding = n_bits - pos; + size_t i = 0; + + add_bits(0, padding > 4 ? 4 : padding, out, pos); + + if (pos & 7) + add_bits(0, (8 - pos) & 7, out, pos); + + while (pos < n_bits) + add_bits(++i & 1 ? 0xec : 0x11, 8, out, pos); + + return true; + } + + template + void Qr::encode_ecc(uint8_t* data, Ecc ecc, uint8_t* out) + { + int n_blocks = N_ECC_BLOCKS[ecc][V]; + int ecc_len = ECC_CODEWORDS_PER_BLOCK[ecc][V]; + + int n_data_bytes = N_DAT_CAPACITY - ecc_len * n_blocks; + + int n_short_blocks = n_blocks - N_DAT_CAPACITY % n_blocks; + int short_len = N_DAT_CAPACITY / n_blocks - ecc_len; + + uint8_t gen_poly[30]; + uint8_t ecc_buf[30]; + + gf_gen_poly(ecc_len, gen_poly); + + uint8_t* data_ptr = data; + + for (int i = 0; i < n_blocks; ++i) + { + int data_len = short_len; + + if (i >= n_short_blocks) + ++data_len; + + gf_poly_div(data_ptr, data_len, gen_poly, ecc_len, ecc_buf); + + for (int j = 0, k = i; j < data_len; ++j, k += n_blocks) + { + if (j == short_len) + k -= n_short_blocks; + out[k] = data_ptr[j]; + } + for (int j = 0, k = n_data_bytes + i; j < ecc_len; ++j, k += n_blocks) + out[k] = ecc_buf[j]; + + data_ptr += data_len; + } + } + + template + void Qr::add_data(uint8_t* data, uint8_t* patterns) + { + int data_pos = 0; + + for (int x = SIDE - 1; x >= 1; x -= 2) + { + if (x == 6) + x = 5; + + for (int i = 0; i < SIDE; ++i) + { + int y = !((x + 1) & 2) ? SIDE - 1 - i : i; + int coord = y * SIDE + x; + + if (!get_arr_bit(patterns, coord)) + { + if (get_bit_r(data, data_pos)) + set_arr_bit(code, coord); + + ++data_pos; + } + + if (!get_arr_bit(patterns, coord - 1)) + { + if (get_bit_r(data, data_pos)) + set_arr_bit(code, coord - 1); + + ++data_pos; + } + } + } + } + + template + void Qr::add_patterns() + { + // White bounds inside finders + draw_bound(1, 1, 5, 5, code); + draw_bound(1, SIDE - 6, 5, 5, code); + draw_bound(SIDE - 6, 1, 5, 5, code); + + // Finish alignment patterns + for (int i = 0; i < N_ALIGN; ++i) + { + for (int j = 0; j < N_ALIGN; ++j) + { + if ((!i && !j) || (!i && j == N_ALIGN - 1) || (!j && i == N_ALIGN - 1)) + continue; + draw_bound(ALIGN_POS[V][i] - 1, ALIGN_POS[V][j] - 1, 3, 3, code); + } + } + + // Draw white separators + draw_rect(7, 0, 1, 8, code); + draw_rect(0, 7, 8, 1, code); + draw_rect(SIDE - 8, 0, 1, 8, code); + draw_rect(SIDE - 8, 7, 8, 1, code); + draw_rect(7, SIDE - 8, 1, 8, code); + draw_rect(0, SIDE - 8, 8, 1, code); + + // Perforate timing patterns + for (int i = 7; i < SIDE - 7; i += 2) + { + clr_arr_bit(code, 6 * SIDE + i); + clr_arr_bit(code, i * SIDE + 6); + } + } + + template + void Qr::add_version() + { + if (V < 7) + return; + + uint32_t rem = V; + + for (uint8_t i = 0; i < 12; ++i) + rem = (rem << 1) ^ ((rem >> 11) * 0x1F25); + + uint32_t data = V << 12 | rem; + + for (int x = 0; x < 6; ++x) + { + for (int j = 0; j < 3; ++j) + { + int y = SIDE - 11 + j; + + bool black = (data >> (x * 3 + j)) & 1; + + if (!black) + { + clr_arr_bit(code, y * SIDE + x); + clr_arr_bit(code, y + SIDE * x); + } + } + } + } + + template + void Qr::add_format(Ecc ecc, int mask) + { + int data = (ecc ^ 1) << 3 | mask; + int rem = data; + + for (int i = 0; i < 10; i++) + rem = (rem << 1) ^ ((rem >> 9) * 0b10100110111); + + int res = (data << 10 | rem) ^ 0b101010000010010; + + for (int i = 0; i < 6; ++i) + { + if ((res >> i) & 1) + { + set_arr_bit(code, SIDE * 8 + SIDE - 1 - i); + set_arr_bit(code, SIDE * i + 8); + } + else + { + clr_arr_bit(code, SIDE * 8 + SIDE - 1 - i); + clr_arr_bit(code, SIDE * i + 8); + } + } + + for (int i = 6; i < 8; ++i) + { + if ((res >> i) & 1) + { + set_arr_bit(code, SIDE * 8 + SIDE - 1 - i); + set_arr_bit(code, SIDE * (i + 1) + 8); + } + else + { + clr_arr_bit(code, SIDE * 8 + SIDE - 1 - i); + clr_arr_bit(code, SIDE * (i + 1) + 8); + } + } + + if ((res >> 8) & 1) + { + set_arr_bit(code, SIDE * 8 + 7); + set_arr_bit(code, SIDE * (SIDE - 7) + 8); + } + else + { + clr_arr_bit(code, SIDE * 8 + 7); + clr_arr_bit(code, SIDE * (SIDE - 7) + 8); + } + + for (int i = 9, j = 5; i < 15; ++i, --j) + { + if ((res >> i) & 1) + { + set_arr_bit(code, SIDE * 8 + j); + set_arr_bit(code, SIDE * (SIDE - 1 - j) + 8); + } + else + { + clr_arr_bit(code, SIDE * 8 + j); + clr_arr_bit(code, SIDE * (SIDE - 1 - j) + 8); + } + } + } + + template + template + void Qr::draw_rect(int y, int x, int height, int width, uint8_t* out) + { + if (B) + { + for (int dy = y * SIDE; dy < (y + height) * SIDE; dy += SIDE) + for (int dx = x; dx < x + width; ++dx) + set_arr_bit(out, dy + dx); + } + else + { + for (int dy = y * SIDE; dy < (y + height) * SIDE; dy += SIDE) + for (int dx = x; dx < x + width; ++dx) + clr_arr_bit(out, dy + dx); + } + } + + template + template + void Qr::draw_bound(int y, int x, int height, int width, uint8_t* out) + { + if (B) + { + for (int i = y * SIDE + x; i < y * SIDE + x + width; ++i) + set_arr_bit(out, i); + for (int i = (y + height - 1) * SIDE + x; + i < (y + height - 1) * SIDE + x + width; ++i) + set_arr_bit(out, i); + for (int i = (y + 1) * SIDE + x; i < (y + height - 1) * SIDE + x; i += SIDE) + set_arr_bit(out, i); + for (int i = (y + 1) * SIDE + x + width - 1; + i < (y + height - 1) * SIDE + x + width - 1; i += SIDE) + set_arr_bit(out, i); + } + else + { + for (int i = y * SIDE + x; i < y * SIDE + x + width; ++i) + clr_arr_bit(out, i); + for (int i = (y + height - 1) * SIDE + x; + i < (y + height - 1) * SIDE + x + width; ++i) + clr_arr_bit(out, i); + for (int i = (y + 1) * SIDE + x; i < (y + height - 1) * SIDE + x; i += SIDE) + clr_arr_bit(out, i); + for (int i = (y + 1) * SIDE + x + width - 1; + i < (y + height - 1) * SIDE + x + width - 1; i += SIDE) + clr_arr_bit(out, i); + } + } + + template + void Qr::reserve_patterns(uint8_t* out) + { + draw_rect(0, 6, SIDE, 1, out); + draw_rect(6, 0, 1, SIDE, out); + + draw_rect(0, 0, 9, 9, out); + draw_rect(SIDE - 8, 0, 8, 9, out); + draw_rect(0, SIDE - 8, 9, 8, out); + + for (int i = 0; i < N_ALIGN; ++i) + { + for (int j = 0; j < N_ALIGN; ++j) + { + if ((!i && !j) || (!i && j == N_ALIGN - 1) || (!j && i == N_ALIGN - 1)) + continue; + draw_rect(ALIGN_POS[V][i] - 2, ALIGN_POS[V][j] - 2, 5, 5, out); + } + } + + if (V >= 7) + { + draw_rect(SIDE - 11, 0, 3, 6, out); + draw_rect(0, SIDE - 11, 6, 3, out); + } + } + + template + template + int Qr::rule_1_3_score() + { + constexpr int y_max = H ? N_BITS : SIDE; + constexpr int x_max = H ? SIDE : N_BITS; + constexpr int y_step = H ? SIDE : 1; + constexpr int x_step = H ? 1 : SIDE; + + int res = 0; + + for (int y = 0; y < y_max; y += y_step) + { + bool color = get_arr_bit(code, y); + int finder = color; + int cnt = 1; + for (int x = 1; x < x_max; x += x_step) + { + if (get_arr_bit(code, y + x) == color) + { + ++cnt; + if (cnt == 5) + res += 3; + if (cnt > 5) + ++res; + } + else + { + color = !color; + cnt = 1; + } + // Finder-like + finder = ((finder << 1) & 0x7ff) | color; + if (x >= x_step * 10) + { + if (finder == 0x05d || finder == 0x5d0) + res += 40; + } + } + } + return res; + } + + template + int Qr::penalty_score() + { + int res = 0; + + res += rule_1_3_score(); + res += rule_1_3_score(); + + for (int y = 0; y < N_BITS - SIDE; y += SIDE) + { + for (int x = 0; x < SIDE - 1; ++x) + { + bool c = get_arr_bit(code, y + x); + + if (c == get_arr_bit(code, y + x + 1) && + c == get_arr_bit(code, y + x + SIDE) && + c == get_arr_bit(code, y + x + SIDE + 1)) + res += 3; + } + } + + int black = 0; + for (int y = 0; y < N_BITS; y += SIDE) + { + for (int x = 0; x < SIDE; ++x) + black += get_arr_bit(code, y + x); + } + res += abs((black * 100) / N_BITS - 50) / 5 * 10; + + return res; + } + + template + int Qr::select_mask(Ecc ecc, uint8_t* patterns) + { + unsigned min_score = -1; + unsigned score = 0; + uint8_t mask = 0; + + for (int i = 0; i < 8; ++i) + { + add_format(ecc, i); + apply_mask(i, patterns); + score = penalty_score(); + if (score < min_score) + { + mask = i; + min_score = score; + } + apply_mask(i, patterns); + } + return mask; + } + + template + void Qr::apply_mask(int mask, uint8_t* patterns) + { + for (int y = 0, dy = 0; y < SIDE; ++y, dy += SIDE) + { + for (int x = 0; x < SIDE; ++x) + { + int coord = dy + x; + + if (get_arr_bit(patterns, coord)) + continue; + + bool keep = true; + + switch (mask) + { + case 0: + keep = (x + y) & 1; + break; + case 1: + keep = y & 1; + break; + case 2: + keep = x % 3; + break; + case 3: + keep = (x + y) % 3; + break; + case 4: + keep = (y / 2 + x / 3) & 1; + break; + case 5: + keep = x * y % 2 + x * y % 3; + break; + case 6: + keep = (x * y % 2 + x * y % 3) & 1; + break; + case 7: + keep = ((x + y) % 2 + x * y % 3) & 1; + break; + } + + if (!keep) + { + if (get_arr_bit(code, coord)) + clr_arr_bit(code, coord); + else + set_arr_bit(code, coord); + } + } + } + } + + /// @brief QR code encoder class. + class QrDelegate final + { + public: + explicit QrDelegate() = default; + ~QrDelegate() = default; + + NE_COPY_DEFAULT(QrDelegate); + + /// @brief Draw method delegate. + template + bool draw(Qr& subject, int x, int y) noexcept + { + return subject.draw(x, y); + } + }; +} // namespace qr + +namespace NeOS::Qr +{ + using namespace qr; +} // namespace NeOS::Qr + +#endif // QR_H \ No newline at end of file diff --git a/dev/boot/BootKit/QrPrelude.h b/dev/boot/BootKit/QrPrelude.h new file mode 100644 index 00000000..e89fad7a --- /dev/null +++ b/dev/boot/BootKit/QrPrelude.h @@ -0,0 +1 @@ +#include \ No newline at end of file diff --git a/dev/boot/BootKit/Rsrc/zka_disk.rsrc b/dev/boot/BootKit/Rsrc/zka_disk.rsrc new file mode 100644 index 00000000..61fd48dd --- /dev/null +++ b/dev/boot/BootKit/Rsrc/zka_disk.rsrc @@ -0,0 +1,116 @@ +#define NE_DISK_HEIGHT 110 +#define NE_DISK_WIDTH 110 + +// array size is 36300 +static const unsigned int zka_disk[] = { + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x333333, 0x565656, 0x636363, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6a6a6a, 0x5f5f5f, 0x4d4d4d, 0x2b2b2b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x464646, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x6a6a6a, 0x3b3b3b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x3d3d3d, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x252525, 0x676767, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x606060, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x3d3d3d, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x616161, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x525252, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x242424, 0x767676, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x393939, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7e7e7e, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4e4e4e, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x3f3f3f, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x666666, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x555555, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x222222, 0x7c7c7c, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x6d6d6d, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x393939, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x868686, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x515151, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x404040, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x6a6a6a, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x828282, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x727272, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x383838, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x8e8e8e, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x525252, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x414141, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x6e6e6e, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x5c5c5c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x868686, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x787878, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x373737, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x959595, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0x444444, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x707070, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0x5e5e5e, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x8b8b8b, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0x7c7c7c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x363636, 0xa7a7a7, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0x9c9c9c, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x717171, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0x636363, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x8e8e8e, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0x818181, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x343434, 0xacacac, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xa3a3a3, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0x484848, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x727272, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x909090, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0x868686, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x313131, 0xb0b0b0, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xa9a9a9, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x525252, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0x494949, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x727272, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0x6a6a6a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x929292, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0x8c8c8c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x2e2e2e, 0xb4b4b4, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xafafaf, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x505050, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0x4b4b4b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x717171, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0x6e6e6e, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x939393, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0x929292, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x2a2a2a, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x4c4c4c, 0x4c4c4c, 0x4c4c4c, 0x4b4b4b, 0x4b4b4b, 0x4b4b4b, 0x4b4b4b, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x494949, 0x494949, 0x494949, 0x494949, 0x484848, 0x484848, 0x484848, 0x484848, 0x474747, 0x474747, 0x474747, 0x464646, 0x464646, 0x464646, 0x464646, 0x454545, 0x454545, 0x454545, 0x454545, 0x444444, 0x444444, 0x444444, 0x444444, 0x434343, 0x434343, 0x434343, 0x434343, 0x424242, 0x424242, 0x424242, 0x414141, 0x414141, 0x414141, 0x414141, 0x404040, 0x404040, 0x404040, 0x404040, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3b3b3b, 0x3b3b3b, 0x3b3b3b, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x393939, 0x393939, 0x393939, 0x393939, 0x383838, 0x383838, 0x383838, 0x383838, 0x373737, 0x373737, 0x373737, 0x373737, 0x363636, 0x363636, 0x363636, 0x353535, 0x353535, 0x353535, 0x353535, 0x343434, 0x343434, 0x343434, 0x343434, 0x333333, 0x333333, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x949494, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0x9f9f9f, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x868686, 0x868686, 0x848484, 0x848484, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa3a3a3, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x999999, 0x979797, 0x979797, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x949494, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0x9f9f9f, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa3a3a3, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x999999, 0x979797, 0x979797, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x949494, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0x9f9f9f, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xc6c6c6, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x868686, 0x868686, 0x848484, 0x848484, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x565656, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x9a9a9a, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa3a3a3, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x797979, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x999999, 0x979797, 0x979797, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x353535, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xbfbfbf, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x949494, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x464646, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0x9f9f9f, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x7f7f7f, 0xbababa, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x626262, 0x484848, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x3a3a3a, 0x4b4b4b, 0x4b4b4b, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x494949, 0x494949, 0x494949, 0x494949, 0x484848, 0x484848, 0x484848, 0x484848, 0x474747, 0x474747, 0x474747, 0x464646, 0x464646, 0x464646, 0x464646, 0x454545, 0x454545, 0x454545, 0x454545, 0x444444, 0x444444, 0x444444, 0x444444, 0x434343, 0x434343, 0x434343, 0x424242, 0x424242, 0x424242, 0x424242, 0x414141, 0x414141, 0x414141, 0x414141, 0x404040, 0x404040, 0x404040, 0x404040, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3b3b3b, 0x3b3b3b, 0x3b3b3b, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x393939, 0x393939, 0x393939, 0x393939, 0x383838, 0x383838, 0x383838, 0x383838, 0x373737, 0x373737, 0x373737, 0x373737, 0x363636, 0x363636, 0x363636, 0x353535, 0x353535, 0x353535, 0x353535, 0x272727, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020 +}; \ No newline at end of file diff --git a/dev/boot/BootKit/Rsrc/zka_has_disk.rsrc b/dev/boot/BootKit/Rsrc/zka_has_disk.rsrc new file mode 100644 index 00000000..4ede8a65 --- /dev/null +++ b/dev/boot/BootKit/Rsrc/zka_has_disk.rsrc @@ -0,0 +1,116 @@ +#define NE_HAS_DISK_HEIGHT 110 +#define NE_HAS_DISK_WIDTH 110 + +// array size is 36300 +static const unsigned int zka_has_disk[] = { + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x333333, 0x565656, 0x636363, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6a6a6a, 0x5f5f5f, 0x4d4d4d, 0x2b2b2b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x464646, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x6a6a6a, 0x3b3b3b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x3d3d3d, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x252525, 0x676767, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x606060, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x3d3d3d, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x616161, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x525252, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x242424, 0x767676, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x393939, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7e7e7e, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4e4e4e, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x3f3f3f, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x666666, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x555555, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x222222, 0x7c7c7c, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x6d6d6d, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x393939, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x868686, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x515151, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x404040, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x6a6a6a, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x89948e, 0x7ba08a, 0x6eaa87, 0x6cab87, 0x6cab87, 0x6caa87, 0x6caa87, 0x6da888, 0x799f8a, 0x89938e, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x828282, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x8c9590, 0x72ab88, 0x61b883, 0x52c37f, 0x4bc87e, 0x4ac77e, 0x4ac67e, 0x49c57e, 0x48c47f, 0x47c37f, 0x47c37f, 0x46c17f, 0x46c180, 0x45c07f, 0x4cba82, 0x5cb085, 0x6fa58a, 0x8c9490, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x727272, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x383838, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x899d90, 0x69b686, 0x4ecb7e, 0x4dca7e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x4ac67f, 0x49c57f, 0x48c47f, 0x47c37f, 0x47c280, 0x46c180, 0x46c080, 0x45bf80, 0x44bf81, 0x43be81, 0x43bd81, 0x42bc81, 0x62ac89, 0x869a91, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x8e8e8e, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x525252, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x86a390, 0x61be83, 0x4ecb7d, 0x4dca7d, 0x4cca7e, 0x4bc87e, 0x4bc87e, 0x4ac77e, 0x4ac67e, 0x49c57e, 0x48c47f, 0x48c37f, 0x47c37f, 0x46c17f, 0x46c180, 0x45c080, 0x45bf80, 0x44be80, 0x43bd80, 0x42bc80, 0x42bc81, 0x41ba81, 0x41ba81, 0x40b981, 0x57af87, 0x839d92, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x414141, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x6e6e6e, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x929e96, 0x68bb87, 0x4fcd7e, 0x4ecc7d, 0x4ecb7e, 0x4dca7e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x4ac67f, 0x49c57f, 0x48c480, 0x47c380, 0x47c280, 0x46c180, 0x46c080, 0x45bf80, 0x44bf81, 0x43be81, 0x43bd81, 0x42bc81, 0x42bb82, 0x41ba82, 0x40b982, 0x40b882, 0x3fb882, 0x3eb782, 0x5fab8b, 0x919b97, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x5c5c5c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x868686, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x88a893, 0x55c97f, 0x4ecc7d, 0x4ecb7d, 0x4dca7d, 0x4cc97e, 0x4bc87e, 0x4bc87e, 0x4ac77e, 0x4ac67e, 0x49c57e, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x46c180, 0x45c080, 0x44bf80, 0x44be80, 0x43bd80, 0x42bc80, 0x42bb81, 0x41ba81, 0x41ba81, 0x40b981, 0x3fb882, 0x3eb782, 0x3eb682, 0x3db582, 0x3db482, 0x45b185, 0x83a195, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x787878, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x373737, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x7bb48f, 0x4fcd7d, 0x4fcc7d, 0x4ecb7d, 0x4dcb7e, 0x4cca7e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x49c57f, 0x49c47f, 0x48c480, 0x47c37f, 0x47c280, 0x46c180, 0x46c080, 0x45bf80, 0x44bf81, 0x43bd81, 0x43bd81, 0x42bc81, 0x42bb82, 0x41ba82, 0x40b982, 0x3fb882, 0x3fb882, 0x3eb682, 0x3eb683, 0x3db583, 0x3cb483, 0x3cb383, 0x3bb284, 0x74a693, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x959595, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0x76b88e, 0x4fcd7d, 0x4ecc7d, 0x4ecb7d, 0x4dca7d, 0x4cca7e, 0x4bc87e, 0x4bc87e, 0x4ac77e, 0x4ac67f, 0x49c57e, 0x48c47f, 0x48c37f, 0x47c37f, 0x46c17f, 0x46c180, 0x45c080, 0x45bf80, 0x44be80, 0x43bd81, 0x42bc81, 0x42bc81, 0x41ba81, 0x41ba81, 0x40b981, 0x3fb882, 0x3eb782, 0x3eb682, 0x3db582, 0x3db583, 0x3cb383, 0x3bb383, 0x3ab283, 0x3ab183, 0x39b083, 0x6fa893, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0x444444, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x707070, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0x79ba90, 0x4fcd7d, 0x4fcd7e, 0x4ecb7e, 0x4dcb7e, 0x4dca7e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x4ac67f, 0x49c47f, 0x48c480, 0x47c380, 0x47c280, 0x46c180, 0x46c080, 0x45bf80, 0x44bf81, 0x43bd81, 0x43bd81, 0x42bc81, 0x42bb82, 0x41ba82, 0x40b982, 0x40b882, 0x3fb883, 0x3eb682, 0x3eb683, 0x3db583, 0x3cb483, 0x3cb383, 0x3bb284, 0x3ab184, 0x3ab184, 0x39af84, 0x38af85, 0x6da894, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0x5e5e5e, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x8b8b8b, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0x7db892, 0x4fcd7d, 0x4ecc7d, 0x4ecb7d, 0x4dca7d, 0x4cc97e, 0x4bc87e, 0x4bc87e, 0x4ac67e, 0x4ac67e, 0x49c57e, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x46c180, 0x45bf80, 0x44bf80, 0x43be80, 0x43bd80, 0x42bc80, 0x42bb81, 0x41ba81, 0x40ba81, 0x3fb881, 0x3fb882, 0x3eb782, 0x3eb682, 0x3db582, 0x3cb482, 0x3cb382, 0x3bb383, 0x3ab183, 0x3ab183, 0x39b083, 0x39af84, 0x38ae84, 0x37ad84, 0x36ac84, 0x74a897, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0x7c7c7c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x363636, 0xa7a7a7, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0x90b39d, 0x4fcd7d, 0x4fcc7d, 0x4ecb7d, 0x4dcb7e, 0x4cc97e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x49c57f, 0x48c47f, 0x48c480, 0x47c27f, 0x47c280, 0x46c180, 0x45c080, 0x44bf80, 0x44be81, 0x43bd81, 0x43bd81, 0x42bb81, 0x41bb82, 0x41ba82, 0x40b982, 0x3fb882, 0x3fb782, 0x3eb682, 0x3eb683, 0x3db483, 0x3cb483, 0x3bb383, 0x3bb284, 0x3ab184, 0x3ab084, 0x39af84, 0x38af84, 0x37ad84, 0x37ad85, 0x36ac85, 0x36ab85, 0x8aa99f, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0x9c9c9c, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xa2afa6, 0x56ca80, 0x4ecc7d, 0x4ecb7d, 0x4dca7d, 0x4cc97e, 0x4bc87e, 0x4bc87e, 0x4ac67e, 0x4ac67f, 0x49c57e, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x46c180, 0x45bf80, 0x44bf80, 0x43be80, 0x43bd81, 0x42bc81, 0x42bb81, 0x41ba81, 0x40ba81, 0x40b881, 0x3fb882, 0x3eb782, 0x3eb682, 0x3db582, 0x3db483, 0x3cb383, 0x3bb383, 0x3ab183, 0x3ab183, 0x39b083, 0x39af84, 0x38ae84, 0x37ad84, 0x36ac84, 0x36ac85, 0x35ab85, 0x35aa85, 0x3ea988, 0xa2aba8, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x717171, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0x70c28e, 0x4fcc7e, 0x4ecb7e, 0x4dcb7e, 0x4cca7e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x49c57f, 0x48c47f, 0x48c480, 0x47c380, 0x47c280, 0x46c180, 0x45c080, 0x45bf80, 0x44be81, 0x43bd81, 0x43bd81, 0x42bc81, 0x42bb82, 0x41ba82, 0x40b982, 0x3fb882, 0x3fb783, 0x3eb682, 0x3eb683, 0x3db583, 0x3cb483, 0x3bb383, 0x3bb284, 0x3ab184, 0x3ab084, 0x39af84, 0x38af85, 0x38ae85, 0x37ad85, 0x36ac85, 0x36ab85, 0x35aa85, 0x34a986, 0x34a886, 0x63aa96, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0x636363, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x8e8e8e, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0x9bb6a5, 0x4ecc7d, 0x4dcb7d, 0x4cca7d, 0x4cc97e, 0x4bc87e, 0x4bc77e, 0x4ac67e, 0x49c67e, 0x49c57e, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x46c080, 0x45bf80, 0x44bf80, 0x43be80, 0x43bd81, 0x42bc80, 0x42bb81, 0x41ba81, 0x40b981, 0x3fb881, 0x3fb882, 0x3eb782, 0x3eb682, 0x3db582, 0x3cb483, 0x3bb383, 0x3bb283, 0x3ab183, 0x3ab183, 0x39b083, 0x38af84, 0x37ae84, 0x37ad84, 0x36ac84, 0x36ab85, 0x35aa85, 0x34aa85, 0x34a985, 0x33a885, 0x32a785, 0x32a686, 0x9baea9, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0x818181, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x343434, 0xacacac, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0x68c68b, 0x4ecb7d, 0x4dcb7e, 0x4cc97e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x49c57f, 0x48c47f, 0x48c480, 0x47c27f, 0x47c280, 0x46c180, 0x45c080, 0x44bf80, 0x44be81, 0x43bd81, 0x43bd81, 0x42bb81, 0x41bb82, 0x41ba82, 0x40b982, 0x3fb882, 0x3fb782, 0x3eb682, 0x3eb683, 0x3db483, 0x3cb483, 0x3bb383, 0x3bb284, 0x3ab184, 0x3ab084, 0x39af84, 0x38af85, 0x37ad84, 0x37ad85, 0x36ac85, 0x36ab85, 0x35aa85, 0x34a986, 0x33a886, 0x33a886, 0x32a686, 0x32a687, 0x57a993, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xa3a3a3, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xa0baaa, 0x4dcb7d, 0x4dca7d, 0x4cc97e, 0x4bc87e, 0x4bc77e, 0x4ac67e, 0x4ac67f, 0x49c57e, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x46c080, 0x45bf80, 0x44bf80, 0x43be80, 0x43bd81, 0x42bc81, 0x42bb81, 0x41ba81, 0x40b981, 0x3fb881, 0x3fb882, 0x3eb782, 0x3eb682, 0x3db582, 0x3cb483, 0x3bb383, 0x3bb283, 0x3ab183, 0x3ab184, 0x39b083, 0x38af84, 0x38ae84, 0x37ad84, 0x36ac84, 0x36ab85, 0x35aa85, 0x35aa85, 0x34a985, 0x33a886, 0x32a786, 0x32a686, 0x31a586, 0x31a486, 0x30a386, 0x9eb2ad, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0x484848, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x727272, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0x72c592, 0x4dcb7e, 0x4cc97e, 0x4cc97e, 0x4bc87e, 0x4bc77f, 0x4ac67f, 0x49c57f, 0x48c47f, 0x48c480, 0x47c280, 0x47c280, 0x46c180, 0x45c080, 0x45bf81, 0x44be81, 0x43bd81, 0x43bd81, 0x42bb81, 0x42bb82, 0x41ba82, 0x40b982, 0x3fb882, 0x3fb783, 0x3eb682, 0x3eb683, 0x3db483, 0x3cb483, 0x3bb383, 0x3bb284, 0x3ab184, 0x3ab084, 0x39af84, 0x38af85, 0x37ad85, 0x37ad85, 0x36ac85, 0x36ab85, 0x35aa85, 0x34a986, 0x33a886, 0x33a886, 0x32a686, 0x32a687, 0x31a587, 0x30a487, 0x30a387, 0x60aa99, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x909090, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xb3bbb6, 0x50c97f, 0x4cc97e, 0x4bc87e, 0x4bc77e, 0x4ac67e, 0x49c57e, 0x48c47e, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x45c080, 0x44bf80, 0x44be80, 0x43bd80, 0x43bd81, 0x42bc80, 0x41bb81, 0x41ba81, 0x40b981, 0x3fb881, 0x3fb782, 0x3eb682, 0x3eb682, 0x3db582, 0x3cb482, 0x3bb383, 0x3bb283, 0x3ab183, 0x3ab083, 0x39af83, 0x38af84, 0x37ae84, 0x51b894, 0x8ed1b9, 0x50b694, 0x35aa85, 0x34a985, 0x33a885, 0x33a885, 0x32a785, 0x32a686, 0x31a586, 0x30a486, 0x2fa386, 0x2fa387, 0x2ea187, 0x32a289, 0xb4b9b8, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0x868686, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x313131, 0xb0b0b0, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0x92c2a5, 0x4cc97e, 0x4cc97e, 0x4bc77e, 0x4ac77f, 0x4ac67f, 0x49c57f, 0x48c47f, 0x48c380, 0x47c27f, 0x46c280, 0x46c080, 0x45c080, 0x44bf80, 0x44be81, 0x43bd81, 0x43bc81, 0x42bb81, 0x41bb82, 0x40ba82, 0x40b982, 0x3fb882, 0x3fb782, 0x3eb682, 0x3db583, 0x3cb483, 0x3cb483, 0x3bb383, 0x3bb284, 0x3ab184, 0x39b084, 0x39af84, 0x38ae85, 0x6bc3a4, 0xf4fcf6, 0xfbfffa, 0xf3fbf5, 0x54b797, 0x34a986, 0x33a886, 0x33a786, 0x32a686, 0x31a686, 0x31a587, 0x30a487, 0x2fa387, 0x2fa287, 0x2ea187, 0x2ea088, 0x86b2a9, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xa9a9a9, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x525252, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0x74c695, 0x4bc87e, 0x4bc77e, 0x4ac67e, 0x49c67f, 0x48c47f, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x45c080, 0x45bf80, 0x44bf80, 0x43bd80, 0x43bd81, 0x42bc81, 0x42bb81, 0x41ba81, 0x40b981, 0x3fb881, 0x3fb882, 0x3eb682, 0x3eb682, 0x3db582, 0x3cb483, 0x3bb383, 0x3bb283, 0x3ab183, 0x3ab184, 0x39af83, 0x38af84, 0x37ae84, 0x6ac3a3, 0xf4fcf5, 0xfafff8, 0xfafff8, 0xfafff8, 0x9ed7c3, 0x33a886, 0x32a786, 0x32a686, 0x31a586, 0x30a486, 0x30a386, 0x2fa387, 0x2ea187, 0x2ea187, 0x2da087, 0x2d9f88, 0x61aa9c, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0x494949, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x727272, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0x57c885, 0x4bc77e, 0x4ac77f, 0x4ac67f, 0x49c57f, 0x48c47f, 0x48c380, 0x47c280, 0x47c280, 0x46c080, 0x45c080, 0x44bf80, 0x44be81, 0x43bd81, 0x43bc81, 0x42bb81, 0x41bb82, 0x40b982, 0x40b982, 0x3fb882, 0x3fb783, 0x3eb683, 0x3db583, 0x3db483, 0x3cb483, 0x3bb383, 0x3bb284, 0x3ab184, 0x3ab084, 0x39af84, 0x38ae85, 0x6ac3a3, 0xf5fdf5, 0xf9fff7, 0xf9fff7, 0xf9fff7, 0xf9fff6, 0x83cbb4, 0x33a786, 0x32a686, 0x32a687, 0x31a587, 0x30a487, 0x2fa387, 0x2fa288, 0x2ea187, 0x2ea088, 0x2d9f88, 0x2c9f88, 0x3ea28f, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0x6a6a6a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x929292, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xb9c4be, 0x4bc77e, 0x4ac67e, 0x49c57e, 0x48c47e, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x45c080, 0x44bf80, 0x44be80, 0x43bd80, 0x43bd81, 0x42bc80, 0x41bb81, 0x41ba81, 0x40b981, 0x3fb881, 0x3fb782, 0x3eb682, 0x3db682, 0x3db582, 0x3cb483, 0x3bb383, 0x3bb283, 0x3ab183, 0x39b083, 0x39af83, 0x38af84, 0x37ae84, 0x6ac2a2, 0xf1fcf2, 0xf8fff5, 0xf7fff5, 0xf7fff5, 0xf7fff4, 0xc3e8d7, 0x36a987, 0x32a686, 0x31a586, 0x30a486, 0x2fa386, 0x2fa287, 0x2ea187, 0x2ea187, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2a9c88, 0xbcc2c1, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0x8c8c8c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x2e2e2e, 0xb4b4b4, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xa9c7b6, 0x4ac77f, 0x49c67f, 0x49c57f, 0x48c47f, 0x48c380, 0x47c280, 0x46c180, 0x46c080, 0x45c080, 0x44bf80, 0x44be81, 0x43bd81, 0x43bc81, 0x42bb81, 0x41ba82, 0x40b982, 0x40b982, 0x3fb882, 0x3fb782, 0x3eb682, 0x3db583, 0x3cb483, 0x3cb383, 0x3bb283, 0x3bb284, 0x3ab184, 0x39b084, 0x38af84, 0x38ae85, 0x69c2a1, 0xf2fcf1, 0xf7fff4, 0xf7fff4, 0xf7fff3, 0xf7fff3, 0xc4e8d7, 0x39aa89, 0x32a686, 0x31a587, 0x31a487, 0x30a487, 0x2fa387, 0x2fa287, 0x2ea187, 0x2ea088, 0x2d9f88, 0x2c9e88, 0x2b9d88, 0x2b9d89, 0x2a9c89, 0xa6beba, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xafafaf, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x505050, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0x99c8ad, 0x49c57f, 0x48c47f, 0x48c47f, 0x47c37f, 0x47c27f, 0x46c17f, 0x45c080, 0x45bf80, 0x44bf80, 0x43bd80, 0x43bd81, 0x42bc81, 0x41bb81, 0x4cbe88, 0x6dca9e, 0x40b882, 0x3fb882, 0x3eb682, 0x3db682, 0x3db582, 0x3cb483, 0x3bb383, 0x3bb283, 0x3ab183, 0x3ab184, 0x39af83, 0x38af84, 0x37ae84, 0x69c2a1, 0xeffcef, 0xf6fff3, 0xf5fff2, 0xf5fff2, 0xf5fff1, 0xc3e8d5, 0x39aa8a, 0x32a686, 0x31a586, 0x30a486, 0x30a386, 0x2fa387, 0x2ea187, 0x2ea187, 0x2da087, 0x2d9f88, 0x2c9e88, 0x2b9d88, 0x2a9c88, 0x2a9c89, 0x299a88, 0x93bab4, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0x4b4b4b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x717171, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0x93caab, 0x49c57f, 0x48c47f, 0x48c380, 0x47c280, 0x47c280, 0x46c080, 0x45c081, 0x44bf81, 0x44be81, 0x43bd81, 0x43bc81, 0x42bb81, 0x63c898, 0xe7f8ec, 0xf9fff7, 0xcdeedb, 0x4bbc8b, 0x3eb683, 0x3db583, 0x3cb483, 0x3cb483, 0x3bb283, 0x3bb284, 0x3ab184, 0x39b084, 0x38af84, 0x38ae85, 0x65c1a0, 0xeffcee, 0xf5fff1, 0xf5fff1, 0xf5fff1, 0xf5fff1, 0xc2e8d5, 0x3aaa8a, 0x32a686, 0x32a687, 0x31a487, 0x30a487, 0x2fa387, 0x2fa288, 0x2ea187, 0x2ea088, 0x2d9f88, 0x2c9f88, 0x2b9d88, 0x2b9d89, 0x2a9c89, 0x2a9b89, 0x299a89, 0x89b8b1, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0x6e6e6e, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x939393, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0x8cc9a7, 0x48c47f, 0x47c27f, 0x46c27f, 0x46c17f, 0x45c080, 0x44bf80, 0x44be80, 0x43bd80, 0x43bd81, 0x42bb80, 0x41bb81, 0x40ba81, 0xb8e6cd, 0xf7fff5, 0xf7fff5, 0xf7fff4, 0xd2f1de, 0x48b989, 0x3cb483, 0x3bb383, 0x3bb283, 0x3ab183, 0x39b083, 0x39af83, 0x38af84, 0x37ad84, 0x64c19e, 0xecfbec, 0xf4fff0, 0xf3ffef, 0xf3ffef, 0xf3ffee, 0xc5ead5, 0x3aa989, 0x31a686, 0x31a586, 0x30a486, 0x2fa386, 0x2fa287, 0x2ea187, 0x2ea187, 0x2d9f87, 0x2c9f87, 0x2b9e87, 0x2b9d88, 0x2a9c88, 0x2a9b88, 0x299a88, 0x289a89, 0x279889, 0x81b5ae, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0x929292, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x2a2a2a, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0x79b493, 0x48c380, 0x47c280, 0x46c180, 0x45c080, 0x45c080, 0x44be80, 0x44be81, 0x43bd81, 0x42bc81, 0x41bb81, 0x41ba82, 0x40b982, 0xb9e7cd, 0xf7fff3, 0xf7fff3, 0xf6fff3, 0xf6fff3, 0xd0f0db, 0x47b78a, 0x3bb283, 0x3bb284, 0x3ab084, 0x39b084, 0x38af84, 0x38ae85, 0x65c19e, 0xedfceb, 0xf3ffee, 0xf3ffee, 0xf2ffee, 0xf2ffee, 0xc3ead4, 0x3aaa8a, 0x32a686, 0x31a587, 0x30a487, 0x30a487, 0x2fa287, 0x2fa287, 0x2ea187, 0x2da088, 0x2c9f88, 0x2c9e88, 0x2b9d88, 0x2b9d89, 0x2a9b89, 0x299b89, 0x299a89, 0x289989, 0x279889, 0x699f98, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x316749, 0x47c280, 0x46c17f, 0x45c080, 0x44bf80, 0x44be80, 0x43bd80, 0x43bd81, 0x42bb81, 0x41bb81, 0x40ba81, 0x40b981, 0x3fb881, 0x59c192, 0xebfbeb, 0xf5fff1, 0xf4fff1, 0xf4fff1, 0xf4fff0, 0xcceed8, 0x43b588, 0x39b084, 0x39af83, 0x38af84, 0x37ad84, 0x65c19e, 0xebfce9, 0xf2ffed, 0xf1ffec, 0xf1ffec, 0xf1ffec, 0xc2ead3, 0x39a98a, 0x32a686, 0x31a586, 0x30a486, 0x2fa386, 0x2fa287, 0x2ea187, 0x2ea187, 0x2d9f87, 0x2c9f88, 0x2b9e88, 0x2b9d88, 0x2a9c88, 0x2a9b89, 0x299a88, 0x289a89, 0x289889, 0x279889, 0x269789, 0x22524d, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x2f5d44, 0x46c180, 0x45c080, 0x45c081, 0x44bf81, 0x44be81, 0x43bd81, 0x42bc81, 0x42bb81, 0x41ba82, 0x40b982, 0x40b982, 0x3fb882, 0x3fb783, 0x62c498, 0xe9fbe9, 0xf4ffef, 0xf3ffef, 0xf3ffef, 0xf3ffee, 0xcbeed7, 0x42b489, 0x38af84, 0x38ae85, 0x63c09d, 0xeafce8, 0xf1ffec, 0xf1ffec, 0xf0ffeb, 0xf0ffeb, 0xc3ebd3, 0x3aaa8a, 0x32a686, 0x31a587, 0x30a487, 0x30a487, 0x2fa387, 0x2fa288, 0x2ea187, 0x2da088, 0x2d9f88, 0x2c9e88, 0x2b9d88, 0x2b9d89, 0x2a9c89, 0x2a9b89, 0x299a89, 0x28998a, 0x27988a, 0x27978a, 0x26968a, 0x224a46, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x294838, 0x45c080, 0x44bf80, 0x44be80, 0x43bd80, 0x43bc81, 0x42bb81, 0x41bb81, 0x40ba81, 0x40b981, 0x3fb881, 0x3fb782, 0x3eb682, 0x3db582, 0x3cb482, 0x60c398, 0xe7fae7, 0xf2ffed, 0xf1ffec, 0xf1ffec, 0xf1ffeb, 0xc9edd5, 0x3eb088, 0x63c09c, 0xe8fbe6, 0xefffea, 0xefffe9, 0xefffe9, 0xeeffe9, 0xc2ead1, 0x39a989, 0x31a686, 0x31a586, 0x30a486, 0x2fa386, 0x2fa287, 0x2ea187, 0x2ea087, 0x2d9f87, 0x2c9f88, 0x2b9e88, 0x2b9d88, 0x2a9c88, 0x2a9b88, 0x299a88, 0x289989, 0x279889, 0x279889, 0x269789, 0x26968a, 0x25958a, 0x213a38, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x24302a, 0x45c081, 0x44be80, 0x44be81, 0x43bd81, 0x42bc81, 0x41bb81, 0x41ba82, 0x40b982, 0x40b982, 0x3fb782, 0x3eb783, 0x3db683, 0x3db583, 0x3cb483, 0x3cb383, 0x61c299, 0xe9fce7, 0xf0ffeb, 0xf0ffeb, 0xf0ffea, 0xf0ffea, 0xc9eed5, 0xe9fce6, 0xefffe9, 0xefffe9, 0xeeffe8, 0xeeffe8, 0xc1ead0, 0x3aaa8a, 0x32a686, 0x31a587, 0x30a487, 0x30a487, 0x2fa287, 0x2fa287, 0x2ea187, 0x2da088, 0x2c9f88, 0x2c9e88, 0x2b9d88, 0x2b9d89, 0x2a9b89, 0x299b89, 0x299a89, 0x28998a, 0x279889, 0x27978a, 0x26968a, 0x25968a, 0x25948a, 0x202928, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x41b279, 0x43bd80, 0x43bc81, 0x42bb81, 0x41bb81, 0x40ba81, 0x40b982, 0x3fb882, 0x3fb782, 0x3eb682, 0x3db582, 0x3cb482, 0x3cb483, 0x3bb383, 0x3bb283, 0x3ab183, 0x60c19a, 0xe6fbe4, 0xeeffe9, 0xeeffe8, 0xeeffe8, 0xedffe7, 0xedffe7, 0xedffe7, 0xedffe6, 0xecffe6, 0xc1eacf, 0x39a98a, 0x32a686, 0x31a586, 0x30a486, 0x2fa386, 0x2fa287, 0x2ea187, 0x2ea087, 0x2d9f87, 0x2c9f88, 0x2b9e88, 0x2b9d88, 0x2a9c88, 0x2a9b89, 0x299a88, 0x289989, 0x279889, 0x279889, 0x269789, 0x26968a, 0x25958a, 0x24948a, 0x238880, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x4c4c4c, 0x4c4c4c, 0x4c4c4c, 0x4b4b4b, 0x4b4b4b, 0x4b4b4b, 0x4b4b4b, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x494949, 0x494949, 0x494949, 0x494949, 0x484848, 0x484848, 0x484848, 0x484848, 0x474747, 0x474747, 0x474747, 0x464646, 0x464646, 0x44976e, 0x43bd81, 0x42bc81, 0x42bb81, 0x41ba82, 0x40b982, 0x40b982, 0x3fb782, 0x3eb783, 0x3eb683, 0x3db583, 0x3cb483, 0x3cb384, 0x3bb283, 0x3ab284, 0x3ab084, 0x39b084, 0x5fc099, 0xe5fbe3, 0xedffe7, 0xedffe7, 0xedffe6, 0xedffe6, 0xecffe5, 0xecffe5, 0xc0ebce, 0x3aaa8a, 0x32a686, 0x31a587, 0x30a487, 0x30a487, 0x2fa287, 0x2fa288, 0x2ea188, 0x2da088, 0x2d9f88, 0x2c9e88, 0x2b9d88, 0x2b9d89, 0x2a9b89, 0x2a9b89, 0x299a89, 0x28998a, 0x27988a, 0x27978a, 0x26968a, 0x26968a, 0x25948a, 0x24948b, 0x2b726d, 0x393939, 0x393939, 0x383838, 0x383838, 0x383838, 0x383838, 0x373737, 0x373737, 0x373737, 0x373737, 0x363636, 0x363636, 0x363636, 0x353535, 0x353535, 0x353535, 0x353535, 0x343434, 0x343434, 0x343434, 0x343434, 0x333333, 0x333333, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0x86b9a0, 0x41bb81, 0x41ba81, 0x40b981, 0x40b981, 0x3fb881, 0x3eb782, 0x3eb682, 0x3db582, 0x3cb482, 0x3cb383, 0x3bb283, 0x3bb283, 0x3ab183, 0x39b083, 0x38af83, 0x38ae84, 0x37ad84, 0x5ebe99, 0xe3fbe0, 0xebffe4, 0xebffe3, 0xebffe3, 0xeaffe3, 0xc3eccf, 0x39a989, 0x31a586, 0x30a486, 0x30a486, 0x2fa386, 0x2fa287, 0x2ea187, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2b9d88, 0x2a9c88, 0x299b88, 0x299a88, 0x289989, 0x279889, 0x279789, 0x269689, 0x26968a, 0x25958a, 0x24948a, 0x23938a, 0x23928a, 0x5f8986, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xaeb8b3, 0x43bb82, 0x41ba82, 0x40b982, 0x40b882, 0x3fb782, 0x3eb783, 0x3db583, 0x3db583, 0x3cb483, 0x3cb383, 0x3bb283, 0x3ab184, 0x39b084, 0x39b084, 0x38ae84, 0x38ae85, 0x37ad85, 0x36ac85, 0x5cbd99, 0xe3fcdf, 0xeaffe2, 0xeaffe2, 0xc2ecce, 0x3bab8a, 0x31a686, 0x31a587, 0x30a487, 0x30a387, 0x2fa287, 0x2ea287, 0x2ea087, 0x2da088, 0x2c9f88, 0x2c9e88, 0x2b9d88, 0x2b9c89, 0x2a9b89, 0x299b89, 0x289989, 0x28998a, 0x279889, 0x27978a, 0x26968a, 0x25958a, 0x24948a, 0x24948b, 0x23928b, 0x26928b, 0x808584, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0x64b891, 0x40b982, 0x3fb882, 0x3fb782, 0x3eb682, 0x3db582, 0x3cb482, 0x3cb483, 0x3bb283, 0x3bb283, 0x3ab183, 0x39b084, 0x38af84, 0x38ae84, 0x37ad84, 0x37ad84, 0x36ab84, 0x35ab85, 0x34aa85, 0x55b996, 0x8ed3b3, 0x85cfaf, 0x38a989, 0x31a686, 0x30a486, 0x30a486, 0x2fa386, 0x2fa287, 0x2ea187, 0x2da087, 0x2d9f87, 0x2c9f88, 0x2b9d88, 0x2b9d88, 0x2a9c88, 0x2a9b89, 0x299a88, 0x289989, 0x279889, 0x279889, 0x269689, 0x26968a, 0x25958a, 0x24948a, 0x23938a, 0x23928b, 0x22918b, 0x468d89, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0x98b7a9, 0x40b882, 0x3fb782, 0x3eb783, 0x3db583, 0x3db583, 0x3cb483, 0x3cb384, 0x3bb283, 0x3ab184, 0x3ab084, 0x39b084, 0x38ae84, 0x38ae85, 0x37ad85, 0x36ac85, 0x36ab85, 0x35aa86, 0x34a986, 0x34a986, 0x33a786, 0x32a786, 0x32a686, 0x31a587, 0x30a487, 0x30a387, 0x2fa287, 0x2fa288, 0x2ea088, 0x2da088, 0x2c9f88, 0x2c9e88, 0x2b9d88, 0x2b9c89, 0x2a9b89, 0x299b89, 0x289989, 0x28998a, 0x27988a, 0x27978a, 0x26968a, 0x25958a, 0x25948a, 0x24948b, 0x23928b, 0x23928b, 0x22918b, 0x758887, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0x57b68c, 0x3db682, 0x3db582, 0x3cb482, 0x3cb383, 0x3bb283, 0x3ab283, 0x39b083, 0x39b084, 0x38af84, 0x38ae84, 0x37ad84, 0x36ac84, 0x36ab84, 0x35ab85, 0x34a985, 0x34a985, 0x33a885, 0x33a786, 0x32a686, 0x31a586, 0x30a486, 0x30a486, 0x2fa286, 0x2fa287, 0x2ea187, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2b9d88, 0x2a9b88, 0x299b88, 0x289a88, 0x289989, 0x279889, 0x279789, 0x269689, 0x25968a, 0x24948a, 0x24948a, 0x23938a, 0x23928b, 0x22918a, 0x22918b, 0x3f8e89, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0x98b6a9, 0x3db583, 0x3db583, 0x3cb483, 0x3cb383, 0x3bb283, 0x3ab184, 0x39b084, 0x39af84, 0x38ae84, 0x38ae85, 0x37ad85, 0x36ac85, 0x35ab85, 0x35aa86, 0x34a985, 0x34a886, 0x33a786, 0x32a786, 0x31a686, 0x31a587, 0x30a487, 0x30a387, 0x2fa287, 0x2ea187, 0x2ea088, 0x2da088, 0x2c9f88, 0x2c9e88, 0x2b9d88, 0x2b9c89, 0x2a9b89, 0x299a89, 0x289989, 0x28998a, 0x27988a, 0x27978a, 0x26968a, 0x25958a, 0x24948a, 0x24938b, 0x23928b, 0x23928b, 0x22918b, 0x23918b, 0x738887, 0x868686, 0x848484, 0x848484, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0x5fb491, 0x3cb383, 0x3bb283, 0x3ab283, 0x3ab183, 0x39b084, 0x38af84, 0x38ae84, 0x37ad84, 0x37ac85, 0x36ab84, 0x35ab85, 0x34aa85, 0x34a985, 0x33a885, 0x33a786, 0x32a686, 0x31a586, 0x30a486, 0x30a487, 0x2fa387, 0x2fa287, 0x2ea187, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2b9d88, 0x2a9c88, 0x299b89, 0x299a89, 0x289989, 0x279889, 0x279789, 0x269689, 0x25968a, 0x25958a, 0x24948a, 0x23938a, 0x23928b, 0x22918b, 0x22918b, 0x22918b, 0x498d89, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xa4b4ad, 0x40b385, 0x3bb284, 0x3ab184, 0x39b084, 0x39b084, 0x38ae84, 0x38ae85, 0x37ad85, 0x36ac85, 0x35ab85, 0x35aa86, 0x34a986, 0x34a986, 0x33a786, 0x32a786, 0x32a686, 0x31a587, 0x30a487, 0x30a387, 0x2fa287, 0x2fa288, 0x2ea088, 0x2da088, 0x2c9f88, 0x2c9e89, 0x2b9d88, 0x2b9c89, 0x2a9b89, 0x299b89, 0x289989, 0x28998a, 0x27988a, 0x27978a, 0x26968a, 0x25958b, 0x24948b, 0x24948b, 0x23928b, 0x23928b, 0x22918b, 0x22918b, 0x29918b, 0x7f8988, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0x89b2a2, 0x39b083, 0x39b084, 0x38af84, 0x38ae84, 0x37ad84, 0x36ac84, 0x35ab84, 0x35aa85, 0x34a985, 0x34a985, 0x33a885, 0x32a786, 0x31a686, 0x31a586, 0x30a486, 0x30a386, 0x2fa286, 0x2ea287, 0x2ea187, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2b9c88, 0x2a9b88, 0x299b88, 0x289a88, 0x289989, 0x279889, 0x279789, 0x269689, 0x25958a, 0x24948a, 0x24948a, 0x23938a, 0x23928b, 0x22918a, 0x22918b, 0x22918b, 0x22918b, 0x6e8a89, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0x72b19a, 0x39af84, 0x38ae84, 0x38ae85, 0x37ac85, 0x36ac85, 0x35ab85, 0x35aa86, 0x34a985, 0x34a886, 0x33a786, 0x32a786, 0x31a586, 0x31a587, 0x30a487, 0x30a387, 0x2fa287, 0x2ea188, 0x2da088, 0x2da088, 0x2c9e88, 0x2c9e88, 0x2b9d88, 0x2a9c89, 0x299b89, 0x299a89, 0x289989, 0x28998a, 0x27978a, 0x26978a, 0x26968a, 0x25958a, 0x24948a, 0x24938b, 0x23928b, 0x23928b, 0x22918b, 0x22918b, 0x22918b, 0x5d8d8b, 0x888888, 0x888888, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0x6daf98, 0x37ad84, 0x36ac85, 0x35ab84, 0x35aa85, 0x34a985, 0x34a985, 0x33a885, 0x32a786, 0x32a686, 0x31a586, 0x30a486, 0x30a387, 0x2fa287, 0x2fa287, 0x2ea187, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2b9c88, 0x2a9b88, 0x299b89, 0x289a89, 0x289989, 0x279889, 0x279789, 0x269689, 0x25958a, 0x24948a, 0x24948a, 0x23938a, 0x23928b, 0x22918b, 0x22918b, 0x22918b, 0x22918b, 0x568d8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0x73ae9a, 0x36ac85, 0x35ab85, 0x35aa86, 0x34a986, 0x34a886, 0x33a786, 0x32a786, 0x31a686, 0x31a587, 0x30a487, 0x30a387, 0x2fa287, 0x2ea188, 0x2da088, 0x2da088, 0x2c9f88, 0x2c9e89, 0x2b9d88, 0x2a9c89, 0x2a9b89, 0x299a89, 0x289989, 0x28998a, 0x27988a, 0x27978a, 0x26968a, 0x25958b, 0x24948b, 0x24938b, 0x23928b, 0x23928b, 0x22918b, 0x22918b, 0x22918b, 0x588f8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0x7aad9d, 0x34a985, 0x34a985, 0x33a785, 0x32a786, 0x31a686, 0x31a586, 0x30a486, 0x30a387, 0x2fa286, 0x2ea287, 0x2ea187, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2b9c88, 0x2a9b88, 0x299b88, 0x289a89, 0x289989, 0x279889, 0x279789, 0x269689, 0x25958a, 0x24948a, 0x24948a, 0x23938a, 0x23928b, 0x22918b, 0x22918b, 0x22918b, 0x22918b, 0x608e8b, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0x90ada4, 0x3da989, 0x33a786, 0x32a686, 0x31a586, 0x31a587, 0x30a487, 0x30a387, 0x2fa287, 0x2ea188, 0x2da088, 0x2d9f88, 0x2c9e88, 0x2c9e88, 0x2b9d88, 0x2a9c89, 0x299b89, 0x299a89, 0x289989, 0x28988a, 0x27978a, 0x26978a, 0x25968a, 0x25958b, 0x24948a, 0x24938b, 0x23928b, 0x22918b, 0x22918b, 0x22918b, 0x2c918b, 0x758f8d, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xa2acaa, 0x5fa894, 0x31a586, 0x30a486, 0x30a387, 0x2fa287, 0x2fa287, 0x2ea087, 0x2da087, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2b9c88, 0x2a9b88, 0x299b89, 0x289a89, 0x289989, 0x279889, 0x27978a, 0x269689, 0x25958a, 0x24948a, 0x24948a, 0x23938a, 0x23928b, 0x22918b, 0x22918b, 0x22918b, 0x4c918d, 0x868e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0x8eaaa3, 0x4fa590, 0x30a387, 0x2fa287, 0x2ea188, 0x2da088, 0x2d9f88, 0x2c9e88, 0x2c9e89, 0x2b9d88, 0x2a9c89, 0x2a9b89, 0x299a89, 0x289989, 0x28988a, 0x27978a, 0x26978a, 0x26968a, 0x25958b, 0x24948b, 0x24938b, 0x23928b, 0x22918b, 0x22918b, 0x43928d, 0x7b9190, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0x93a8a3, 0x5ea394, 0x36a08a, 0x2c9f87, 0x2c9e88, 0x2b9d88, 0x2a9c88, 0x299b88, 0x299a89, 0x289989, 0x289989, 0x279889, 0x269789, 0x269689, 0x25958a, 0x24948a, 0x24938a, 0x23928a, 0x23928b, 0x2d918b, 0x53928f, 0x819291, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0x89a49f, 0x62a195, 0x389d8b, 0x2a9c89, 0x299b89, 0x299a89, 0x289989, 0x28988a, 0x27978a, 0x26968a, 0x25958a, 0x25958a, 0x24948a, 0x36948d, 0x599491, 0x7d9594, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0x9ba2a1, 0x8ea09d, 0x809e9a, 0x749c97, 0x689b95, 0x679a94, 0x729a96, 0x7e9997, 0x889998, 0x949998, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xc6c6c6, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x868686, 0x868686, 0x848484, 0x848484, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x565656, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x9a9a9a, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa3a3a3, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x797979, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x999999, 0x979797, 0x979797, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x353535, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xbfbfbf, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x949494, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x464646, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0x9f9f9f, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x7f7f7f, 0xbababa, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x626262, 0x484848, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x3a3a3a, 0x4b4b4b, 0x4b4b4b, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x494949, 0x494949, 0x494949, 0x494949, 0x484848, 0x484848, 0x484848, 0x484848, 0x474747, 0x474747, 0x474747, 0x464646, 0x464646, 0x464646, 0x464646, 0x454545, 0x454545, 0x454545, 0x454545, 0x444444, 0x444444, 0x444444, 0x444444, 0x434343, 0x434343, 0x434343, 0x424242, 0x424242, 0x424242, 0x424242, 0x414141, 0x414141, 0x414141, 0x414141, 0x404040, 0x404040, 0x404040, 0x404040, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3b3b3b, 0x3b3b3b, 0x3b3b3b, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x393939, 0x393939, 0x393939, 0x393939, 0x383838, 0x383838, 0x383838, 0x383838, 0x373737, 0x373737, 0x373737, 0x373737, 0x363636, 0x363636, 0x363636, 0x353535, 0x353535, 0x353535, 0x353535, 0x272727, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020 +}; \ No newline at end of file diff --git a/dev/boot/BootKit/Rsrc/zka_no_disk.rsrc b/dev/boot/BootKit/Rsrc/zka_no_disk.rsrc new file mode 100644 index 00000000..f89abad0 --- /dev/null +++ b/dev/boot/BootKit/Rsrc/zka_no_disk.rsrc @@ -0,0 +1,116 @@ +#define NE_NO_DISK_HEIGHT 110 +#define NE_NO_DISK_WIDTH 110 + +// array size is 36300 +static const unsigned int zka_no_disk[] = { + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x333333, 0x565656, 0x636363, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6d6d6d, 0x6a6a6a, 0x5f5f5f, 0x4d4d4d, 0x2b2b2b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x464646, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x707070, 0x6a6a6a, 0x3b3b3b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x3d3d3d, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x727272, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x252525, 0x676767, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x757575, 0x606060, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x777777, 0x787878, 0x777777, 0x777777, 0x3d3d3d, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x616161, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x7a7a7a, 0x7b7b7b, 0x525252, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x242424, 0x767676, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x7c7c7c, 0x7d7d7d, 0x7c7c7c, 0x7c7c7c, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x393939, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7f7f7f, 0x808080, 0x7e7e7e, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4e4e4e, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x828282, 0x818181, 0x828282, 0x828282, 0x3f3f3f, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x666666, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x858585, 0x555555, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x222222, 0x7c7c7c, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x868686, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x878787, 0x6d6d6d, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x393939, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x8a8a8a, 0x868686, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x515151, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x8c8c8c, 0x404040, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x6a6a6a, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x8f8f8f, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x828282, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0xa69a77, 0xbea35a, 0xc0a458, 0xa69a77, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x919191, 0x727272, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x383838, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0xab9d77, 0xebb626, 0xffbe0c, 0xffbd0c, 0xffbd0c, 0xffbc0c, 0xecb524, 0xaa9c78, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x949494, 0x8e8e8e, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x525252, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0xa49b83, 0xfcbc0f, 0xfebc0c, 0xffbc0c, 0xfebc0b, 0xffbb0c, 0xfebb0b, 0xffba0b, 0xfcb90e, 0xa49b83, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x969696, 0x414141, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x6e6e6e, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0xe8b52c, 0xffbd0c, 0xffbc0c, 0xffbc0c, 0xffbb0c, 0xffbb0c, 0xffba0b, 0xffba0c, 0xffb90b, 0xe8b22c, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x999999, 0x5c5c5c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x868686, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0xbca66b, 0xfebb0b, 0xffbb0b, 0xfeba0b, 0xffba0b, 0xfeba0b, 0xffb90b, 0xfeb80b, 0xffb80b, 0xfeb80b, 0xffb70b, 0xbda46a, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x9b9b9b, 0x787878, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x373737, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0xa09f9b, 0xf3b81e, 0xffbb0c, 0xffbb0c, 0xffba0b, 0xffba0c, 0xffb90b, 0xffb90b, 0xffb80b, 0xffb80b, 0xffb70b, 0xffb70b, 0xf3b31d, 0xa09e9b, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x9e9e9e, 0x959595, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xcbac5c, 0xffba0b, 0xfeba0b, 0xffb90b, 0xfeb90b, 0xffb80b, 0xfeb80b, 0xffb70b, 0xfeb70a, 0xffb60b, 0xfeb60a, 0xffb60a, 0xfeb50a, 0xccaa5b, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0xa0a0a0, 0xa1a1a1, 0x444444, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x707070, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xaaa699, 0xfab914, 0xffba0c, 0xffb90b, 0xffb90c, 0xffb80b, 0xffb80b, 0xffb70b, 0xffb70b, 0xffb60b, 0xffb60b, 0xffb50b, 0xffb50b, 0xffb40a, 0xfab313, 0xa9a498, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0xa3a3a3, 0xa4a4a4, 0x5e5e5e, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x8b8b8b, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xd9b14c, 0xfeb80b, 0xfeb80b, 0xfeb70b, 0xffb70b, 0xfeb60a, 0xfeb60a, 0xfeb60a, 0xffb50a, 0xfeb50a, 0xfeb40a, 0xfeb40a, 0xfeb30a, 0xfeb30a, 0xfeb20a, 0xd9ac4a, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0xa5a5a5, 0xa6a6a6, 0x7c7c7c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x363636, 0xa7a7a7, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xb5aa91, 0xfeb80d, 0xffb80b, 0xffb80b, 0xffb70b, 0xffb70b, 0xffb60b, 0xffb60b, 0xffb50a, 0xffb50b, 0xffb40a, 0xffb40a, 0xffb30a, 0xffb30a, 0xffb20a, 0xffb20a, 0xfeb10c, 0xb5aa92, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0xa8a8a8, 0xa9a9a9, 0x9c9c9c, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xe6b43a, 0xffb70b, 0xfeb60a, 0xffb60b, 0xfeb60a, 0xffb50a, 0xfeb50a, 0xffb40a, 0xfeb40a, 0xffb40a, 0xfeb30a, 0xffb20a, 0xfeb20a, 0xffb20a, 0xfeb109, 0xffb109, 0xfeb009, 0xe6ae39, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0xababab, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x717171, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xc2b085, 0xffb70b, 0xffb70b, 0xffb60b, 0xffb60b, 0xffb50b, 0xffb50b, 0xffb40a, 0xffb40b, 0xffb30a, 0xffb30a, 0xffb20a, 0xffb20a, 0xffb10a, 0xffb10a, 0xffb00a, 0xffb00a, 0xffaf0a, 0xffaf0a, 0xc2ae85, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0xaeaeae, 0x636363, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x8e8e8e, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb1b0af, 0xf1b526, 0xfeb50a, 0xffb50a, 0xfeb40a, 0xfeb40a, 0xfeb40a, 0xffb30a, 0xfeb30a, 0xfeb20a, 0xfeb209, 0xfeb10a, 0xfeb109, 0xfeb009, 0xfeb009, 0xfeb009, 0xfeaf09, 0xfeaf09, 0xfeae09, 0xfeae09, 0xf1ad25, 0xb1b0af, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0xb0b0b0, 0x818181, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x343434, 0xacacac, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xd0b472, 0xffb60b, 0xffb50a, 0xffb50b, 0xffb40a, 0xffb40a, 0xffb30a, 0xffb30a, 0xffb20a, 0xdc9e15, 0x90712e, 0x91712e, 0xdd9c15, 0xffb00a, 0xffaf09, 0xffaf0a, 0xffae09, 0xffae09, 0xffad09, 0xffad09, 0xffac09, 0xd0b071, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xb3b3b3, 0xa3a3a3, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x545454, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb8b5ae, 0xf8b519, 0xffb40a, 0xfeb40a, 0xffb30a, 0xfeb30a, 0xffb20a, 0xfeb20a, 0xffb10a, 0xfeb109, 0x564f40, 0x444444, 0x444444, 0x564e3e, 0xfeaf09, 0xfeae09, 0xffae09, 0xfead09, 0xfead09, 0xfeac08, 0xffac09, 0xfeab08, 0xf8ac17, 0xb8b5ae, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0xb5b5b5, 0x484848, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x727272, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xdcb660, 0xffb40a, 0xffb40b, 0xffb30a, 0xffb30a, 0xffb20a, 0xffb20a, 0xffb10a, 0xffb10a, 0xeba510, 0x444444, 0x434343, 0x434343, 0x424242, 0xeca30f, 0xffad09, 0xffad09, 0xffac09, 0xffac09, 0xffac09, 0xffab09, 0xffab09, 0xffaa09, 0xdcb15e, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0xb8b8b8, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x909090, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xc1b9a8, 0xfcb30f, 0xfeb20a, 0xfeb20a, 0xfeb109, 0xfeb10a, 0xfeb009, 0xfeb009, 0xfeb009, 0xfeaf09, 0xe6a110, 0x424242, 0x424242, 0x414141, 0x414141, 0xe69e10, 0xfeac08, 0xfeac08, 0xfeab08, 0xfeab08, 0xfeaa08, 0xfeaa08, 0xfea908, 0xfea908, 0xfca90d, 0xc1b8a8, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0xbababa, 0x868686, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x313131, 0xb0b0b0, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xe6b74c, 0xffb30a, 0xffb20a, 0xffb20a, 0xffb10a, 0xffb10a, 0xffb009, 0xffb00a, 0xffaf09, 0xffaf09, 0xe7a010, 0x414141, 0x414141, 0x414141, 0x404040, 0xe79e10, 0xffab09, 0xffab09, 0xffaa08, 0xffaa09, 0xffa908, 0xffa908, 0xffa808, 0xffa808, 0xffa808, 0xe7af4b, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xa9a9a9, 0x2a2a2a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x525252, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xcbbc9b, 0xfeb209, 0xffb10a, 0xfeb109, 0xffb009, 0xfeb009, 0xffaf09, 0xfeaf09, 0xfeae09, 0xfeae09, 0xffae09, 0xe69f10, 0x404040, 0x3f3f3f, 0x3f3f3f, 0x3e3e3e, 0xe69d0f, 0xfeaa08, 0xfeaa08, 0xfea908, 0xfea908, 0xfea808, 0xfea808, 0xfea707, 0xfea708, 0xfea607, 0xfea607, 0xcbba9b, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0xbfbfbf, 0x494949, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x727272, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xf1b533, 0xffb10a, 0xffb10a, 0xffb00a, 0xffb00a, 0xffaf09, 0xffaf0a, 0xffae09, 0xffae09, 0xffad09, 0xffad09, 0xe79e10, 0x3f3f3f, 0x3e3e3e, 0x3e3e3e, 0x3d3d3d, 0xe79c10, 0xffaa08, 0xffa909, 0xffa908, 0xffa808, 0xffa808, 0xffa708, 0xffa708, 0xffa608, 0xffa608, 0xffa608, 0xf1ab31, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0xc2c2c2, 0x6a6a6a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x929292, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xd6be89, 0xfeb009, 0xfeaf09, 0xfeaf09, 0xfeae09, 0xfeae09, 0xfeae09, 0xfead09, 0xfead08, 0xfeac09, 0xfeac08, 0xfeab08, 0xe69d0f, 0x3d3d3d, 0x3c3c3c, 0x3c3c3c, 0x3b3b3b, 0xe69b0e, 0xfea808, 0xfea808, 0xfea707, 0xfea708, 0xfea607, 0xfea607, 0xfea507, 0xfea507, 0xfea407, 0xfea407, 0xfea307, 0xd6ba89, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0xc4c4c4, 0x8c8c8c, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x2e2e2e, 0xb4b4b4, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc9c8c6, 0xf8b321, 0xffb00a, 0xffaf09, 0xffaf09, 0xffae09, 0xffae09, 0xffad09, 0xffad09, 0xffac09, 0xffac09, 0xffab09, 0xffab09, 0xe79c0f, 0x3c3c3c, 0x3c3c3c, 0x3b3b3b, 0x3b3b3b, 0xe69a0e, 0xffa708, 0xffa708, 0xffa608, 0xffa608, 0xffa608, 0xffa508, 0xfea507, 0xffa407, 0xffa407, 0xffa307, 0xfea307, 0xf8a71f, 0xc8c7c5, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xc7c7c7, 0xc7c7c7, 0xc8c8c8, 0xc7c7c7, 0xafafaf, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x505050, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xe1be76, 0xfeaf09, 0xfeae09, 0xfeae09, 0xffad09, 0xfead09, 0xfeac09, 0xfeac08, 0xffac09, 0xfeab08, 0xfeab08, 0xfeaa08, 0xfeaa08, 0xe69b0e, 0x3b3b3b, 0x3a3a3a, 0x3a3a3a, 0x393939, 0xe5990e, 0xfea607, 0xfea607, 0xfea507, 0xfea507, 0xfea407, 0xfea407, 0xfea307, 0xfea307, 0xfea207, 0xfea207, 0xfea106, 0xfea107, 0xe0b774, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0xc9c9c9, 0xcacaca, 0x4b4b4b, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x717171, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xd0cbc2, 0xfbb117, 0xffae09, 0xffae09, 0xffad09, 0xffad09, 0xffac09, 0xffac09, 0xffab09, 0xffab09, 0xffaa08, 0xffaa09, 0xffa908, 0xffa909, 0xe69a0e, 0x3a3a3a, 0x393939, 0x393939, 0x383838, 0xe6980e, 0xffa608, 0xffa508, 0xffa507, 0xffa408, 0xffa407, 0xffa407, 0xffa307, 0xffa307, 0xffa207, 0xffa207, 0xffa107, 0xffa107, 0xfba315, 0xd0cbc2, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0xcdcdcd, 0xcdcdcd, 0xcccccc, 0xcdcdcd, 0x6e6e6e, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x939393, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xe9bc60, 0xfead09, 0xfeac08, 0xfeac09, 0xfeac08, 0xfeab08, 0xfeab08, 0xfeaa08, 0xfeaa08, 0xfea908, 0xfea908, 0xfea808, 0xfea808, 0xfea808, 0xe5990d, 0x383838, 0x373737, 0x373737, 0x363636, 0xe5970d, 0xfea407, 0xfea407, 0xfea307, 0xfea307, 0xfea206, 0xfea207, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xe9b45f, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0xcecece, 0xcfcfcf, 0x929292, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x2a2a2a, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xb0a691, 0xfdad0c, 0xffad09, 0xffac09, 0xffac09, 0xffab09, 0xffab09, 0xffaa08, 0xffaa08, 0xffa908, 0xffa908, 0xfea808, 0xffa808, 0xffa708, 0xffa708, 0xe5980e, 0x373737, 0x363636, 0x363636, 0x353535, 0xe6960d, 0xfea407, 0xffa307, 0xfea307, 0xffa207, 0xfea207, 0xffa107, 0xfea106, 0xffa007, 0xfea006, 0xffa007, 0xfe9f06, 0xff9f06, 0xfe9e06, 0xfd9e09, 0xb0a491, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0x292929, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xb88010, 0xfeac08, 0xffab09, 0xfeab08, 0xfeaa08, 0xfeaa08, 0xfea908, 0xfea908, 0xfea808, 0xfea808, 0xfea808, 0xfea707, 0xfea708, 0xfea607, 0xfea607, 0xf8a208, 0x3a3834, 0x353535, 0x353535, 0x393733, 0xf89f08, 0xfea207, 0xfea207, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xfe9e06, 0xfe9d06, 0xfe9d06, 0xfe9d05, 0xfe9c06, 0xb7740e, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x523f1b, 0xffac09, 0xffab09, 0xffab09, 0xffaa08, 0xffaa09, 0xffa908, 0xffa908, 0xffa808, 0xffa808, 0xffa708, 0xffa708, 0xffa608, 0xffa608, 0xffa508, 0xffa508, 0xffa407, 0xa9751b, 0x353434, 0x353533, 0xab7519, 0xffa207, 0xffa207, 0xffa107, 0xffa107, 0xffa007, 0xffa007, 0xffa007, 0xfe9f06, 0xff9f06, 0xff9e06, 0xff9e06, 0xfe9d06, 0xff9d06, 0xff9c06, 0xff9c06, 0xfe9b06, 0x523b1a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd38f0d, 0xfeaa08, 0xfeaa08, 0xfea908, 0xfea908, 0xfea808, 0xfea808, 0xfea708, 0xfea707, 0xfea607, 0xfea607, 0xfea607, 0xfea507, 0xfea507, 0xfea407, 0xfea407, 0xfea307, 0xfea307, 0xe9970a, 0xea970b, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xfe9e06, 0xfe9d05, 0xfe9d06, 0xfe9c05, 0xfe9c06, 0xfe9b05, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xd3810a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x715318, 0xffaa08, 0xffaa08, 0xffa908, 0xffa908, 0xffa808, 0xffa808, 0xffa708, 0xffa708, 0xffa608, 0xffa608, 0xffa507, 0xffa508, 0xfea407, 0xffa407, 0xffa307, 0xffa307, 0xfea207, 0xffa207, 0xffa207, 0xffa107, 0xfea106, 0xffa007, 0xfea006, 0xff9f07, 0xfe9f06, 0xff9e06, 0xfe9e06, 0xff9e06, 0xfe9d06, 0xff9d06, 0xfe9c06, 0xff9c06, 0xfe9b05, 0xff9b06, 0xfe9a05, 0xff9a05, 0xfe9905, 0xff9905, 0x704b16, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x27241f, 0xe89b0b, 0xfea908, 0xfea808, 0xfea808, 0xfea708, 0xfea707, 0xfea608, 0xfea607, 0xfea607, 0xfea507, 0xfea507, 0xfea407, 0xfea407, 0xfea307, 0xfea307, 0xfea207, 0xfea207, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xfe9e06, 0xfe9d06, 0xfe9d06, 0xfe9c05, 0xfe9c06, 0xfe9b05, 0xfe9b05, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xfe9905, 0xfe9805, 0xfe9804, 0xfe9705, 0xe78b07, 0x27241f, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x4c4c4c, 0x4c4c4c, 0x4c4c4c, 0x4b4b4b, 0x4b4b4b, 0x4b4b4b, 0x4b4b4b, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x494949, 0x494949, 0x494949, 0x494949, 0x484848, 0x484848, 0x484848, 0x484848, 0x474747, 0x474747, 0x474747, 0x464646, 0x464646, 0x464646, 0x464646, 0x454545, 0x9f7627, 0xffa908, 0xffa808, 0xffa808, 0xffa708, 0xffa708, 0xffa608, 0xffa608, 0xffa508, 0xffa508, 0xffa407, 0xffa408, 0xffa307, 0xffa307, 0xffa207, 0xffa207, 0xffa207, 0xffa107, 0xffa107, 0xffa007, 0xffa007, 0xff9f07, 0xff9f06, 0xff9e06, 0xff9e06, 0xff9e06, 0xff9d06, 0xff9d06, 0xff9c06, 0xff9c06, 0xfe9b06, 0xff9b06, 0xff9a05, 0xff9a06, 0xfe9905, 0xff9905, 0xff9805, 0xff9805, 0xfe9705, 0xff9705, 0xfe9605, 0x996620, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x393939, 0x393939, 0x393939, 0x393939, 0x383838, 0x383838, 0x383838, 0x383838, 0x373737, 0x373737, 0x373737, 0x373737, 0x363636, 0x363636, 0x363636, 0x353535, 0x353535, 0x353535, 0x353535, 0x343434, 0x343434, 0x343434, 0x343434, 0x333333, 0x333333, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xbbb4a6, 0xfba80e, 0xfea708, 0xfea607, 0xfea607, 0xfea607, 0xfea507, 0xfea507, 0xfea407, 0xfea407, 0xfea307, 0xfea307, 0xfea207, 0xfea206, 0xfea207, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xe4910b, 0xa97016, 0xa97016, 0xe69009, 0xfe9d06, 0xfe9c05, 0xfe9c05, 0xfe9b05, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xfe9905, 0xfe9805, 0xfe9805, 0xfe9704, 0xfe9704, 0xfe9704, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xf99409, 0x92897d, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xe2ad4c, 0xffa708, 0xffa708, 0xfea608, 0xffa608, 0xffa507, 0xffa508, 0xfea407, 0xffa407, 0xfea307, 0xffa307, 0xfea207, 0xffa207, 0xfea107, 0xffa107, 0xfea006, 0xffa007, 0xfe9f06, 0xff9f06, 0xab7115, 0x2f2e2d, 0x2c2c2c, 0x2c2c2c, 0x2d2c2b, 0xac7014, 0xfe9c06, 0xff9b06, 0xfe9b05, 0xff9a06, 0xfe9a05, 0xff9a05, 0xfe9905, 0xff9905, 0xfe9805, 0xff9805, 0xfe9705, 0xff9705, 0xfe9605, 0xff9605, 0xfe9504, 0xfe9504, 0xfe9404, 0xff9404, 0xcf8f38, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xc2b399, 0xfea609, 0xfea607, 0xfea507, 0xfea507, 0xfea407, 0xfea407, 0xfea407, 0xfea307, 0xfea307, 0xfea206, 0xfea207, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xf99b07, 0x322f2a, 0x2b2b2b, 0x2b2b2b, 0x2a2a2a, 0x292929, 0x332f28, 0xfc9905, 0xfe9a05, 0xfe9905, 0xfe9905, 0xfe9805, 0xfe9805, 0xfe9704, 0xfe9705, 0xfe9704, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xfe9404, 0xfe9404, 0xfe9304, 0xfe9304, 0xfe9304, 0xfd9204, 0x9b8971, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xecaa33, 0xffa608, 0xffa508, 0xffa508, 0xffa407, 0xffa407, 0xffa307, 0xffa307, 0xffa207, 0xffa207, 0xffa107, 0xffa107, 0xffa007, 0xffa007, 0xffa006, 0xff9f07, 0xfe9e06, 0xff9e06, 0xff9e06, 0xe18d0b, 0x2b2b2b, 0x2a2a2a, 0x2a2a2a, 0x292929, 0x292929, 0x282828, 0xe18b0a, 0xff9a06, 0xfe9905, 0xff9905, 0xfe9805, 0xff9805, 0xfe9705, 0xff9705, 0xfe9605, 0xff9605, 0xfe9504, 0xff9505, 0xfe9404, 0xff9404, 0xfe9304, 0xff9304, 0xfe9204, 0xff9204, 0xfe9104, 0xe18f25, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xccb284, 0xfea407, 0xfea407, 0xfea407, 0xfea307, 0xfea307, 0xfea207, 0xfea206, 0xfea107, 0xfea106, 0xfea006, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xfe9e06, 0xfe9d05, 0xfe9d06, 0xfe9c05, 0xfb9a06, 0x2f2c28, 0x292929, 0x282828, 0x282828, 0x272727, 0x302c25, 0xfb9705, 0xfe9805, 0xfe9704, 0xfe9704, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xfe9504, 0xfe9404, 0xfe9404, 0xfe9304, 0xfe9303, 0xfe9204, 0xfe9203, 0xfe9103, 0xfe9103, 0xfe9103, 0xfe9003, 0xfe9003, 0xa88960, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xbab9b7, 0xf5a821, 0xfea407, 0xffa407, 0xffa307, 0xffa307, 0xfea207, 0xffa207, 0xffa107, 0xffa107, 0xfea006, 0xffa007, 0xfe9f06, 0xff9f06, 0xfe9e06, 0xff9e06, 0xfe9d06, 0xff9d06, 0xfe9c06, 0xff9c06, 0xfe9c06, 0xff9b06, 0xa66c13, 0x282828, 0x272727, 0x272727, 0x262626, 0xa96b12, 0xfe9805, 0xff9805, 0xfe9705, 0xff9705, 0xfe9605, 0xff9605, 0xfe9504, 0xff9504, 0xfe9404, 0xff9404, 0xfe9304, 0xff9304, 0xfe9204, 0xff9204, 0xfe9104, 0xfe9104, 0xfe9003, 0xff9004, 0xfe8f03, 0xfe8f03, 0xed8d16, 0x878684, 0x848484, 0x848484, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xd5b06e, 0xfea307, 0xfea307, 0xfea207, 0xfea206, 0xfea207, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xfe9e06, 0xfe9d06, 0xfe9d06, 0xfe9c05, 0xfe9c06, 0xfe9b05, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xc0780e, 0x6e4c1b, 0x714d1a, 0xc2780d, 0xfe9705, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xfe9504, 0xfe9404, 0xfe9404, 0xfe9304, 0xfe9304, 0xfe9204, 0xfe9203, 0xfe9104, 0xfe9103, 0xfe9103, 0xfe9003, 0xfe9003, 0xfe8f03, 0xfe8f03, 0xfe8e03, 0xfe8e03, 0xfe8d03, 0xb68850, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xf8a517, 0xffa307, 0xffa207, 0xffa207, 0xffa107, 0xffa107, 0xffa007, 0xffa007, 0xff9f06, 0xff9f07, 0xff9e06, 0xff9e06, 0xff9d06, 0xff9d06, 0xff9d06, 0xff9c06, 0xff9c06, 0xff9b06, 0xfe9b05, 0xff9a06, 0xff9a05, 0xff9a06, 0xfe9905, 0xff9905, 0xff9805, 0xff9805, 0xfe9705, 0xff9705, 0xfe9605, 0xff9605, 0xfe9504, 0xff9505, 0xfe9404, 0xff9404, 0xfe9304, 0xff9304, 0xfe9204, 0xff9204, 0xfe9104, 0xff9104, 0xfe9004, 0xff9004, 0xfe8f03, 0xff8f03, 0xfe8e03, 0xff8e03, 0xfe8d03, 0xff8d03, 0xfe8d03, 0xf38c0f, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xceb282, 0xfea206, 0xfea106, 0xfea106, 0xfea006, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xfe9e06, 0xfe9e06, 0xfe9d05, 0xfe9d06, 0xfe9c05, 0xfe9c05, 0xfe9b05, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xfe9905, 0xfe9805, 0xfe9805, 0xfe9704, 0xfe9704, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xfe9404, 0xfe9404, 0xfe9304, 0xfe9304, 0xfe9203, 0xfe9204, 0xfe9103, 0xfe9103, 0xfe9103, 0xfe9003, 0xfe9003, 0xfe8f03, 0xfe8f03, 0xfe8e03, 0xfe8e02, 0xfe8d03, 0xfe8d02, 0xfe8d02, 0xfe8c02, 0xfe8c02, 0xfe8b02, 0xfe8b02, 0xa7865e, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xd9af69, 0xfea107, 0xffa107, 0xfea006, 0xffa007, 0xfe9f06, 0xff9f06, 0xfe9e06, 0xff9e06, 0xfe9d06, 0xff9d06, 0xfe9c06, 0xff9c06, 0xfe9b06, 0xff9b06, 0xfe9a05, 0xff9a05, 0xfe9a05, 0xff9905, 0xfe9805, 0xff9805, 0xfe9805, 0xff9705, 0xfe9705, 0xff9605, 0xfe9604, 0xff9605, 0xfe9504, 0xfe9504, 0xfe9404, 0xff9404, 0xfe9304, 0xfe9304, 0xfe9204, 0xff9204, 0xfe9103, 0xfe9104, 0xfe9003, 0xfe9004, 0xfe8f03, 0xfe8f03, 0xfe8e03, 0xfe8e03, 0xfe8d03, 0xfe8d03, 0xfe8c03, 0xfe8c03, 0xfe8b02, 0xfe8b03, 0xfe8a02, 0xfe8a02, 0x824f13, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xd7ae6c, 0xfea006, 0xfe9f06, 0xfe9f06, 0xfe9e06, 0xfe9e06, 0xfe9e06, 0xfe9d05, 0xfe9d06, 0xfe9c05, 0xfe9c06, 0xfe9b05, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xfe9905, 0xfe9805, 0xfe9805, 0xfe9704, 0xfe9705, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xfe9404, 0xfe9404, 0xfe9304, 0xfe9304, 0xfe9204, 0xfe9204, 0xfe9203, 0xfe9103, 0xfe9103, 0xfe9003, 0xfe9003, 0xfe8f03, 0xfe8f03, 0xfe8f03, 0xfe8e03, 0xfe8e03, 0xfe8d02, 0xfe8d03, 0xfe8c02, 0xfe8c02, 0xfe8b02, 0xfe8b02, 0xfe8a02, 0xfe8a02, 0xfe8902, 0xfe8902, 0x7e4c13, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xc8b596, 0xff9f06, 0xff9f07, 0xfe9e06, 0xff9e06, 0xff9d06, 0xff9d06, 0xfe9c06, 0xff9c06, 0xff9b06, 0xff9b06, 0xfe9a05, 0xff9a06, 0xfe9a05, 0xff9905, 0xfe9905, 0xff9805, 0xfe9805, 0xff9705, 0xfe9705, 0xff9605, 0xfe9605, 0xff9605, 0xfe9504, 0xff9504, 0xfe9404, 0xff9404, 0xfe9304, 0xff9304, 0xfe9204, 0xff9204, 0xfe9104, 0xff9104, 0xfe9003, 0xff9004, 0xfe8f03, 0xff8f03, 0xfe8e03, 0xff8e03, 0xfe8d03, 0xff8d03, 0xfe8c03, 0xff8c03, 0xfe8b03, 0xfe8b03, 0xfe8a02, 0xff8a03, 0xfe8902, 0xfe8902, 0xfe8902, 0xff8802, 0x4c351a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xeca433, 0xfe9d06, 0xfe9d05, 0xfe9c06, 0xfe9c05, 0xfe9c05, 0xfe9b05, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xfe9905, 0xfe9805, 0xfe9805, 0xfe9704, 0xfe9704, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xfe9404, 0xfe9404, 0xfe9304, 0xfe9304, 0xfe9203, 0xfe9204, 0xfe9103, 0xfe9103, 0xfe9003, 0xfe9003, 0xfe8f03, 0xfe8f03, 0xfe8f03, 0xfe8e03, 0xfe8e02, 0xfe8d03, 0xfe8d02, 0xfe8c03, 0xfe8c02, 0xfe8b02, 0xfe8b02, 0xfe8b02, 0xfe8a02, 0xfe8a02, 0xfe8902, 0xfe8902, 0xfe8801, 0xfe8802, 0xfe8701, 0xe17b0a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xbeb7ad, 0xf3a224, 0xfe9c06, 0xff9c06, 0xfe9b06, 0xff9b06, 0xfe9a05, 0xff9a05, 0xfe9905, 0xff9905, 0xfe9805, 0xff9805, 0xfe9705, 0xff9705, 0xfe9705, 0xff9605, 0xfe9604, 0xff9505, 0xfe9504, 0xff9404, 0xfe9404, 0xff9404, 0xfe9304, 0xfe9304, 0xfe9204, 0xff9204, 0xfe9103, 0xfe9104, 0xfe9003, 0xff9004, 0xfe8f03, 0xfe8f03, 0xfe8e03, 0xfe8e03, 0xfe8d03, 0xfe8d03, 0xfe8c03, 0xfe8c03, 0xfe8b02, 0xfe8b03, 0xfe8a02, 0xfe8a02, 0xfe8902, 0xfe8902, 0xfe8802, 0xfe8802, 0xfe8702, 0xfe8702, 0xf6870a, 0x5d472f, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4d4d4d, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xbbb5ac, 0xe2a549, 0xfe9b05, 0xfe9a05, 0xfe9a05, 0xfe9905, 0xfe9905, 0xfe9805, 0xfe9805, 0xfe9704, 0xfe9705, 0xfe9604, 0xfe9604, 0xfe9504, 0xfe9504, 0xfe9404, 0xfe9404, 0xfe9304, 0xfe9304, 0xfe9204, 0xfe9204, 0xfe9103, 0xfe9103, 0xfe9103, 0xfe9003, 0xfe8f03, 0xfe8f03, 0xfe8f03, 0xfe8e03, 0xfe8e03, 0xfe8d03, 0xfe8d02, 0xfe8d03, 0xfe8c02, 0xfe8b02, 0xfe8b02, 0xfe8b02, 0xfe8a02, 0xfe8a02, 0xfe8902, 0xfe8902, 0xfe8801, 0xfe8802, 0xfe8701, 0xfe8702, 0xfa8605, 0xd08635, 0x91867a, 0x393939, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x4c4c4c, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xc3af90, 0xc7ad88, 0xc5ac87, 0xc5ac87, 0xc4aa85, 0xc4aa85, 0xc2a884, 0xc1a783, 0xc1a682, 0xc0a681, 0xbfa580, 0xbea480, 0xbea37f, 0xbda27e, 0xbca17d, 0xbba07d, 0xbb9f7c, 0xba9f7b, 0xb99e7a, 0xb89d7a, 0xb89c79, 0xb79b78, 0xb59976, 0xb59976, 0xb49875, 0xb49875, 0xb29673, 0xb29673, 0xb19472, 0xb19472, 0xaf9370, 0xaf9270, 0xae916f, 0xad906e, 0xac8f6d, 0xac8e6c, 0xab8d6c, 0xaa8d6b, 0xa98c6a, 0xa98b69, 0xa88a69, 0xa2896e, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x949494, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0x9f9f9f, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd2d2d2, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x5a5a5a, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x595959, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xc6c6c6, 0xd1d1d1, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x868686, 0x868686, 0x848484, 0x848484, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x6f6f6f, 0x6d6d6d, 0x565656, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x9a9a9a, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa3a3a3, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x6d6d6d, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x797979, 0xd1d1d1, 0xd0d0d0, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcbcbcb, 0xcbcbcb, 0xc9c9c9, 0xc9c9c9, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb2b2b2, 0xb0b0b0, 0xb0b0b0, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x999999, 0x979797, 0x979797, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x848484, 0x848484, 0x828282, 0x828282, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x353535, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0xbfbfbf, 0xcfcfcf, 0xcecece, 0xcdcdcd, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc2c2c2, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xababab, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x949494, 0x949494, 0x929292, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7b7b7b, 0x7b7b7b, 0x797979, 0x797979, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x707070, 0x6f6f6f, 0x6e6e6e, 0x464646, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x464646, 0xcfcfcf, 0xcfcfcf, 0xcdcdcd, 0xcdcdcd, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc1c1c1, 0xc0c0c0, 0xbfbfbf, 0xbebebe, 0xbdbdbd, 0xbcbcbc, 0xbbbbbb, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb6b6b6, 0xb6b6b6, 0xb4b4b4, 0xb4b4b4, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xaaaaaa, 0xa9a9a9, 0xa8a8a8, 0xa7a7a7, 0xa6a6a6, 0xa5a5a5, 0xa4a4a4, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0x9f9f9f, 0x9f9f9f, 0x9d9d9d, 0x9d9d9d, 0x9b9b9b, 0x9b9b9b, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x919191, 0x909090, 0x8f8f8f, 0x8e8e8e, 0x8d8d8d, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x888888, 0x888888, 0x868686, 0x868686, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x787878, 0x777777, 0x767676, 0x757575, 0x747474, 0x737373, 0x727272, 0x717171, 0x6f6f6f, 0x676767, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x7f7f7f, 0xbababa, 0xcccccc, 0xcbcbcb, 0xcacaca, 0xc9c9c9, 0xc8c8c8, 0xc7c7c7, 0xc6c6c6, 0xc5c5c5, 0xc4c4c4, 0xc3c3c3, 0xc2c2c2, 0xc0c0c0, 0xc0c0c0, 0xbebebe, 0xbebebe, 0xbcbcbc, 0xbcbcbc, 0xbababa, 0xb9b9b9, 0xb8b8b8, 0xb7b7b7, 0xb6b6b6, 0xb5b5b5, 0xb4b4b4, 0xb3b3b3, 0xb2b2b2, 0xb1b1b1, 0xb0b0b0, 0xafafaf, 0xaeaeae, 0xadadad, 0xacacac, 0xababab, 0xa9a9a9, 0xa9a9a9, 0xa7a7a7, 0xa7a7a7, 0xa5a5a5, 0xa5a5a5, 0xa3a3a3, 0xa2a2a2, 0xa1a1a1, 0xa0a0a0, 0x9f9f9f, 0x9e9e9e, 0x9d9d9d, 0x9c9c9c, 0x9b9b9b, 0x9a9a9a, 0x999999, 0x989898, 0x979797, 0x969696, 0x959595, 0x949494, 0x939393, 0x929292, 0x909090, 0x909090, 0x8e8e8e, 0x8e8e8e, 0x8c8c8c, 0x8b8b8b, 0x8a8a8a, 0x898989, 0x888888, 0x878787, 0x868686, 0x858585, 0x848484, 0x838383, 0x828282, 0x818181, 0x808080, 0x7f7f7f, 0x7e7e7e, 0x7d7d7d, 0x7c7c7c, 0x7b7b7b, 0x7a7a7a, 0x797979, 0x777777, 0x777777, 0x757575, 0x757575, 0x737373, 0x727272, 0x717171, 0x626262, 0x484848, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x3a3a3a, 0x4b4b4b, 0x4b4b4b, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x4a4a4a, 0x494949, 0x494949, 0x494949, 0x494949, 0x484848, 0x484848, 0x484848, 0x484848, 0x474747, 0x474747, 0x474747, 0x464646, 0x464646, 0x464646, 0x464646, 0x454545, 0x454545, 0x454545, 0x454545, 0x444444, 0x444444, 0x444444, 0x444444, 0x434343, 0x434343, 0x434343, 0x424242, 0x424242, 0x424242, 0x424242, 0x414141, 0x414141, 0x414141, 0x414141, 0x404040, 0x404040, 0x404040, 0x404040, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3f3f3f, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3e3e3e, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3d3d3d, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3c3c3c, 0x3b3b3b, 0x3b3b3b, 0x3b3b3b, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x3a3a3a, 0x393939, 0x393939, 0x393939, 0x393939, 0x383838, 0x383838, 0x383838, 0x383838, 0x373737, 0x373737, 0x373737, 0x373737, 0x363636, 0x363636, 0x363636, 0x353535, 0x353535, 0x353535, 0x353535, 0x272727, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, + 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020, 0x202020 +}; \ No newline at end of file diff --git a/dev/boot/BootKit/Rsrc/zka_swirl.rsrc b/dev/boot/BootKit/Rsrc/zka_swirl.rsrc new file mode 100644 index 00000000..0cb11bde --- /dev/null +++ b/dev/boot/BootKit/Rsrc/zka_swirl.rsrc @@ -0,0 +1,70 @@ +#define ZKA_SWIRL_HEIGHT 64 +#define ZKA_SWIRL_WIDTH 64 + +// array size is 12288 (32x32) +const unsigned int zka_swirl[] = { + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xf5f5f5, 0x7b7893, 0x020039, 0x020239, 0x01013a, 0x01013b, 0x00013b, 0x00013b, 0x01033f, 0x8587a0, 0xf7f7f7, 0xf7f7f7, 0xf8f8f8, 0xf7f7f7, 0xf5f5f5, 0xf7f7f7, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xf7f7f7, 0xf6f6f6, 0xf6f6f6, 0xd4d2da, 0x1e174b, 0x030138, 0x020139, 0x010139, 0x01013a, 0x00013a, 0x1a1e53, 0xcbccd5, 0xf6f6f6, 0xf6f6f6, 0xf6f6f6, 0xf6f6f6, 0xf6f6f6, 0xf6f6f6, 0xf5f5f6, 0xf6f6f6, 0xcdcbd6, 0x2b2453, 0x2a2a55, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xf6f6f6, 0xf6f6f6, 0xf5f5f5, 0xf5f5f5, 0xe9e9ec, 0x302856, 0x050137, 0x040138, 0x020139, 0x010139, 0x01013a, 0x4a4c74, 0xe0e0e5, 0xf5f5f5, 0xf5f5f5, 0xf6f6f6, 0xf5f5f5, 0xf5f5f5, 0xf5f5f5, 0xebebee, 0xb8b6c4, 0x554e74, 0x140940, 0x0b0135, 0x0d0134, 0x100235, 0x0a0033, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xbfbfbf, 0xf6f6f6, 0xf4f4f4, 0xf5f5f5, 0xf5f5f5, 0xf5f5f5, 0xf5f5f5, 0x756e8c, 0x070136, 0x060137, 0x040138, 0x030138, 0x020139, 0x6a6a8b, 0xecedef, 0xf5f5f5, 0xf5f5f5, 0xf5f5f5, 0xf5f5f5, 0xf5f5f5, 0xeeeef0, 0x908ea6, 0x272152, 0x060137, 0x060136, 0x0a0135, 0x0b0135, 0x0d0134, 0x100134, 0x120133, 0x130032, 0x1c0039, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x1d0031, 0x746583, 0xf4f4f4, 0xf4f4f4, 0xf4f4f4, 0xf4f4f4, 0xf4f4f4, 0xb6b3c0, 0x0a0135, 0x070136, 0x060137, 0x040137, 0x030138, 0x7a7994, 0xf4f4f4, 0xf5f5f5, 0xf4f4f4, 0xf4f4f4, 0xf4f4f4, 0xf3f3f3, 0x9999af, 0x131147, 0x030138, 0x040137, 0x060137, 0x090136, 0x0a0135, 0x0c0135, 0x0e0135, 0x110133, 0x120133, 0x140133, 0x160132, 0x180031, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x200030, 0x1d012e, 0x1b0130, 0xcdc8d1, 0xf4f4f4, 0xf4f4f4, 0xf4f4f4, 0xf4f4f4, 0xe6e6e9, 0x241549, 0x0b0135, 0x090136, 0x060137, 0x050137, 0x656183, 0xf4f4f4, 0xf3f3f4, 0xf4f4f4, 0xf4f4f4, 0xf3f3f3, 0xc9cad3, 0x3d3e6a, 0x010139, 0x020139, 0x030138, 0x050137, 0x060136, 0x090136, 0x0b0135, 0x0d0135, 0x100134, 0x120134, 0x3e2b56, 0x645476, 0x7d708a, 0x9a8fa3, 0xcfcbd3, 0xf7f7f7, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x220031, 0x20012e, 0x1e012e, 0x5b4567, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0x837993, 0x0d0134, 0x0c0135, 0x0a0136, 0x060137, 0x5d587c, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0x82849f, 0x010340, 0x01013a, 0x010139, 0x020139, 0x030138, 0x060137, 0x070137, 0x0a0136, 0x392d5a, 0x8b849b, 0xbfbac6, 0xeaeaec, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf4f4f4, 0xf4f4f4, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x550055, 0x24002d, 0x22012d, 0x21012e, 0x20012e, 0xa99eb0, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xdcdadf, 0x1f0b3f, 0x0e0134, 0x0c0135, 0x0a0136, 0x2d2353, 0xe0dee3, 0xf2f2f2, 0xf3f3f3, 0xf3f3f3, 0xe9e9eb, 0x5c5f83, 0x00013c, 0x00013c, 0x01013a, 0x010139, 0x030138, 0x040138, 0x251e50, 0x86829b, 0xceccd5, 0xf2f2f3, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf2f2f2, 0xf2f2f2, 0xf3f3f3, 0xf3f3f3, 0xf3f3f3, 0xf2f2f2, 0xf2f2f3, 0xf4f4f4, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0x320937, 0x25012c, 0x23012c, 0x23012e, 0x240232, 0xe2dfe3, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0x6a5c7c, 0x120133, 0x100134, 0x0d0134, 0x1b0d42, 0xd0cfd7, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xd6d6dc, 0x333463, 0x00013c, 0x00013d, 0x00013c, 0x01013a, 0x020139, 0x363360, 0xa4a2b5, 0xececee, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf3f3f3, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xeae9ea, 0x2a012c, 0x27012c, 0x25012c, 0x23012d, 0x52365b, 0xf1f1f1, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xdedce0, 0x1a0235, 0x130133, 0x110133, 0x0d0134, 0x9791a6, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xd5d5db, 0x282758, 0x00013a, 0x00013c, 0x00013c, 0x00013c, 0x1b1e52, 0x9f9eb3, 0xf1f1f1, 0xf2f2f2, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf2f2f2, 0xf1f1f1, 0xf2f2f2, 0xf2f2f2, 0xf2f2f2, 0xf1f1f1, 0xf1f1f1, 0xf2f2f2, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf2f2f2, 0xf1f1f1, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xf1f1f1, 0xd9d4d9, 0x2a012b, 0x28012b, 0x27012c, 0x25012c, 0x8b7990, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0x897c94, 0x170131, 0x140132, 0x120133, 0x473962, 0xf0f0f0, 0xf1f1f1, 0xf1f1f1, 0xe4e3e7, 0x2e2b5b, 0x010139, 0x01013a, 0x00013c, 0x00013d, 0x6c6e8e, 0xe9e9eb, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf0f0f0, 0xdad6dc, 0xbdb6c2, 0xb1a9b6, 0xaea2b3, 0xaea2b2, 0xb2a7b5, 0xb9afba, 0xc4bac4, 0xdfdadf, 0xf1f1f1, 0xf1f1f1, 0xeaeaea, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xf0f0f0, 0xf0f0f0, 0xbfb4be, 0x2b012a, 0x2a012b, 0x29012b, 0x27012c, 0xbcb3bd, 0xf0f0f0, 0xf0f0f0, 0xf0f0f0, 0xeff0f0, 0x452d56, 0x180131, 0x150132, 0x130133, 0xc2bec9, 0xf0f0f0, 0xf1f1f1, 0xeff0f0, 0x423c65, 0x030138, 0x020139, 0x01013b, 0x0a0e49, 0x9fa1b5, 0xf1f1f1, 0xf0f0f0, 0xf0f0f0, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xf1f1f1, 0xe7e6e8, 0xa9a2b4, 0x756885, 0x3f2a54, 0x1f0536, 0x1a0131, 0x1c0130, 0x1f012e, 0x21012e, 0x22012d, 0x24012d, 0x25012c, 0x28012b, 0x29012b, 0x330634, 0x563255, 0x5f375b, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xf2f2f2, 0xf0f0f0, 0xf0f0f0, 0xaa98a9, 0x2d012a, 0x2b012a, 0x2a012a, 0x29012c, 0xd6d1d7, 0xf0f0f0, 0xf0f0f0, 0xf0f0f0, 0xc6bfc9, 0x1c0130, 0x1a0130, 0x180132, 0x615273, 0xf0f0f0, 0xf0f0f0, 0xeff0f0, 0x7f7993, 0x060137, 0x030138, 0x020139, 0x242657, 0xd4d4da, 0xeff0f0, 0xf0f0f0, 0xeff0f0, 0xf0f0f0, 0xf0f0f0, 0xe2e1e4, 0x9793a9, 0x4d4168, 0x140338, 0x120133, 0x140132, 0x180132, 0x1a0131, 0x1c0130, 0x1f012e, 0x20012e, 0x22012d, 0x24012d, 0x25012c, 0x28012b, 0x29002a, 0x2b012a, 0x2c012a, 0x2d012a, 0x2e0129, 0x2f0028, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xf0f0f0, 0xeef0f0, 0xeff0f0, 0xeff0f0, 0xa08d9e, 0x2e0029, 0x2d012a, 0x2b012a, 0x411841, 0xedeced, 0xeff0f0, 0xeff0f0, 0xeff0f0, 0x8f8196, 0x1e012e, 0x1b0130, 0x190131, 0xc6c2cb, 0xeff0f0, 0xeff0f0, 0xbfbbc7, 0x10033a, 0x060136, 0x040138, 0x353360, 0xd9d8de, 0xeff0f0, 0xeff0f0, 0xeff0f0, 0xeff0f0, 0xd8d7dd, 0x807c96, 0x1b1045, 0x0b0135, 0x0d0135, 0x100133, 0x130132, 0x150132, 0x190131, 0x1b0130, 0x1e0130, 0x20012e, 0x22012d, 0x24012d, 0x25012c, 0x28012b, 0x29012b, 0x2b012a, 0x2c012a, 0x2d012a, 0x300129, 0x310128, 0x320129, 0x320027, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xc4b9c3, 0xefeff0, 0xeff0f0, 0xeff0f0, 0x9e899a, 0x310129, 0x2e0129, 0x2d012a, 0x5e3c5d, 0xefeff0, 0xefefef, 0xeff0f0, 0xeff0f0, 0x5e4466, 0x20012e, 0x1c0130, 0x452e57, 0xeff0f0, 0xefefef, 0xe7e6e9, 0x312150, 0x0b0135, 0x070137, 0x272051, 0xd7d6dc, 0xefeff0, 0xeff0f0, 0xefefef, 0xebebec, 0x9595ab, 0x151046, 0x050137, 0x070136, 0x0b0135, 0x0e0134, 0x120133, 0x140133, 0x250b3d, 0x371e49, 0x4f375c, 0x5c4366, 0x5e4465, 0x55385c, 0x45244c, 0x370e3a, 0x2b012c, 0x2b012b, 0x2c012a, 0x2e012a, 0x300129, 0x310128, 0x320128, 0x340128, 0x350027, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x3a0025, 0x8a6a80, 0xefefef, 0xefefef, 0xefefef, 0x9f899a, 0x320028, 0x310028, 0x300129, 0x795c76, 0xefefef, 0xefefef, 0xefefef, 0xe3e0e3, 0x2c0635, 0x22012e, 0x20012e, 0x9d92a5, 0xefefef, 0xefefef, 0x877d95, 0x100134, 0x0c0135, 0x1b1044, 0xd1d1d7, 0xefefef, 0xefefef, 0xefefef, 0xcccdd5, 0x333462, 0x010139, 0x030138, 0x060137, 0x0a0137, 0x3f335d, 0x7e748e, 0xaca6b5, 0xe0dde2, 0xefefef, 0xefefef, 0xefefef, 0xefefef, 0xefefef, 0xefefef, 0xefefef, 0xefefef, 0xe7e6e7, 0xc5bcc5, 0xa796a7, 0x755571, 0x4c1e44, 0x320028, 0x340127, 0x350127, 0x360127, 0x390027, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x2a002a, 0x3a0024, 0x7c5670, 0xeeeeee, 0xefefef, 0xefefef, 0xa48e9e, 0x340127, 0x330028, 0x310129, 0x81667e, 0xeeeeee, 0xeeeeee, 0xefefef, 0xc6bdc7, 0x26012c, 0x23012d, 0x21012d, 0xd7d3d9, 0xeeeeee, 0xe1e0e3, 0x2c1747, 0x110133, 0x0d0135, 0xaaa6b6, 0xefefef, 0xefefef, 0xeeeeee, 0xa2a3b5, 0x0a104a, 0x00013b, 0x020139, 0x130d44, 0x78748f, 0xc9c7cf, 0xefefef, 0xefefef, 0xeeeeef, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xefeeef, 0xefefef, 0xefeeef, 0xeeeded, 0xc3b7c1, 0x84657d, 0x4c193f, 0x370125, 0x370026, 0x400033, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x3e0027, 0x3d0024, 0x6a3d5b, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xad99a8, 0x360027, 0x350027, 0x330128, 0x876b81, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xb0a2b1, 0x28012b, 0x25012c, 0x4e3156, 0xeeeeee, 0xeeeeee, 0xa097a9, 0x170132, 0x120133, 0x756a87, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0x8c8ca3, 0x020340, 0x00013c, 0x0e1149, 0x8f8ea6, 0xe0e0e3, 0xeeeeee, 0xeeeeee, 0xe8e7e9, 0xd2cfd5, 0xb2acb8, 0x908398, 0x817089, 0x7d6983, 0x7c6783, 0x826c85, 0x907c91, 0xab9cac, 0xc2b9c2, 0xddd9dd, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xeeeeee, 0xedecec, 0xb7a6b2, 0x714662, 0x3e0228, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x40152a, 0x3f0025, 0x3e0023, 0x4b0d34, 0xededed, 0xededed, 0xededed, 0xc1b5be, 0x380025, 0x360025, 0x350027, 0x866980, 0xededed, 0xededed, 0xededed, 0x958295, 0x2a012a, 0x28012c, 0x88758b, 0xededed, 0xededee, 0x4a3157, 0x180131, 0x220a3d, 0xd7d4d9, 0xededee, 0xededed, 0x8d8ba2, 0x04033d, 0x00013c, 0x4d5178, 0xd0d1d7, 0xededed, 0xe9e9eb, 0xbfbcc7, 0x756b89, 0x362552, 0x180134, 0x190131, 0x1c0130, 0x1f012e, 0x22012d, 0x24012c, 0x28012c, 0x2a012b, 0x2c012a, 0x2d012a, 0x350430, 0x633e5d, 0x998394, 0xc6bbc3, 0xececec, 0xeeeeee, 0xededed, 0xededed, 0xededed, 0xededed, 0xededed, 0xc8bbc2, 0xefefef, 0x000000, 0x000000, + 0x000000, 0x000000, 0x400023, 0x410022, 0x400022, 0x3f0023, 0xdbd5d9, 0xededed, 0xededed, 0xd9d3d7, 0x3a0025, 0x380125, 0x370025, 0x83627a, 0xededed, 0xededed, 0xededed, 0x897086, 0x2c012a, 0x2a012b, 0xb5abb6, 0xededed, 0xd2ced4, 0x1f012e, 0x1a0130, 0x8a7f95, 0xededed, 0xededed, 0xb5b3c0, 0x0b053d, 0x03023a, 0x8889a0, 0xe6e6e8, 0xe9e9eb, 0x9f9eb1, 0x36305c, 0x0a0137, 0x0e0134, 0x130133, 0x170132, 0x1a0130, 0x1f012e, 0x21012d, 0x24012c, 0x27012b, 0x2a012b, 0x2c012a, 0x2d0129, 0x310129, 0x320128, 0x330028, 0x350127, 0x360027, 0x5c2c4e, 0x94798b, 0xdbd6da, 0xededed, 0xededed, 0xededed, 0xededed, 0xededed, 0xeaeaea, 0x000000, 0x000000, + 0x000000, 0x7f0000, 0x430022, 0x430022, 0x420022, 0x410022, 0xb5a0ad, 0xededed, 0xededed, 0xe9e8e8, 0x3f0228, 0x3c0124, 0x390024, 0x77516b, 0xececec, 0xececec, 0xececec, 0x856a81, 0x300029, 0x2d012a, 0xcac3ca, 0xececec, 0x918195, 0x21012d, 0x2a0a3a, 0xe2e2e4, 0xececec, 0xd5d3d8, 0x1f1144, 0x120940, 0xacabb9, 0xececec, 0xc2c3cd, 0x2d2c5d, 0x030138, 0x060136, 0x2a1c4d, 0x6e6481, 0xa199ab, 0xb4aeba, 0xcdc8d0, 0xd6d3d8, 0xd4cfd4, 0xc6bec7, 0xb8aeb9, 0xa292a1, 0x745571, 0x400e38, 0x330128, 0x340027, 0x360027, 0x380127, 0x390125, 0x390025, 0x3c0124, 0x44062d, 0x856177, 0xdfdbde, 0xececec, 0xececec, 0xececec, 0xebecec, 0xffffff, 0x000000, + 0x000000, 0x8b6574, 0x460122, 0x450021, 0x440021, 0x430021, 0x967586, 0xececec, 0xecebeb, 0xececec, 0x693957, 0x3e0023, 0x3d0024, 0x602e4f, 0xececec, 0xececec, 0xececec, 0x866980, 0x330128, 0x300129, 0xe5e4e5, 0xececec, 0x6a4f6d, 0x24012d, 0x786580, 0xececec, 0xececec, 0x5c4e71, 0x100236, 0xb4b2be, 0xececec, 0x7b7d97, 0x020541, 0x111249, 0x716d8c, 0xc0bec8, 0xbcb9c4, 0xa49dae, 0x998fa1, 0x918498, 0x97899c, 0xa89bac, 0xbab1bb, 0xd8d3d8, 0xebebeb, 0xececec, 0xececec, 0xececec, 0xccc2c9, 0x937a8d, 0x542245, 0x3a0125, 0x3c0124, 0x3d0024, 0x3e0023, 0x3f0023, 0x400023, 0x4f1034, 0x9a7b8c, 0xe4e1e2, 0xececec, 0xececec, 0xeaeaea, 0x000000, + 0x000000, 0xe8e6e6, 0x672b49, 0x460021, 0x460021, 0x450021, 0x551436, 0xeaeaea, 0xececec, 0xebebeb, 0x8e6a7f, 0x400023, 0x3f0023, 0x4a0b32, 0xdedadd, 0xebebeb, 0xebebeb, 0x8d7084, 0x350027, 0x38032d, 0xebebeb, 0xebebeb, 0x421942, 0x28012b, 0xb9b1bb, 0xebebeb, 0xafa9b5, 0x150132, 0x878096, 0xebebeb, 0x625f81, 0x03033f, 0x757793, 0x737390, 0x423d66, 0x13063d, 0x100134, 0x150132, 0x1a0130, 0x1f012e, 0x23012d, 0x27012c, 0x2a012b, 0x2d012a, 0x471a41, 0x7f6078, 0xbaadb6, 0xebebeb, 0xebebeb, 0xebebeb, 0xebebeb, 0xbdafb8, 0x6c3d5a, 0x3f0023, 0x400023, 0x410022, 0x410022, 0x420022, 0x430021, 0x5a1b3d, 0xc7b8c0, 0xebebeb, 0xececec, 0x000000, + 0x000000, 0xebebeb, 0xa07f8f, 0x490020, 0x490020, 0x470020, 0x460020, 0xcabcc3, 0xebebeb, 0xeaeaea, 0xb9a7b1, 0x420022, 0x410122, 0x400023, 0xcec3c9, 0xebebeb, 0xebebeb, 0x9b8292, 0x380025, 0x3f0731, 0xebeaea, 0xeaeaea, 0x32032e, 0x350935, 0xdddadd, 0xebebeb, 0x4c3358, 0x554165, 0xebebeb, 0x615a7b, 0x3c3762, 0xc9c9d1, 0xeaeaea, 0xd7d7db, 0xb8b6c2, 0xc8c6ce, 0xd7d5da, 0xd3d1d6, 0xd4d0d5, 0xc4bdc6, 0xa598a8, 0x816a82, 0x5a3557, 0x34022d, 0x330128, 0x350027, 0x370125, 0x511b40, 0xa58d9b, 0xddd9dc, 0xeaeaea, 0xeaeaea, 0xeaeaea, 0xb6a3af, 0x5b1f41, 0x430022, 0x440021, 0x440021, 0x450021, 0x460021, 0x470121, 0x9d7d8c, 0xe5e3e4, 0x000000, + 0xe7e7e7, 0xeaeaea, 0xdbd4d8, 0x520629, 0x4a001f, 0x4a0020, 0x490020, 0x977284, 0xeaeaea, 0xeaeaea, 0xe7e6e7, 0x4f072d, 0x440021, 0x430022, 0xa28695, 0xeaeaea, 0xeaeaea, 0xbbabb6, 0x3c0024, 0x3e022a, 0xeaeaea, 0xe1dfe0, 0x320128, 0x5a3456, 0xeaeaea, 0xc7bfc8, 0x33103e, 0xd4d0d6, 0xe3e2e4, 0x938da1, 0xdedde0, 0xeaeaea, 0xeaeaea, 0xeaeaea, 0xeaeaea, 0xeaeaea, 0xeaeaea, 0x8f8196, 0x42224c, 0x674c6a, 0xa292a2, 0xe2e0e2, 0xeaeaea, 0xcec6cb, 0x988092, 0x4b143b, 0x3a0024, 0x3d0024, 0x3e0023, 0x571c3f, 0xa48897, 0xeaeaea, 0xeaeaea, 0xeaeaea, 0xe8e8e8, 0x9f8190, 0x470123, 0x460020, 0x470020, 0x470020, 0x490020, 0x490020, 0x6d314d, 0xad8fa3, + 0xe8e8e8, 0xe9e9e9, 0xeaeaea, 0x865369, 0x4c001f, 0x4c001f, 0x4c001f, 0x5c1636, 0xe4e2e3, 0xeaeaea, 0xeaeaea, 0x895c72, 0x460020, 0x450021, 0x794a62, 0xeaeaea, 0xeaeaea, 0xd2c9cd, 0x400124, 0x3d0023, 0xe2dfe1, 0xdad6d9, 0x360027, 0x75536d, 0xe9e9e9, 0x826b83, 0x857188, 0xeaeaea, 0xeaeaea, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9ea, 0xe9e9e9, 0xe9e9e9, 0xeaeaea, 0xe9e9e9, 0xeae9ea, 0xd6d2d7, 0x887389, 0x380633, 0x3c0632, 0x83647b, 0xd8d3d6, 0xe9e9e9, 0xe2dfe1, 0x96798a, 0x46062c, 0x410022, 0x420022, 0x430021, 0x6a3350, 0xd7cfd3, 0xeaeaea, 0xeae9ea, 0xeaeaea, 0xcec3c8, 0x5e1a3a, 0x4a0020, 0x4a001f, 0x4b001f, 0x4b001f, 0x4c001f, 0x4d0021, + 0xe8e8e8, 0xe9e9e9, 0xe9e9e9, 0xcec0c6, 0x4e001e, 0x4e001e, 0x4d001e, 0x4d001e, 0xb096a2, 0xe9e8e8, 0xe9e9e9, 0xc9bbc1, 0x4b0121, 0x490020, 0x4f072a, 0xe4e1e2, 0xe9e9e9, 0xe4e2e3, 0x5b1f40, 0x410022, 0xc6b9c1, 0xe3e2e2, 0x3a0024, 0x8e7185, 0xe9e9e9, 0x4f2347, 0xd0cbd0, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xe9e8e9, 0xe9e9e9, 0xd6d0d5, 0x83637b, 0x3c0127, 0x44062d, 0x967789, 0xe2e0e2, 0xe9e9e9, 0xd4ccd1, 0x76445e, 0x450021, 0x460020, 0x470020, 0x550f31, 0xb69ea9, 0xe9e9e9, 0xe9e9e9, 0xe9e9e9, 0xdad4d7, 0x784058, 0x4c001f, 0x4d001f, 0x4d001e, 0x4d001e, 0x4d001e, + 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe9e9e9, 0x844f64, 0x50001c, 0x50001c, 0x4f001e, 0x6f2e4a, 0xe9e9e9, 0xe8e8e8, 0xe8e8e8, 0x6f324e, 0x4b001f, 0x4b001f, 0xa98c99, 0xe8e8e8, 0xe8e8e8, 0x8a6176, 0x450021, 0xab93a0, 0xe8e8e8, 0x47052b, 0x997c8e, 0xe8e8e8, 0xe2e0e1, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe7e7e7, 0xe8e8e8, 0xbdaeb7, 0x521337, 0x430022, 0x642947, 0xd9d3d6, 0xe8e8e8, 0xe8e8e8, 0x9b7888, 0x4e0325, 0x4a001f, 0x4b001f, 0x4c001f, 0xa07e8c, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0x88566b, 0x4f001e, 0x4f001e, 0x50001e, 0x50001c, + 0xe9e9e9, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xd4cacd, 0x560324, 0x52001c, 0x51001c, 0x51001c, 0xb296a0, 0xe8e8e8, 0xe8e8e8, 0xbba5af, 0x4f001e, 0x4e001e, 0x71314c, 0xe8e8e8, 0xe8e8e8, 0xc1b0b8, 0x4a001f, 0x835269, 0xe8e8e8, 0x5e2141, 0x9b7b8c, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0xe8e8e8, 0x9e8393, 0x855d73, 0xe8e8e8, 0xd4cdd1, 0x5f1f3e, 0x490020, 0x5c1738, 0xc8bac0, 0xe8e8e8, 0xe8e8e8, 0xb196a2, 0x570a2b, 0x4e001e, 0x4e001e, 0x4f001e, 0x94687b, 0xe7e7e7, 0xe8e8e8, 0xe8e8e8, 0xe8e7e7, 0x996e7f, 0x51001c, 0x51001c, 0x51001d, + 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xa27c8a, 0x54001b, 0x53001b, 0x53001b, 0x661936, 0xe2e0e0, 0xe7e7e7, 0xe6e6e6, 0x80465c, 0x51001c, 0x51001c, 0xb296a0, 0xe8e8e8, 0xe2e0e1, 0x682441, 0x5a0d2d, 0xe6e6e6, 0x84556a, 0x946d7f, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe8e8e8, 0xe8e7e8, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xd8d2d5, 0x642744, 0x8e6578, 0xe7e7e7, 0xd8d0d4, 0x6a2a45, 0x4e001e, 0x5b0d2e, 0xc4b3b9, 0xe7e7e7, 0xe7e7e7, 0xc6b6bc, 0x52011f, 0x51001c, 0x51001c, 0x51001c, 0x9e7887, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe5e4e5, 0x8d5a6d, 0x53001b, 0x53001b, + 0xdcd6d8, 0xe6e6e6, 0xe7e7e7, 0xe6e6e6, 0xe7e6e6, 0xe5e3e3, 0x712541, 0x56001a, 0x55001a, 0x56001b, 0x996b7b, 0xe7e6e7, 0xe7e7e7, 0xcfc3c7, 0x5d0727, 0x54001b, 0x6e2741, 0xe3e1e2, 0xe7e7e7, 0xae8f9a, 0x52001c, 0xbba3ad, 0xa88894, 0x80475f, 0xe6e6e6, 0xe7e7e7, 0xe7e7e7, 0xe6e6e6, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e6e7, 0xe7e7e7, 0xe6e6e6, 0xe7e7e7, 0xe7e6e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xe7e7e7, 0xc7b8bd, 0x4f001e, 0xad909b, 0xe7e7e7, 0xd3c8cd, 0x601030, 0x52001c, 0x641735, 0xd4c9cd, 0xe7e7e7, 0xe6e6e6, 0xb499a4, 0x54001b, 0x54001b, 0x54001b, 0x54001b, 0xa98592, 0xe7e6e6, 0xe6e6e6, 0xe7e7e7, 0xddd8da, 0x82465d, 0x55001a, + 0x8c5164, 0xe5e5e5, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xd3c8cc, 0x630d2b, 0x580019, 0x58001a, 0x5a001a, 0xbda5ad, 0xe6e6e6, 0xe6e6e6, 0xab8693, 0x590019, 0x58001a, 0xa07683, 0xe6e6e6, 0xdfdcdd, 0x681935, 0x804156, 0xe0ddde, 0x762e47, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0x915f72, 0x5c0524, 0xd6cacf, 0xe6e6e6, 0xc4b2b8, 0x57001b, 0x56001a, 0x6e223e, 0xdcd4d7, 0xe6e6e6, 0xe6e6e6, 0xa17887, 0x56001a, 0x57001a, 0x57001a, 0x5c0220, 0xc2adb4, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xd9d2d4, 0x691935, + 0x5b0019, 0xae8b96, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e5e5, 0xe6e6e6, 0xae8a96, 0x5e011b, 0x5c0019, 0x5c0019, 0x670d2a, 0xd6cbcf, 0xe6e6e6, 0xe5e3e4, 0x8c5164, 0x5c0018, 0x640624, 0xbfa6ae, 0xe6e6e6, 0xba9ea8, 0x5d0018, 0xcab7bd, 0xd3c6ca, 0xe5e5e5, 0xe6e5e5, 0xe6e5e6, 0xe6e6e6, 0xe6e5e5, 0xe6e6e6, 0xe6e5e5, 0xe6e6e6, 0xe6e5e5, 0xe6e5e5, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe6e6e6, 0xe5e5e5, 0xccbbc0, 0xcebfc4, 0x5d011c, 0x905669, 0xe6e6e6, 0xe6e6e6, 0x9a6a7a, 0x5a0019, 0x5a0019, 0x976676, 0xe5e5e5, 0xe6e6e6, 0xe5e4e4, 0x7c374e, 0x580019, 0x5a0019, 0x5a0019, 0x691431, 0xdbd4d6, 0xe6e6e6, 0xe5e5e5, 0xe6e6e6, 0xc3afb5, + 0x5e0018, 0x630622, 0xc9b6bc, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xa27482, 0x5e0017, 0x5e0017, 0x5f0017, 0x7d3046, 0xdad4d5, 0xe5e5e5, 0xe3e2e2, 0x80364c, 0x600017, 0x690a25, 0xd0c0c4, 0xe5e4e4, 0xa16d7b, 0x813246, 0xe1dede, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e4e4, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe4e2e3, 0x761f36, 0xe5e5e5, 0x863f54, 0x61011a, 0xcab7bd, 0xe5e5e5, 0xdfdcdd, 0x721e37, 0x5e0018, 0x5e011a, 0xc2adb4, 0xe5e5e5, 0xe5e5e5, 0xdad2d5, 0x6b1631, 0x5c0018, 0x5c0019, 0x5c0019, 0x88495d, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, 0xe5e5e5, + 0x600018, 0x5f0018, 0x6c122d, 0xd4c7cb, 0xe5e5e5, 0xe5e5e5, 0xe4e4e4, 0xe5e5e5, 0xe4e4e4, 0x986372, 0x610017, 0x610016, 0x620016, 0x884254, 0xdbd4d6, 0xe4e4e4, 0xdedadb, 0x7d2940, 0x650016, 0x761931, 0xd1c1c5, 0xe4e3e3, 0x832e41, 0xa87580, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe5e4e4, 0xe4e4e4, 0xe4e4e4, 0xe5e5e5, 0xe5e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0x812a3e, 0xcdbbbf, 0xba9aa4, 0x640014, 0x955767, 0xe4e4e4, 0xe5e4e4, 0xaa818c, 0x610017, 0x600017, 0x7f3349, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xae8994, 0x5e0018, 0x5e0018, 0x5e0018, 0x5e0018, 0xc0a7ae, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, + 0x610016, 0x610017, 0x610017, 0x741c35, 0xdad2d4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0x9b6473, 0x640016, 0x640014, 0x650014, 0x7b2238, 0xdad0d3, 0xe4e4e4, 0xdcd6d8, 0x9e6370, 0x690013, 0x7b182e, 0xc7aeb4, 0xdfdbdc, 0x934352, 0xc19fa5, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0xe4e4e4, 0x944b5b, 0xb48b94, 0xded9db, 0x6b0118, 0x6f0922, 0xd9cfd1, 0xe4e4e4, 0xe0ddde, 0x6e0c28, 0x630016, 0x630016, 0xc2aab0, 0xe4e4e4, 0xe4e4e4, 0xdedadb, 0x79273e, 0x610017, 0x600017, 0x600017, 0x78273e, 0xe0ddde, 0xe4e4e4, 0xe5e4e4, + 0x620016, 0x630016, 0x630014, 0x630016, 0x781f37, 0xd6cccf, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xaa7c87, 0x670013, 0x680013, 0x690013, 0x791930, 0xcfbdc1, 0xe3e3e3, 0xe3e3e3, 0xb78e97, 0x740318, 0x730112, 0xaa6e7a, 0xdcd5d6, 0xd4c2c6, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe4e4e4, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0x9d5664, 0xa2616d, 0xe4e4e4, 0x83283c, 0x6c0012, 0xb58c95, 0xe3e3e3, 0xe4e4e4, 0x9b606e, 0x660014, 0x660014, 0x802d42, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xb796a0, 0x630016, 0x620016, 0x620016, 0x620016, 0xb08c96, 0xe3e3e3, 0xe5e5e5, + 0x640018, 0x650014, 0x650014, 0x650014, 0x650014, 0x771931, 0xd4c7ca, 0xe3e2e2, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xbc9aa1, 0x740b22, 0x6b0012, 0x6c0011, 0x710218, 0xaa757f, 0xded8d9, 0xe3e3e3, 0xd5c6c9, 0xa05765, 0x7a0112, 0x8c2233, 0xc8a7ab, 0xe3e3e3, 0xe3e3e3, 0xe2e2e2, 0xe3e2e2, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e3e3, 0xe3e2e2, 0xe3e3e3, 0xe3e3e3, 0xc9aaad, 0xbe8e94, 0xe3e2e2, 0x9e505d, 0x9b4d5c, 0xe3e3e3, 0x9c5765, 0x6f0011, 0x9a5564, 0xe3e3e3, 0xe3e3e3, 0xcab5b9, 0x690013, 0x690013, 0x680013, 0xccb9be, 0xe3e3e3, 0xe2e2e2, 0xdfdbdc, 0x71112a, 0x650016, 0x640016, 0x640016, 0x782138, 0xdcd6d7, 0xe2e2e2, + 0x6a031a, 0x670014, 0x670014, 0x670014, 0x680013, 0x680013, 0x6d031b, 0xc0a5ab, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xd5c8ca, 0x98505f, 0x710011, 0x720010, 0x730010, 0x841c30, 0xbf99a0, 0xe2e2e2, 0xe2e2e2, 0xd9ced0, 0xb1737b, 0x8e1727, 0x941e2b, 0xbf888d, 0xdbcfd0, 0xe2e2e2, 0xe3e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe1ddde, 0x9b303c, 0xbc868c, 0xe2e2e2, 0x963846, 0x994250, 0xe2e2e2, 0xa86b77, 0x730010, 0x821e32, 0xe2e2e2, 0xe2e2e2, 0xdedbdc, 0x7b182d, 0x6b0012, 0x6a0013, 0xa26977, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xae848f, 0x660014, 0x660014, 0x660014, 0x650014, 0xb5919b, 0xe1e1e1, + 0xe0e0e0, 0xaa7a85, 0x6a0117, 0x690013, 0x690013, 0x6a0013, 0x6b0012, 0x6b0012, 0xa8757f, 0xe0e0e0, 0xe2e1e1, 0xe2e1e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xc09ea5, 0x8e3545, 0x76000e, 0x78000d, 0x7a000c, 0x8b1f30, 0xb9878d, 0xd4c2c5, 0xe2e2e2, 0xe2e1e1, 0xd5c2c4, 0xc18b8f, 0xc2878c, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xe2e1e1, 0xe2e2e2, 0xe2e1e1, 0xdcd0d1, 0xc18085, 0xcdacae, 0x8c010a, 0xd9cacb, 0xe2e1e2, 0x8a1122, 0x9a414e, 0xe2e2e2, 0xb17c85, 0x77000e, 0x770113, 0xe0dfdf, 0xe2e1e1, 0xe2e2e2, 0x9a5563, 0x6d0011, 0x6d0012, 0x7e1f34, 0xe2e2e2, 0xe2e2e2, 0xe2e2e2, 0xd5cbcd, 0x690014, 0x680013, 0x670014, 0x670014, 0x85354a, 0xdfdfdf, + 0x000000, 0xe2e0e2, 0xbb9ba2, 0x760e25, 0x6b0012, 0x6c0012, 0x6c0011, 0x6e0012, 0x6e0011, 0x811b31, 0xc8b1b6, 0xe1e1e1, 0xe1e1e1, 0xe1e1e1, 0xe1e1e1, 0xe1e1e1, 0xe1e1e1, 0xc4a2a8, 0x9e4d5a, 0x7f0111, 0x7f000b, 0x810009, 0x85000b, 0x9a2c38, 0xac545e, 0xbc7c82, 0xc48c91, 0xca9b9e, 0xcb9a9c, 0xca8d8e, 0xc87c7d, 0xc66666, 0xd29b9c, 0xded5d5, 0xd7bfbf, 0xb13f44, 0xdcd1d2, 0xa22731, 0xa9454f, 0xe1e1e1, 0xdacecf, 0x830009, 0xa04953, 0xe1e1e1, 0xb7868e, 0x7a000d, 0x78000d, 0xd2c2c4, 0xe1e1e1, 0xe1e1e1, 0xb1838c, 0x710010, 0x6f0011, 0x6e0011, 0xd1c2c5, 0xe1e1e1, 0xe1e1e1, 0xe1e0e1, 0x8c4051, 0x6a0013, 0x690013, 0x690013, 0x680014, 0x000000, + 0x000000, 0xe0e0e0, 0xe0e0e0, 0xd2c5c8, 0x883345, 0x6e0012, 0x6f0011, 0x710011, 0x710011, 0x720010, 0x730010, 0x994c5a, 0xd4c7ca, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe1e1e1, 0xdbd3d4, 0xc0949a, 0xa95c64, 0x972432, 0x8f0614, 0x8d0005, 0x910004, 0x950004, 0x9d040c, 0xa81c22, 0xb94e51, 0xc87e7f, 0xded5d6, 0xdfdada, 0xc98283, 0xae191c, 0xd9c3c4, 0xbb6a6e, 0x960003, 0xceacaf, 0xe1e1e1, 0xc3979b, 0x870008, 0xab5f67, 0xe0e0e0, 0xb57f86, 0x7d000b, 0x7b000c, 0xc7aaaf, 0xe1e0e1, 0xe1e1e1, 0xcab3b6, 0x74000e, 0x730010, 0x710011, 0xb58c94, 0xe1e0e0, 0xe1e1e1, 0xe0e0e0, 0xb0848d, 0x6c0012, 0x6b0012, 0x6a0012, 0x6a0012, 0x000000, + 0x000000, 0xe1e1e1, 0xe0e0e0, 0xe0e0e0, 0xdfdede, 0xb48991, 0x7c1228, 0x720010, 0x730010, 0x74000f, 0x75000e, 0x76000e, 0x7b0316, 0x9c4d5a, 0xc7aaae, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xdfddde, 0xded9da, 0xdfddde, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xce8b8b, 0xb92323, 0xb72d2e, 0xdac7c7, 0xcc989a, 0x9d0002, 0xad3f45, 0xe0e0e0, 0xe0e0e0, 0xa94e56, 0x8b0007, 0xbf8d92, 0xe0e0e0, 0xb06e78, 0x80000b, 0x7e000b, 0xc4a2a7, 0xe0e0e0, 0xe0e0e0, 0xd2c4c7, 0x770010, 0x75000e, 0x74000f, 0xa56874, 0xe0e0e0, 0xe0e0e0, 0xe0e0e0, 0xd0c1c4, 0x6e0012, 0x6d0012, 0x6c0012, 0x6c0012, 0x000000, + 0x000000, 0xdbdbdb, 0xdfdfdf, 0xdfdfdf, 0xdfdfdf, 0xdfdfdf, 0xdbd5d6, 0xa2616c, 0x790318, 0x76000e, 0x77000d, 0x79000d, 0x7a000c, 0x7b000c, 0x7c000c, 0x881323, 0xb0727a, 0xcbb1b4, 0xdedbdb, 0xdfdfdf, 0xe0e0e0, 0xdfdfdf, 0xdfdfdf, 0xdfdfdf, 0xdfdfdf, 0xe0e0e0, 0xe0e0e0, 0xdfdfdf, 0xd4b5b6, 0xc26a6c, 0xb21819, 0xb10000, 0xc86d6d, 0xdfdddd, 0xd2acad, 0xa7090f, 0x9f0002, 0xd5bdbe, 0xdfdfdf, 0xdbd2d3, 0x960d19, 0x8c0006, 0xceb4b6, 0xe0e0e0, 0xaa5f68, 0x82000a, 0x80000a, 0xc5a3a9, 0xdfdfdf, 0xe0dfdf, 0xd9d0d1, 0x7e061b, 0x77000d, 0x76000f, 0x8e3443, 0xdfdfdf, 0xe0e0e0, 0xdfdfdf, 0xdfdfdf, 0x7a0f24, 0x6e0011, 0x6e0012, 0x55002a, 0x000000, + 0x000000, 0x000000, 0xdcdcdc, 0xdfdfdf, 0xdedede, 0xdfdfdf, 0xdfdfdf, 0xdfdfdf, 0xd3c6c7, 0xa25d68, 0x841123, 0x7b000c, 0x7c000c, 0x7d000b, 0x7f000b, 0x81000a, 0x820009, 0x840009, 0x87010c, 0x992a35, 0xaa535c, 0xb2656c, 0xb66b72, 0xb86c72, 0xb8686c, 0xb55a5f, 0xad383e, 0xa60a11, 0xa40001, 0xa90001, 0xba3a3c, 0xd6b5b5, 0xdfdfdf, 0xcd9293, 0xac060b, 0xa40001, 0xc68788, 0xdfdfdf, 0xdfdfdf, 0xc1898c, 0x910004, 0x940914, 0xdedcdd, 0xdfdede, 0x9c3541, 0x850009, 0x820009, 0xc8aaae, 0xdfdfdf, 0xdfdfdf, 0xdbd6d7, 0x830e21, 0x79000c, 0x78000d, 0x7c0519, 0xdfdedf, 0xdfdede, 0xdfdfdf, 0xdfdfdf, 0x924352, 0x710010, 0x6e0012, 0x000000, 0x000000, + 0x000000, 0x000000, 0xdfdfdf, 0xdddcdc, 0xdedede, 0xdedede, 0xdedede, 0xdedede, 0xdedede, 0xdedede, 0xdad4d4, 0xbf999f, 0x9d4955, 0x830414, 0x81000a, 0x82000a, 0x840009, 0x850007, 0x880006, 0x8a0006, 0x8c0006, 0x8e0005, 0x910004, 0x940003, 0x970003, 0x9a0002, 0x9e0002, 0xa5070d, 0xba5154, 0xd3b0b0, 0xdedddd, 0xdcd4d4, 0xc87071, 0xad0000, 0xa90000, 0xc0686b, 0xdedede, 0xdedede, 0xdbd4d4, 0x9f141e, 0x930004, 0xae535b, 0xdedede, 0xdddddd, 0x8d0311, 0x860007, 0x840009, 0xd1bec0, 0xdedede, 0xdedede, 0xdddbdb, 0x881326, 0x7b000c, 0x7a000c, 0x78000d, 0xdad4d5, 0xdedede, 0xdedede, 0xdedede, 0xae7a84, 0x730010, 0x70000a, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x923747, 0xb4858c, 0xdcd9d9, 0xdedede, 0xdedede, 0xdedede, 0xdedede, 0xdedede, 0xdedede, 0xdedede, 0xd6cbcc, 0xc6a7ab, 0xb17078, 0xa5515b, 0x962230, 0x900b19, 0x8d020d, 0x8f0109, 0x92010a, 0x980612, 0x9f1922, 0xad4047, 0xb96569, 0xcda1a4, 0xdacece, 0xdedede, 0xdedede, 0xd4b0b0, 0xbb2b2b, 0xb10000, 0xae0000, 0xbc4b4d, 0xdcd7d7, 0xdedede, 0xdedddd, 0xba676a, 0x980003, 0x950003, 0xcba8ab, 0xdedede, 0xcfb5b7, 0x8a0006, 0x880006, 0x87010b, 0xdcdada, 0xdedddd, 0xdedede, 0xdcd9d9, 0x881222, 0x7d000b, 0x7c000c, 0x7a000c, 0xd5cbcd, 0xdedede, 0xdedede, 0xdedede, 0xba939a, 0x730011, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x80000d, 0x78000d, 0x830d21, 0xa5606b, 0xcdb7bb, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdedddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xdddddd, 0xd1acad, 0xba3d3e, 0xaf0000, 0xb20000, 0xb10000, 0xc26061, 0xdddddd, 0xdddddd, 0xdddddd, 0xd2b6b7, 0x9d0002, 0x990002, 0xa62d35, 0xdddddd, 0xdddddd, 0xb8757b, 0x8d0006, 0x8a0006, 0x921422, 0xdddddd, 0xdddddd, 0xdddddd, 0xd9d3d4, 0x86071a, 0x7f000b, 0x7d000b, 0x7c000c, 0xd2c4c6, 0xdddddd, 0xdddddd, 0xdddddd, 0xccb8bc, 0x71001c, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x7a000e, 0x7b000c, 0x7c000c, 0x7e000d, 0x932c3a, 0xb27a82, 0xcab1b5, 0xdcdbdb, 0xdddcdc, 0xdddcdc, 0xdddddd, 0xdddddd, 0xdddcdc, 0xdddcdc, 0xdddcdc, 0xdddcdc, 0xdcdcdc, 0xdcdcdc, 0xdddddd, 0xdcdcdc, 0xdddddd, 0xd6c2c3, 0xc37a7d, 0xb23336, 0xa90000, 0xab0000, 0xaf0000, 0xb30101, 0xc87272, 0xdddddd, 0xdddddd, 0xdddddd, 0xdcd8d8, 0xaa2025, 0x9e0002, 0x9b0002, 0xc79799, 0xdddddd, 0xdddcdc, 0x99141f, 0x8e0005, 0x8c0006, 0xa64c55, 0xdcdcdc, 0xdcdcdc, 0xdddcdc, 0xd4c8c9, 0x83010d, 0x80000a, 0x7f000b, 0x7e000b, 0xd2c3c5, 0xdcdcdc, 0xdcdcdc, 0xdddddd, 0xdddddd, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x7d000b, 0x7e000b, 0x7f000b, 0x80000a, 0x82000a, 0x820009, 0x870412, 0x9b3643, 0xac6169, 0xb67a81, 0xc39a9e, 0xc8a9ac, 0xccb0b2, 0xceb4b6, 0xcdb1b3, 0xcaa6a8, 0xc28b8f, 0xb9696e, 0xb14a4f, 0xa5131b, 0xa00001, 0xa30001, 0xa50001, 0xa90000, 0xac0000, 0xba3334, 0xd6bcbc, 0xdcdcdc, 0xdcdcdc, 0xdcdcdc, 0xdbd8d9, 0xb23235, 0xa10001, 0x9f0002, 0xae363d, 0xdbdada, 0xdcdcdc, 0xcba8ab, 0x920004, 0x900005, 0x8e0006, 0xb97e83, 0xdcdcdc, 0xdcdcdc, 0xdcdcdc, 0xccb4b6, 0x830009, 0x82000a, 0x80000a, 0x80000b, 0xd2c6c8, 0xdcdcdc, 0xdcdcdc, 0xdcdcdc, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x7f0011, 0x7f000a, 0x80000a, 0x81000a, 0x820009, 0x840009, 0x840007, 0x860007, 0x880007, 0x890006, 0x8b0006, 0x8d0006, 0x8e0005, 0x900004, 0x920004, 0x940003, 0x960003, 0x990003, 0x9d0002, 0x9e0002, 0xa10001, 0xa40001, 0xa70000, 0xae0a0d, 0xc98686, 0xdad3d3, 0xdbdbdb, 0xdcdbdb, 0xdcdbdb, 0xdbd9d9, 0xbf6163, 0xa50001, 0xa20001, 0xa10206, 0xd1b6b7, 0xdbdbdb, 0xdbdbdb, 0xae4b52, 0x930003, 0x910004, 0x8f0005, 0xccb1b4, 0xdcdcdc, 0xdcdbdb, 0xdcdcdc, 0xc29ca0, 0x840007, 0x830009, 0x820009, 0x81000a, 0xd5cbcd, 0xdcdbdb, 0xdbdbdb, 0xd9d9d9, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x7f000a, 0x82000a, 0x830009, 0x840009, 0x850007, 0x860007, 0x880007, 0x890006, 0x8b0006, 0x8c0006, 0x8e0005, 0x900005, 0x910004, 0x950003, 0x960003, 0x980003, 0x9a0002, 0x9c0002, 0x9f0001, 0xa20001, 0xae2227, 0xc47e7f, 0xd8cece, 0xdbdbdb, 0xdbdbdb, 0xdbdbdb, 0xdbdbdb, 0xd8cccc, 0xbe5354, 0xa80000, 0xa60001, 0xa30001, 0xc1797b, 0xdbdbdb, 0xdbdbdb, 0xd2bfc0, 0x9a0209, 0x940003, 0x920004, 0x9e242e, 0xdbdada, 0xdbdbdb, 0xdbdadb, 0xdbdbdb, 0xb27178, 0x860007, 0x840009, 0x830009, 0x83000b, 0xdad7d7, 0xdbdbdb, 0xd8d8d8, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x850009, 0x840009, 0x860008, 0x860007, 0x880006, 0x890006, 0x8b0006, 0x8c0006, 0x8e0006, 0x900005, 0x910004, 0x940003, 0x960003, 0x980003, 0x990002, 0x9c0003, 0xa61a20, 0xbc686c, 0xd0b2b3, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xd6c5c5, 0xb72829, 0xad0000, 0xaa0000, 0xa60001, 0xb13135, 0xdbdbdb, 0xdadada, 0xdadada, 0xaf464d, 0x980003, 0x960003, 0x940003, 0xbb7e82, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xa34650, 0x880008, 0x860007, 0x850007, 0x8f1424, 0xdadada, 0xd9d9d9, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xd4d4d4, 0xc9adb0, 0xc19b9f, 0xb3767c, 0xa64f59, 0xa13d46, 0x9e323d, 0x9b2430, 0x9b1e29, 0x9d1f2a, 0xa23038, 0xa94047, 0xaf5156, 0xbb7377, 0xc59294, 0xd5c9ca, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xdadada, 0xcd9393, 0xb50d0d, 0xae0000, 0xad0000, 0xa90000, 0xaf191e, 0xd6c6c7, 0xdadada, 0xdadada, 0xca9ea0, 0x9c0002, 0x990002, 0x970003, 0x980109, 0xd2c0c2, 0xdadada, 0xdadada, 0xdadada, 0xd7d1d1, 0x8f0917, 0x890007, 0x880007, 0x860007, 0x9c3c46, 0xdbdbdb, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xd4d4d4, 0xdbdbdb, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xdad9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd6c9c9, 0xbf494a, 0xb30000, 0xb10000, 0xaf0000, 0xac0000, 0xb01618, 0xd3c0c0, 0xd9d9d9, 0xd9d9d9, 0xd7d2d2, 0xa7181e, 0x9c0002, 0x9a0002, 0x980003, 0xad4c52, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xc5a0a4, 0x8c0006, 0x8a0006, 0x890007, 0x870007, 0x9e3945, 0xd4d4d4, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xd4d4d4, 0xdadada, 0xd9d9d9, 0xd8d8d8, 0xd9d9d9, 0xd8d8d8, 0xd8d8d8, 0xd9d8d8, 0xd9d8d8, 0xd9d9d9, 0xd9d9d9, 0xd8d8d8, 0xd9d9d9, 0xd8d8d8, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd9d9d9, 0xd5caca, 0xc16566, 0xb30c0d, 0xb10000, 0xb30000, 0xb10000, 0xaf0000, 0xb21618, 0xd3bcbc, 0xd9d9d9, 0xd9d8d8, 0xd9d9d9, 0xbb6669, 0x9f0001, 0x9d0002, 0x9b0002, 0x9a0003, 0xceb5b6, 0xd9d8d8, 0xd9d9d9, 0xd8d8d8, 0xd9d9d9, 0xb1656b, 0x8d0006, 0x8b0006, 0x8a0006, 0x8a0006, 0x7f0000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xd9d9d9, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xcfb2b3, 0xbe6365, 0xad0609, 0xac0000, 0xae0000, 0xb10000, 0xb30000, 0xb10000, 0xb72324, 0xd4c3c4, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xc5888a, 0xa20001, 0x9f0001, 0x9e0002, 0x9b0002, 0xaf454c, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd8d8d8, 0xd7d7d7, 0x97141f, 0x8e0005, 0x8c0006, 0x8d0005, 0x950015, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xd5d5d5, 0xd8d8d8, 0xd8d7d7, 0xd8d8d8, 0xd7d7d7, 0xd8d8d8, 0xd8d7d7, 0xd8d8d8, 0xd8d7d7, 0xd7d6d6, 0xd0bcbc, 0xc28183, 0xae252a, 0xa60001, 0xa80000, 0xaa0000, 0xad0000, 0xb00000, 0xb10000, 0xb20000, 0xc05051, 0xd7d7d7, 0xd8d8d8, 0xd8d7d7, 0xd8d8d8, 0xd0b8b9, 0xa50001, 0xa20001, 0xa10001, 0x9e0001, 0xa0060e, 0xd2c4c5, 0xd8d8d8, 0xd8d8d8, 0xd8d7d7, 0xd8d7d7, 0xc8a8aa, 0x910004, 0x8f0004, 0x8e0005, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xd9d9d9, 0xd8d8d8, 0xd7d7d7, 0xd4cdcd, 0xcbafb0, 0xc39093, 0xbb7276, 0xb2494f, 0xa40e14, 0xa10001, 0xa40001, 0xa50001, 0xa70000, 0xa90000, 0xab0000, 0xad0000, 0xaf0000, 0xb30505, 0xc98485, 0xd7d7d7, 0xd7d7d7, 0xd7d7d7, 0xd7d7d7, 0xd0b6b7, 0xab0d11, 0xa40001, 0xa30001, 0xa10001, 0xa00001, 0xbc7578, 0xd7d7d7, 0xd7d7d7, 0xd7d7d7, 0xd7d7d7, 0xd7d7d7, 0xa8414a, 0x920005, 0x900006, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x990411, 0x970002, 0x990002, 0x9a0002, 0x9c0002, 0x9e0002, 0xa10001, 0xa10001, 0xa30001, 0xa60001, 0xa70001, 0xa90000, 0xab0000, 0xad0000, 0xbc4445, 0xd2bdbd, 0xd7d6d6, 0xd6d6d6, 0xd6d6d6, 0xd6d6d6, 0xd0b5b6, 0xad0e12, 0xa70001, 0xa50001, 0xa30001, 0xa20001, 0xab252b, 0xd5d1d2, 0xd6d6d6, 0xd6d6d6, 0xd6d6d6, 0xd7d6d6, 0xcfbcbe, 0x990510, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x8e0000, 0x9b0002, 0x9b0001, 0x9d0002, 0xa00002, 0xa00001, 0xa30001, 0xa40001, 0xa60001, 0xa80000, 0xab0001, 0xb53031, 0xcba1a2, 0xd6d6d6, 0xd6d6d6, 0xd6d6d6, 0xd6d6d6, 0xd6d6d6, 0xceaeae, 0xb11417, 0xa90000, 0xa70000, 0xa50001, 0xa40001, 0xa60a10, 0xcfbabc, 0xd6d6d6, 0xd6d5d5, 0xd6d6d6, 0xd6d6d6, 0xd7d7d7, 0xd9d9d9, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x990000, 0x9f0002, 0xa00001, 0xa10001, 0xa30001, 0xa40001, 0xa80103, 0xb74446, 0xcca7a7, 0xd5d5d5, 0xd5d5d5, 0xd5d5d5, 0xd6d5d5, 0xd5d5d5, 0xd6d6d6, 0xc78282, 0xb00305, 0xab0000, 0xa90000, 0xa90000, 0xa60001, 0xa50102, 0xc69294, 0xd5d5d5, 0xd5d5d5, 0xd6d6d6, 0xd5d3d3, 0xdfdfdf, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xaa0000, 0xa20000, 0xa40002, 0xb85659, 0xceb7b7, 0xd5d5d5, 0xd5d5d5, 0xd5d5d5, 0xd5d5d5, 0xd5d5d5, 0xd5d4d4, 0xd3c9c9, 0xc36767, 0xb00000, 0xad0000, 0xac0000, 0xaa0000, 0xa80000, 0xa70001, 0xbf7476, 0xd6d5d5, 0xd4d4d4, 0xd5d5d5, 0xdbdbdb, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, + 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xd7d7d7, 0xd4d4d4, 0xd6d6d6, 0xd6d5d5, 0xd5d5d5, 0xd4d4d4, 0xcfabab, 0xb81e1e, 0xb20000, 0xaf0000, 0xae0000, 0xac0000, 0xab0000, 0xaa0000, 0xa70303, 0xd6d6d6, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000 +}; \ No newline at end of file diff --git a/dev/boot/BootKit/Shared/base.h b/dev/boot/BootKit/Shared/base.h new file mode 100644 index 00000000..88459ec3 --- /dev/null +++ b/dev/boot/BootKit/Shared/base.h @@ -0,0 +1,26 @@ +#ifndef UTL_BASE_H +#define UTL_BASE_H + +#include +#include +#include + +namespace utl +{ + + /** + * @brief Helper to get number of elements in array. + * + * @tparam T Auto-deduced element type + * @tparam N Auto-deduced number of elements + * @return Array size + */ + template + constexpr size_t countof(T (&)[N]) + { + return N; + } + +} // namespace utl + +#endif \ No newline at end of file diff --git a/dev/boot/BootKit/Shared/bit.h b/dev/boot/BootKit/Shared/bit.h new file mode 100644 index 00000000..fa0fab82 --- /dev/null +++ b/dev/boot/BootKit/Shared/bit.h @@ -0,0 +1,247 @@ +#ifndef UTL_BIT_H +#define UTL_BIT_H + +#include + +namespace utl +{ + + /** + * @brief Size of object in terms of bits. + * + * @tparam T Object type + * @return Number of bits + */ + template + constexpr auto bit_size() + { + return sizeof(T) * 8; + } + + /** + * @brief Integer with all bits set to 1. + * + * @tparam T Integer type + * @return All set integer + */ + template + constexpr T bit_full() + { + return T(-1); + } + + /** + * @brief Wrap around mask for power of two number of bits + * within given integer type. For example: + * [ bit_wrap = 8 - 1 = 0b111 ] + * [ bit_wrap = 16 - 1 = 0b1111 ] + * [ bit_wrap = 32 - 1 = 0b11111 ] + * + * @tparam T Integer type + * @return Wrap around mask for number of bits + */ + template + constexpr T bit_wrap() + { + return bit_size() - 1; + } + + /** + * @brief Number of bits to fit bit_wrap result, in other words + * bit width of (sizeof(T) * 8 - 1). For example: + * [ bit_shft = bit_width(0b111) = 3 ] + * [ bit_shft = bit_width(0b1111) = 4 ] + * [ bit_shft = bit_width(0b11111) = 5 ] + * + * @tparam T Integer type + * @return Number of bits to shift to divide by sizeof(T) * 8 + */ + template + constexpr auto bit_shft() + { + return std::bit_width(bit_wrap()); + } + + /** + * @brief Round up division by number of bits within given integer type, + * which sizeof(T) * 8 is power of two. + * + * @tparam T Inetegr type + * @param x Dividend + * @return Quotient + */ + template + constexpr auto bit_ceil(auto x) + { + return (x + bit_wrap()) >> bit_shft(); + } + + /** + * @brief Count leading zeros. + * + * @param x Unsigned integer argument + * @return Number of leading zeros + */ + constexpr unsigned cntlz(auto x) + { + if constexpr (std::is_same_v) + return std::countl_zero(unsigned(x)); + else + return std::countl_zero(x); + } + + /** + * @brief Count trailing zeros. + * + * @param x Unsigned integer argument + * @return Number of trailing zeros + */ + constexpr unsigned cnttz(auto x) + { + if constexpr (std::is_same_v) + return std::countr_zero(unsigned(x)); + else + return std::countr_zero(x); + } + + /** + * @brief Get number of words (integers) required to store N bits. + * + * @tparam T Word integer type + * @param n Number of bits to store + * @return Number of words + */ + template + constexpr size_t words_in_bits(size_t n) + { + return (n >> bit_shft()) + !!(n & bit_wrap()); + } + + /** + * @brief Get number of bytes required to store N bits. + * + * @param n Number of bits to store + * @return Number of bytes + */ + constexpr size_t bytes_in_bits(size_t n) + { + return words_in_bits(n); + } + + /** + * @brief Make integer with bit at given position. + * + * @tparam T Inetegr type + * @param n Bit position + * @return Integer with set bit + */ + template + constexpr T bit(int n) + { + return T(1) << n; + } + + /** + * @brief Get n-th bit of an integer. + * + * @tparam T Integer type + * @param x Integer + * @param n Bit position from LSB + * @return true if set + */ + template + constexpr bool get_bit(T x, int n) + { + return (x >> n) & 1; + } + + /** + * @brief Set n-th bit of an integer. + * + * @tparam T Integer type + * @param x Integer + * @param n Bit position from LSB + */ + template + constexpr void set_bit(T& x, int n) + { + x |= 1 << n; + } + + /** + * @brief Clear n-th bit of an integer. + * + * @tparam T Integer type + * @param x Integer + * @param n Bit position from LSB + */ + template + constexpr void clr_bit(T& x, int n) + { + x &= ~(1 << n); + } + + /** + * @brief Get n-th bit in array of words (starting from LSB). + * + * @tparam T Word type + * @param p Array of words + * @param n Index of bit to get + * @return true if set + */ + template + constexpr bool get_arr_bit(const T* p, unsigned n) + { + return get_bit(p[n >> bit_shft()], n & bit_wrap()); + } + + /** + * @brief Set n-th bit in array of words (starting from LSB). + * + * @tparam T Word type + * @param p Array of words + * @param n Index of bit to set + */ + template + constexpr void set_arr_bit(T* p, unsigned n) + { + set_bit(p[n >> bit_shft()], n & bit_wrap()); + } + + /** + * @brief Clear n-th bit in array of words (starting from LSB). + * + * @tparam T Word type + * @param p Array of words + * @param n Index of bit to clear + */ + template + constexpr void clr_arr_bit(T* p, unsigned n) + { + clr_bit(p[n >> bit_shft()], n & bit_wrap()); + } + + /** + * @brief Shift bits left in array of integer elements from least significant bit + * and considering 0-th byte as the right most. + * uint16_t example: 0b10000000'11100001 ==> 0b00000001'11000010. + * + * @tparam T Integer type + * @tparam L Length of array + * @param x Array of integers, nullptr not acceptable! + * @param len Number of elements + */ + template + constexpr void shift_left(T (&x)[L]) + { + for (int i = L - 1; i > 0; --i) + { + x[i] <<= 1; + x[i] |= x[i - 1] >> bit_wrap(); + } + x[0] <<= 1; + } + +} // namespace utl + +#endif \ No newline at end of file diff --git a/dev/boot/BootKit/Support.h b/dev/boot/BootKit/Support.h new file mode 100644 index 00000000..3c79262b --- /dev/null +++ b/dev/boot/BootKit/Support.h @@ -0,0 +1,173 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +/// @file Support.h +/// @brief Purpose of this file is to help port libs into the bootloader. + +#ifndef __aarch64__ +#include +#endif + +#define kLongMax ((long)(~0UL >> 1)) +#define kLongMin (~kLongMax) + +#ifdef __BOOTZ__ + +/// @brief memset definition in C++. +/// @param dst destination pointer. +/// @param byte value to fill in. +/// @param len length of of src. +EXTERN_C void* memset(void* dst, int byte, long long unsigned int len); + +/// @brief memcpy definition in C++. +/// @param dst destination pointer. +/// @param src source pointer. +/// @param len length of of src. +EXTERN_C void* memcpy(void* dst, const void* src, long long unsigned int len); + +/// @brief strlen definition in C++. +EXTERN_C size_t strlen(const char* whatToCheck); + +/// @brief strcmp definition in C++. +EXTERN_C int strcmp(const char* whatToCheck, const char* whatToCheckRight); + +#else + +#include + +#endif // __BOOTZ__ + +#define SetMem(dst, c, sz) memset(dst, c, sz) +#define MoveMem(dst, src, sz) memcpy(dst, src, sz) +#define CopyMem(dst, src, sz) memcpy(dst, src, sz) +#define StrLen(src) strlen(src) +#define StrCmp(dst, src) strcmp(dst, src) + +inline int IsSpace(int c) +{ + return c == ' '; +} + +inline int StringNCompare(const char* destination, const char* source, long length) +{ + long err = 0; + + for (long i = 0UL; i < length; ++i) + { + if (source[i] != destination[i]) + ++err; + } + + return err; +} + +inline long StringToLong(const char* nptr, char** endptr, int base) +{ + const char *p = nptr, *endp; + bool is_neg = 0, overflow = 0; + + /* Need unsigned so (-kLongMin) can fit in these: */ + unsigned long n = 0UL, cutoff; + int cutlim; + + if (base < 0 || base == 1 || base > 36) + { + return 0L; + } + + endp = nptr; + + while (IsSpace(*p)) + p++; + + if (*p == '+') + { + p++; + } + else if (*p == '-') + { + is_neg = 1, p++; + } + if (*p == '0') + { + p++; + /* For strtol(" 0xZ", &endptr, 16), endptr should point to 'x'; + * pointing to ' ' or '0' is non-compliant. + * (Many implementations do this wrong.) */ + endp = p; + if (base == 16 && (*p == 'X' || *p == 'x')) + { + p++; + } + else if (base == 2 && (*p == 'B' || *p == 'b')) + { + /* C23 standard supports "0B" and "0b" prefixes. */ + p++; + } + else if (base == 0) + { + if (*p == 'X' || *p == 'x') + { + base = 16, p++; + } + else if (*p == 'B' || *p == 'b') + { + base = 2, p++; + } + else + { + base = 8; + } + } + } + else if (base == 0) + { + base = 10; + } + + cutoff = (is_neg) ? -(kLongMin / base) : kLongMax / base; + cutlim = (is_neg) ? -(kLongMin % base) : kLongMax % base; + + while (1) + { + int c; + if (*p >= 'A') + c = ((*p - 'A') & (~('a' ^ 'A'))) + 10; + else if (*p <= '9') + c = *p - '0'; + else + break; + if (c < 0 || c >= base) + break; + endp = ++p; + if (overflow) + { + /* endptr should go forward and point to the non-digit character + * (of the given base); required by ANSI standard. */ + if (endptr) + continue; + break; + } + if (n > cutoff || (n == cutoff && c > cutlim)) + { + overflow = 1; + continue; + } + n = n * base + c; + } + + if (endptr) + *endptr = (char*)endp; + + if (overflow) + { + return ((is_neg) ? kLongMin : kLongMax); + } + + return (long)((is_neg) ? -n : n); +} diff --git a/dev/boot/DownloadOVMF.ps1 b/dev/boot/DownloadOVMF.ps1 new file mode 100644 index 00000000..5a2c5f0e --- /dev/null +++ b/dev/boot/DownloadOVMF.ps1 @@ -0,0 +1,4 @@ +$client = new-object System.Net.WebClient +$output = "$PSScriptRoot\OVMF.fd" + +$client.DownloadFile("https://retrage.github.io/edk2-nightly/bin/DEBUGX64_OVMF.fd", $output) diff --git a/dev/boot/Mod/.keep b/dev/boot/Mod/.keep new file mode 100644 index 00000000..e69de29b diff --git a/dev/boot/Mod/NetBoot/.hgkeep b/dev/boot/Mod/NetBoot/.hgkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/boot/Mod/NetBoot/Boot.S b/dev/boot/Mod/NetBoot/Boot.S new file mode 100644 index 00000000..2095b91d --- /dev/null +++ b/dev/boot/Mod/NetBoot/Boot.S @@ -0,0 +1,28 @@ +;; /* +;; * ======================================================== +;; * +;; * BootZ +;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. +;; * +;; * ======================================================== +;; */ + +.code64 +.intel_syntax noprefix + +#define kTypeDriver 101 +#define kArchAmd64 122 +#define kHandoverMagic 0xBADCC + +.section .ldr + +.quad kHandoverMagic +.word kTypeDriver + +.text + +.extern main +.global __main + +__main: + ret diff --git a/dev/boot/Mod/NetBoot/NetBoot.cc b/dev/boot/Mod/NetBoot/NetBoot.cc new file mode 100644 index 00000000..16a9ae1e --- /dev/null +++ b/dev/boot/Mod/NetBoot/NetBoot.cc @@ -0,0 +1,44 @@ +/* + * ======================================================== + * + * NetBoot + * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + * + * ======================================================== + */ + +#include +#include +#include + +EXTERN_C Int32 ModuleMain(NeOS::HEL::BootInfoHeader* handover) +{ + NETBOOT_INTERNET_HEADER inet{}; + + /// TODO: Read Packet from localhost + + if (inet.PatchLength < 0) + { + Boot::BootTextWriter writer; + writer.Write("NetBootLauncher: No Patch attached to packet.\r"); + + return kEfiFail; + } + + if (!inet.EEPROM) + { + Boot::BootThread thread(inet.Data); + + if (thread.IsValid()) + return thread.Start(handover, YES); + } + else + { + Boot::BootTextWriter writer; + writer.Write("NetBootLauncher: EEPROM flash not available for now.\r"); + + return kEfiFail; // TODO: Add support for EEPROM firmware update. + } + + return kEfiFail; +} diff --git a/dev/boot/Mod/NetBoot/NetBoot.h b/dev/boot/Mod/NetBoot/NetBoot.h new file mode 100644 index 00000000..aeeaf18b --- /dev/null +++ b/dev/boot/Mod/NetBoot/NetBoot.h @@ -0,0 +1,33 @@ +/* + * ======================================================== + * + * NetBoot + * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + * + * ======================================================== + */ + +#pragma once + +#include + +#define kNetBootINetMagic "NETB" +#define kNetBootINetMagicLength (4) + +#define kNetBootNameLen (256U) + +/// @brief the internet header is used to download updates OTA. +typedef struct NETBOOT_INTERNET_HEADER +{ + NeOS::Char NB1; /// magic char 1 'N' + NeOS::Char NB2; /// magic char 2 'E' + NeOS::Char NB3; /// magic char 3 'T' + NeOS::Char NB4; /// magic char 4 'B' + + NeOS::Char PatchName[kNetBootNameLen]; /// example: Modjo + NeOS::Int32 PatchLength; /// the patch length. + NeOS::Char PatchTarget[kNetBootNameLen]; /// the target file. + NeOS::Boolean EEPROM : 1; /// does it imply an EEPROM reprogram? + NeOS::Boolean Preflight : 1; /// is it a preflight packet. + NeOS::Char Data[]; /// non preflight packet has a patch blob for a **PatchTarget** +} ATTRIBUTE(packed) NETBOOT_INTERNET_HEADER; diff --git a/dev/boot/Mod/NetBoot/build.json b/dev/boot/Mod/NetBoot/build.json new file mode 100644 index 00000000..2c92567d --- /dev/null +++ b/dev/boot/Mod/NetBoot/build.json @@ -0,0 +1,24 @@ +{ + "compiler_path": "x86_64-w64-mingw32-g++", + "compiler_std": "c++20", + "headers_path": ["../", "../../", "../../../kernel", "../../../", "./"], + "sources_path": [".cc", "*.S"], + "output_name": "netboot.sys", + "compiler_flags": [ + "-ffreestanding", + "-nostdlib", + "-std=c++20", + "-fPIC", + "-fno-rtti", + "-fno-exceptions", + "-Wl,--subsystem=17,--image-base,0x10000000,-e,ModuleMain" + ], + "cpp_macros": [ + "__NEOSKRNL__", + "__BOOTZ__", + "__NE_AMD64__", + "kNetBootVersionHighest=0x0100", + "kNetBootVersionLowest=0x0100", + "kNetBootVersion=0x0100" + ] +} diff --git a/dev/boot/Mod/SysChk/.hgkeep b/dev/boot/Mod/SysChk/.hgkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/boot/Mod/SysChk/Boot.S b/dev/boot/Mod/SysChk/Boot.S new file mode 100644 index 00000000..8ebfb352 --- /dev/null +++ b/dev/boot/Mod/SysChk/Boot.S @@ -0,0 +1,22 @@ +;; /* +;; * ======================================================== +;; * +;; * BootZ +;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. +;; * +;; * ======================================================== +;; */ + +#ifdef __NE_AMD64__ +.code64 +.intel_syntax noprefix +#endif + +#define kTypeDriver 101 +#define kArchAmd64 122 +#define kHandoverMagic 0xBADCC + +.section .ldr + +.quad kHandoverMagic +.word kTypeDriver diff --git a/dev/boot/Mod/SysChk/Module.cc b/dev/boot/Mod/SysChk/Module.cc new file mode 100644 index 00000000..c22e183b --- /dev/null +++ b/dev/boot/Mod/SysChk/Module.cc @@ -0,0 +1,36 @@ +/* + * ======================================================== + * + * NetBoot + * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + * + * ======================================================== + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +EXTERN_C Int32 ModuleMain(NeOS::HEL::BootInfoHeader* handover) +{ +#ifdef __NE_AMD64__ + Boot::BDiskFormatFactory partition_factory; + + if (partition_factory.IsPartitionValid()) + return kEfiOk; + + return kEfiFail; +#else + return kEfiOk; +#endif +} diff --git a/dev/boot/Mod/SysChk/amd64.json b/dev/boot/Mod/SysChk/amd64.json new file mode 100644 index 00000000..97b6c418 --- /dev/null +++ b/dev/boot/Mod/SysChk/amd64.json @@ -0,0 +1,24 @@ +{ + "compiler_path": "x86_64-w64-mingw32-g++", + "compiler_std": "c++20", + "headers_path": ["../", "../../", "../../../kernel", "../../../", "./"], + "sources_path": ["*.cc", "*.S", "../../src/HEL/AMD64/*.cc", "../../src/HEL/AMD64/*.S", "../../src/*.cc"], + "output_name": "syschk.sys", + "compiler_flags": [ + "-nostdlib", + "-std=c++20", + "-fPIC", + "-fno-rtti", + "-fno-exceptions", + "-Wl,--subsystem=17,--image-base,0x10000000,-e,ModuleMain" + ], + "cpp_macros": [ + "__NEOSKRNL__", + "__BOOTZ__", + "__BOOTLDR_STANDALONE__", + "__NE_AMD64__", + "kChkVersionHighest=0x0100", + "kChkVersionLowest=0x0100", + "kChkVersion=0x0100" + ] +} diff --git a/dev/boot/Mod/SysChk/arm64.json b/dev/boot/Mod/SysChk/arm64.json new file mode 100644 index 00000000..6d9161ea --- /dev/null +++ b/dev/boot/Mod/SysChk/arm64.json @@ -0,0 +1,26 @@ +{ + "compiler_path": "clang++", + "compiler_std": "c++20", + "headers_path": ["../", "../../", "../../../kernel", "../../../", "./"], + "sources_path": ["*.cc", "*.S", "../../src/HEL/ARM64/*.cc", "../../src/HEL/ARM64/*.S", "../../src/*.cc"], + "output_name": "syschk.sys", + "compiler_flags": [ + "-ffreestanding", + "-nostdlib", + "-std=c++20", + "-fno-rtti", + "-fno-exceptions", + "-fuse-ld=lld", + "-Wl,-subsystem:efi_application,-entry:ModuleMain", + "-target aarch64-unknown-windows" + ], + "cpp_macros": [ + "__NEOSKRNL__", + "__BOOTZ__", + "__BOOTLDR_STANDALONE__", + "__NE_ARM64__", + "kChkVersionHighest=0x0100", + "kChkVersionLowest=0x0100", + "kChkVersion=0x0100" + ] +} diff --git a/dev/boot/amd64-desktop.make b/dev/boot/amd64-desktop.make new file mode 100644 index 00000000..4d2b211c --- /dev/null +++ b/dev/boot/amd64-desktop.make @@ -0,0 +1,154 @@ +################################################## +# (c) Amlal EL Mahrouss, all rights reserved. +# This is the bootloader makefile. +################################################## + +CC_GNU=x86_64-w64-mingw32-g++ +LD_GNU=x86_64-w64-mingw32-ld + +WINDRES=x86_64-w64-mingw32-windres + +ADD_FILE=touch +COPY=cp +HTTP_GET=wget + +# Select this for Windows. +ifneq ($(findstring CYGWIN_NT-10.0,$(shell uname)), ) +EMU=qemu-system-x86_64w.exe +else +# this for NT distributions +EMU=qemu-system-x86_64 -net none +endif + +ifeq ($(NEOS_MODEL), ) +NE_MODEL=-DkMachineModel="\"NeOS\"" +endif + +BIOS=OVMF.fd +IMG=epm-master-1.img +IMG_2=epm-master-2.img + +BOOT=./src/neos.img + +DISK_DRV = + +ifneq ($(ATA_PIO_SUPPORT), ) +DISK_DRV = -D__ATA_PIO__ +endif + +ifneq ($(ATA_DMA_SUPPORT), ) +DISK_DRV = -D__ATA_DMA__ +endif + +ifneq ($(AHCI_SUPPORT), ) +DISK_DRV = -D__AHCI__ +endif + +ifneq ($(DEBUG_SUPPORT), ) +DEBUG_MACRO = -D__DEBUG__ +endif + +ifeq ($(shell uname), Darwin) +EMU_FLAGS=-M q35 -net none -smp 4 -m 8G \ + -bios $(BIOS) -cdrom $(BOOT) -boot d +endif + +ifneq ($(shell uname), Darwin) +EMU_FLAGS=-net none -smp 4 -m 8G \ + -bios $(BIOS) -M q35 -cdrom $(BOOT) -boot d -accel kvm +endif + +LD_FLAGS=-e Main --subsystem=10 + +STANDALONE_MACRO=-D__BOOTLDR_STANDALONE__ +OBJ=*.o + +REM=rm +REM_FLAG=-f + +FLAG_ASM=-f win64 +FLAG_GNU=-fshort-wchar -D__EFI_x86_64__ -mno-red-zone -D__NEOSKRNL__ -D__BOOTZ__ \ + -DEFI_FUNCTION_WRAPPER -I./ -I../kernel $(DISK_DRV) -I../ -c -nostdlib -fno-rtti -fno-exceptions \ + -std=c++20 -DBOOTZ_GPT_SUPPORT -DBOOTZ_EPM_SUPPORT -D__HAVE_NE_APIS__ -DZBA_USE_FB -D__NE_AMD64__ -D__NE__ -DNE_AUTO_FORMAT + +BOOTLOADER=bootz.exe +KERNEL=neoskrnl.exe +SYSCHK=syschk.sys +STARTUP=startup.sys +SCIKIT=libSCI.dylib + +.PHONY: invalid-recipe +invalid-recipe: + @echo "=== ERROR ===" + @echo "=> Use make compile- instead." + +.PHONY: all +all: compile-amd64 + mkdir -p src/Root/EFI/BOOT + $(LD_GNU) $(OBJ) $(LD_FLAGS) -o src/$(BOOTLOADER) + $(COPY) src/$(BOOTLOADER) src/Root/EFI/BOOT/BOOTX64.EFI + $(COPY) src/$(BOOTLOADER) src/Root/EFI/BOOT/BOOTZ.EFI + $(COPY) ../kernel/$(KERNEL) src/Root/$(KERNEL) + $(COPY) ./modules/SysChk/$(SYSCHK) src/Root/$(SYSCHK) + $(COPY) ../SCIKit/$(SCIKIT) src/Root/$(SCIKIT) + $(COPY) src/$(BOOTLOADER) src/Root/$(BOOTLOADER) + +.PHONY: disk +disk: + dd if=/dev/zero of=$(BOOT) bs=30M count=100 + mformat -i $(BOOT) -F -v "NEOS_ESP" + + +ifneq ($(DEBUG_SUPPORT), ) +DEBUG = -D__DEBUG__ +endif + +.PHONY: compile-amd64 +compile-amd64: + $(WINDRES) src/BootloaderRsrc.rsrc -O coff -o BootloaderRsrc.o + $(CC_GNU) $(NE_MODEL) $(STANDALONE_MACRO) $(FLAG_GNU) $(DEBUG) \ + $(wildcard src/HEL/AMD64/*.cc) \ + $(wildcard src/HEL/AMD64/*.S) \ + $(wildcard src/*.cc) + +.PHONY: run-efi-amd64-ahci +run-efi-amd64-ahci: + $(EMU) $(EMU_FLAGS) -d int -hda $(IMG) -s -S -trace ahci_* -boot menu=on + +.PHONY: run-efi-amd64-ata-pio +run-efi-amd64-ata-pio: + $(EMU) $(EMU_FLAGS) -device piix3-ide,id=ide -drive id=disk,file=$(IMG),format=raw,if=none -device ide-hd,drive=disk,bus=ide.0 -s -S + +.PHONY: run-efi-amd64-ata-dma +run-efi-amd64-ata-dma: + $(EMU) $(EMU_FLAGS) -device piix4-ide,id=ide -drive id=disk,file=$(IMG),format=raw,if=none -device ide-hd,drive=disk,bus=ide.0 -s -S + +.PHONY: run-efi-amd64-ata +run-efi-amd64-ata: run-efi-amd64-ata-dma + +# img_2 is the rescue disk. img is the bootable disk, as provided by the Zeta specs. +.PHONY: epm-img +epm-img: + qemu-img create -f raw $(IMG) 4G + +.PHONY: efi +efi: + $(HTTP_GET) https://retrage.github.io/edk2-nightly/bin/DEBUGX64_OVMF.fd -O OVMF.fd + +BINS=*.bin +EXECUTABLES=bootz.exe neoskrnl.exe OVMF.fd + +TARGETS=$(REM_FLAG) $(OBJ) $(BIN) $(IMG) $(IMG_2) $(EXECUTABLES) + +.PHONY: clean +clean: + $(REM) $(TARGETS) + +.PHONY: help +help: + @echo "=== HELP ===" + @echo "epm-img: Format a disk using the Explicit Partition Map." + @echo "gpt-img: Format a disk using the Explicit Partition Map." + @echo "clean: remove bootloader and files." + @echo "bootloader-amd64: Build bootloader. (PC AMD64)" + @echo "run-efi-amd64-: Run bootloader. (PC AMD64)" diff --git a/dev/boot/arm64-desktop.make b/dev/boot/arm64-desktop.make new file mode 100644 index 00000000..5b38d46c --- /dev/null +++ b/dev/boot/arm64-desktop.make @@ -0,0 +1,112 @@ +################################################## +# (c) Amlal EL Mahrouss, all rights reserved. +# This is the bootloader makefile. +################################################## + +CC_GNU = clang++ +LD_GNU = lld-link + +ADD_FILE=touch +COPY=cp +HTTP_GET=wget + +# Select this for Windows. +ifneq ($(findstring CYGWIN_NT-10.0,$(shell uname)), ) +EMU=qemu-system-aarch64w.exe +else +# this for NT distributions +EMU=qemu-system-aarch64 +endif + +ifeq ($(NEOS_MODEL), ) +NE_MODEL=-DkMachineModel="\"NeKernel\"" +endif + +BIOS=OVMF.fd +IMG=epm-master-1.img +IMG_2=epm-slave.img +IMG_3=epm-master-2.img + +EMU_FLAGS=-net none -smp 4 -m 8G -cpu max -M virt \ + -bios $(BIOS) \ + -drive id=disk,file=$(IMG),format=raw,if=none \ + -drive \ + file=fat:rw:src/Root/,index=2,format=raw \ + -no-shutdown -no-reboot -cpu cortex-a72 -device virtio-gpu-pci + +LD_FLAGS=-subsystem:efi_application -entry:Main /nodefaultlib + +STANDALONE_MACRO=-D__BOOTLDR_STANDALONE__ +OBJ=*.o + +REM=rm +REM_FLAG=-f + +FLAG_ASM=-f win64 +FLAG_GNU=-fshort-wchar -c -ffreestanding -MMD -mno-red-zone -D__NE_ARM64__ -fno-rtti -fno-exceptions -I./ \ + -target aarch64-unknown-windows \ + -std=c++20 -DBOOTZ_EPM_SUPPORT -DZBA_USE_FB -D__FSKIT_USE_NEFS__ -D__BOOTLDR_STANDALONE__ -D__NEOSKRNL__ -D__BOOTZ__ -D__HAVE_NE_APIS__ -D__NE__ -I../ -I../kernel + +BOOT_LOADER=bootz.exe +KERNEL=neoskrnl.exe +SYSCHK=syschk.sys +STARTUP=startup.sys + +.PHONY: invalid-recipe +invalid-recipe: + @echo "invalid-recipe: Use make compile- instead." + +.PHONY: all +all: compile + mkdir -p src/Root/EFI/BOOT + $(LD_GNU) $(OBJ) $(LD_FLAGS) /out:src/$(BOOT_LOADER) + $(COPY) src/$(BOOT_LOADER) src/Root/EFI/BOOT/BOOTAA64.EFI + $(COPY) src/$(BOOT_LOADER) src/Root/EFI/BOOT/BootZ.EFI + $(COPY) ../kernel/$(KERNEL) src/Root/$(KERNEL) + $(COPY) ./modules/SysChk/$(SYSCHK) src/Root/$(SYSCHK) + $(COPY) src/$(BOOT_LOADER) src/Root/$(BOOT_LOADER) + +ifneq ($(DEBUG_SUPPORT), ) +DEBUG = -D__DEBUG__ +endif + +.PHONY: compile +compile: + $(RESCMD) + $(CC_GNU) $(NE_MODEL) $(STANDALONE_MACRO) $(FLAG_GNU) $(DEBUG) \ + $(wildcard src/HEL/ARM64/*.cc) \ + $(wildcard src/HEL/ARM64/*.S) \ + $(wildcard src/*.cc) + +.PHONY: run +run: + $(EMU) $(EMU_FLAGS) + +# img_2 is the rescue disk. img is the bootable disk, as provided by the Zeta. +.PHONY: epm-img +epm-img: + qemu-img create -f raw $(IMG) 10G + qemu-img create -f raw $(IMG_2) 4G + qemu-img create -f raw $(IMG_3) 4G + +.PHONY: efi +efi: + $(HTTP_GET) https://retrage.github.io/edk2-nightly/bin/DEBUGAARCH64_QEMU_EFI.fd -O OVMF.fd + +BINS=*.bin +EXECUTABLES=bootz.exe neoskrnl.exe OVMF.fd + +TARGETS=$(REM_FLAG) $(OBJ) $(BIN) $(IMG) $(IMG_2) $(EXECUTABLES) + +.PHONY: clean +clean: + $(REM) $(TARGETS) + +.PHONY: help +help: + @echo "=== HELP ===" + @echo "epm-img: Format a disk using the Explicit Partition Map." + @echo "gpt-img: Format a disk using the Explicit Partition Map." + @echo "clean: clean bootloader." + @echo "bootloader-amd64: Build bootloader. (PC AMD64)" + @echo "run: Run bootloader. (PC AMD64)" diff --git a/dev/boot/arm64-mobile.make b/dev/boot/arm64-mobile.make new file mode 100644 index 00000000..485bfed0 --- /dev/null +++ b/dev/boot/arm64-mobile.make @@ -0,0 +1,113 @@ +################################################## +# (c) Amlal EL Mahrouss, all rights reserved. +# This is the bootloader makefile. +################################################## + +CC_GNU = clang++ +LD_GNU = lld-link + +ADD_FILE=touch +COPY=cp +HTTP_GET=wget + +# Select this for Windows. +ifneq ($(findstring CYGWIN_NT-10.0,$(shell uname)), ) +EMU=qemu-system-aarch64w.exe +else +# this for NT distributions +EMU=qemu-system-aarch64 +endif + +ifeq ($(NEOS_MODEL), ) +NE_MODEL=-DkMachineModel="\"NeKernel\"" +endif + +BIOS=OVMF.fd +IMG=epm-master-1.img +IMG_2=epm-slave.img +IMG_3=epm-master-2.img + +EMU_FLAGS=-net none -smp 4 -m 8G -cpu max -M virt-9.1 \ + -bios $(BIOS) \ + -drive id=disk,file=$(IMG),format=raw,if=none \ + -drive \ + file=fat:rw:src/Root/,index=1,format=raw \ + -device virtio-tablet-pci \ + -no-shutdown -no-reboot -cpu cortex-a72 -device virtio-gpu-pci + +LD_FLAGS=-subsystem:efi_application -entry:Main /nodefaultlib + +STANDALONE_MACRO=-D__BOOTLDR_STANDALONE__ +OBJ=*.o + +REM=rm +REM_FLAG=-f + +FLAG_ASM=-f win64 +FLAG_GNU=-fshort-wchar -c -ffreestanding -MMD -mno-red-zone -D__NE_ARM64__ -fno-rtti -fno-exceptions -I./ \ + -target aarch64-unknown-windows \ + -std=c++20 -DBOOTZ_EPM_SUPPORT -DkExpectedWidth=320 -DkExpectedHeight=480 -D__FSKIT_USE_NEFS__ -D__BOOTLDR_STANDALONE__ -D__NEOSKRNL__ -D__BOOTZ__ -D__HAVE_NE_APIS__ -D__NE__ -I../ -I../kernel + +BOOT_LOADER=bootz.exe +KERNEL=neoskrnl.exe +SYSCHK=syschk.sys +STARTUP=startup.sys + +.PHONY: invalid-recipe +invalid-recipe: + @echo "invalid-recipe: Use make compile- instead." + +.PHONY: all +all: compile + mkdir -p src/Root/EFI/BOOT + $(LD_GNU) $(OBJ) $(LD_FLAGS) /out:src/$(BOOT_LOADER) + $(COPY) src/$(BOOT_LOADER) src/Root/EFI/BOOT/BOOTAA64.EFI + $(COPY) src/$(BOOT_LOADER) src/Root/EFI/BOOT/BootZ.EFI + $(COPY) ../kernel/$(KERNEL) src/Root/$(KERNEL) + $(COPY) ./modules/SysChk/$(SYSCHK) src/Root/$(SYSCHK) + $(COPY) src/$(BOOT_LOADER) src/Root/$(BOOT_LOADER) + +ifneq ($(DEBUG_SUPPORT), ) +DEBUG = -D__DEBUG__ +endif + +.PHONY: compile +compile: + $(RESCMD) + $(CC_GNU) $(NE_MODEL) $(STANDALONE_MACRO) $(FLAG_GNU) $(DEBUG) \ + $(wildcard src/HEL/ARM64/*.cc) \ + $(wildcard src/HEL/ARM64/*.S) \ + $(wildcard src/*.cc) + +.PHONY: run +run: + $(EMU) $(EMU_FLAGS) + +# img_2 is the rescue disk. img is the bootable disk, as provided by the Zeta. +.PHONY: epm-img +epm-img: + qemu-img create -f raw $(IMG) 10G + qemu-img create -f raw $(IMG_2) 4G + qemu-img create -f raw $(IMG_3) 4G + +.PHONY: efi +efi: + $(HTTP_GET) https://retrage.github.io/edk2-nightly/bin/DEBUGAARCH64_QEMU_EFI.fd -O OVMF.fd + +BINS=*.bin +EXECUTABLES=bootz.exe neoskrnl.exe OVMF.fd + +TARGETS=$(REM_FLAG) $(OBJ) $(BIN) $(IMG) $(IMG_2) $(EXECUTABLES) + +.PHONY: clean +clean: + $(REM) $(TARGETS) + +.PHONY: help +help: + @echo "=== HELP ===" + @echo "epm-img: Format a disk using the Explicit Partition Map." + @echo "gpt-img: Format a disk using the Explicit Partition Map." + @echo "clean: clean bootloader." + @echo "bootloader-amd64: Build bootloader. (PC AMD64)" + @echo "run-efi-amd64: Run bootloader. (PC AMD64)" diff --git a/dev/boot/gdbinit b/dev/boot/gdbinit new file mode 100644 index 00000000..9522f6e8 --- /dev/null +++ b/dev/boot/gdbinit @@ -0,0 +1,3 @@ +set disassemble-next-line on +b Main +target remote localhost:1234 diff --git a/dev/boot/src/.gitkeep b/dev/boot/src/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/boot/src/BootFileReader.cc b/dev/boot/src/BootFileReader.cc new file mode 100644 index 00000000..a2afbce5 --- /dev/null +++ b/dev/boot/src/BootFileReader.cc @@ -0,0 +1,206 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: FileReader.cc + Purpose: New Boot FileReader, + Read complete file and store it in a buffer. + +------------------------------------------- */ + +#include +#include +#include +#include +#include +#include + +/// @file BootFileReader +/// @brief Bootloader File reader. +/// BUGS: 0 + +//////////////////////////////////////////////////////////////////////////////////////////////////// +/// +/// +/// @name BootFileReader class +/// @brief Reads the file as a blob. +/// +/// +//////////////////////////////////////////////////////////////////////////////////////////////////// + +/*** + @brief File Reader constructor. +*/ +Boot::BootFileReader::BootFileReader(const CharacterTypeUTF16* path, + EfiHandlePtr ImageHandle) +{ + if (path != nullptr) + { + SizeT index = 0UL; + for (; path[index] != L'\0'; ++index) + { + mPath[index] = path[index]; + } + + mPath[index] = 0; + } + + /// Load protocols with their GUIDs. + + EfiGUID guidEfp = EfiGUID(EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID); + + EfiSimpleFilesystemProtocol* efp = nullptr; + + EfiLoadImageProtocol* img = nullptr; + EfiGUID guidImg = EfiGUID(EFI_LOADED_IMAGE_PROTOCOL_GUID); + + if (BS->HandleProtocol(ImageHandle, &guidImg, (void**)&img) != kEfiOk) + { + mWriter.Write(L"BootZ: Handle-Protocol: No-Such-Protocol").Write(L"\r"); + this->mErrorCode = kNotSupported; + } + + if (BS->HandleProtocol(img->DeviceHandle, &guidEfp, (void**)&efp) != kEfiOk) + { + mWriter.Write(L"BootZ: Handle-Protocol: No-Such-Protocol").Write(L"\r"); + this->mErrorCode = kNotSupported; + return; + } + + /// Start doing disk I/O + + if (efp->OpenVolume(efp, &mRootFs) != kEfiOk) + { + mWriter.Write(L"BootZ: Fetch-Protocol: No-Such-Volume").Write(L"\r"); + this->mErrorCode = kNotSupported; + return; + } + + EfiFileProtocol* fileFs = nullptr; + + if (mRootFs->Open(mRootFs, &fileFs, mPath, kEFIFileRead, kEFIReadOnly) != + kEfiOk) + { + mWriter.Write(L"BootZ: Fetch-Protocol: No-Such-Path: ") + .Write(mPath) + .Write(L"\r"); + this->mErrorCode = kNotSupported; + + fb_render_string("BootZ: PLEASE RECOVER YOUR MINKRNL INSTALL.", 40, 10, RGB(0xFF, 0xFF, 0xFF)); + + mRootFs->Close(mRootFs); + + return; + } + + mSizeFile = 0; + mFile = fileFs; + mErrorCode = kOperationOkay; +} + +Boot::BootFileReader::~BootFileReader() +{ + if (this->mFile) + { + this->mFile->Close(this->mFile); + this->mFile = nullptr; + } + + if (this->mRootFs) + { + this->mRootFs->Close(this->mRootFs); + this->mRootFs = nullptr; + } + + if (this->mBlob) + { + BS->FreePool(this->mBlob); + this->mBlob = nullptr; + } + + BSetMem(this->mPath, 0, kPathLen); +} + +/** + @brief Reads all of the file into a buffer. + @param **readUntil** size of file + @param **chunkToRead** chunk to read each time. +*/ +Void Boot::BootFileReader::ReadAll(SizeT readUntil, SizeT chunkToRead, UIntPtr out_address) +{ + UInt32 szInfo = sizeof(EfiFileInfo); + + EfiFileInfo newPtrInfo{}; + + EfiGUID kFileInfoGUID = EFI_FILE_INFO_GUID; + + if (mFile->GetInfo(mFile, &kFileInfoGUID, &szInfo, &newPtrInfo) == kEfiOk) + { + readUntil = newPtrInfo.FileSize; + mWriter.Write(L"BootZ: File size: ").Write(readUntil).Write("\r"); + } + + if (readUntil == 0) + { + mErrorCode = kNotSupported; + return; + } + + if (mBlob == nullptr) + { + if (!out_address) + { + if (auto err = BS->AllocatePool(EfiLoaderCode, readUntil, (VoidPtr*)&mBlob) != + kEfiOk) + { + mWriter.Write(L"*** error: ").Write(err).Write(L" ***\r"); + EFI::ThrowError(L"OutOfMemory", L"Out of memory."); + } + } + else + { + mBlob = (VoidPtr)out_address; + } + } + + mWriter.Write(L"*** Bytes to read: ").Write(readUntil).Write(L" ***\r"); + + UInt64 bufSize = chunkToRead; + UInt64 szCnt = 0UL; + + while (szCnt < readUntil) + { + auto res = mFile->Read(mFile, &bufSize, (VoidPtr)(&((Char*)mBlob)[szCnt])); + + szCnt += bufSize; + + if (res == kBufferTooSmall) + { + bufSize = chunkToRead; + } + } + + mSizeFile = szCnt; + mErrorCode = kOperationOkay; +} + +/// @brief error code getter. +/// @return the error code. +Int32& Boot::BootFileReader::Error() +{ + return mErrorCode; +} + +/// @brief blob getter. +/// @return the blob. +VoidPtr Boot::BootFileReader::Blob() +{ + return mBlob; +} + +/// @breif Size getter. +/// @return the size of the file. +UInt64& Boot::BootFileReader::Size() +{ + return mSizeFile; +} diff --git a/dev/boot/src/BootString.cc b/dev/boot/src/BootString.cc new file mode 100644 index 00000000..194261d0 --- /dev/null +++ b/dev/boot/src/BootString.cc @@ -0,0 +1,92 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: BootString.cc + Purpose: BootZ string library + + Revision History: + + + +------------------------------------------- */ + +#include +#include +#include + +/// BUGS: 0 + +///////////////////////////////////////////////////////////////////////////////////////////////////////// + +NeOS::SizeT Boot::BCopyMem(CharacterTypeUTF16* dest, CharacterTypeUTF16* src, const NeOS::SizeT len) +{ + if (!dest || !src) + return 0; + + SizeT index = 0UL; + for (; index < len; ++index) + { + dest[index] = src[index]; + } + + return index; +} + +NeOS::SizeT Boot::BStrLen(const CharacterTypeUTF16* ptr) +{ + if (!ptr) + return 0; + + NeOS::SizeT cnt = 0; + + while (*ptr != (CharacterTypeUTF16)0) + { + ++ptr; + ++cnt; + } + + return cnt; +} + +NeOS::SizeT Boot::BSetMem(CharacterTypeUTF16* src, const CharacterTypeUTF16 byte, const NeOS::SizeT len) +{ + if (!src) + return 0; + + NeOS::SizeT cnt = 0UL; + + while (*src != 0) + { + if (cnt > len) + break; + + *src = byte; + ++src; + + ++cnt; + } + + return cnt; +} + +NeOS::SizeT Boot::BSetMem(CharacterTypeUTF8* src, const CharacterTypeUTF8 byte, const NeOS::SizeT len) +{ + if (!src) + return 0; + + NeOS::SizeT cnt = 0UL; + + while (*src != 0) + { + if (cnt > len) + break; + + *src = byte; + ++src; + + ++cnt; + } + + return cnt; +} diff --git a/dev/boot/src/BootSupport.cc b/dev/boot/src/BootSupport.cc new file mode 100644 index 00000000..4d808ddc --- /dev/null +++ b/dev/boot/src/BootSupport.cc @@ -0,0 +1,82 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include + +#ifdef __BOOTLDR_STANDALONE__ + +/// @brief memset definition in C++. +/// @param dst destination pointer. +/// @param byte value to fill in. +/// @param len length of of src. +EXTERN_C VoidPtr memset(void* dst, int byte, long long unsigned int len) +{ + for (size_t i = 0UL; i < len; ++i) + { + ((int*)dst)[i] = byte; + } + + return dst; +} + +/// @brief memcpy definition in C++. +/// @param dst destination pointer. +/// @param src source pointer. +/// @param len length of of src. +EXTERN_C VoidPtr memcpy(void* dst, const void* src, long long unsigned int len) +{ + for (size_t i = 0UL; i < len; ++i) + { + ((int*)dst)[i] = ((int*)src)[i]; + } + + return dst; +} + +/// @brief strlen definition in C++. +EXTERN_C size_t strlen(const char* whatToCheck) +{ + SizeT len = 0; + + while (whatToCheck[len] != 0) + { + ++len; + } + + return len; +} + +/// @brief strcmp definition in C++. +EXTERN_C int strcmp(const char* whatToCheck, const char* whatToCheckRight) +{ + if (!whatToCheck || *whatToCheck == 0) + return 0; + + SizeT len = 0; + + while (whatToCheck[len] == whatToCheckRight[len]) + { + if (whatToCheck[len] == 0) + return 0; + + ++len; + } + + return len; +} + +/// @brief something specific to the Microsoft's ABI, When the stack grows too big. +EXTERN_C void ___chkstk_ms(void) +{ +} + +#endif diff --git a/dev/boot/src/BootTextWriter.cc b/dev/boot/src/BootTextWriter.cc new file mode 100644 index 00000000..b58d3429 --- /dev/null +++ b/dev/boot/src/BootTextWriter.cc @@ -0,0 +1,169 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: BootTextWriter.cc + Purpose: BootZ string library + + Revision History: + + + +------------------------------------------- */ + +#include +#include +#include +#include + +///////////////////////////////////////////////////////////////////////////////////////////////////////// +/// BUGS: 0 /// +///////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +@brief puts wrapper over EFI ConOut. +*/ +Boot::BootTextWriter& Boot::BootTextWriter::Write(const CharacterTypeUTF16* str) +{ +#ifdef __DEBUG__ + if (!str || *str == 0) + return *this; + + CharacterTypeUTF16 strTmp[2]; + strTmp[1] = 0; + + for (size_t i = 0; str[i] != 0; i++) + { + if (str[i] == '\r') + { + strTmp[0] = str[i]; + ST->ConOut->OutputString(ST->ConOut, strTmp); + + strTmp[0] = '\n'; + ST->ConOut->OutputString(ST->ConOut, strTmp); + } + else + { + strTmp[0] = str[i]; + ST->ConOut->OutputString(ST->ConOut, strTmp); + } + } +#endif // ifdef __DEBUG__ + + return *this; +} + +/// @brief UTF-8 equivalent of Write (UTF-16). +/// @param str the input string. +Boot::BootTextWriter& Boot::BootTextWriter::Write(const Char* str) +{ +#ifdef __DEBUG__ + if (!str || *str == 0) + return *this; + + CharacterTypeUTF16 strTmp[2]; + strTmp[1] = 0; + + for (size_t i = 0; str[i] != 0; i++) + { + if (str[i] == '\r') + { + strTmp[0] = str[i]; + ST->ConOut->OutputString(ST->ConOut, strTmp); + + strTmp[0] = '\n'; + ST->ConOut->OutputString(ST->ConOut, strTmp); + } + else + { + strTmp[0] = str[i]; + ST->ConOut->OutputString(ST->ConOut, strTmp); + } + } +#endif // ifdef __DEBUG__ + + return *this; +} + +Boot::BootTextWriter& Boot::BootTextWriter::Write(const UChar* str) +{ +#ifdef __DEBUG__ + if (!str || *str == 0) + return *this; + + CharacterTypeUTF16 strTmp[2]; + strTmp[1] = 0; + + for (size_t i = 0; str[i] != 0; i++) + { + if (str[i] == '\r') + { + strTmp[0] = str[i]; + ST->ConOut->OutputString(ST->ConOut, strTmp); + + strTmp[0] = '\n'; + ST->ConOut->OutputString(ST->ConOut, strTmp); + } + else + { + strTmp[0] = str[i]; + ST->ConOut->OutputString(ST->ConOut, strTmp); + } + } +#endif // ifdef __DEBUG__ + + return *this; +} + +/** +@brief putc wrapper over EFI ConOut. +*/ +Boot::BootTextWriter& Boot::BootTextWriter::WriteCharacter(CharacterTypeUTF16 c) +{ +#ifdef __DEBUG__ + EfiCharType str[2]; + + str[0] = c; + str[1] = 0; + ST->ConOut->OutputString(ST->ConOut, str); +#endif // ifdef __DEBUG__ + + return *this; +} + +Boot::BootTextWriter& Boot::BootTextWriter::Write(const Long& x) +{ +#ifdef __DEBUG__ + this->_Write(x); + this->Write("h"); +#endif // ifdef __DEBUG__ + + return *this; +} + +Boot::BootTextWriter& Boot::BootTextWriter::_Write(const Long& x) +{ +#ifdef __DEBUG__ + UInt64 y = (x > 0 ? x : -x) / 16; + UInt64 h = (x > 0 ? x : -x) % 16; + + if (y) + this->_Write(y); + + /* fail if the hex number is not base-16 */ + if (h > 16) + { + this->WriteCharacter('?'); + return *this; + } + + if (y < 0) + y = -y; + + const char cNumbers[] = "0123456789ABCDEF"; + + this->WriteCharacter(cNumbers[h]); +#endif // ifdef __DEBUG__ + + return *this; +} diff --git a/dev/boot/src/BootThread.cc b/dev/boot/src/BootThread.cc new file mode 100644 index 00000000..e087d386 --- /dev/null +++ b/dev/boot/src/BootThread.cc @@ -0,0 +1,211 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/// @brief External boot services symbol. +EXTERN EfiBootServices* BS; + +/// @note BootThread doesn't parse the symbols so doesn't nullify them, .bss is though. + +namespace Boot +{ + EXTERN_C Int32 rt_jump_to_address(VoidPtr code, HEL::BootInfoHeader* handover, UInt8* stack); + + BootThread::BootThread(VoidPtr blob) + : fBlob(blob), fStartAddress(nullptr) + { + // detect the format. + const Char* blob_bytes = reinterpret_cast(fBlob); + + BootTextWriter writer; + + if (!blob_bytes) + { + // failed to provide a valid pointer. + return; + } + + if (blob_bytes[0] == kMagMz0 && + blob_bytes[1] == kMagMz1) + { + LDR_EXEC_HEADER_PTR header_ptr = CFKit::ldr_find_exec_header(blob_bytes); + LDR_OPTIONAL_HEADER_PTR opt_header_ptr = CFKit::ldr_find_opt_exec_header(blob_bytes); + + if (!header_ptr || !opt_header_ptr) + return; + +#ifdef __NE_AMD64__ + if (header_ptr->Machine != kPeMachineAMD64 || + header_ptr->Signature != kPeSignature) + { + writer.Write("BootZ: Not a PE32+ executable.\r"); + return; + } +#elif defined(__NE_ARM64__) + if (header_ptr->Machine != kPeMachineARM64 || + header_ptr->Signature != kPeSignature) + { + writer.Write("BootZ: Not a PE32+ executable.\r"); + return; + } +#endif // __NE_AMD64__ || __NE_ARM64__ + + writer.Write("BootZ: PE32+ executable detected (NeKernel Subsystem).\r"); + + auto numSecs = header_ptr->NumberOfSections; + + writer.Write("BootZ: Major Linker Ver: ").Write(opt_header_ptr->MajorLinkerVersion).Write("\r"); + writer.Write("BootZ: Minor Linker Ver: ").Write(opt_header_ptr->MinorLinkerVersion).Write("\r"); + writer.Write("BootZ: Major Subsystem Ver: ").Write(opt_header_ptr->MajorSubsystemVersion).Write("\r"); + writer.Write("BootZ: Minor Subsystem Ver: ").Write(opt_header_ptr->MinorSubsystemVersion).Write("\r"); + writer.Write("BootZ: Magic: ").Write(header_ptr->Signature).Write("\r"); + + constexpr auto cPageSize = 512; + + EfiPhysicalAddress loadStartAddress = opt_header_ptr->ImageBase; + loadStartAddress += opt_header_ptr->BaseOfData; + + writer.Write("BootZ: Image base: ").Write(loadStartAddress).Write("\r"); + + auto numPages = opt_header_ptr->SizeOfImage / cPageSize; + BS->AllocatePages(AllocateAddress, EfiLoaderData, numPages, &loadStartAddress); + + LDR_SECTION_HEADER_PTR sectPtr = (LDR_SECTION_HEADER_PTR)(((Char*)opt_header_ptr) + header_ptr->SizeOfOptionalHeader); + + constexpr auto sectionForCode = ".text"; + constexpr auto sectionForNewLdr = ".ldr"; + constexpr auto sectionForBSS = ".bss"; + + for (SizeT sectIndex = 0; sectIndex < numSecs; ++sectIndex) + { + LDR_SECTION_HEADER_PTR sect = §Ptr[sectIndex]; + + SetMem((VoidPtr)(loadStartAddress + sect->VirtualAddress), 0, sect->SizeOfRawData); + + if (StrCmp(sectionForCode, sect->Name) == 0) + { + fStartAddress = (VoidPtr)((UIntPtr)loadStartAddress + opt_header_ptr->AddressOfEntryPoint); + writer.Write("BootZ: Executable entry address: ").Write((UIntPtr)fStartAddress).Write("\r"); + } + else if (StrCmp(sectionForNewLdr, sect->Name) == 0) + { + struct HANDOVER_INFORMATION_STUB + { + UInt64 HandoverMagic; + UInt32 HandoverType; + UInt32 HandoverPad; + UInt32 HandoverArch; + }* handover_struc = (struct HANDOVER_INFORMATION_STUB*)((UIntPtr)fBlob + sect->PointerToRawData); + + if (handover_struc->HandoverMagic != kHandoverMagic && + handover_struc->HandoverType != HEL::kTypeKernel) + { +#ifdef __NE_AMD64__ + if (handover_struc->HandoverArch != HEL::kArchAMD64) + { + fb_render_string("BootZ: Not an handover header, bad CPU...", 40, 10, RGB(0xFF, 0xFF, 0xFF)); + ::EFI::Stop(); + } +#endif + +#ifdef __NE_ARM64__ + if (handover_struc->HandoverArch != HEL::kArchARM64) + { + fb_render_string("BootZ: Not an handover header, bad CPU...", 40, 10, RGB(0xFF, 0xFF, 0xFF)); + ::EFI::Stop(); + } +#endif + fb_render_string("BootZ: Not an handover header...", 40, 10, RGB(0xFF, 0xFF, 0xFF)); + + ::EFI::Stop(); + } + } + + writer.Write("BootZ: Raw offset: ").Write(sect->PointerToRawData).Write(" of ").Write(sect->Name).Write("\r"); + + CopyMem((VoidPtr)(loadStartAddress + sect->VirtualAddress), (VoidPtr)((UIntPtr)fBlob + sect->PointerToRawData), sect->SizeOfRawData); + } + } + else if (blob_bytes[0] == kPefMagic[0] && + blob_bytes[1] == kPefMagic[1] && + blob_bytes[2] == kPefMagic[2] && + blob_bytes[3] == kPefMagic[3]) + { + // ========================================= // + // PEF executable detected. + // ========================================= // + + fStartAddress = nullptr; + writer.Write("BootZ: PEF executable detected, won't load it.\r"); + writer.Write("BootZ: note: PEF executables aren't loadable by default.\r"); + } + else + { + writer.Write("BootZ: Invalid Executable.\r"); + } + + fStack = new UInt8[mib_cast(16)]; + } + + /// @note handover header has to be valid! + Int32 BootThread::Start(HEL::BootInfoHeader* handover, Bool own_stack) + { + HEL::HandoverProc err_fn = [](HEL::BootInfoHeader* rcx) -> Int32 { + fb_render_string("BootZ: Invalid Boot Image...", 50, 10, RGB(0xFF, 0xFF, 0xFF)); + ::EFI::Stop(); + + return NO; + }; + + if (!fStartAddress) + { + err_fn(handover); + } + + fHandover = handover; + + if (own_stack) + { + rt_jump_to_address(fStartAddress, fHandover, &fStack[mib_cast(16) - 1]); + } + else + { + if (fStack) + delete[] fStack; + + fStack = nullptr; + + return reinterpret_cast(fStartAddress)(fHandover); + } + + return kEfiOk; + } + + const Char* BootThread::GetName() + { + return fBlobName; + } + + Void BootThread::SetName(const Char* name) + { + CopyMem(fBlobName, name, StrLen(name)); + } + + bool BootThread::IsValid() + { + return fStartAddress != nullptr; + } +} // namespace Boot diff --git a/dev/boot/src/BootloaderRsrc.rsrc b/dev/boot/src/BootloaderRsrc.rsrc new file mode 100644 index 00000000..2f8177a7 --- /dev/null +++ b/dev/boot/src/BootloaderRsrc.rsrc @@ -0,0 +1,25 @@ +#include "../../kernel/CompilerKit/Version.h" + +1 VERSIONINFO +FILEVERSION 1,0,0,0 +PRODUCTVERSION 1,0,0,0 +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080904E4" + BEGIN + VALUE "CompanyName", "Amlal EL Mahrouss" + VALUE "FileDescription", "NeKernel OS Loader." + VALUE "FileVersion", BOOTLOADER_VERSION + VALUE "InternalName", "bootz" + VALUE "LegalCopyright", "Copyright (C) 2024, Amlal EL Mahrouss all rights reserved." + VALUE "OriginalFilename", "bootz.exe" + VALUE "ProductName", "bootz" + VALUE "ProductVersion", BOOTLOADER_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x809, 1252 + END +END diff --git a/dev/boot/src/HEL/64X000/.gitkeep b/dev/boot/src/HEL/64X000/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/boot/src/HEL/64X000/BootCB.S b/dev/boot/src/HEL/64X000/BootCB.S new file mode 100644 index 00000000..f286f449 --- /dev/null +++ b/dev/boot/src/HEL/64X000/BootCB.S @@ -0,0 +1,35 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +.section .boot_hdr +.align 4 + +/* BootZ boot header begin for a 64x000 Kernel. */ + +boot_hdr_mag: + .ascii "CB" +boot_hdr_name: + // it has to match ten bytes. + .asciz "bootz\0\0\0" +boot_hdr_ver: + .word 0x104 +boot_hdr_proc: + .long bootloader_start + +/* BootZ boot header end */ + +.extern bootloader_main +.extern bootloader_stack + +.globl bootloader_start +bootloader_start: + psh 4 /* real address of .Laddr */ + ldi 0,(bootloader_stack-bootloader_start)(4) /* stack address location */ + mv 19,0 /* use user defined stack */ + jrl + + bl bootloader_main + blr diff --git a/dev/boot/src/HEL/AMD64/BootAPI.S b/dev/boot/src/HEL/AMD64/BootAPI.S new file mode 100644 index 00000000..963ef46a --- /dev/null +++ b/dev/boot/src/HEL/AMD64/BootAPI.S @@ -0,0 +1,60 @@ +.global rt_jump_to_address +.global rt_reset_hardware + +.text + +.intel_syntax noprefix + +/** + @brief this function setups a stack and then jumps to + a function */ +rt_jump_to_address: + mov rbx, rcx + mov rcx, rdx + push rbx + push rdx + mov rsp, r8 + push rax + jmp rbx + + pop rdx + pop rbx + pop rax + + ret + +rt_reset_hardware: + /* dont raise any interrupts. (except ofc NMIs.) */ + cli + /* remap PIC */ +wait_gate1: + in al,0x64 + and al,2 + jnz wait_gate1 + mov al,0x0D1 + out 0x64,al +wait_gate2: + in al,0x64 + and al,2 + jnz wait_gate2 + mov al,0x0FE + out 0x60,al + + /* trigger triple fault, by writing to cr4 */ + + mov rax, 0 + lidt [rax] + +reset_wait: + jmp reset_wait + +.global boot_write_cr3 +.global boot_read_cr3 + +boot_read_cr3: + mov rax, rax + ret + +boot_write_cr3: + mov cr3, rcx + ret diff --git a/dev/boot/src/HEL/AMD64/BootATA.cc b/dev/boot/src/HEL/AMD64/BootATA.cc new file mode 100644 index 00000000..0ec6ab18 --- /dev/null +++ b/dev/boot/src/HEL/AMD64/BootATA.cc @@ -0,0 +1,283 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +/** + * @file BootATA.cc + * @author Amlal EL Mahrouss (amlalelmahrouss@icloud.com) + * @brief ATA driver. + * @version 0.1 + * @date 2024-02-02 + * + * @copyright Copyright (c) Amlal EL Mahrouss + * + */ + +#include +#include +#include + +/// bugs: 0 + +using namespace Boot; + +#define kATADataLen 256 + +static Boolean kATADetected = false; +static Int32 kATADeviceType = kATADeviceCount; +static UInt16 kATAData[kATADataLen] = {0}; + +Boolean boot_ata_detected(Void); + +STATIC Boolean boot_ata_wait_io(UInt16 IO) +{ + for (int i = 0; i < 400; i++) + rt_in8(IO + ATA_REG_STATUS); + +ATAWaitForIO_Retry: + auto status_rdy = rt_in8(IO + ATA_REG_STATUS); + + if ((status_rdy & ATA_SR_BSY)) + goto ATAWaitForIO_Retry; + +ATAWaitForIO_Retry2: + status_rdy = rt_in8(IO + ATA_REG_STATUS); + + if (status_rdy & ATA_SR_ERR) + return false; + + if (!(status_rdy & ATA_SR_DRDY)) + goto ATAWaitForIO_Retry2; + + return true; +} + +Void boot_ata_select(UInt16 Bus) +{ + if (Bus == ATA_PRIMARY_IO) + rt_out8(Bus + ATA_REG_HDDEVSEL, ATA_PRIMARY_SEL); + else + rt_out8(Bus + ATA_REG_HDDEVSEL, ATA_SECONDARY_SEL); +} + +Boolean boot_ata_init(UInt16 Bus, UInt8 Drive, UInt16& OutBus, UInt8& OutMaster) +{ + if (boot_ata_detected()) + return true; + + BootTextWriter writer; + + UInt16 IO = Bus; + + boot_ata_select(IO); + + // Bus init, NEIN bit. + rt_out8(IO + ATA_REG_NEIN, 1); + + // identify until it's good. +ATAInit_Retry: + auto status_rdy = rt_in8(IO + ATA_REG_STATUS); + + if (status_rdy & ATA_SR_ERR) + { + writer.Write( + L"BootZ: ATA: Not an IDE based drive.\r"); + + return false; + } + + if ((status_rdy & ATA_SR_BSY)) + goto ATAInit_Retry; + + rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_IDENTIFY); + + /// fetch serial info + /// model, speed, number of sectors... + + boot_ata_wait_io(IO); + + for (SizeT indexData = 0ul; indexData < kATADataLen; ++indexData) + { + kATAData[indexData] = NeOS::HAL::rt_in16(IO + ATA_REG_DATA); + } + + OutBus = + (Bus == ATA_PRIMARY_IO) ? BootDeviceATA::kPrimary : BootDeviceATA::kSecondary; + + OutMaster = (Bus == ATA_PRIMARY_IO) ? ATA_MASTER : ATA_SLAVE; + + return true; +} + +Void boot_ata_read(UInt64 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf, SizeT SectorSz, SizeT Size) +{ + Lba /= SectorSz; + + UInt8 Command = ((!Master) ? 0xE0 : 0xF0); + + boot_ata_wait_io(IO); + boot_ata_select(IO); + + rt_out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F)); + + rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz) / SectorSz)); + + rt_out8(IO + ATA_REG_LBA0, (Lba)&0xFF); + rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); + rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); + rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); + + rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_READ_PIO); + + boot_ata_wait_io(IO); + + for (SizeT IndexOff = 0; IndexOff < Size; ++IndexOff) + { + boot_ata_wait_io(IO); + Buf[IndexOff] = NeOS::HAL::rt_in16(IO + ATA_REG_DATA); + boot_ata_wait_io(IO); + } +} + +Void boot_ata_write(UInt64 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf, SizeT SectorSz, SizeT Size) +{ + Lba /= SectorSz; + + UInt8 Command = ((!Master) ? 0xE0 : 0xF0); + + boot_ata_wait_io(IO); + boot_ata_select(IO); + + rt_out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F)); + + rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + (SectorSz)) / SectorSz)); + + rt_out8(IO + ATA_REG_LBA0, (Lba)&0xFF); + rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); + rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); + rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); + + rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_WRITE_PIO); + + boot_ata_wait_io(IO); + + for (SizeT IndexOff = 0; IndexOff < Size; ++IndexOff) + { + boot_ata_wait_io(IO); + rt_out16(IO + ATA_REG_DATA, Buf[IndexOff]); + boot_ata_wait_io(IO); + } + + boot_ata_wait_io(IO); +} + +/// @check is ATA detected? +Boolean boot_ata_detected(Void) +{ + return kATADetected; +} + +/*** + * + * + * @brief ATA Device class. + * + * + */ + +/** + * @brief ATA Device constructor. + * @param void none. + */ +BootDeviceATA::BootDeviceATA() noexcept +{ + if (boot_ata_init(ATA_PRIMARY_IO, true, this->Leak().mBus, + this->Leak().mMaster) || + boot_ata_init(ATA_SECONDARY_IO, true, this->Leak().mBus, + this->Leak().mMaster)) + { + kATADetected = true; + } +} +/** + * @brief Is ATA detected? + */ +BootDeviceATA::operator bool() +{ + return boot_ata_detected(); +} + +/** + @brief Read Buf from disk + @param Sz Sector size + @param Buf buffer +*/ +BootDeviceATA& BootDeviceATA::Read(CharacterTypeUTF8* Buf, const SizeT& SectorSz) +{ + if (!boot_ata_detected()) + { + Leak().mErr = true; + return *this; + } + + this->Leak().mErr = false; + + if (!Buf || SectorSz < 1) + return *this; + + boot_ata_read(this->Leak().mBase, this->Leak().mBus, this->Leak().mMaster, + Buf, SectorSz, this->Leak().mSize); + + return *this; +} + +/** + @brief Write Buf into disk + @param Sz Sector size + @param Buf buffer +*/ +BootDeviceATA& BootDeviceATA::Write(CharacterTypeUTF8* Buf, const SizeT& SectorSz) +{ + if (!boot_ata_detected()) + { + Leak().mErr = true; + return *this; + } + + Leak().mErr = false; + + if (!Buf || SectorSz < 1 || this->Leak().mSize < 1) + { + Leak().mErr = true; + return *this; + } + + boot_ata_write(this->Leak().mBase, this->Leak().mBus, this->Leak().mMaster, + Buf, SectorSz, this->Leak().mSize); + + return *this; +} + +/** + * @brief ATA trait getter. + * @return BootDeviceATA::ATATrait& the drive config. + */ +BootDeviceATA::ATATrait& BootDeviceATA::Leak() +{ + return mTrait; +} + +/*** + @brief Getter, gets the number of sectors inside the drive. +*/ +SizeT BootDeviceATA::GetSectorsCount() noexcept +{ + return (kATAData[61] << 16) | kATAData[60]; +} + +SizeT BootDeviceATA::GetDiskSize() noexcept +{ + return this->GetSectorsCount() * BootDeviceATA::kSectorSize; +} diff --git a/dev/boot/src/HEL/AMD64/BootEFI.cc b/dev/boot/src/HEL/AMD64/BootEFI.cc new file mode 100644 index 00000000..5e2b3855 --- /dev/null +++ b/dev/boot/src/HEL/AMD64/BootEFI.cc @@ -0,0 +1,316 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Makes the compiler shut up. +#ifndef kMachineModel +#define kMachineModel "ZkaOS" +#endif // !kMachineModel + +#ifndef kExpectedWidth +#define kExpectedWidth (1280) +#endif + +#ifndef kExpectedHeight +#define kExpectedHeight (720) +#endif + +/** Graphics related. */ + +STATIC EfiGraphicsOutputProtocol* kGop = nullptr; +STATIC UInt16 kGopStride = 0U; +STATIC EfiGUID kGopGuid; + +/** Related to jumping to the reset vector. */ + +EXTERN_C Void rt_reset_hardware(); + +/** Boot Services symbol. */ +EXTERN EfiBootServices* BS; + +/** + @brief Finds and stores the GOP object. +*/ +STATIC Bool boot_init_fb() noexcept +{ + kGopGuid = EfiGUID(EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID); + kGop = nullptr; + + if (BS->LocateProtocol(&kGopGuid, nullptr, (VoidPtr*)&kGop) != kEfiOk) + return No; + + kGopStride = 4; + + for (SizeT i = 0; i < kGop->Mode->MaxMode; ++i) + { + EfiGraphicsOutputProtocolModeInformation* infoPtr = nullptr; + UInt32 sz = 0U; + + kGop->QueryMode(kGop, i, &sz, &infoPtr); + + if (infoPtr->HorizontalResolution == kExpectedWidth && + infoPtr->VerticalResolution == kExpectedHeight) + { + kGop->SetMode(kGop, i); + return Yes; + } + } + + return No; +} + +EfiGUID kEfiGlobalNamespaceVarGUID = { + 0x8BE4DF61, 0x93CA, 0x11D2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C}}; + +/// @brief Main EFI entrypoint. +/// @param image_handle Handle of this image. +/// @param sys_table The system table of it. +/// @return nothing, never returns. +EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr image_handle, + EfiSystemTable* sys_table) +{ + InitEFI(sys_table); ///! Init the EFI library. + + HEL::BootInfoHeader* handover_hdr = + new HEL::BootInfoHeader(); + + UInt32 map_key = 0; + UInt32 size_struct_ptr = sizeof(EfiMemoryDescriptor); + EfiMemoryDescriptor* struct_ptr = nullptr; + UInt32 sz_desc = sizeof(EfiMemoryDescriptor); + UInt32 rev_desc = 0; + +#ifdef ZBA_USE_FB + if (!boot_init_fb()) + return 1; ///! Init the GOP. + + for (SizeT index_vt = 0; index_vt < sys_table->NumberOfTableEntries; + ++index_vt) + { + Char* vendor_table = reinterpret_cast( + sys_table->ConfigurationTable[index_vt].VendorTable); + + // ACPI's 'RSD PTR', which contains the ACPI SDT (MADT, FACP...) + if (vendor_table[0] == 'R' && vendor_table[1] == 'S' && + vendor_table[2] == 'D' && vendor_table[3] == ' ' && + vendor_table[4] == 'P' && vendor_table[5] == 'T' && + vendor_table[6] == 'R' && vendor_table[7] == ' ') + { + handover_hdr->f_HardwareTables.f_VendorPtr = (VoidPtr)vendor_table; + break; + } + } + + // ------------------------------------------ // + // draw background color. + // ------------------------------------------ // + + handover_hdr->f_GOP.f_The = kGop->Mode->FrameBufferBase; + handover_hdr->f_GOP.f_Width = kGop->Mode->Info->VerticalResolution; + handover_hdr->f_GOP.f_Height = kGop->Mode->Info->HorizontalResolution; + handover_hdr->f_GOP.f_PixelPerLine = kGop->Mode->Info->PixelsPerScanLine; + handover_hdr->f_GOP.f_PixelFormat = kGop->Mode->Info->PixelFormat; + handover_hdr->f_GOP.f_Size = kGop->Mode->FrameBufferSize; +#endif // ZBA_USE_FB + + // ------------------------------------------- // + // Grab MP services, extended to runtime. // + // ------------------------------------------- // + + EfiGUID guid_mp = EfiGUID(EFI_MP_SERVICES_PROTOCOL_GUID); + EfiMpServicesProtocol* mp = nullptr; + + BS->LocateProtocol(&guid_mp, nullptr, reinterpret_cast(&mp)); + + handover_hdr->f_HardwareTables.f_MpPtr = reinterpret_cast(mp); + + kHandoverHeader = handover_hdr; + + fb_init(); + + FB::fb_clear_video(); + + FBDrawBitMapInRegion(zka_disk, NE_DISK_WIDTH, NE_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - NE_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - NE_DISK_HEIGHT) / 2); + + fb_clear(); + + UInt32 cnt_enabled = 0; + UInt32 cnt_disabled = 0; + + if (mp) + { + mp->GetNumberOfProcessors(mp, &cnt_disabled, &cnt_enabled); + handover_hdr->f_HardwareTables.f_MultiProcessingEnabled = cnt_enabled > 1; + } + else + { + handover_hdr->f_HardwareTables.f_MultiProcessingEnabled = NO; + } + + // Fill handover header now. + + // ---------------------------------------------------- // + // The following checks for an exisiting partition + // inside the disk, if it doesn't have one, + // format the disk. + // ---------------------------------------------------- // + + BS->GetMemoryMap(&size_struct_ptr, struct_ptr, &map_key, &sz_desc, &rev_desc); + + struct_ptr = new EfiMemoryDescriptor[sz_desc]; + + BS->GetMemoryMap(&size_struct_ptr, struct_ptr, &map_key, &sz_desc, &rev_desc); + + auto kDefaultMemoryMap = 0; // Grab any usable entries. + + //-----------------------------------------------------------// + // A simple loop which finds a usable memory region for us. + //-----------------------------------------------------------// + + SizeT lookup_index = 0UL; + + for (; struct_ptr[lookup_index].Kind != EfiMemoryType::EfiConventionalMemory; ++lookup_index) + { + NE_UNUSED(0); + } + + kDefaultMemoryMap = lookup_index; + + //-------------------------------------------------------------// + // Update handover file specific table and phyiscal start field. + //-------------------------------------------------------------// + + handover_hdr->f_BitMapStart = (VoidPtr)struct_ptr[kDefaultMemoryMap].VirtualStart; /* Start of bitmap. */ + handover_hdr->f_BitMapSize = struct_ptr[kDefaultMemoryMap].NumberOfPages * sizeof(UIntPtr); /* Size of bitmap. */ + + handover_hdr->f_FirmwareCustomTables[0] = (VoidPtr)BS; + handover_hdr->f_FirmwareCustomTables[1] = (VoidPtr)ST; + + Boot::BootFileReader reader_syschk(L"syschk.sys", image_handle); + reader_syschk.ReadAll(0); + + Boot::BootThread* syschk_thread = nullptr; + + // ------------------------------------------ // + // If we succeed in reading the blob, then execute it. + // ------------------------------------------ // + + if (reader_syschk.Blob()) + { + syschk_thread = new Boot::BootThread(reader_syschk.Blob()); + syschk_thread->SetName("BootZ: System Recovery Check"); + syschk_thread->Start(handover_hdr, NO); + } + +#if defined(__ATA_PIO__) + Boot::BDiskFormatFactory partition_factory; + + if (syschk_thread->Start(handover_hdr, NO) != kEfiOk) + { + if (partition_factory.IsPartitionValid() == NO) + { + Boot::BDiskFormatFactory::BFileDescriptor root{}; + + root.fFileName[0] = kNeFSRoot[0]; + root.fFileName[1] = 0; + + root.fKind = kNeFSCatalogKindDir; + + const auto kFSName = "SSD"; + + partition_factory.Format(kFSName, &root, 1); + + fb_init(); + + FB::fb_clear_video(); + + FBDrawBitMapInRegion(zka_has_disk, NE_HAS_DISK_WIDTH, NE_HAS_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - NE_HAS_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - NE_HAS_DISK_HEIGHT) / 2); + + fb_clear(); + } + } +#endif + + // ------------------------------------------ // + // null these fields, to avoid being reused later. + // ------------------------------------------ // + + handover_hdr->f_FirmwareCustomTables[0] = nullptr; + handover_hdr->f_FirmwareCustomTables[1] = nullptr; + + handover_hdr->f_FirmwareVendorLen = Boot::BStrLen(sys_table->FirmwareVendor); + + handover_hdr->f_Magic = kHandoverMagic; + handover_hdr->f_Version = kHandoverVersion; + + // Provide fimware vendor name. + + Boot::BCopyMem(handover_hdr->f_FirmwareVendorName, sys_table->FirmwareVendor, + handover_hdr->f_FirmwareVendorLen); + + handover_hdr->f_FirmwareVendorLen = Boot::BStrLen(sys_table->FirmwareVendor); + + // Assign to global 'kHandoverHeader'. + + WideChar kernel_path[256U] = L"neoskrnl.exe"; + UInt32 kernel_path_sz = 256U; + + if (ST->RuntimeServices->GetVariable(L"/props/boot_path", kEfiGlobalNamespaceVarGUID, nullptr, &kernel_path_sz, kernel_path) != kEfiOk) + { + /// access attributes (in order) + /// EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS + UInt32 attr = 0x00000001 | 0x00000002 | 0x00000004; + ST->RuntimeServices->SetVariable(L"/props/boot_path", kEfiGlobalNamespaceVarGUID, &attr, &kernel_path_sz, kernel_path); + } + + Boot::BootFileReader reader_kernel(kernel_path, image_handle); + + reader_kernel.ReadAll(0); + + Boot::BootThread* kernel_thread = nullptr; + + // ------------------------------------------ // + // If we succeed in reading the blob, then execute it. + // ------------------------------------------ // + + if (reader_kernel.Blob()) + { + kernel_thread = new Boot::BootThread(reader_kernel.Blob()); + kernel_thread->SetName("BootZ: MicroKernel."); + + handover_hdr->f_KernelImage = reader_kernel.Blob(); + } + else + { + fb_init(); + FBDrawBitMapInRegion(zka_no_disk, NE_NO_DISK_WIDTH, NE_NO_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - NE_NO_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - NE_NO_DISK_HEIGHT) / 2); + + EFI::Stop(); + } + + EFI::ExitBootServices(map_key, image_handle); + + // ---------------------------------------------------- // + // Finally load the OS kernel. + // ---------------------------------------------------- // + + kernel_thread->Start(handover_hdr, YES); + + CANT_REACH(); +} diff --git a/dev/boot/src/HEL/AMD64/BootPlatform.cc b/dev/boot/src/HEL/AMD64/BootPlatform.cc new file mode 100644 index 00000000..c7ae4085 --- /dev/null +++ b/dev/boot/src/HEL/AMD64/BootPlatform.cc @@ -0,0 +1,106 @@ + +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include + +#ifdef __BOOTLDR_STANDALONE__ + +using namespace Boot; + +EXTERN_C void rt_hlt() +{ + asm volatile("hlt"); +} + +EXTERN_C void rt_cli() +{ + asm volatile("cli"); +} + +EXTERN_C void rt_sti() +{ + asm volatile("sti"); +} + +EXTERN_C void rt_cld() +{ + asm volatile("cld"); +} + +EXTERN_C void rt_std() +{ + asm volatile("std"); +} + +EXTERN_C void rt_out8(UInt16 port, UInt8 value) +{ + asm volatile("outb %%al, %1" + : + : "a"(value), "Nd"(port) + : "memory"); +} + +EXTERN_C void rt_out16(UInt16 port, UInt16 value) +{ + asm volatile("outw %%ax, %1" + : + : "a"(value), "Nd"(port) + : "memory"); +} + +EXTERN_C void rt_out32(UInt16 port, UInt32 value) +{ + asm volatile("outl %%eax, %1" + : + : "a"(value), "Nd"(port) + : "memory"); +} + +EXTERN_C UInt8 rt_in8(UInt16 port) +{ + UInt8 value; + asm volatile("inb %1, %%al" + : "=a"(value) + : "Nd"(port) + : "memory"); + + return value; +} + +EXTERN_C UInt16 rt_in16(UInt16 port) +{ + UInt16 value; + asm volatile("inw %%dx, %%ax" + : "=a"(value) + : "d"(port)); + + return value; +} + +EXTERN_C UInt32 rt_in32(UInt16 port) +{ + UInt32 value; + asm volatile("inl %1, %%eax" + : "=a"(value) + : "Nd"(port) + : "memory"); + + return value; +} + +#else + +#include + +void rt_hlt() +{ + NeOS::HAL::rt_halt(); +} + +#endif // __BOOTLDR_STANDALONE__ diff --git a/dev/boot/src/HEL/AMD64/BootSATA.cc b/dev/boot/src/HEL/AMD64/BootSATA.cc new file mode 100644 index 00000000..b485023d --- /dev/null +++ b/dev/boot/src/HEL/AMD64/BootSATA.cc @@ -0,0 +1,20 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +/** + * @file BootAHCI.cc + * @author Amlal EL Mahrouss (amlalelmahrouss@icloud.com) + * @brief SATA support for BootZ. + * @version 0.1 + * @date 2024-02-02 + * + * @copyright Copyright (c) Amlal EL Mahrouss + * + */ + +#include +#include +#include diff --git a/dev/boot/src/HEL/ARM64/.gitkeep b/dev/boot/src/HEL/ARM64/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/boot/src/HEL/ARM64/BootAPI.S b/dev/boot/src/HEL/ARM64/BootAPI.S new file mode 100644 index 00000000..a60ad218 --- /dev/null +++ b/dev/boot/src/HEL/ARM64/BootAPI.S @@ -0,0 +1,12 @@ +.global rt_jump_to_address + +.text + +/** + @brief this function setups a stack and then jumps to + a function */ +rt_jump_to_address: + mov x19, x0 + mov sp, x2 + blr x19 + diff --git a/dev/boot/src/HEL/ARM64/BootCB.S b/dev/boot/src/HEL/ARM64/BootCB.S new file mode 100644 index 00000000..2d1ff60c --- /dev/null +++ b/dev/boot/src/HEL/ARM64/BootCB.S @@ -0,0 +1,40 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifdef __NE_COREBOOT__ + +.section .boot_hdr +.align 4 + +/* BootZ boot header begin */ + +boot_hdr_mag: + .ascii "CB" +boot_hdr_name: + // it has to match ten bytes. + .asciz "bootz\0\0" +boot_hdr_ver: + .word 0x104 +boot_hdr_proc: + .long bootloader_start + +/* BootZ boot header end */ + +.extern bootloader_main +.extern bootloader_stack + +.globl bootloader_start +bootloader_start: + adr x0, bootloader_stack + ldr x1, =bootloader_start + sub x0, x0, x1 + ldr x0, [x0] + mov sp, x0 + + bl bootloader_main + ret + +#endif // __NE_COREBOOT__ \ No newline at end of file diff --git a/dev/boot/src/HEL/ARM64/BootEFI.cc b/dev/boot/src/HEL/ARM64/BootEFI.cc new file mode 100644 index 00000000..d60f305b --- /dev/null +++ b/dev/boot/src/HEL/ARM64/BootEFI.cc @@ -0,0 +1,220 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Makes the compiler shut up. +#ifndef kMachineModel +#define kMachineModel "ZkaOS" +#endif // !kMachineModel + +#ifndef kExpectedWidth +#define kExpectedWidth (1920) +#endif + +#ifndef kExpectedHeight +#define kExpectedHeight (1080) +#endif + +/** Graphics related. */ + +STATIC EfiGraphicsOutputProtocol* kGop = nullptr; +STATIC UInt16 kGopStride = 0U; +STATIC EfiGUID kGopGuid; + +EXTERN_C Void rt_reset_hardware(); + +EXTERN EfiBootServices* BS; + +/** + @brief Finds and stores the GOP object. +*/ +STATIC Bool boot_init_fb() noexcept +{ + kGopGuid = EfiGUID(EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID); + kGop = nullptr; + + if (BS->LocateProtocol(&kGopGuid, nullptr, (VoidPtr*)&kGop) != kEfiOk) + return No; + + kGopStride = 4; + + for (SizeT i = 0; i < kGop->Mode->MaxMode; ++i) + { + EfiGraphicsOutputProtocolModeInformation* infoPtr = nullptr; + UInt32 sz = 0U; + + kGop->QueryMode(kGop, i, &sz, &infoPtr); + + if (infoPtr->HorizontalResolution == kExpectedWidth && + infoPtr->VerticalResolution == kExpectedHeight) + { + kGop->SetMode(kGop, i); + return Yes; + } + } + + return No; +} + +EXTERN EfiBootServices* BS; + +/// @brief Main EFI entrypoint. +/// @param image_handle Handle of this image. +/// @param sys_table The system table of it. +/// @return nothing, never returns. +EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr image_handle, + EfiSystemTable* sys_table) +{ + InitEFI(sys_table); ///! Init the EFI library. + + HEL::BootInfoHeader* handover_hdr = + new HEL::BootInfoHeader(); + + UInt32 map_key = 0; + UInt32 size_struct_ptr = sizeof(EfiMemoryDescriptor); + EfiMemoryDescriptor* struct_ptr = nullptr; + UInt32 sz_desc = sizeof(EfiMemoryDescriptor); + UInt32 rev_desc = 0; + +#ifdef ZBA_USE_FB + if (!boot_init_fb()) + return 1; ///! Init the GOP. + + for (SizeT index_vt = 0; index_vt < sys_table->NumberOfTableEntries; + ++index_vt) + { + Char* vendor_table = reinterpret_cast( + sys_table->ConfigurationTable[index_vt].VendorTable); + + // ACPI's 'RSD PTR', which contains the ACPI SDT (MADT, FACP...) + if (vendor_table[0] == 'R' && vendor_table[1] == 'S' && + vendor_table[2] == 'D' && vendor_table[3] == ' ' && + vendor_table[4] == 'P' && vendor_table[5] == 'T' && + vendor_table[6] == 'R' && vendor_table[7] == ' ') + { + handover_hdr->f_HardwareTables.f_VendorPtr = (VoidPtr)vendor_table; + break; + } + } + + // ------------------------------------------ // + // draw background color. + // ------------------------------------------ // + + handover_hdr->f_GOP.f_The = kGop->Mode->FrameBufferBase; + handover_hdr->f_GOP.f_Width = kGop->Mode->Info->VerticalResolution; + handover_hdr->f_GOP.f_Height = kGop->Mode->Info->HorizontalResolution; + handover_hdr->f_GOP.f_PixelPerLine = kGop->Mode->Info->PixelsPerScanLine; + handover_hdr->f_GOP.f_PixelFormat = kGop->Mode->Info->PixelFormat; + handover_hdr->f_GOP.f_Size = kGop->Mode->FrameBufferSize; +#endif // ZBA_USE_FB + + // ------------------------------------------- // + // Grab MP services, extended to runtime. // + // ------------------------------------------- // + + EfiGUID guid_mp = EfiGUID(EFI_MP_SERVICES_PROTOCOL_GUID); + EfiMpServicesProtocol* mp = nullptr; + + BS->LocateProtocol(&guid_mp, nullptr, reinterpret_cast(&mp)); + + handover_hdr->f_HardwareTables.f_MpPtr = reinterpret_cast(mp); + + kHandoverHeader = handover_hdr; + + fb_init(); + + FB::fb_clear_video(); + + FBDrawBitMapInRegion(zka_disk, NE_DISK_WIDTH, NE_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - NE_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - NE_DISK_HEIGHT) / 2); + + fb_clear(); + + UInt32 cnt_enabled = 0; + UInt32 cnt_disabled = 0; + + if (mp) + { + mp->GetNumberOfProcessors(mp, &cnt_disabled, &cnt_enabled); + handover_hdr->f_HardwareTables.f_MultiProcessingEnabled = cnt_enabled > 1; + } + else + { + handover_hdr->f_HardwareTables.f_MultiProcessingEnabled = NO; + } + + //-------------------------------------------------------------// + // Update handover file specific table and phyiscal start field. + //-------------------------------------------------------------// + + handover_hdr->f_BitMapStart = nullptr; /* Start of bitmap. */ + handover_hdr->f_BitMapSize = kHandoverBitMapSz; /* Size of bitmap. */ + + while (BS->AllocatePool(EfiLoaderData, handover_hdr->f_BitMapSize, &handover_hdr->f_BitMapStart) != kEfiOk) + { + if (handover_hdr->f_BitMapStart) + { + BS->FreePool(handover_hdr->f_BitMapStart); + handover_hdr->f_BitMapStart = nullptr; + } + } + + // ------------------------------------------ // + // null these fields, to avoid being reused later. + // ------------------------------------------ // + + handover_hdr->f_FirmwareCustomTables[0] = nullptr; + handover_hdr->f_FirmwareCustomTables[1] = nullptr; + + handover_hdr->f_FirmwareVendorLen = Boot::BStrLen(sys_table->FirmwareVendor); + + handover_hdr->f_Magic = kHandoverMagic; + handover_hdr->f_Version = kHandoverVersion; + + // Provide fimware vendor name. + + Boot::BCopyMem(handover_hdr->f_FirmwareVendorName, sys_table->FirmwareVendor, + handover_hdr->f_FirmwareVendorLen); + + handover_hdr->f_FirmwareVendorLen = Boot::BStrLen(sys_table->FirmwareVendor); + + // Assign to global 'kHandoverHeader'. + + Boot::BootFileReader reader_kernel(L"neoskrnl.exe", image_handle); + + reader_kernel.ReadAll(0); + + // ------------------------------------------ // + // If we succeed in reading the blob, then execute it. + // ------------------------------------------ // + + if (reader_kernel.Blob()) + { + auto kernel_thread = Boot::BootThread(reader_kernel.Blob()); + kernel_thread.SetName("BootZ: MicroKernel."); + + handover_hdr->f_KernelImage = reader_kernel.Blob(); + + EFI::ExitBootServices(map_key, image_handle); + + kernel_thread.Start(handover_hdr, YES); + } + + CANT_REACH(); +} diff --git a/dev/boot/src/HEL/ARM64/BootPlatform.cc b/dev/boot/src/HEL/ARM64/BootPlatform.cc new file mode 100644 index 00000000..9713b80d --- /dev/null +++ b/dev/boot/src/HEL/ARM64/BootPlatform.cc @@ -0,0 +1,37 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include + +#ifdef __BOOTLDR_STANDALONE__ + +using namespace Boot; + +EXTERN_C void rt_hlt() +{ + while (Yes) + ; +} + +EXTERN_C void rt_cli() +{ +} + +EXTERN_C void rt_sti() +{ +} + +EXTERN_C void rt_cld() +{ +} + +EXTERN_C void rt_std() +{ +} + +#endif // __BOOTLDR_STANDALONE__ diff --git a/dev/boot/src/HEL/POWER/.gitkeep b/dev/boot/src/HEL/POWER/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/boot/src/HEL/POWER/BootCB.S b/dev/boot/src/HEL/POWER/BootCB.S new file mode 100644 index 00000000..2b64f8c1 --- /dev/null +++ b/dev/boot/src/HEL/POWER/BootCB.S @@ -0,0 +1,34 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +.section .boot_hdr +.align 4 + +/* BootZ boot header begin */ + +boot_hdr_mag: + .ascii "CB" +boot_hdr_name: + // it has to match ten bytes. + .asciz "bootz\0\0\0" +boot_hdr_ver: + .word 0x104 +boot_hdr_proc: + .long bootloader_start + +/* BootZ boot header end */ + +.extern bootloader_main +.extern bootloader_stack + +.globl bootloader_start +bootloader_start: + mflr 4 /* real address of .Laddr */ + lwz 0,(bootloader_stack-bootloader_start)(4) /* stack address location */ + mr 1,0 /* use user defined stack */ + + bl bootloader_main + blr diff --git a/dev/boot/src/New+Delete.cc b/dev/boot/src/New+Delete.cc new file mode 100644 index 00000000..03a1bb68 --- /dev/null +++ b/dev/boot/src/New+Delete.cc @@ -0,0 +1,60 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include + +#ifdef __BOOTLDR_STANDALONE__ +EXTERN EfiBootServices* BS; + +/// @brief Allocates a new object. +/// @param sz the size. +/// @return +void* operator new(size_t sz) +{ + void* buf = nullptr; + + while (BS->AllocatePool(EfiMemoryType::EfiLoaderData, sz, &buf) != kEfiOk) + BS->FreePool(buf); + + return buf; +} + +/// @brief Allocates a new object. +/// @param sz the size. +/// @return +void* operator new[](size_t sz) +{ + void* buf = nullptr; + BS->AllocatePool(EfiMemoryType::EfiLoaderData, sz, &buf); + + return buf; +} + +/// @brief Deletes the object. +/// @param buf the object. +void operator delete(void* buf) +{ + BS->FreePool(buf); +} + +/// @brief Deletes the object. +/// @param buf the object. +void operator delete[](void* buf) +{ + BS->FreePool(buf); +} + +/// @brief Deletes the object (array specific). +/// @param buf the object. +/// @param size it's size. +void operator delete(void* buf, size_t size) +{ + BS->FreePool(buf); +} + +#endif // __BOOTLDR_STANDALONE__ diff --git a/dev/boot/src/Root/EFI/STARTUP.NSH b/dev/boot/src/Root/EFI/STARTUP.NSH new file mode 100644 index 00000000..2cf25f23 --- /dev/null +++ b/dev/boot/src/Root/EFI/STARTUP.NSH @@ -0,0 +1,2 @@ +fs0: +BOOT\BOOTAA64.EFI diff --git a/dev/kernel/ArchKit/ArchKit.h b/dev/kernel/ArchKit/ArchKit.h new file mode 100644 index 00000000..04fc5bf6 --- /dev/null +++ b/dev/kernel/ArchKit/ArchKit.h @@ -0,0 +1,94 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +#include + +#ifdef __NE_AMD64__ +#include +#include +#include +#elif defined(__NE_POWER64__) +#include +#elif defined(__NE_ARM64__) +#include +#elif defined(__NE_SDK__) +#include +#else +#error !!! unknown architecture !!! +#endif + +#define kKernelMaxSystemCalls (512U) + +namespace NeOS +{ + inline SSizeT rt_hash_seed(const Char* seed, int mul) + { + SSizeT hash = 0; + + for (SSizeT idx = 0; seed[idx] != 0; ++idx) + { + hash += seed[idx]; + hash ^= mul; + } + + return hash; + } + + /// @brief write to mapped memory register + /// @param base the base address. + /// @param reg the register. + /// @param value the write to write on it. + template + inline Void ke_dma_write(UIntPtr base, DataKind reg, DataKind value) noexcept + { + *(volatile DataKind*)(base + reg) = value; + } + + /// @brief read from mapped memory register. + /// @param base base address + /// @param reg the register. + /// @return the value inside the register. + template + inline UInt32 ke_dma_read(UIntPtr base, DataKind reg) noexcept + { + return *(volatile DataKind*)(base + reg); + } + + namespace HAL + { + auto mm_is_bitmap(VoidPtr ptr) -> Bool; + } +} // namespace NeOS + +typedef NeOS::Void (*rt_syscall_proc)(NeOS::VoidPtr); + +struct HalSyscallEntry final +{ + NeOS::Int64 fHash; + NeOS::Bool fHooked; + rt_syscall_proc fProc; + + operator bool() + { + return fHooked; + } +}; + +inline NeOS::Array + kSyscalls; + +inline NeOS::Array + kKerncalls; + +EXTERN_C NeOS::HAL::StackFramePtr mp_get_current_context(NeOS::Int64 pid); diff --git a/dev/kernel/CFKit/GUIDWizard.h b/dev/kernel/CFKit/GUIDWizard.h new file mode 100644 index 00000000..5236688f --- /dev/null +++ b/dev/kernel/CFKit/GUIDWizard.h @@ -0,0 +1,24 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace CFKit::XRN::Version1 +{ + using namespace NeOS; + + Ref cf_make_sequence(const ArrayList& seq); + ErrorOr> cf_try_guid_to_string(Ref& guid); +} // namespace CFKit::XRN::Version1 diff --git a/dev/kernel/CFKit/GUIDWrapper.h b/dev/kernel/CFKit/GUIDWrapper.h new file mode 100644 index 00000000..3b7ada6d --- /dev/null +++ b/dev/kernel/CFKit/GUIDWrapper.h @@ -0,0 +1,60 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +/* GUID for C++ Components */ + +#define kXRNNil "@{........-....-M...-N...-............}" + +// eXtensible Resource Information +namespace CFKit::XRN +{ + using namespace NeOS; + + union GUIDSequence { + alignas(8) UShort u8[16]; + alignas(8) UShort u16[8]; + alignas(8) UInt u32[4]; + alignas(8) ULong u64[2]; + + struct + { + alignas(8) UInt fMs1; + UShort fMs2; + UShort fMs3; + UChar fMs4[8]; + }; + }; + + class GUID final + { + public: + explicit GUID() = default; + ~GUID() = default; + + public: + GUID& operator=(const GUID&) = default; + GUID(const GUID&) = default; + + public: + GUIDSequence& operator->() noexcept + { + return fUUID; + } + GUIDSequence& Leak() noexcept + { + return fUUID; + } + + private: + GUIDSequence fUUID; + }; +} // namespace CFKit::XRN diff --git a/dev/kernel/CFKit/Property.h b/dev/kernel/CFKit/Property.h new file mode 100644 index 00000000..e4588ad6 --- /dev/null +++ b/dev/kernel/CFKit/Property.h @@ -0,0 +1,56 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef CFKIT_PROPS_H +#define CFKIT_PROPS_H + +#include +#include +#include +#include +#include + +#define kMaxPropLen (256U) + +namespace CFKit +{ + using namespace NeOS; + + /// @brief handle to anything (number, ptr, string...) + using PropertyId = UIntPtr; + + /// @brief Kernel property class. + /// @example /prop/smp_max or /prop/kern_ver + class Property + { + public: + Property(); + virtual ~Property(); + + public: + Property& operator=(const Property&) = default; + Property(const Property&) = default; + + BOOL StringEquals(KString& name); + PropertyId& GetValue(); + KString& GetKey(); + + private: + KString fName{kMaxPropLen}; + PropertyId fValue{0UL}; + Ref fGUID{}; + }; + + template + using PropertyArray = Array; +} // namespace CFKit + +namespace NeOS +{ + using namespace CFKit; +} + +#endif // !CFKIT_PROPS_H diff --git a/dev/kernel/CFKit/Utils.h b/dev/kernel/CFKit/Utils.h new file mode 100644 index 00000000..b8f16164 --- /dev/null +++ b/dev/kernel/CFKit/Utils.h @@ -0,0 +1,55 @@ +#ifndef CFKIT_UTILS_H +#define CFKIT_UTILS_H + +#include +#include + +namespace CFKit +{ + using namespace NeOS; + + /// @brief Finds the PE header inside the blob. + inline auto ldr_find_exec_header(DosHeaderPtr ptrDos) -> LDR_EXEC_HEADER_PTR + { + if (!ptrDos) + return nullptr; + + if (ptrDos->eMagic[0] != kMagMz0) + return nullptr; + + if (ptrDos->eMagic[1] != kMagMz1) + return nullptr; + + return (LDR_EXEC_HEADER_PTR)(VoidPtr)(&ptrDos->eLfanew + 1); + } + + /// @brief Finds the PE optional header inside the blob. + inline auto ldr_find_opt_exec_header(DosHeaderPtr ptrDos) -> LDR_OPTIONAL_HEADER_PTR + { + if (!ptrDos) + return nullptr; + + auto exec = ldr_find_exec_header(ptrDos); + + if (!exec) + return nullptr; + + return (LDR_OPTIONAL_HEADER_PTR)(VoidPtr)(&exec->Characteristics + 1); + } + + /// @brief Finds the PE header inside the blob. + /// @note overloaded function. + inline auto ldr_find_exec_header(const Char* ptrDos) -> LDR_EXEC_HEADER_PTR + { + return ldr_find_exec_header((DosHeaderPtr)ptrDos); + } + + /// @brief Finds the PE header inside the blob. + /// @note overloaded function. + inline auto ldr_find_opt_exec_header(const Char* ptrDos) -> LDR_OPTIONAL_HEADER_PTR + { + return ldr_find_opt_exec_header((DosHeaderPtr)ptrDos); + } +} // namespace CFKit + +#endif // ifndef CFKIT_UTILS_H diff --git a/dev/kernel/CompilerKit/CompilerKit.h b/dev/kernel/CompilerKit/CompilerKit.h new file mode 100644 index 00000000..c1a5f424 --- /dev/null +++ b/dev/kernel/CompilerKit/CompilerKit.h @@ -0,0 +1,13 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef _INC_CL_H +#define _INC_CL_H + +#include +#include + +#endif /* ifndef _INC_CL_H */ diff --git a/dev/kernel/CompilerKit/Detail.h b/dev/kernel/CompilerKit/Detail.h new file mode 100644 index 00000000..c098f273 --- /dev/null +++ b/dev/kernel/CompilerKit/Detail.h @@ -0,0 +1,27 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#ifdef __NEOSKRNL__ +#include +#endif // ifdef __NEOSKRNL__ + +#define NE_COPY_DELETE(KLASS) \ + KLASS& operator=(const KLASS&) = delete; \ + KLASS(const KLASS&) = delete; + +#define NE_COPY_DEFAULT(KLASS) \ + KLASS& operator=(const KLASS&) = default; \ + KLASS(const KLASS&) = default; + +#define NE_MOVE_DELETE(KLASS) \ + KLASS& operator=(KLASS&&) = delete; \ + KLASS(KLASS&&) = delete; + +#define NE_MOVE_DEFAULT(KLASS) \ + KLASS& operator=(KLASS&&) = default; \ + KLASS(KLASS&&) = default; diff --git a/dev/kernel/CompilerKit/Version.h b/dev/kernel/CompilerKit/Version.h new file mode 100644 index 00000000..11854cd8 --- /dev/null +++ b/dev/kernel/CompilerKit/Version.h @@ -0,0 +1,7 @@ +// (c) Amlal EL Mahrouss + +#pragma once + +/// .. +#define BOOTLOADER_VERSION "1104.2025.110" +#define KERNEL_VERSION "1104.2025.110" diff --git a/dev/kernel/FSKit/Defines.h b/dev/kernel/FSKit/Defines.h new file mode 100644 index 00000000..9431a9c0 --- /dev/null +++ b/dev/kernel/FSKit/Defines.h @@ -0,0 +1,12 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +#define FSKIT_VERSION "1.0.0" +#define FSKIT_VERSION_BCD 0x0100 diff --git a/dev/kernel/FSKit/HeFS.h b/dev/kernel/FSKit/HeFS.h new file mode 100644 index 00000000..6911ddef --- /dev/null +++ b/dev/kernel/FSKit/HeFS.h @@ -0,0 +1,59 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +/// @file HeFS.h +/// @brief HeFS filesystem support. + +#define kHeFSVersion (0x0100) +#define kHeFSMagic " HeFS" +#define kHeFSMagicLen (8) + +#define kHeFSFileNameLen (256U) +#define kHeFSPartNameLen (256U) + +#define kHeFSMinimumDiskSize (gib_cast(64)) + +enum +{ + kHeFSInvalidDrive, + kHeFSHDDDrive, + kHeFSSSDDrive, + kHeFSMassStorageDrive, + kHeFSSCSIDrive, + kHeFSDriveCount, +}; + +struct HeFS_BOOT_NODE; + +struct HeFS_BOOT_NODE final +{ + NeOS::Char fMagic[kHeFSMagicLen]; + NeOS::Char fPartName[kHeFSPartNameLen]; + NeOS::UInt32 fVersion; + NeOS::UInt64 fBadSectors; + NeOS::UInt64 fSectorCount; + NeOS::UInt64 fSectorSize; + NeOS::UInt32 fChecksum; + NeOS::UInt8 fDriveKind; + NeOS::UInt8 fTextEncoding; + NeOS::UInt64 fRootINode; + NeOS::UInt64 fRecoveryINode; +}; + +struct HeFS_INDEX_NODE +{ + NeOS::Char fName[kHeFSFileNameLen]; + NeOS::UInt32 fFlags; + NeOS::UInt16 fKind; + NeOS::UInt32 fSize; + NeOS::Lba fFirstINode; + NeOS::Lba fLastINode; + NeOS::UInt32 fChecksum; +}; \ No newline at end of file diff --git a/dev/kernel/FSKit/IndexableProperty.h b/dev/kernel/FSKit/IndexableProperty.h new file mode 100644 index 00000000..6a79bc1b --- /dev/null +++ b/dev/kernel/FSKit/IndexableProperty.h @@ -0,0 +1,63 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +#define kIndexerCatalogNameLength 256U +#define kIndexerClaimed 0xCF + +namespace NeOS +{ + namespace Indexer + { + struct IndexProperty final + { + public: + Char Drive[kDriveNameLen]; + Char Path[kIndexerCatalogNameLength]; + }; + + class IndexableProperty final : public Property + { + public: + explicit IndexableProperty() + : Property() + { + NeOS::KString strProp(kMaxPropLen); + strProp += "/prop/indexable"; + + this->GetKey() = strProp; + } + + ~IndexableProperty() override = default; + + NE_COPY_DEFAULT(IndexableProperty); + + public: + IndexProperty& Leak() noexcept; + + public: + void AddFlag(Int16 flag); + void RemoveFlag(Int16 flag); + Int16 HasFlag(Int16 flag); + + private: + IndexProperty fIndex; + UInt32 fFlags; + }; + + /// @brief Index a file into the indexer instance. + /// @param filename path + /// @param filenameLen used bytes in path. + /// @param indexer the filesystem indexer. + /// @return none. + Void fs_index_file(const Char* filename, SizeT filenameLen, IndexableProperty& indexer); + } // namespace Indexer +} // namespace NeOS diff --git a/dev/kernel/FSKit/NeFS.h b/dev/kernel/FSKit/NeFS.h new file mode 100644 index 00000000..b2f7095d --- /dev/null +++ b/dev/kernel/FSKit/NeFS.h @@ -0,0 +1,445 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + FILE: NeFS.h + PURPOSE: NeFS (New extended File System) support. + + Revision History: + + ?/?/?: Added file (amlel) + 12/02/24: Add UUID macro for EPM and GPT partition schemes. + 3/16/24: Add mandatory sector size, kNeFSSectorSz is set to 2048 by +default. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include +#include +#include + +/** + @brief New extended File System specification. + @author Amlal EL Mahrouss (Amlal EL Mahrouss, amlalelmahrouss at icloud dot com) +*/ + +#define kNeFSInvalidFork (-1) +#define kNeFSInvalidCatalog (-1) +#define kNeFSCatalogNameLen (256) + +#define kNeFSMinimumDiskSize (gib_cast(4)) + +#define kNeFSSectorSz (512) + +#define kNeFSIdentLen (8) +#define kNeFSIdent " NeFS" +#define kNeFSPadLen (392) + +#define kNeFSMetaFilePrefix '$' + +#define kNeFSVersionInteger (0x0129) +#define kNeFSVerionString "1.2.9" + +/// @brief Standard fork types. +#define kNeFSDataFork "main_data" +#define kNeFSResourceFork "main_rsrc" + +#define kNeFSForkSize (sizeof(NEFS_FORK_STRUCT)) + +#define kNeFSPartitionTypeStandard (7) +#define kNeFSPartitionTypePage (8) +#define kNeFSPartitionTypeBoot (9) + +#define kNeFSCatalogKindFile (1) +#define kNeFSCatalogKindDir (2) +#define kNeFSCatalogKindAlias (3) + +//! Shared between network and/or partitions. Export forks as .zip when copying. +#define kNeFSCatalogKindShared (4) + +#define kNeFSCatalogKindResource (5) +#define kNeFSCatalogKindExecutable (6) + +#define kNeFSCatalogKindPage (8) + +#define kNeFSCatalogKindDevice (9) +#define kNeFSCatalogKindLock (10) + +#define kNeFSCatalogKindRLE (11) +#define kNeFSCatalogKindMetaFile (12) + +#define kNeFSCatalogKindTTF (13) +#define kNeFSCatalogKindRIFF (14) +#define kNeFSCatalogKindMPEG (15) +#define kNeFSCatalogKindMOFF (16) + +#define kNeFSSeparator '/' +#define kNeFSSeparatorAlt '/' + +#define kNeFSUpDir ".." +#define kNeFSRoot "/" +#define kNeFSRootAlt "/" + +#define kNeFSLF '\r' +#define kNeFSEOF (-1) + +#define kNeFSBitWidth (sizeof(NeOS::Char)) +#define kNeFSLbaType (NeOS::Lba) + +/// @note Start after the partition map header. (Virtual addressing) +#define kNeFSRootCatalogStartAddress (1024) +#define kNeFSCatalogStartAddress (kNeFSRootCatalogStartAddress + sizeof(NEFS_ROOT_PARTITION_BLOCK)) + +#define kResourceTypeDialog (10) +#define kResourceTypeString (11) +#define kResourceTypeMenu (12) +#define kResourceTypeSound (13) +#define kResourceTypeFont (14) +#define kNeFSPartLen (32) + +#define kNeFSFlagDeleted (70) +#define kNeFSFlagUnallocated (0) +#define kNeFSFlagCreated (71) + +#define kNeFSMimeNameLen (200) +#define kNeFSForkNameLen (200) + +#define kNeFSFrameworkExt ".fwrk/" +#define kNeFSStepsExt ".step/" +#define kNeFSApplicationExt ".app/" +#define kNeFSJournalExt ".jrnl" + +struct NEFS_CATALOG_STRUCT; +struct NEFS_FORK_STRUCT; +struct NEFS_ROOT_PARTITION_BLOCK; + +enum +{ + kNeFSHardDrive = 0xC0, // Hard Drive + kNeFSSolidStateDrive = 0xC1, // Solid State Drive + kNeFSOpticalDrive = 0x0C, // Blu-Ray/DVD + kNeFSMassStorageDevice = 0xCC, // USB + kNeFSScsiDrive = 0xC4, // SCSI Hard Drive + kNeFSFlashDrive = 0xC6, + kNeFSUnknown = 0xFF, // Unknown device. + kNeFSDriveCount = 7, +}; + +enum +{ + kNeFSStatusUnlocked = 0x18, + kNeFSStatusLocked, + kNeFSStatusError, + kNeFSStatusInvalid, +}; + +/// @brief Catalog type. +struct PACKED NEFS_CATALOG_STRUCT final +{ + BOOL ForkOrCatalog : 1 {0}; + + NeOS::Char Name[kNeFSCatalogNameLen] = {0}; + NeOS::Char Mime[kNeFSMimeNameLen] = {0}; + + /// Catalog flags. + NeOS::UInt16 Flags; + + /// Catalog allocation status. + NeOS::UInt16 Status; + + /// Custom catalog flags. + NeOS::UInt16 CatalogFlags; + + /// Catalog kind. + NeOS::Int32 Kind; + + /// Size of the data fork. + NeOS::Lba DataForkSize; + + /// Size of all resource forks. + NeOS::Lba ResourceForkSize; + + /// Forks LBA. + NeOS::Lba DataFork; + NeOS::Lba ResourceFork; + + /// Buddy allocation tracker. + NeOS::Lba NextSibling; + NeOS::Lba PrevSibling; + + /// Best-buddy tracker. + NeOS::Lba NextBestSibling; + NeOS::Lba NextPrevSibling; + + NeOS::UInt32 Checksum; +}; + +/// @brief Fork type, contains a data page. +/// @note The way we store is way different than how other filesystems do, specific chunk of code are +/// written into either the data fork or resource fork, the resource fork is reserved for file metadata. +/// whereas the data fork is reserved for file data. +struct PACKED NEFS_FORK_STRUCT final +{ + BOOL ForkOrCatalog : 1 {1}; + + NeOS::Char ForkName[kNeFSForkNameLen] = {0}; + NeOS::Char CatalogName[kNeFSCatalogNameLen] = {0}; + + NeOS::Int32 Flags; + NeOS::Int32 Kind; + + NeOS::Int64 ResourceId; + NeOS::Int32 ResourceKind; + NeOS::Int32 ResourceFlags; + + NeOS::Lba DataOffset; // 8 Where to look for this data? + NeOS::SizeT DataSize; /// Data size according using sector count. + + NeOS::Lba NextSibling; + NeOS::Lba PreviousSibling; + + NeOS::Char Pad[2] = {0}; +}; + +/// @brief Partition block type +struct PACKED NEFS_ROOT_PARTITION_BLOCK final +{ + NeOS::Char Ident[kNeFSIdentLen] = {0}; + NeOS::Char PartitionName[kNeFSPartLen] = {0}; + + NeOS::Int32 Flags; + NeOS::Int32 Kind; + + NeOS::Lba StartCatalog; + NeOS::SizeT CatalogCount; + + NeOS::SizeT DiskSize; + + NeOS::SizeT FreeCatalog; + NeOS::SizeT FreeSectors; + + NeOS::SizeT SectorCount; + NeOS::SizeT SectorSize; + + NeOS::UInt64 Version; + + NeOS::Lba EpmBlock; + + NeOS::Char Pad[kNeFSPadLen]; +}; + +namespace NeOS +{ + class NeFileSystemParser; + class NeFileSystemJournal; + class NeFileSystemHelper; + + enum + { + kNeFSSubDriveA, + kNeFSSubDriveB, + kNeFSSubDriveC, + kNeFSSubDriveD, + kNeFSSubDriveInvalid, + kNeFSSubDriveCount, + }; + + /// \brief Resource fork kind. + enum + { + kNeFSRsrcForkKind = 0, + kNeFSDataForkKind = 1 + }; + + /// + /// \name NeFileSystemParser + /// \brief NeFS parser class. (catalog creation, remove removal, root, + /// forks...) Designed like the DOM, detects the filesystem automatically. + /// + class NeFileSystemParser final + { + public: + explicit NeFileSystemParser() = default; + ~NeFileSystemParser() = default; + + public: + NE_COPY_DEFAULT(NeFileSystemParser); + + public: + /// @brief Creates a new fork inside the NeFS partition. + /// @param catalog it's catalog + /// @param theFork the fork itself. + /// @return the fork + _Output BOOL CreateFork(_Input NEFS_FORK_STRUCT& in); + + /// @brief Find fork inside New filesystem. + /// @param catalog the catalog. + /// @param name the fork name. + /// @return the fork. + _Output NEFS_FORK_STRUCT* FindFork(_Input NEFS_CATALOG_STRUCT* catalog, + _Input const Char* name, + Boolean data); + + _Output Void RemoveFork(_Input NEFS_FORK_STRUCT* fork); + + _Output Void CloseFork(_Input NEFS_FORK_STRUCT* fork); + + _Output NEFS_CATALOG_STRUCT* FindCatalog(_Input const Char* catalog_name, Lba& ou_lba, Bool search_hidden = YES, Bool local_search = NO); + + _Output NEFS_CATALOG_STRUCT* GetCatalog(_Input const Char* name); + + _Output NEFS_CATALOG_STRUCT* CreateCatalog(_Input const Char* name, + _Input const Int32& flags, + _Input const Int32& kind); + + _Output NEFS_CATALOG_STRUCT* CreateCatalog(_Input const Char* name); + + _Output Bool WriteCatalog(_Input const Char* catalog, + _Input Bool rsrc, + _Input VoidPtr data, + _Input SizeT sz, + _Input const Char* name); + + _Output VoidPtr ReadCatalog(_Input _Output NEFS_CATALOG_STRUCT* catalog, + _Input Bool isRsrcFork, + _Input SizeT dataSz, + _Input const Char* forkName); + + _Output Bool Seek(_Input _Output NEFS_CATALOG_STRUCT* catalog, SizeT off); + + _Output SizeT Tell(_Input _Output NEFS_CATALOG_STRUCT* catalog); + + _Output Bool RemoveCatalog(_Input const Char* catalog); + + _Output Bool CloseCatalog(_InOut NEFS_CATALOG_STRUCT* catalog); + + /// @brief Make a EPM+NeFS drive out of the disk. + /// @param drive The drive to write on. + /// @return If it was sucessful, see err_local_get(). + _Output Bool Format(_Input _Output DriveTrait* drive, _Input const Lba endLba, _Input const Int32 flags, const Char* part_name); + + public: + UInt32 mDriveIndex{kNeFSSubDriveA}; + }; + + /// + /// \name NeFileSystemHelper + /// \brief Filesystem helper and utils. + /// + + class NeFileSystemHelper final + { + public: + STATIC const Char* Root(); + STATIC const Char* UpDir(); + STATIC const Char Separator(); + STATIC const Char MetaFile(); + }; + + /// @brief Journal class for NeFS. + class NeFileSystemJournal final + { + private: + NEFS_CATALOG_STRUCT* mNode{nullptr}; + + public: + explicit NeFileSystemJournal(const char* stamp = nullptr) + { + if (!stamp) + { + kout << "Invalid: Journal Stamp, using default name.\r"; + return; + } + + kout << "Info: Journal stamp: " << stamp << kendl; + rt_copy_memory((VoidPtr)stamp, this->mStamp, rt_string_len(stamp)); + } + + ~NeFileSystemJournal() = default; + + NE_COPY_DEFAULT(NeFileSystemJournal); + + Bool CreateJournal(NeFileSystemParser* parser) + { + if (!parser) + return NO; + + delete parser->CreateCatalog("/etc/xml/", 0, kNeFSCatalogKindDir); + mNode = parser->CreateCatalog(mStamp); + + if (!mNode) + return NO; + + return YES; + } + + Bool GetJournal(NeFileSystemParser* parser) + { + if (!parser) + return NO; + + auto node = parser->GetCatalog(mStamp); + + if (node) + { + mNode = node; + return YES; + } + + return NO; + } + + Bool ReleaseJournal() + { + if (mNode) + { + delete mNode; + mNode = nullptr; + return YES; + } + + return NO; + } + + Bool CommitJournal(NeFileSystemParser* parser, + Char* xml_data, + Char* journal_name) + { + if (!parser || + !mNode) + return NO; + + NEFS_FORK_STRUCT new_fork{}; + + rt_copy_memory(mStamp, new_fork.CatalogName, rt_string_len(mStamp)); + rt_copy_memory(journal_name, new_fork.ForkName, rt_string_len(journal_name)); + + new_fork.ResourceKind = 0; + new_fork.ResourceId = 0; + new_fork.ResourceFlags = 0; + new_fork.DataSize = rt_string_len(xml_data); + new_fork.Kind = kNeFSRsrcForkKind; + + if (!parser->CreateFork(new_fork)) + return NO; + + kout << "XML Commited: " << xml_data << "\r\nTo Journal Fork: " << journal_name << kendl; + + auto ret = parser->WriteCatalog(new_fork.CatalogName, YES, xml_data, rt_string_len(xml_data), new_fork.ForkName); + + return ret; + } + + private: + Char mStamp[kNeFSCatalogNameLen] = {"/etc/xml/journal" kNeFSJournalExt}; + }; + + namespace NeFS + { + Boolean fs_init_nefs(Void) noexcept; + } // namespace NeFS +} // namespace NeOS diff --git a/dev/kernel/FirmwareKit/.gitkeep b/dev/kernel/FirmwareKit/.gitkeep new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/dev/kernel/FirmwareKit/.gitkeep @@ -0,0 +1 @@ + diff --git a/dev/kernel/FirmwareKit/CoreBoot/CoreBoot.h b/dev/kernel/FirmwareKit/CoreBoot/CoreBoot.h new file mode 100644 index 00000000..5fe3f4ea --- /dev/null +++ b/dev/kernel/FirmwareKit/CoreBoot/CoreBoot.h @@ -0,0 +1,31 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +namespace Firmware::Detail::CoreBoot +{ + using namespace NeOS; + + struct LEHeader; + + /// @brief Linear Executable Header + /// @author Amlal EL Mahrouss + struct ATTRIBUTE(aligned(4)) LEHeader + { + const Char fMagic[2]; // magic number + const Char fName[10]; // operating system name + const UInt32 fRevision; // firmware revision + const UInt32 fStartAddress; // start address (master/slave(s) thread) + +#ifdef NE_IS_EXTENDED_COREBOOT + const UIntPtr fMasterStructure; // master structure for MP/PM and device tree and such (ARM) + const UIntPtr fMasterStructureVersion; // master structure version. +#endif + }; +} // namespace Firmware::Detail::CoreBoot diff --git a/dev/kernel/FirmwareKit/CoreBoot/NS.h b/dev/kernel/FirmwareKit/CoreBoot/NS.h new file mode 100644 index 00000000..95576de8 --- /dev/null +++ b/dev/kernel/FirmwareKit/CoreBoot/NS.h @@ -0,0 +1,10 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include \ No newline at end of file diff --git a/dev/kernel/FirmwareKit/CoreBoot/NetBoot.h b/dev/kernel/FirmwareKit/CoreBoot/NetBoot.h new file mode 100644 index 00000000..21ce02ba --- /dev/null +++ b/dev/kernel/FirmwareKit/CoreBoot/NetBoot.h @@ -0,0 +1,25 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +/// @brief the internet header is used to download updates OTA. +typedef struct NETBOOT_INTERNET_HEADER +{ + NeOS::Char NB1; /// magic char 1 'N' + NeOS::Char NB2; /// magic char 2 'E' + NeOS::Char NB3; /// magic char 3 'T' + NeOS::Char NB4; /// magic char 4 'B' + + NeOS::Char PatchName[256U]; /// example: ColdChoco + NeOS::Int32 PatchLength; /// the patch length. + NeOS::Char PatchTarget[256U]; /// the target file. + NeOS::Boolean ImpliesROM; /// does it imply an EEPROM reprogram? + NeOS::Boolean Preflight; /// is it a preflight packet. + NeOS::Char Patch[]; /// non preflight packet has a patch blob for a **PatchTarget** +} NETBOOT_INTERNET_HEADER; diff --git a/dev/kernel/FirmwareKit/EFI.h b/dev/kernel/FirmwareKit/EFI.h new file mode 100644 index 00000000..57f7e17a --- /dev/null +++ b/dev/kernel/FirmwareKit/EFI.h @@ -0,0 +1,11 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +/// @note this header is used to reference the EFI/EFI.h diff --git a/dev/kernel/FirmwareKit/EFI/API.h b/dev/kernel/FirmwareKit/EFI/API.h new file mode 100644 index 00000000..b05fcc71 --- /dev/null +++ b/dev/kernel/FirmwareKit/EFI/API.h @@ -0,0 +1,107 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef __EFI_API__ +#define __EFI_API__ + +#include +#include +#include +#include + +#define kNeWebsiteMacro "https://aker.com/help" +#define kNeKernelSubsystem (StrLen(kNeWebsiteMacro)) + +#ifdef __BOOTZ__ +// forward decl. +class BootTextWriter; + +#define __BOOTKIT_NO_INCLUDE__ 1 + +#include +#include +#endif // ifdef __BOOTZ__ + +inline EfiSystemTable* ST = nullptr; +inline EfiBootServices* BS = nullptr; + +EXTERN_C void rt_cli(); +EXTERN_C void rt_hlt(); + +namespace EFI +{ + /// @brief Halt and clear interrupts. + /// @return + inline Void Stop() noexcept + { + while (YES) + { + rt_cli(); + rt_hlt(); + } + } + + /** +@brief Exit EFI API to let the OS load correctly. +Bascially frees everything we have in the EFI side. +*/ + inline void ExitBootServices(UInt64 MapKey, EfiHandlePtr ImageHandle) noexcept + { + if (!ST) + return; + + ST->BootServices->ExitBootServices(ImageHandle, MapKey); + } + + inline UInt32 Platform() noexcept + { + return kPeMachineAMD64; + } + + /*** + * @brief Throw an error, stop execution as well. + * @param ErrorCode error code to be print. + * @param Reason reason to be print. + */ + inline void ThrowError(const EfiCharType* ErrorCode, + const EfiCharType* Reason) noexcept + { + ST->ConOut->OutputString(ST->ConOut, L"\r*** STOP ***\r"); + + ST->ConOut->OutputString(ST->ConOut, L"*** ERROR: "); + ST->ConOut->OutputString(ST->ConOut, ErrorCode); + + ST->ConOut->OutputString(ST->ConOut, L" ***\r *** REASON: "); + ST->ConOut->OutputString(ST->ConOut, Reason); + + ST->ConOut->OutputString(ST->ConOut, L" ***\r"); + + EFI::Stop(); + } +} // namespace EFI + +inline void InitEFI(EfiSystemTable* SystemTable) noexcept +{ + if (!SystemTable) + return; + + ST = SystemTable; + BS = ST->BootServices; + + ST->ConOut->ClearScreen(SystemTable->ConOut); + ST->ConOut->SetAttribute(SystemTable->ConOut, kEFIYellow); + + ST->BootServices->SetWatchdogTimer(0, 0, 0, nullptr); + ST->ConOut->EnableCursor(ST->ConOut, false); +} + +#ifdef __BOOTZ__ + +#include + +#endif // ifdef __BOOTZ__ + +#endif /* ifndef __EFI_API__ */ diff --git a/dev/kernel/FirmwareKit/EFI/EFI.h b/dev/kernel/FirmwareKit/EFI/EFI.h new file mode 100644 index 00000000..ff97f7d6 --- /dev/null +++ b/dev/kernel/FirmwareKit/EFI/EFI.h @@ -0,0 +1,936 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef FIRMWARE_KIT_EFI_H +#define FIRMWARE_KIT_EFI_H + +/** +@brief Implementation of the main EFI protocols. +*/ + +#include + +using namespace NeOS; + +/* we always use stdcall in EFI, the pascal way of calling functions. */ + +#ifndef EPI_API +#define EFI_API __attribute__((ms_abi)) +#endif // ifndef EPI_API + +#define IN +#define OUT +#define OPTIONAL + +#define EFI_FINAL final + +// Forward decls + +struct EfiTableHeader; +struct EfiLoadFileProtocol; +struct EfiSimpleTextOutputProtocol; +struct EfiDevicePathProtocol; +struct EfiBootServices; +struct EfiMemoryDescriptor; +struct EfiSystemTable; +struct EfiGUID; +struct EfiFileDevicePathProtocol; +struct EfiHandle; +struct EfiGraphicsOutputProtocol; +struct EfiBitmask; +struct EfiFileProtocol; +struct EfiSimpleTextInputProtocol; + +typedef UInt64 EfiStatusType; + +typedef Char16 EfiChar16Type; + +/// @brief Core Handle Kind +/// Self is like NT's Win32 HANDLE type. +typedef struct EfiHandle +{ +} * EfiHandlePtr; + +/* UEFI uses wide characters by default. */ +typedef WideChar EfiCharType; + +typedef UInt64 EfiPhysicalAddress; +typedef UIntPtr EfiVirtualAddress; + +/// What's BootBolicy? +/// If TRUE, indicates that the request originates from the boot manager, and +/// that the boot manager is attempting to load FilePath as a boot selection. If +/// FALSE, then FilePath must match an exact file to be loaded. + +typedef UInt64(EFI_API* EfiTextString)(struct EfiSimpleTextOutputProtocol* Self, + const WideChar* OutputString); + +typedef UInt64(EFI_API* EfiTextAttrib)(struct EfiSimpleTextOutputProtocol* Self, + const WideChar Attribute); + +typedef UInt64(EFI_API* EfiTextClear)(struct EfiSimpleTextOutputProtocol* Self); + +typedef UInt64(EFI_API* EfiLoadFile)(EfiLoadFileProtocol* Self, + EfiFileDevicePathProtocol* FilePath, + Boolean BootPolicy, + UInt32* BufferSize, + VoidPtr Buffer); + +typedef UInt64(EFI_API* EfiCopyMem)(VoidPtr DstBuf, VoidPtr SrcBuf, SizeT Length); + +typedef UInt64(EFI_API* EfiSetMem)(VoidPtr DstBuf, Char Byte, SizeT Length); + +typedef UInt64(EFI_API* EfiHandleProtocol)(EfiHandlePtr Handle, EfiGUID* Guid, VoidPtr* Device); + +typedef UInt64(EFI_API* EfiLocateDevicePath)(EfiGUID* Protocol, + EfiDevicePathProtocol** DevicePath, + EfiHandlePtr Device); + +typedef UInt64(EFI_API* EfiStartImage)(EfiHandlePtr Handle, VoidPtr ArgsSize, VoidPtr ArgsPtr); + +typedef UInt64(EFI_API* EfiLoadImage)(Boolean BootPolicy, + EfiHandlePtr ParentHandle, + EfiFileDevicePathProtocol* DeviceFile, + VoidPtr buffer, + SizeT size, + EfiHandlePtr* ppHandle); + +/// EFI pool helpers, taken from iPXE. + +typedef enum EfiMemoryType +{ + /// + /// Not used. + /// + EfiReservedMemoryType, + /// + /// The code portions of a loaded application. + /// (Note that UEFI OS loaders are UEFI applications.) + /// + EfiLoaderCode, + /// + /// The data portions of a loaded application and the default data allocation + /// type used by an application to allocate pool memory. + /// + EfiLoaderData, + /// + /// The code portions of a loaded Boot Services Driver. + /// + EfiBootServicesCode, + /// + /// The data portions of a loaded Boot Serves Driver, and the default data + /// allocation type used by a Boot Services Driver to allocate pool memory. + /// + EfiBootServicesData, + /// + /// The code portions of a loaded Runtime Services Driver. + /// + EfiRuntimeServicesCode, + /// + /// The data portions of a loaded Runtime Services Driver and the default + /// data allocation type used by a Runtime Services Driver to allocate pool + /// memory. + /// + EfiRuntimeServicesData, + /// + /// Free (unallocated) memory. + /// + EfiConventionalMemory, + /// + /// Memory in which errors have been detected. + /// + EfiUnusableMemory, + /// + /// Memory that holds the ACPI tables. + /// + EfiACPIReclaimMemory, + /// + /// Address space reserved for use by the firmware. + /// + EfiACPIMemoryNVS, + /// + /// Used by system firmware to request that a memory-mapped IO region + /// be mapped by the OS to a virtual address so it can be accessed by EFI + /// runtime services. + /// + EfiMemoryMappedIO, + /// + /// System memory-mapped IO region that is used to translate memory + /// cycles to IO cycles by the processor. + /// + EfiMemoryMappedIOPortSpace, + /// + /// Address space reserved by the firmware for code that is part of the + /// processor. + /// + EfiPalCode, + /// + /// A memory region that operates as EfiConventionalMemory, + /// however it happens to also support byte-addressable non-volatility. + /// + EfiPersistentMemory, + /// + /// A memory region that describes system memory that has not been accepted + /// by a corresponding call to the underlying isolation architecture. + /// + EfiUnacceptedMemoryType, + /// + /// The last type of memory. + /// Not a real type. + /// + EfiMaxMemoryType, +} EfiMemoryType; + +typedef enum EfiAllocateType +{ + /// Anything that satisfy the request. + AllocateAnyPages, + AllocateMaxAddress, + /// + /// Allocate pages at a specified address. + /// + AllocateAddress, + /// + /// Maximum enumeration value that may be used for bounds checking. + /// + MaxAllocateType +} EfiAllocateType; + +typedef struct EfiMemoryDescriptor +{ + /// + /// Kind of the memory region. + /// Kind EFI_MEMORY_TYPE is defined in the + /// AllocatePages() function description. + /// + UInt32 Kind; + /// + /// Physical address of the first byte in the memory region. PhysicalStart + /// must be aligned on a 4 KiB boundary, and must not be above + /// 0xfffffffffffff000. Kind EFI_PHYSICAL_ADDRESS is defined in the + /// AllocatePages() function description + /// + EfiPhysicalAddress PhysicalStart; + /// + /// Virtual address of the first byte in the memory region. + /// VirtualStart must be aligned on a 4 KiB boundary, + /// and must not be above 0xfffffffffffff000. + /// + EfiVirtualAddress VirtualStart; + /// + /// NumberOfPages Number of 4 KiB pages in the memory region. + /// NumberOfPages must not be 0, and must not be any value + /// that would represent a memory page with a start address, + /// either physical or virtual, above 0xfffffffffffff000. + /// + UInt64 NumberOfPages; + /// + /// Attributes of the memory region that describe the bit mask of capabilities + /// for that memory region, and not necessarily the current settings for that + /// memory region. + /// + UInt64 Attribute; +} EfiMemoryDescriptor; + +typedef UInt64(EFI_API* EfiAllocatePool)(EfiMemoryType PoolType, UInt32 Size, VoidPtr* Buffer); + +typedef UInt64(EFI_API* EfiFreePool)(VoidPtr Buffer); + +typedef UInt64(EFI_API* EfiCalculateCrc32)(VoidPtr Data, UInt32 DataSize, UInt32* CrcOut); + +/** +@brief Present in every header, used to identify a UEFI structure. +*/ +typedef struct EfiTableHeader +{ + UInt64 Signature; + UInt32 Revision; + UInt32 HeaderSize; + UInt32 Crc32; + UInt32 Reserved; +} EfiTableHeader; + +#define EFI_ACPI_TABLE_PROTOCOL_GUID \ + { \ + 0xffe06bdd, 0x6107, 0x46a6, \ + { \ + 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c \ + } \ + } + +#define EFI_LOAD_FILE_PROTOCOL_GUID \ + { \ + 0x56EC3091, 0x954C, 0x11d2, \ + { \ + 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ + } \ + } + +#define EFI_LOAD_FILE2_PROTOCOL_GUID \ + { \ + 0x4006c0c1, 0xfcb3, 0x403e, \ + { \ + 0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d \ + } \ + } + +#define EFI_LOADED_IMAGE_PROTOCOL_GUID \ + { \ + 0x5B1B31A1, 0x9562, 0x11d2, \ + { \ + 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B \ + } \ + } + +#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ + { \ + 0x9042a9de, 0x23dc, 0x4a38, \ + { \ + 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a \ + } \ + } + +#define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000 + +#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ + { \ + 0x0964e5b22, 0x6459, 0x11d2, \ + { \ + 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ + } \ + } + +#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \ + { \ + 0xbc62157e, 0x3e33, 0x4fec, \ + { \ + 0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf \ + } \ + } + +#define EFI_DEVICE_PATH_PROTOCOL_GUID \ + { \ + 0x9576e91, 0x6d3f, 0x11d2, \ + { \ + 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ + } \ + } + +#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ + { \ + 0x0964e5b22, 0x6459, 0x11d2, \ + { \ + 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ + } \ + } + +typedef UInt64(EfiImageUnload)(EfiHandlePtr ImageHandle); + +enum +{ + kPixelRedGreenBlueReserved8BitPerColor, + kPixelBlueGreenRedReserved8BitPerColor, + kPixelBitMask, + kPixelBltOnly, + kPixelFormatMax +}; + +typedef struct EfiBitmask +{ + UInt32 RedMask; + UInt32 GreenMask; + UInt32 BlueMask; + UInt32 ReservedMask; +} EfiBitmask; + +typedef struct +{ + UInt8 Blue; + UInt8 Green; + UInt8 Red; + UInt8 Reserved; +} EfiGraphicsOutputBltPixel; + +typedef enum EfiGraphicsOutputProtocolBltOperation +{ + EfiBltVideoFill, + EfiBltVideoToBltBuffer, + EfiBltBufferToVideo, + EfiBltVideoToVideo, + EfiGraphicsOutputBltOperationMax +} EfiGraphicsOutputProtocolBltOperation; + +typedef struct EfiGraphicsOutputProtocolModeInformation +{ + UInt32 Version; + UInt32 HorizontalResolution; + UInt32 VerticalResolution; + UInt32 PixelFormat; + EfiBitmask PixelInformation; + UInt32 PixelsPerScanLine; +} EfiGraphicsOutputProtocolModeInformation; + +typedef UInt64(EFI_API* EfiGraphicsOutputProtocolQueryMode)( + EfiGraphicsOutputProtocol* Self, UInt32 ModeNumber, UInt32* SizeOfInfo, EfiGraphicsOutputProtocolModeInformation** Info); + +typedef UInt64(EFI_API* EfiGraphicsOutputProtocolSetMode)( + EfiGraphicsOutputProtocol* Self, UInt32 ModeNumber); + +typedef UInt64(EFI_API* EfiGraphicsOutputProtocolBlt)( + EfiGraphicsOutputProtocol* Self, EfiGraphicsOutputBltPixel* BltBuffer, EfiGraphicsOutputProtocolBltOperation BltOperation, UInt32 SourceX, UInt32 SourceY, UInt32 DestinationX, UInt32 DestinationY, UInt32 Width, UInt32 Height, UInt32 Delta); + +typedef struct +{ + UInt32 MaxMode; + UInt32 Mode; + EfiGraphicsOutputProtocolModeInformation* Info; + UInt32 SizeOfInfo; + UIntPtr FrameBufferBase; + UInt32 FrameBufferSize; +} EfiGraphicsOutputProtocolMode; + +typedef struct EfiGraphicsOutputProtocol +{ + EfiGraphicsOutputProtocolQueryMode QueryMode; + EfiGraphicsOutputProtocolSetMode SetMode; + EfiGraphicsOutputProtocolBlt Blt; + EfiGraphicsOutputProtocolMode* Mode; +} EfiGraphicsOutputProtocol; + +typedef struct EfiLoadImageProtocol +{ + UInt32 Revision; + EfiHandlePtr ParentHandle; + EfiSystemTable* SystemTable; + + // Source location of the image + EfiHandlePtr DeviceHandle; + EfiDevicePathProtocol* FilePath; + Void* Reserved; + + // Image’s load options + UInt32 LoadOptionsSize; + Void* LoadOptions; + + // Location where image was loaded + Void* ImageBase; + UInt64 ImageSize; + EfiMemoryType ImageCodeType; + EfiMemoryType ImageDataType; + EfiImageUnload Unload; +} EfiLoadImageProtocol; + +typedef struct EfiLoadFileProtocol +{ + EfiLoadFile LoadFile; +} EfiLoadFileProtocol; + +typedef struct EfiDevicePathProtocol +{ + UInt8 Kind; + UInt8 SubType; + UInt8 Length[2]; +} EfiDevicePathProtocol; + +typedef struct EfiFileDevicePathProtocol +{ + EfiDevicePathProtocol Proto; + + /// + /// File Path of this struct + /// + WideChar Path[kPathLen]; +} EfiFileDevicePathProtocol; + +typedef UInt64(EFI_API* EfiExitBootServices)(VoidPtr ImageHandle, + UInt32 MapKey); + +typedef UInt64(EFI_API* EfiAllocatePages)(EfiAllocateType AllocType, + EfiMemoryType MemType, + UInt32 Count, + EfiPhysicalAddress* Memory); + +typedef UInt64(EFI_API* EfiFreePages)(EfiPhysicalAddress* Memory, UInt32 Pages); + +typedef UInt64(EFI_API* EfiGetMemoryMap)(UInt32* MapSize, + EfiMemoryDescriptor* DescPtr, + UInt32* MapKey, + UInt32* DescSize, + UInt32* DescVersion); + +/** + * @brief GUID type, something you can also find in CFKit. + */ +typedef struct EfiGUID EFI_FINAL +{ + UInt32 Data1; + UInt16 Data2; + UInt16 Data3; + UInt8 Data4[8]; +} EfiGUID; + +/*** + * Protocol stuff... + */ + +#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \ + { \ + 0x387477c1, 0x69c7, 0x11d2, \ + { \ + 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ + } \ + } + +/** some helpers */ +#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 +#define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002 +#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004 +#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008 +#define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010 +#define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020 + +typedef UInt64(EFI_API* EfiLocateProtocol)(EfiGUID* Protocol, + VoidPtr Registration, + VoidPtr* Interface); + +typedef UInt64(EFI_API* EfiOpenProtocol)(EfiHandlePtr Handle, EfiGUID* Guid, VoidPtr* Interface, EfiHandlePtr AgentHandle, EfiHandlePtr ControllerHandle, UInt32 Attributes); + +typedef UInt64(EFI_API* EfiEnableCursor)(EfiSimpleTextOutputProtocol* Self, Boolean Visible); + +/** +@name EfiBootServices +@brief UEFI Boot Services record, it contains functions necessary to a +firmware level application. +*/ +typedef struct EfiBootServices +{ + EfiTableHeader SystemTable; + VoidPtr RaiseTPL; + VoidPtr RestoreTPL; + EfiAllocatePages AllocatePages; + EfiFreePages FreePages; + EfiGetMemoryMap GetMemoryMap; + EfiAllocatePool AllocatePool; + EfiFreePool FreePool; + VoidPtr CreateEvent; + VoidPtr SetTimer; + VoidPtr WaitForEvent; + VoidPtr SignalEvent; + VoidPtr CloseEvent; + VoidPtr CheckEvent; + VoidPtr InstallProtocolInterface; + VoidPtr ReinstallProtocolInterface; + VoidPtr UninstallProtocolInterface; + EfiHandleProtocol HandleProtocol; + VoidPtr Reserved; + VoidPtr RegisterProtocolNotify; + VoidPtr LocateHandle; + EfiLocateDevicePath LocateDevicePath; + VoidPtr InstallConfigurationTable; + EfiLoadImage LoadImage; + EfiStartImage StartImage; + VoidPtr Exit; + VoidPtr UnloadImage; + EfiExitBootServices ExitBootServices; + VoidPtr GetNextMonotonicCount; + VoidPtr Stall; + EfiStatusType(EFI_API* SetWatchdogTimer)(UInt32 Timeout, UInt64 WatchdogCode, UInt32 DataSize, EfiCharType* Data); + VoidPtr ConnectController; + VoidPtr DriveonnectController; + EfiOpenProtocol OpenProtocol; + VoidPtr CloseProtocol; + VoidPtr OpenProtocolInformation; + VoidPtr ProtocolsPerHandle; + VoidPtr LocateHandleBuffer; + EfiLocateProtocol LocateProtocol; + VoidPtr InstallMultipleProtocolInterfaces; + VoidPtr UninstallMultipleProtocolInterfaces; + EfiCalculateCrc32 CalculateCrc32; + EfiCopyMem CopyMem; + EfiSetMem SetMem; + VoidPtr CreateEventEx; +} EfiBootServices; + +#define kEntireDevPath 0xFF +#define kThisInstancePath 0x01 + +/** +@brief PrintF like protocol. +*/ +typedef struct EfiSimpleTextOutputProtocol +{ + VoidPtr Reset; + EfiTextString OutputString; + VoidPtr TestString; + VoidPtr QueryMode; + VoidPtr SetMode; + EfiTextAttrib SetAttribute; + EfiTextClear ClearScreen; + VoidPtr SetCursorPosition; + EfiEnableCursor EnableCursor; + VoidPtr Mode; +} EfiSimpleTextOutputProtocol; + +typedef struct +{ + UInt16 ScanCode; + EfiChar16Type UnicodeChar; +} EfiInputKey; + +typedef EfiStatusType(EFI_API* EfiInputReadKey)( + IN EfiSimpleTextInputProtocol* This, + OUT EfiInputKey* Key); + +typedef EfiStatusType(EFI_API* EfiInputReset)( + IN EfiSimpleTextInputProtocol* This, + IN Boolean ExtendedChk); + +typedef EfiStatusType(EFI_API* EfiWaitForEvent)( + IN UInt32 NumberOfEvents, + IN VoidPtr Event, + OUT UInt32* Index); + +typedef struct EfiSimpleTextInputProtocol +{ + EfiInputReset Reset; + EfiInputReadKey ReadKeyStroke; + EfiWaitForEvent WaitForKey; +} EfiSimpleTextInputProtocol; + +/// @biref Open Volume procedure ptr. +typedef UInt64(EFI_API* EfiOpenVolume)(struct EfiSimpleFilesystemProtocol*, + struct EfiFileProtocol**); + +struct EfiSimpleFilesystemProtocol +{ + UInt64 Revision; + EfiOpenVolume OpenVolume; +}; + +typedef struct EfiRuntimeServices +{ + EfiTableHeader SystemTable; + VoidPtr GetTime, SetTime, GetWakeupTime, SetWakeupTime, SetVirtualAddressMap, ConvertPointer; + UInt64(EFI_API* GetVariable)(const WideChar* Name, EfiGUID VendorGUID, UInt32* Attributes, UInt32* DataSize, VoidPtr Data); + VoidPtr GetNextVariable; + UInt64(EFI_API* SetVariable)(const WideChar* Name, EfiGUID VendorGUID, UInt32* Attributes, UInt32* DataSize, VoidPtr Data); + VoidPtr GetNextHighMonotonicCount; + VoidPtr ResetSystem; + VoidPtr UpdateCapsule; + VoidPtr QueryCapsuleCapabilites; + VoidPtr QueryVariableInfo; +} EfiRuntimeServices; + +/** +@brief The Structure that they give you when booting. +*/ +typedef struct EfiSystemTable +{ + EfiTableHeader SystemHeader; + WideChar* FirmwareVendor; + UInt32 FirmwareRevision; + EfiHandlePtr ConsoleInHandle; + EfiSimpleTextInputProtocol* ConIn; + EfiHandlePtr ConsoleOutHandle; + EfiSimpleTextOutputProtocol* ConOut; + EfiHandlePtr StandardErrorHandle; + VoidPtr StdErr; + EfiRuntimeServices* RuntimeServices; + EfiBootServices* BootServices; + UInt64 NumberOfTableEntries; + /// The configuration table (contains the RSD PTR entry.) + struct + { + EfiGUID VendorGUID; + VoidPtr VendorTable; + } * ConfigurationTable; +} EfiSystemTable; + +#define kEfiOk 0 +#define kEfiFail -1 +#define kBufferTooSmall 5 + +#define EFI_EXTERN_C extern "C" + +typedef struct EfiIPV4 +{ + UInt8 Addr[4]; +} EfiIPV4; + +/// +/// 16-byte buffer. An IPv6 internet protocol address. +/// +typedef struct EfiIPV6 +{ + UInt8 Addr[16]; +} EfiIPV6; + +#define kEFIYellow (0x01 | 0x02 | 0x04 | 0x08) + +#ifdef __x86_64 +#define __EFI_x86_64__ 1 +#endif // __x86_64 + +enum +{ + kEFIHwDevicePath = 0x01, + kEFIAcpiDevicePath = 0x02, + kEFIMessaingDevicePath = 0x03, + kEFIMediaDevicePath = 0x04, + kEFIBiosBootPath = 0x05, + kEFIEndOfPath = 0x06, + kEFICount = 6, +}; + +#define END_DEVICE_PATH_TYPE 0x7f +#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xFF +#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01 + +#define kEfiOffsetOf(T, F) __builtin_offsetof(T, F) + +/// File I/O macros + +#define kEFIFileRead 0x0000000000000001 +#define kEFIFileWrite 0x0000000000000002 +#define kEFIFileCreate 0x0000000000000000 + +#define kEFIReadOnly 0x01 +#define kEFIHidden 0x02 +#define kEFISystem 0x04 +#define kEFIReserved 0x08 +#define kEFIDirectory 0x10 +#define kEFIArchive 0x20 + +#define EFI_FILE_PROTOCOL_REVISION 0x00010000 +#define EFI_FILE_PROTOCOL_REVISION2 0x00020000 +#define EFI_FILE_PROTOCOL_LATEST_REVISION EFI_FILE_PROTOCOL_REVISION2 + +#define EFI_EXTRA_DESCRIPTOR_SIZE 8 + +#define EFI_MP_SERVICES_PROTOCOL_GUID \ + { \ + 0x3fdda605, 0xa76e, 0x4f46, \ + { \ + 0xad, 0x29, 0x12, 0xf4, \ + 0x53, 0x1b, 0x3d, 0x08 \ + } \ + } + +#define PROCESSOR_AS_BSP_BIT 0x00000001 +#define PROCESSOR_ENABLED_BIT 0x00000002 +#define PROCESSOR_HEALTH_STATUS_BIT 0x00000004 + +#define END_OF_CPU_LIST 0xffffffff + +typedef struct EfiIOToken +{ + // + // If Event is NULL, then blocking I/O is performed. + // If Event is not NULL and non-blocking I/O is supported, then non-blocking + // I/O is performed, and Event will be signaled when the read request is + // completed. The caller must be prepared to handle the case where the + // callback associated with Event occurs before the original asynchronous I/O + // request call returns. + // + UInt64 Event; + + // + // Defines whether or not the signaled event encountered an error. + // + UInt64 Status; + + // + // For OpenEx(): Not Used, ignored. + // For ReadEx(): On input, the size of the Buffer. On output, the amount of + // data returned in Buffer. + // In both cases, the size is measured in bytes. + // For WriteEx(): On input, the size of the Buffer. On output, the amount of + // data actually written. + // In both cases, the size is measured in bytes. + // For FlushEx(): Not used, ignored. + // + UInt32 BufferSize; + + // + // For OpenEx(): Not Used, ignored. + // For ReadEx(): The buffer into which the data is read. + // For WriteEx(): The buffer of data to write. + // For FlushEx(): Not Used, ignored. + // + Void* Buffer; +} EfiIOToken; + +typedef struct EfiFileProtocol +{ + UInt64 Revision; + + EfiStatusType(EFI_API* Open)(struct EfiFileProtocol* Self, + struct EfiFileProtocol** Out, + EfiCharType* CharType, + UInt64 OpenMode, + UInt64 Attrib); + + EfiStatusType(EFI_API* Close)(struct EfiFileProtocol* Self); + + EfiStatusType(EFI_API* Delete)(struct EfiFileProtocol* Self); + + EfiStatusType(EFI_API* Read)(struct EfiFileProtocol* Self, UInt64* BufSize, VoidPtr BufOut); + + EfiStatusType(EFI_API* Write)(struct EfiFileProtocol* Self, UInt64* BufSize, VoidPtr BufOut); + + EfiStatusType(EFI_API* GetPosition)(EfiFileProtocol* Self, UInt64* Position); + + EfiStatusType(EFI_API* SetPosition)(EfiFileProtocol* Self, UInt64* Position); + + EfiStatusType(EFI_API* GetInfo)(struct EfiFileProtocol*, struct EfiGUID*, UInt32*, void*); + + EfiStatusType(EFI_API* SetInfo)(struct EfiFileProtocol*, struct EfiGUID*, UInt32*, void*); + + EfiStatusType(EFI_API* Flush)(EfiFileProtocol*); + + EfiStatusType(EFI_API* OpenEx)(EfiFileProtocol* Self, + EfiFileProtocol** OutHandle, + EfiCharType* Path, + UInt64 Mode, + UInt64 Attrib, + struct EfiIOToken* Token); + + EfiStatusType(EFI_API* ReadEx)(EfiFileProtocol* Self, + struct EfiIOToken* Token); + + EfiStatusType(EFI_API* WriteEx)(EfiFileProtocol* Self, + struct EfiIOToken* Token); + + EfiStatusType(EFI_API* FlushEx)(EfiFileProtocol* Self, + struct EfiIOToken* Token); +} EfiFileProtocol, *EfiFileProtocolPtr; + +typedef UInt64 EfiCursorType; + +typedef struct EfiTime +{ + UInt16 Year; + UInt8 Month; + UInt8 Day; + UInt8 Hour; + UInt8 Minute; + UInt8 Second; + UInt8 Pad1; + UInt32 Nanosecond; + Int16 TimeZone; + UInt8 Daylight; + UInt8 Pad2; +} EfiTime; + +#define EFI_FILE_INFO_GUID \ + { \ + 0x09576e92, 0x6d3f, 0x11d2, \ + { \ + 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \ + } \ + } + +struct EfiFileInfo EFI_FINAL +{ + /// @brief Structure size. + UInt64 Size; + /// @brief File size. + UInt64 FileSize; + /// @brief Physical size on disk. + UInt64 PhysicalSize; + /// @brief Create time. + EfiTime CreateTime; + /// @brief Last access time. + EfiTime LastAccessTime; + /// @brief Edit time. + EfiTime EditTime; + /// @brief Attributes. + UInt64 Attribute; + /// @brief VLA file name. + WideChar FileName[1]; +}; + +//******************************************************* +// EFI_CPU_PHYSICAL_LOCATION +// @note As in the EFI specs. +//******************************************************* +typedef struct _EfiCPUPhyiscalLocation +{ + UInt32 Package; + UInt32 Core; + UInt32 Thread; +} EfiCPUPhyiscalLocation; + +typedef union _EfiExtendedProcessorInformation { + EfiCPUPhyiscalLocation Location2; +} EfiExtendedProcessorInformation; + +typedef struct _EfiProcessorInformation +{ + UInt64 ProcessorId; + UInt32 StatusFlag; + EfiCPUPhyiscalLocation Location; + EfiExtendedProcessorInformation ExtendedInformation; +} EfiProcessorInformation; + +typedef EfiStatusType EFI_API (*EfiMpServicesGetNumberOfProcessors)( + IN struct _EfiMpServicesProtocol* Self, + OUT UInt32* NumberOfProcessors, + OUT UInt32* NumberOfEnabledProcessors); + +typedef EfiStatusType EFI_API (*EfiMpServicesGetProcessorInfo)( + IN struct _EfiMpServicesProtocol* Self, + IN UInt32* ProcessorNumber, + OUT struct _EfiProcessorInformation* NumberOfEnabledProcessors); + +typedef void EFI_API (*EFI_AP_PROCEDURE)( + IN VoidPtr ProcedureArgument); + +typedef EfiStatusType EFI_API (*EfiMpServicesStartupAllAPS)( + IN struct _EfiMpServicesProtocol* Self, + IN EFI_AP_PROCEDURE Procedure, + IN Boolean SingleThread, + IN VoidPtr WaitEvent OPTIONAL, // EFI_EVENT first, but unused here. + IN UInt32 TimeoutInMicroSeconds, + IN Void* ProcedureArgument OPTIONAL, + OUT UInt32** FailedCpuList OPTIONAL); + +typedef EfiStatusType EFI_API (*EfiMpServicesSwitchBSP)( + IN struct _EfiMpServicesProtocol* Self, + IN UInt32 ProcessorNumber, + IN Boolean EnableOldBSP); + +typedef EfiStatusType EFI_API (*EfiMpServicesStartupThisAP)( + IN struct _EfiMpServicesProtocol* Self, + IN EFI_AP_PROCEDURE Procedure, + IN UInt32 ProcessorNumber, + IN VoidPtr WaitEvent OPTIONAL, + IN UInt32 TimeoutInMicroseconds, + IN Void* ProcedureArgument OPTIONAL, + OUT Boolean* Finished OPTIONAL); + +typedef EfiStatusType EFI_API (*EfiMpServicesDisableThisAP)( + IN struct _EfiMpServicesProtocol* Self, + IN UInt32 ProcessorNumber, + IN Boolean EnableAP, + IN UInt32* HealthFlag OPTIONAL); + +typedef EfiStatusType EFI_API (*EfiMpServicesWhoAmI)( + IN struct _EfiMpServicesProtocol* Self, + OUT UInt32* ProcessorNumber); + +typedef struct _EfiMpServicesProtocol +{ + EfiMpServicesGetNumberOfProcessors GetNumberOfProcessors; + EfiMpServicesGetProcessorInfo GetProcessorInfo; + EfiMpServicesStartupAllAPS StartupAllAPs; + EfiMpServicesStartupThisAP StartupThisAP; + EfiMpServicesSwitchBSP SwitchBSP; + EfiMpServicesDisableThisAP EnableDisableAP; + EfiMpServicesWhoAmI WhoAmI; +} EfiMpServicesProtocol; + +#endif // ifndef FIRMWARE_KIT_EFI_H diff --git a/dev/kernel/FirmwareKit/EFI/NS.h b/dev/kernel/FirmwareKit/EFI/NS.h new file mode 100644 index 00000000..18da8aaa --- /dev/null +++ b/dev/kernel/FirmwareKit/EFI/NS.h @@ -0,0 +1,20 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +namespace Firmware::Detail::EFI +{ + using namespace NeOS; + + EXTERN_C + { +#include + } + +} // namespace Firmware::Detail::EFI diff --git a/dev/kernel/FirmwareKit/EPM.h b/dev/kernel/FirmwareKit/EPM.h new file mode 100644 index 00000000..4728e2f5 --- /dev/null +++ b/dev/kernel/FirmwareKit/EPM.h @@ -0,0 +1,111 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +/** + @brief The Explicit Partition Map scheme. +*/ + +#ifndef FIRMWAREKIT_EPM_H +#define FIRMWAREKIT_EPM_H + +#include + +#define kEPMNameLength (32) +#define kEPMFilesystemLength (16) +#define kEPMMagicLength (5) + +/* @brief AMD64 magic for EPM */ +#define kEPMMagic86 "EPMAM" + +/* @brief RISC-V magic for EPM */ +#define kEPMMagicRISCV "EPMRV" + +/* @brief ARM magic for EPM */ +#define kEPMMagicARM "EPMAR" + +/* @brief 64x0 magic for EPM */ +#define kEPMMagic64k "EPM64" + +/* @brief 32x0 magic for EPM */ +#define kEPMMagic32k "EPM32" + +/* @brief POWER magic for EPM */ +#define kEPMMagicPPC "EPMPC" + +/* @brief Invalid magic for EPM */ +#define kEPMMagicError "EPM??" + +#ifdef __NE_AMD64__ +#define kEPMMagic kEPMMagic86 +#else +#ifdef __NE_ARM64__ +#define kEPMMagic kEPMMagicARM +#else +#define kEPMMagic kEPMMagicError +#endif +#endif + +///! @brief partition must start at this address. +///! Anything below is reserved for Data backup by the Main OS. +#define kEPMPartBlockLba (sizeof(EPM_PART_BLOCK)) + +///! @brief Current EPM revision. +#define kEPMRevisionBcd (0x0100) + +/// !@brief EPM boot block address. +#define kEPMBootBlockLba (0U) + +#define kEPMReserveLen (399) + +struct EPM_GUID; +struct EPM_PART_BLOCK; + +/* The first 0 > 128 addresses of a disk contains these headers. */ + +/// @brief EPM GUID structure. +typedef struct EPM_GUID +{ + NeOS::UInt32 Data1; + NeOS::UInt16 Data2; + NeOS::UInt16 Data3; + NeOS::UInt8 Data4[8]; +} PACKED EPM_GUID; + +/** + * @brief The EPM boot block. + * @note NumBlock and LbaStart are ignored on some platforms. + */ +struct PACKED EPM_PART_BLOCK +{ + NeOS::Char Magic[kEPMMagicLength]; + NeOS::Char Name[kEPMNameLength]; + EPM_GUID Guid; + NeOS::Int32 Version; + NeOS::Int64 NumBlocks; + NeOS::Int64 SectorSz; + NeOS::Int64 LbaStart; // base offset + NeOS::Int64 LbaEnd; // end offset + NeOS::Int16 Kind; + NeOS::Int16 Flags; + NeOS::Int32 FsVersion; + NeOS::Char Fs[kEPMFilesystemLength]; /* NeFS, HeFS... */ + NeOS::Char Reserved[kEPMReserveLen]; // to fill a full sector. +}; + +///! @brief Version kind enum. +///! @brief Use in boot block version field. + +enum +{ + kEPMInvalid = 0x00, + kEPMGenericOS = 0xcf, // Generic OS + kEPMLinux = 0x8f, // Linux on EPM + kEPMBSD = 0x9f, // Berkeley Soft. Distribution + kEPMNeOS = 0x1f, // This OS. + kEPMInvalidOS = 0xff, +}; + +#endif // ifndef FIRMWAREKIT_EPM_H diff --git a/dev/kernel/FirmwareKit/GPT.h b/dev/kernel/FirmwareKit/GPT.h new file mode 100644 index 00000000..91838bc7 --- /dev/null +++ b/dev/kernel/FirmwareKit/GPT.h @@ -0,0 +1,57 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include + +#define kSectorSizeGPT (512U) + +namespace NeOS +{ + struct GPT_GUID; + struct GPT_PARTITION_TABLE; + struct GPT_PARTITION_ENTRY; + + /// @brief GPT GUID structure. + typedef struct GPT_GUID + { + NeOS::UInt32 Data1; + NeOS::UInt16 Data2; + NeOS::UInt16 Data3; + NeOS::UInt8 Data4[8]; + } GPT_GUID; + + struct PACKED GPT_PARTITION_TABLE final + { + Char PartitionName[8]; + UInt32 Revision; + UInt32 HeaderSize; + UInt32 ChecksumCRC32; + UInt32 Reserved1; + UInt64 LBAHeader; + UInt64 LBAAltHeader; + UInt64 FirstGPTEntry; + UInt64 LastGPTEntry; + GPT_GUID Guid; + UInt64 StartingLBA; + UInt32 NumPartitionEntries; + UInt32 SizeOfEntries; + UInt32 CRC32PartEntry; + UInt8 Reserved2[kSectorSizeGPT]; + }; + + struct PACKED GPT_PARTITION_ENTRY + { + GPT_GUID PartitionTypeGUID; + GPT_GUID UniquePartitionGUID; + UInt64 StartLBA; + UInt64 EndLBA; + UInt64 Attributes; + UInt8 Name[72]; + }; +} // namespace NeOS diff --git a/dev/kernel/FirmwareKit/Handover.h b/dev/kernel/FirmwareKit/Handover.h new file mode 100644 index 00000000..4ff681ed --- /dev/null +++ b/dev/kernel/FirmwareKit/Handover.h @@ -0,0 +1,108 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +/** + * @file Handover.h + * @author Amlal EL Mahrouss (amlalelmahrouss@icloud.com) + * @brief The handover boot protocol. + * @version 1.15 + * @date 2024-02-23 + * + * @copyright Copyright (c) 2024, Amlal EL Mahrouss + * + */ + +#pragma once + +#include + +#define kHandoverMagic 0xBADCC +#define kHandoverVersion 0x0117 + +/* Initial bitmap pointer location and size. */ +#define kHandoverBitMapSz (gib_cast(4)) +#define kHandoverStructSz sizeof(HEL::BootInfoHeader) + +namespace NeOS::HEL +{ + /** + @brief The executable type enum. + */ + enum + { + kTypeKernel = 100, + kTypeKernelDriver = 101, + kTypeRsrc = 102, + kTypeInvalid = 103, + kTypeCount = 4, + }; + + /** + @brief The executable architecture enum. + */ + + enum + { + kArchAMD64 = 122, + kArchARM64 = 123, + kArchRISCV = 124, + kArchCount = 3, + }; + + struct BootInfoHeader final + { + UInt64 f_Magic; + UInt64 f_Version; + + VoidPtr f_BitMapStart; + SizeT f_BitMapSize; + + VoidPtr f_PageStart; + + VoidPtr f_KernelImage; + SizeT f_KernelSz; + VoidPtr f_StartupImage; + SizeT f_StartupSz; + + WideChar f_FirmwareVendorName[32]; + SizeT f_FirmwareVendorLen; + + VoidPtr f_FirmwareCustomTables[2]; // On EFI 0: BS 1: ST + + struct + { + VoidPtr f_SmBios; + VoidPtr f_VendorPtr; + VoidPtr f_MpPtr; + Bool f_MultiProcessingEnabled; + } f_HardwareTables; + + struct + { + UIntPtr f_The; + SizeT f_Size; + UInt32 f_Width; + UInt32 f_Height; + UInt32 f_PixelFormat; + UInt32 f_PixelPerLine; + } f_GOP; + + UInt64 f_FirmwareSpecific[8]; + }; + + enum + { + kHandoverSpecificKind, + kHandoverSpecificAttrib, + kHandoverSpecificMemoryEfi, + }; + + /// @brief Alias of bootloader main type. + typedef Int32 (*HandoverProc)(BootInfoHeader* boot_info); +} // namespace NeOS::HEL + +/// @brief Bootloader information header global variable. +inline NeOS::HEL::BootInfoHeader* kHandoverHeader = nullptr; diff --git a/dev/kernel/HALKit/.gitkeep b/dev/kernel/HALKit/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/kernel/HALKit/AMD64/CPUID.h b/dev/kernel/HALKit/AMD64/CPUID.h new file mode 100644 index 00000000..7f04ac27 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/CPUID.h @@ -0,0 +1,86 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: CPUID.h + Purpose: CPUID flags. + + Revision History: + + 30/01/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +#include + +enum CPUFeatureEnum +{ + kCPUFeatureSSE3 = 1 << 0, + kCPUFeaturePCLMUL = 1 << 1, + kCPUFeatureDTES64 = 1 << 2, + kCPUFeatureMONITOR = 1 << 3, + kCPUFeatureDS_CPL = 1 << 4, + kCPUFeatureVMX = 1 << 5, + kCPUFeatureSMX = 1 << 6, + kCPUFeatureEST = 1 << 7, + kCPUFeatureTM2 = 1 << 8, + kCPUFeatureSSSE3 = 1 << 9, + kCPUFeatureCID = 1 << 10, + kCPUFeatureSDBG = 1 << 11, + kCPUFeatureFMA = 1 << 12, + kCPUFeatureCX16 = 1 << 13, + kCPUFeatureXTPR = 1 << 14, + kCPUFeaturePDCM = 1 << 15, + kCPUFeaturePCID = 1 << 17, + kCPUFeatureDCA = 1 << 18, + kCPUFeatureSSE4_1 = 1 << 19, + kCPUFeatureSSE4_2 = 1 << 20, + kCPUFeatureX2APIC = 1 << 21, + kCPUFeatureMOVBE = 1 << 22, + kCPUFeaturePOP3C = 1 << 23, + kCPUFeatureECXTSC = 1 << 24, + kCPUFeatureAES = 1 << 25, + kCPUFeatureXSAVE = 1 << 26, + kCPUFeatureOSXSAVE = 1 << 27, + kCPUFeatureAVX = 1 << 28, + kCPUFeatureF16C = 1 << 29, + kCPUFeatureRDRAND = 1 << 30, + kCPUFeatureHYPERVISOR = 1 << 31, + kCPUFeatureFPU = 1 << 0, + kCPUFeatureVME = 1 << 1, + kCPUFeatureDE = 1 << 2, + kCPUFeaturePSE = 1 << 3, + kCPUFeatureEDXTSC = 1 << 4, + kCPUFeatureMSR = 1 << 5, + kCPUFeaturePAE = 1 << 6, + kCPUFeatureMCE = 1 << 7, + kCPUFeatureCX8 = 1 << 8, + kCPUFeatureAPIC = 1 << 9, + kCPUFeatureSEP = 1 << 11, + kCPUFeatureMTRR = 1 << 12, + kCPUFeaturePGE = 1 << 13, + kCPUFeatureMCA = 1 << 14, + kCPUFeatureCMOV = 1 << 15, + kCPUFeaturePAT = 1 << 16, + kCPUFeaturePSE36 = 1 << 17, + kCPUFeaturePSN = 1 << 18, + kCPUFeatureCLFLUSH = 1 << 19, + kCPUFeatureDS = 1 << 21, + kCPUFeatureACPI = 1 << 22, + kCPUFeatureMMX = 1 << 23, + kCPUFeatureFXSR = 1 << 24, + kCPUFeatureSSE = 1 << 25, + kCPUFeatureSSE2 = 1 << 26, + kCPUFeatureSS = 1 << 27, + kCPUFeatureHTT = 1 << 28, + kCPUFeatureTM = 1 << 29, + kCPUFeatureIA64 = 1 << 30, + kCPUFeaturePBE = 1 << 31 +}; + +namespace NeOS +{ + typedef Int64 CPUID; +} // namespace NeOS diff --git a/dev/kernel/HALKit/AMD64/HalACPIFactoryInterface.cc b/dev/kernel/HALKit/AMD64/HalACPIFactoryInterface.cc new file mode 100644 index 00000000..f327dc3f --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalACPIFactoryInterface.cc @@ -0,0 +1,122 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include +#include + +namespace NeOS +{ + namespace Detail + { + struct FADT final : public SDT + { + UInt32 FirmwareCtrl; + UInt32 Dsdt; + + // field used in ACPI 1.0; no longer in use, for compatibility only + UInt8 Reserved; + + UInt8 PreferredPowerManagementProfile; + UInt16 SCI_Interrupt; + UInt32 SMI_CommandPort; + UInt8 AcpiEnable; + UInt8 AcpiDisable; + UInt8 S4BIOS_REQ; + UInt8 PSTATE_Control; + UInt32 PM1aEventBlock; + UInt32 PM1bEventBlock; + UInt32 PM1aControlBlock; + UInt32 PM1bControlBlock; + UInt32 PM2ControlBlock; + UInt32 PMTimerBlock; + UInt32 GPE0Block; + UInt32 GPE1Block; + UInt8 PM1EventLength; + UInt8 PM1ControlLength; + UInt8 PM2ControlLength; + UInt8 PMTimerLength; + UInt8 GPE0Length; + UInt8 GPE1Length; + UInt8 GPE1Base; + UInt8 CStateControl; + UInt16 WorstC2Latency; + UInt16 WorstC3Latency; + UInt16 FlushSize; + UInt16 FlushStride; + UInt8 DutyOffset; + UInt8 DutyWidth; + UInt8 DayAlarm; + UInt8 MonthAlarm; + UInt8 Century; + + // reserved in ACPI 1.0; used since ACPI 2.0+ + UInt16 BootArchitecturkMMFlags; + + UInt8 Reserved2; + UInt32 Flags; + + // 12 byte structure; see below for details + ACPI_ADDRESS ResetReg; + + UInt8 ResetValue; + UInt8 Reserved3[3]; + + // 64bit pointers - Available on ACPI 2.0+ + UInt64 X_FirmwareControl; + UInt64 X_Dsdt; + + ACPI_ADDRESS X_PM1aEventBlock; + ACPI_ADDRESS X_PM1bEventBlock; + ACPI_ADDRESS X_PM1aControlBlock; + ACPI_ADDRESS X_PM1bControlBlock; + ACPI_ADDRESS X_PM2ControlBlock; + ACPI_ADDRESS X_PMTimerBlock; + ACPI_ADDRESS X_GPE0Block; + ACPI_ADDRESS X_GPE1Block; + }; + } // namespace Detail + + ACPIFactoryInterface::ACPIFactoryInterface(VoidPtr rsp_ptr) + : fRsdp(rsp_ptr), fEntries(0) + { + } + + Bool ACPIFactoryInterface::Shutdown() + { + failed_to_shutdown: + return NO; + } + + /// @brief Reboot machine in either ACPI or by triple faulting. + /// @return nothing it's a reboot. + Void ACPIFactoryInterface::Reboot() + { + failed_to_reboot: + asm volatile(".intel_syntax noprefix; " + "rt_reset_hardware:; " + "cli; " + "wait_gate1: ; " + "in al,0x64 ; " + "and al,2 ; " + "jnz wait_gate1 ; " + "mov al,0x0D1 ; " + "out 0x64,al ; " + "wait_gate2: ; " + "in al,0x64 ; " + "and al,2 ; " + "jnz wait_gate2 ; " + "mov al,0x0FE ; " + "out 0x60,al ; " + "xor rax,rax ; " + "lidt [rax] ; " + "reset_wait: ; " + "jmp reset_wait ; " + ".att_syntax; "); + } +} // namespace NeOS diff --git a/dev/kernel/HALKit/AMD64/HalAPICController.cc b/dev/kernel/HALKit/AMD64/HalAPICController.cc new file mode 100644 index 00000000..a4de5091 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalAPICController.cc @@ -0,0 +1,44 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +#define cIOAPICRegVal (4) +#define cIOAPICRegReg (0) + +namespace NeOS::HAL +{ + APICController::APICController(VoidPtr base) + : fApic(base) + { + } + + /// @brief Read from APIC controller. + /// @param reg register. + UInt32 APICController::Read(UInt32 reg) noexcept + { + MUST_PASS(this->fApic); + + UInt32 volatile* io_apic = (UInt32 volatile*)this->fApic; + io_apic[cIOAPICRegReg] = (reg & 0xFF); + + return io_apic[cIOAPICRegVal]; + } + + /// @brief Write to APIC controller. + /// @param reg register. + /// @param value value. + Void APICController::Write(UInt32 reg, UInt32 value) noexcept + { + MUST_PASS(this->fApic); + + UInt32 volatile* io_apic = (UInt32 volatile*)this->fApic; + + io_apic[cIOAPICRegReg] = (reg & 0xFF); + io_apic[cIOAPICRegVal] = value; + } +} // namespace NeOS::HAL diff --git a/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc b/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc new file mode 100644 index 00000000..da680afa --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc @@ -0,0 +1,271 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define kApicSignature "APIC" + +#define kAPIC_ICR_Low 0x300 +#define kAPIC_ICR_High 0x310 +#define kAPIC_SIPI_Vector 0x00500 +#define kAPIC_EIPI_Vector 0x00400 + +#define kAPIC_BASE_MSR 0x1B +#define kAPIC_BASE_MSR_BSP 0x100 +#define kAPIC_BASE_MSR_ENABLE 0x800 + +/// @note: _hal_switch_context is internal + +/////////////////////////////////////////////////////////////////////////////////////// + +//! NOTE: fGSI stands 'Field Global System Interrupt' + +/////////////////////////////////////////////////////////////////////////////////////// + +namespace NeOS::HAL +{ + struct PROCESS_APIC_MADT; + struct PROCESS_CONTROL_BLOCK; + + struct PROCESS_CONTROL_BLOCK final + { + HAL::StackFramePtr mFrame; + }; + + STATIC struct PROCESS_APIC_MADT* kMADTBlock = nullptr; + STATIC Bool kSMPAware = false; + STATIC Int64 kSMPCount = 0; + + STATIC UIntPtr kApicBaseAddress = 0UL; + + STATIC Int32 kSMPInterrupt = 0; + STATIC UInt64 kAPICLocales[kSchedProcessLimitPerTeam] = {0}; + STATIC VoidPtr kRawMADT = nullptr; + + /// @brief Multiple APIC Descriptor Table. + struct PROCESS_APIC_MADT final SDT_OBJECT + { + UInt32 Address; // Madt address + UInt8 Flags; // Madt flags + + struct + { + UInt8 Type; + UInt8 Len; + + union { + struct + { + UInt8 IoID; + UInt8 Zero; + UInt32 IoAddress; + UInt32 GISBase; + } IOAPIC; + + struct + { + UInt8 Source; + UInt8 IRQSource; + UInt32 GSI; + UInt16 Flags; + } LApicNMI; + + struct + { + UInt8 ProcessorID; + UInt16 Flags; + UInt8 LINT; + } LAPIC; + + struct + { + UInt16 Reserved; + UInt64 Address; + } LApicOverride; + + struct + { + UInt16 Reserved; + UInt32 x2APICID; + UInt32 Flags; + UInt32 AcpiID; + } LApic; + }; + } List[]; // Records List + }; + + /////////////////////////////////////////////////////////////////////////////////////// + + /***********************************************************************************/ + /// @brief Send IPI command to APIC. + /// @param apic_id programmable interrupt controller id. + /// @param vector vector interrupt. + /// @param target target APIC adress. + /// @return + /***********************************************************************************/ + + Void hal_send_start_ipi(UInt32 target, UInt32 apic_id) + { + NeOS::ke_dma_write(target, kAPIC_ICR_High, apic_id << 24); + NeOS::ke_dma_write(target, kAPIC_ICR_Low, 0x00000500 | 0x00004000 | 0x00000000); + + while (NeOS::ke_dma_read(target, kAPIC_ICR_Low) & 0x1000) + { + ; + } + } + + /***********************************************************************************/ + /// @brief Send end IPI for CPU. + /// @param apic_id + /// @param vector + /// @param target + /// @return + /***********************************************************************************/ + Void hal_send_sipi(UInt32 target, UInt32 apic_id, UInt8 vector) + { + NeOS::ke_dma_write(target, kAPIC_ICR_High, apic_id << 24); + NeOS::ke_dma_write(target, kAPIC_ICR_Low, 0x00000600 | 0x00004000 | 0x00000000 | vector); + + while (NeOS::ke_dma_read(target, kAPIC_ICR_Low) & 0x1000) + { + NE_UNUSED(0); + } + } + + STATIC PROCESS_CONTROL_BLOCK kProcessBlocks[kSchedProcessLimitPerTeam] = {0}; + + EXTERN_C HAL::StackFramePtr mp_get_current_context(Int64 pid) + { + const auto process_index = pid % kSchedProcessLimitPerTeam; + return kProcessBlocks[process_index].mFrame; + } + + EXTERN_C BOOL mp_register_process(HAL::StackFramePtr stack_frame, ProcessID pid) + { + MUST_PASS(stack_frame); + + const auto process_index = pid % kSchedProcessLimitPerTeam; + + kProcessBlocks[process_index].mFrame = stack_frame; + + auto first_id = kAPICLocales[0]; + + hal_send_sipi(kApicBaseAddress, first_id, (UInt8)(((UIntPtr)stack_frame->BP) >> 12)); + + return YES; + } + + /***********************************************************************************/ + /// @brief Is the current config SMP aware? + /// @return True if YES, False if not. + /***********************************************************************************/ + Bool mp_is_smp(Void) noexcept + { + return kSMPAware; + } + + /***********************************************************************************/ + /// @brief Assembly symbol to bootstrap AP. + /***********************************************************************************/ + EXTERN_C Char* hal_ap_blob_start; + + /***********************************************************************************/ + /// @brief Assembly symbol to bootstrap AP. + /***********************************************************************************/ + EXTERN_C Char* hal_ap_blob_end; + + /***********************************************************************************/ + /// @brief Fetch and enable SMP scheduler. + /// @param vendor_ptr SMP containing structure. + /***********************************************************************************/ + Void mp_get_cores(VoidPtr vendor_ptr) noexcept + { + if (!vendor_ptr) + return; + + if (!kHandoverHeader->f_HardwareTables.f_MultiProcessingEnabled) + { + kSMPAware = NO; + return; + } + + auto hw_and_pow_int = PowerFactoryInterface(vendor_ptr); + kRawMADT = hw_and_pow_int.Find(kApicSignature).Leak().Leak(); + + kMADTBlock = reinterpret_cast(kRawMADT); + kSMPAware = NO; + + if (kMADTBlock) + { + SizeT index = 0; + + kSMPInterrupt = 0; + kSMPCount = 0; + + kout << "SMP: Starting APs...\r"; + + UInt32 eax, edx; + kApicBaseAddress = kMADTBlock->Address; + + while (Yes) + { + if (kMADTBlock->List[index].Type > 9 || + kSMPCount > kSchedProcessLimitPerTeam) + break; + + switch (kMADTBlock->List[index].Type) + { + case 0x00: { + if (kMADTBlock->List[kSMPCount].LAPIC.ProcessorID < 1) + break; + + kAPICLocales[kSMPCount] = kMADTBlock->List[kSMPCount].LAPIC.ProcessorID; + kout << "SMP: APIC ID: " << number(kAPICLocales[kSMPCount]) << kendl; + + // I'll just make the AP start from scratch here. + + hal_send_start_ipi(kApicBaseAddress, kAPICLocales[kSMPCount]); + + HardwareTimer timer(NeOS::rtl_ms(10)); + timer.Wait(); + + /// TODO: HAL helper to create an address. + + hal_send_sipi(kApicBaseAddress, kAPICLocales[kSMPCount], (UInt8)(((UIntPtr)hal_ap_blob_start) >> 12)); + + ++kSMPCount; + break; + } + default: + break; + } + + ++index; + } + + kout << "SMP: number of APs: " << number(kSMPCount) << kendl; + + // Kernel is now SMP aware. + // That means that the scheduler is now available (on MP Kernels) + + kSMPAware = true; + + /// TODO: Notify Boot AP that it must start. + } + } +} // namespace NeOS::HAL + +/////////////////////////////////////////////////////////////////////////////////////// diff --git a/dev/kernel/HALKit/AMD64/HalApplicationProcessorGNU.s b/dev/kernel/HALKit/AMD64/HalApplicationProcessorGNU.s new file mode 100644 index 00000000..a8ad3b76 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalApplicationProcessorGNU.s @@ -0,0 +1,8 @@ +.data + +.global hal_ap_blob_start /* Export the start symbol */ +.global hal_ap_blob_end /* Export the end symbol */ + +hal_ap_blob_start: + .incbin "HALKit/AMD64/HalApplicationProcessorStartup.bin" +hal_ap_blob_end: diff --git a/dev/kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm b/dev/kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm new file mode 100644 index 00000000..c64e0a09 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm @@ -0,0 +1,77 @@ +;; /* +;; * ======================================================== +;; * +;; * NeKernel +;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. +;; * +;; * ======================================================== +;; */ + +[bits 16] +[org 0x7c000] + +hal_ap_start: + mov ax, 0x0 + mov ss, ax + mov esp, 0x7000 + + cli + mov eax, cr0 + or eax, 1 + mov cr0, eax + jmp .hal_ap_start_flush +.hal_ap_start_flush: + mov ax, 0x10 + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + mov ss, ax + + mov eax, cr4 + or eax, 1 << 5 + mov cr4, eax + + mov eax, cr3 + mov cr3, eax + + mov ecx, 0xC0000080 + rdmsr + or eax, 1 + wrmsr + + mov eax, cr0 + or eax, (1 << 31) + mov cr0, eax + + jmp 0x08:hal_ap_64bit_entry +hal_ap_end: + +hal_ap_length: + dq hal_ap_end - hal_ap_start + +[bits 64] + +hal_ap_64bit_entry: + mov ax, 0x23 + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + mov ss, ax + mov rsp, [hal_ap_64bit_entry_stack_end] + + push 0x33 + push qword [hal_ap_64bit_entry_loop] + o64 pushf + push rsp + push 0x33 + + o64 iret + +hal_ap_64bit_entry_loop: + jmp $ + +hal_ap_64bit_entry_stack: + resb 8196*2 +hal_ap_64bit_entry_stack_end: \ No newline at end of file diff --git a/dev/kernel/HALKit/AMD64/HalBoot.asm b/dev/kernel/HALKit/AMD64/HalBoot.asm new file mode 100644 index 00000000..3ccdd50e --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalBoot.asm @@ -0,0 +1,28 @@ +;; /* +;; * ======================================================== +;; * +;; * NeKernel +;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. +;; * +;; * ======================================================== +;; */ + +[bits 64] + +;; Global symbol of this unit +[extern hal_init_platform] + +%define kTypeKernel 100 +%define kArchAmd64 122 +%define kHandoverMagic 0xBADCC + +section .ldr + +HandoverMagic: + dq kHandoverMagic +HandoverType: + dw kTypeKernel +HandoverPad: + dw 0 +HandoverArch: + dw kArchAmd64 diff --git a/dev/kernel/HALKit/AMD64/HalCommonAPI.asm b/dev/kernel/HALKit/AMD64/HalCommonAPI.asm new file mode 100644 index 00000000..671a955b --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalCommonAPI.asm @@ -0,0 +1,82 @@ +;; /* +;; * ======================================================== +;; * +;; * NeKernel +;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. +;; * +;; * ======================================================== +;; */ + +section .text + +extern rt_wait_400ns + +global rt_out8 +global rt_out16 +global rt_out32 + +global rt_in8 +global rt_in16 +global rt_in32 + +rt_out8: + mov al, dl + mov dx, cx + out dx, al + ret + +rt_out16: + mov ax, dx + mov dx, cx + out dx, ax + ret + +rt_out32: + mov eax, edx + mov edx, ecx + out dx, eax + ret + +rt_in8: + mov dx, cx + in al, dx + ret + +rt_in16: + mov edx, ecx + in ax, dx + ret + +rt_in32: + mov rdx, rcx + in eax, dx + ret + +extern hal_system_call_enter +global mp_system_call_handler + +mp_system_call_handler: + + push r8 + push r9 + push r10 + push r11 + push r12 + push r13 + push r14 + push r15 + + jmp hal_system_call_enter + + pop r15 + pop r14 + pop r13 + pop r12 + pop r11 + pop r10 + pop r9 + pop r8 + + o64 sysret + +[bits 16] diff --git a/dev/kernel/HALKit/AMD64/HalControlRegister.s b/dev/kernel/HALKit/AMD64/HalControlRegister.s new file mode 100644 index 00000000..b94744f5 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalControlRegister.s @@ -0,0 +1,45 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +.globl hal_write_cr3 +.globl hal_write_cr0 +.globl hal_read_cr2 +.globl hal_read_cr3 +.globl hal_read_cr0 +.globl hal_flush_tlb +.globl hal_invl_tlb + +.text + +hal_invl_tlb: + invlpg (%rcx) + retq + +hal_flush_tlb: + call hal_read_cr3 + mov %rax, %rcx + call hal_write_cr3 + retq + +hal_read_cr3: + movq %cr3, %rax + retq + +hal_read_cr0: + movq %cr0, %rax + retq + +hal_read_cr2: + movq %cr2, %rax + retq + +hal_write_cr3: + movq %rcx, %cr3 + retq + +hal_write_cr0: + movq %rcx, %cr0 + retq diff --git a/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc b/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc new file mode 100644 index 00000000..9eaa24eb --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc @@ -0,0 +1,245 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include + +STATIC BOOL kIsScheduling = NO; + +/// @brief Handle GPF fault. +/// @param rsp +EXTERN_C void idt_handle_gpf(NeOS::UIntPtr rsp) +{ + auto process = NeOS::UserProcessScheduler::The().CurrentProcess(); + + if (process.Leak().Status != NeOS::ProcessStatusKind::kRunning) + return; + + kIsScheduling = NO; + + kout << "Kernel: General Protection Fault.\r"; + + process.Leak().ProcessSignal.SignalArg = rsp; + process.Leak().ProcessSignal.SignalID = SIGKILL; + process.Leak().ProcessSignal.PreviousStatus = process.Leak().Status; + + kout << "Kernel: SIGKILL status.\r"; + + process.Leak().Status = NeOS::ProcessStatusKind::kKilled; + + process.Leak().Crash(); +} + +/// @brief Handle page fault. +/// @param rsp +EXTERN_C void idt_handle_pf(NeOS::UIntPtr rsp) +{ + auto process = NeOS::UserProcessScheduler::The().CurrentProcess(); + + if (process.Leak().Status != NeOS::ProcessStatusKind::kRunning) + return; + + kIsScheduling = NO; + + kout << "Kernel: Page Fault.\r"; + kout << "Kernel: SIGKILL\r"; + + process.Leak().ProcessSignal.SignalArg = rsp; + process.Leak().ProcessSignal.SignalID = SIGKILL; + process.Leak().ProcessSignal.PreviousStatus = process.Leak().Status; + + process.Leak().Status = NeOS::ProcessStatusKind::kKilled; + + process.Leak().Crash(); +} + +namespace NeOS::Detail +{ + constexpr static Int32 kTimeoutCount = 100000UL; +} + +/// @brief Handle scheduler interrupt. +EXTERN_C void idt_handle_scheduler(NeOS::UIntPtr rsp) +{ + static NeOS::Int64 try_count_before_brute = NeOS::Detail::kTimeoutCount; + + while (kIsScheduling) + { + --try_count_before_brute; + + if (try_count_before_brute < 1) + break; + } + + try_count_before_brute = NeOS::Detail::kTimeoutCount; + kIsScheduling = YES; + + NeOS::UserProcessHelper::StartScheduling(); + + kIsScheduling = NO; +} + +/// @brief Handle math fault. +/// @param rsp +EXTERN_C void idt_handle_math(NeOS::UIntPtr rsp) +{ + auto process = NeOS::UserProcessScheduler::The().CurrentProcess(); + + if (process.Leak().Status != NeOS::ProcessStatusKind::kRunning) + return; + + kIsScheduling = NO; + + kout << "Kernel: Math error (division by zero?).\r"; + + process.Leak().ProcessSignal.SignalArg = rsp; + process.Leak().ProcessSignal.SignalID = SIGKILL; + process.Leak().ProcessSignal.PreviousStatus = process.Leak().Status; + + kout << "Kernel: SIGKILL status.\r"; + + process.Leak().Status = NeOS::ProcessStatusKind::kKilled; + + process.Leak().Crash(); +} + +/// @brief Handle any generic fault. +/// @param rsp +EXTERN_C void idt_handle_generic(NeOS::UIntPtr rsp) +{ + auto process = NeOS::UserProcessScheduler::The().CurrentProcess(); + + if (process.Leak().Status != NeOS::ProcessStatusKind::kRunning) + { + kout << "Getting here.\r"; + return; + } + + kIsScheduling = NO; + + kout << "Kernel: Generic Process Fault.\r"; + + process.Leak().ProcessSignal.SignalArg = rsp; + process.Leak().ProcessSignal.SignalID = SIGKILL; + process.Leak().ProcessSignal.PreviousStatus = process.Leak().Status; + + kout << "Kernel: SIGKILL status.\r"; + + process.Leak().Status = NeOS::ProcessStatusKind::kKilled; + + process.Leak().Crash(); +} + +EXTERN_C NeOS::Void idt_handle_breakpoint(NeOS::UIntPtr rip) +{ + auto process = NeOS::UserProcessScheduler::The().CurrentProcess(); + + if (process.Leak().Status != NeOS::ProcessStatusKind::kRunning) + { + kout << "Kernel: SIGTRAP\r"; + + while (YES) + ; + } + + kIsScheduling = NO; + + kout << "Kernel: Process RIP: " << NeOS::hex_number(rip) << kendl; + kout << "Kernel: SIGTRAP\r"; + + process.Leak().ProcessSignal.SignalArg = rip; + process.Leak().ProcessSignal.SignalID = SIGTRAP; + + process.Leak().ProcessSignal.PreviousStatus = process.Leak().Status; + + kout << "Kernel: SIGTRAP status.\r"; + + process.Leak().Status = NeOS::ProcessStatusKind::kFrozen; +} + +/// @brief Handle #UD fault. +/// @param rsp +EXTERN_C void idt_handle_ud(NeOS::UIntPtr rsp) +{ + auto process = NeOS::UserProcessScheduler::The().CurrentProcess(); + + if (process.Leak().Status != NeOS::ProcessStatusKind::kRunning) + return; + + kIsScheduling = NO; + + kout << "Kernel: Undefined Opcode.\r"; + + process.Leak().ProcessSignal.SignalArg = rsp; + process.Leak().ProcessSignal.SignalID = SIGKILL; + process.Leak().ProcessSignal.PreviousStatus = process.Leak().Status; + + kout << "Kernel: SIGKILL status.\r"; + + process.Leak().Status = NeOS::ProcessStatusKind::kKilled; + + process.Leak().Crash(); +} + +/// @brief Enter syscall from assembly. +/// @param stack the stack pushed from assembly routine. +/// @return nothing. +EXTERN_C NeOS::Void hal_system_call_enter(NeOS::UIntPtr rcx_syscall_index, NeOS::UIntPtr rdx_syscall_struct) +{ + if (rcx_syscall_index < kSyscalls.Count()) + { + kout << "syscall: Enter Syscall.\r"; + + if (kSyscalls[rcx_syscall_index].fHooked) + { + if (kSyscalls[rcx_syscall_index].fProc) + { + (kSyscalls[rcx_syscall_index].fProc)((NeOS::VoidPtr)rdx_syscall_struct); + } + else + { + kout << "syscall: syscall isn't valid at all! (is nullptr)\r"; + } + } + else + { + kout << "syscall: syscall isn't hooked at all! (is set to false)\r"; + } + + kout << "syscall: Exit Syscall.\r"; + } +} + +/// @brief Enter Kernel call from assembly (DDK only). +/// @param stack the stack pushed from assembly routine. +/// @return nothing. +EXTERN_C NeOS::Void hal_kernel_call_enter(NeOS::UIntPtr rcx_kerncall_index, NeOS::UIntPtr rdx_kerncall_struct) +{ + if (rcx_kerncall_index < kKerncalls.Count()) + { + kout << "kerncall: Enter Kernel Call List.\r"; + + if (kKerncalls[rcx_kerncall_index].fHooked) + { + if (kKerncalls[rcx_kerncall_index].fProc) + { + (kKerncalls[rcx_kerncall_index].fProc)((NeOS::VoidPtr)rdx_kerncall_struct); + } + else + { + kout << "kerncall: Kernel call isn't valid at all! (is nullptr)\r"; + } + } + else + { + kout << "kerncall: Kernel call isn't hooked at all! (is set to false)\r"; + } + + kout << "kerncall: Exit Kernel Call List.\r"; + } +} diff --git a/dev/kernel/HALKit/AMD64/HalCoreSystemCalls.cc b/dev/kernel/HALKit/AMD64/HalCoreSystemCalls.cc new file mode 100644 index 00000000..75eb1f15 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalCoreSystemCalls.cc @@ -0,0 +1,5 @@ +/* ------------------------------------------- + + Copyright (C) 2025, Amlal EL Mahrouss, all rights reserved. + + ------------------------------------------- */ diff --git a/dev/kernel/HALKit/AMD64/HalDebugOutput.cc b/dev/kernel/HALKit/AMD64/HalDebugOutput.cc new file mode 100644 index 00000000..2bc89a5e --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalDebugOutput.cc @@ -0,0 +1,190 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include +#include +#include + +namespace NeOS +{ + enum CommStatus : UInt16 + { + kStateInvalid, + kStateReady = 0xCF, + kStateTransmit = 0xFC, + kStateCnt = 3 + }; + + namespace Detail + { + constexpr const UInt16 kPort = 0x3F8; + static UInt16 kState = kStateInvalid; + + /// @brief Init COM1. + /// @return + template + bool hal_serial_init() noexcept + { + if (kState == kStateReady || kState == kStateTransmit) + return true; + + HAL::rt_out8(PORT + 1, 0x00); // Disable all interrupts + HAL::rt_out8(PORT + 3, 0x80); // Enable DLAB (set baud rate divisor) + HAL::rt_out8(PORT + 0, 0x03); // Set divisor to 3 (lo byte) 38400 baud + HAL::rt_out8(PORT + 1, 0x00); // (hi byte) + HAL::rt_out8(PORT + 3, 0x03); // 8 bits, no parity, one stop bit + HAL::rt_out8(PORT + 2, 0xC7); // Enable FIFO, clear them, with 14-byte threshold + HAL::rt_out8(PORT + 4, 0x0B); // IRQs enabled, RTS/DSR set + HAL::rt_out8(PORT + 4, 0x1E); // Set in loopback mode, test the serial chip + HAL::rt_out8(PORT + 0, 0xAE); // Test serial chip (send byte 0xAE and check if + // serial returns same byte) + + // Check if serial is faulty (i.e: not same byte as sent) + if (HAL::rt_in8(PORT) != 0xAE) + { + return false; + } + + kState = kStateReady; + + // If serial is not faulty set it in normal operation mode + // (not-loopback with IRQs enabled and OUT#1 and OUT#2 bits enabled) + HAL::rt_out8(PORT + 4, 0x0F); + + return true; + } + } // namespace Detail + + TerminalDevice::~TerminalDevice() = default; + + EXTERN_C void ke_io_write(IDeviceObject* obj, const Char* bytes) + { +#ifdef __DEBUG__ + Detail::hal_serial_init(); + + if (!bytes || Detail::kState != kStateReady) + return; + + if (*bytes == 0) + return; + + Detail::kState = kStateTransmit; + + SizeT index = 0; + SizeT len = 0; + + index = 0; + len = rt_string_len(bytes, 256U); + + static int x = kFontSizeX, y = kFontSizeY; + + static BOOL not_important = YES; + + while (index < len) + { + if (bytes[index] == '\r') + HAL::rt_out8(Detail::kPort, '\r'); + + HAL::rt_out8(Detail::kPort, bytes[index] == '\r' ? '\n' : bytes[index]); + + char tmp_str[2]; + tmp_str[0] = bytes[index]; + tmp_str[1] = 0; + + if (bytes[index] == '*') + { + if (not_important) + not_important = NO; + else + not_important = YES; + + ++index; + + continue; + } + + fb_render_string(tmp_str, y, x, not_important ? RGB(0xff, 0xff, 0xff) : RGB(0x00, 0x00, 0xff)); + + if (bytes[index] == '\r') + { + y += kFontSizeY; + x = kFontSizeX; + } + + x += kFontSizeX; + + if (y > kHandoverHeader->f_GOP.f_Height) + { + y = kFontSizeY; + + fb_init(); + + FBDrawInRegion(fb_get_clear_clr(), FB::UIAccessibilty::Height(), FB::UIAccessibilty::Width(), + 0, 0); + + fb_clear(); + } + + ++index; + } + + Detail::kState = kStateReady; +#endif // __DEBUG__ + } + + EXTERN_C void ke_io_read(IDeviceObject*, const Char* bytes) + { +#ifdef __DEBUG__ + Detail::hal_serial_init(); + + if (!bytes || Detail::kState != kStateReady) + return; + + Detail::kState = kStateTransmit; + + SizeT index = 0; + + ///! TODO: Look on how to wait for the UART to complete. + while (true) + { + auto in = HAL::rt_in8(Detail::kPort); + + ///! If enter pressed then break. + if (in == 0xD) + { + break; + } + + if (in < '0' || in < 'A' || in < 'a') + { + if (in != '@' || in != '!' || in != '?' || in != '.' || in != '/' || + in != ':') + { + continue; + } + } + + ((char*)bytes)[index] = in; + + ++index; + } + + ((char*)bytes)[index] = 0; + + Detail::kState = kStateReady; +#endif // __DEBUG__ + } + + TerminalDevice TerminalDevice::The() noexcept + { + TerminalDevice out(NeOS::ke_io_write, NeOS::ke_io_read); + return out; + } + +} // namespace NeOS diff --git a/dev/kernel/HALKit/AMD64/HalDebugPort.cc b/dev/kernel/HALKit/AMD64/HalDebugPort.cc new file mode 100644 index 00000000..7eada646 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalDebugPort.cc @@ -0,0 +1,42 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +//! @file DebuggerPort.cc +//! @brief UART debug via packets. + +#include +#include + +// after that we have start of additional data. + +namespace NeOS +{ + void rt_debug_listen(DebuggerPortHeader* theHook) noexcept + { + if (theHook == nullptr) + return; + + for (UInt32 i = 0U; i < kDebugMaxPorts; ++i) + { + HAL::rt_out16(theHook->fPort[i], kDebugMag0); + HAL::rt_wait_400ns(); + + HAL::rt_out16(theHook->fPort[i], kDebugMag1); + HAL::rt_wait_400ns(); + + HAL::rt_out16(theHook->fPort[i], kDebugMag2); + HAL::rt_wait_400ns(); + + HAL::rt_out16(theHook->fPort[i], kDebugMag3); + HAL::rt_wait_400ns(); + + if (HAL::rt_in16(theHook->fPort[i]) != kDebugUnboundPort) + ++theHook->fPortCnt; + + HAL::rt_wait_400ns(); + } + } +} // namespace NeOS diff --git a/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc b/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc new file mode 100644 index 00000000..154b11af --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc @@ -0,0 +1,126 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +#define kPITDefaultTicks (1000U) + +namespace NeOS::HAL +{ + namespace Detail + { + STATIC ::NeOS::Detail::AMD64::InterruptDescriptorAMD64 + kInterruptVectorTable[kKernelIdtSize] = {}; + + STATIC void hal_set_irq_mask(UInt8 irql); + STATIC void hal_clear_irq_mask(UInt8 irql); + + STATIC Void hal_enable_pit(UInt16 ticks) noexcept + { + if (ticks == 0) + ticks = kPITDefaultTicks; + + // Configure PIT to receieve scheduler interrupts. + + UInt16 kPITCommDivisor = kPITFrequency / ticks; // 100 Hz. + + HAL::rt_out8(kPITControlPort, 0x36); // Command to PIT + HAL::rt_out8(kPITChannel0Port, kPITCommDivisor & 0xFF); // Send low byte + HAL::rt_out8(kPITChannel0Port, (kPITCommDivisor >> 8) & 0xFF); // Send high byte + + hal_clear_irq_mask(32); + } + + STATIC void hal_set_irq_mask(UInt8 irql) + { + UInt16 port; + UInt8 value; + + if (irql < 8) + { + port = kPICData; + } + else + { + port = kPIC2Data; + irql -= 8; + } + + value = rt_in8(port) | (1 << irql); + rt_out8(port, value); + } + + STATIC void hal_clear_irq_mask(UInt8 irql) + { + UInt16 port; + UInt8 value; + + if (irql < 8) + { + port = kPICData; + } + else + { + port = kPIC2Data; + irql -= 8; + } + + value = rt_in8(port) & ~(1 << irql); + rt_out8(port, value); + } + } // namespace Detail + + /// @brief Loads the provided Global Descriptor Table. + /// @param gdt + /// @return + Void GDTLoader::Load(RegisterGDT& gdt) + { + hal_load_gdt(gdt); + } + + Void IDTLoader::Load(Register64& idt) + { + rt_cli(); + + const Int16 kPITTickForScheduler = kPITDefaultTicks; + + volatile ::NeOS::UIntPtr** ptr_ivt = (volatile ::NeOS::UIntPtr**)idt.Base; + + for (SizeT idt_indx = 0; idt_indx < kKernelIdtSize; ++idt_indx) + { + Detail::kInterruptVectorTable[idt_indx].Selector = kIDTSelector; + Detail::kInterruptVectorTable[idt_indx].Ist = 0; + Detail::kInterruptVectorTable[idt_indx].TypeAttributes = kInterruptGate; + Detail::kInterruptVectorTable[idt_indx].OffsetLow = ((UIntPtr)ptr_ivt[idt_indx] & 0xFFFF); + Detail::kInterruptVectorTable[idt_indx].OffsetMid = (((UIntPtr)ptr_ivt[idt_indx] >> 16) & 0xFFFF); + Detail::kInterruptVectorTable[idt_indx].OffsetHigh = + (((UIntPtr)ptr_ivt[idt_indx] >> 32) & 0xFFFFFFFF); + + Detail::kInterruptVectorTable[idt_indx].Zero = 0; + } + + idt.Base = (UIntPtr)&Detail::kInterruptVectorTable[0]; + idt.Limit = sizeof(::NeOS::Detail::AMD64::InterruptDescriptorAMD64) * + (kKernelIdtSize); + + hal_load_idt(idt); + + Detail::hal_enable_pit(kPITTickForScheduler); + + rt_sti(); + } + + void GDTLoader::Load(Ref& gdt) + { + GDTLoader::Load(gdt.Leak()); + } + + void IDTLoader::Load(Ref& idt) + { + IDTLoader::Load(idt.Leak()); + } +} // namespace NeOS::HAL diff --git a/dev/kernel/HALKit/AMD64/HalInterruptAPI.asm b/dev/kernel/HALKit/AMD64/HalInterruptAPI.asm new file mode 100644 index 00000000..ffea6707 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalInterruptAPI.asm @@ -0,0 +1,402 @@ +;; /* +;; * --------------------------------------------------- +;; * +;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. +;; * +;; * File: HalInterruptAPI.asm +;; * Purpose: Interrupt API, redirect raw interrupts into their handlers. +;; * +;; * --------------------------------------------------- +;; */ + +[bits 64] + +%define kInterruptId 50 + +%macro IntExp 1 +global __NE_INT_%1 +__NE_INT_%1: + cld + + std + + o64 iret +%endmacro + +%macro IntNormal 1 +global __NE_INT_%1 +__NE_INT_%1: + cld + + std + + o64 iret +%endmacro + +; This file handles the core interrupt table +; Last edited 31/01/24 + +global ke_handle_irq +global kInterruptVectorTable + +extern idt_handle_gpf +extern idt_handle_pf +extern ke_io_write +extern idt_handle_ud +extern idt_handle_generic +extern idt_handle_breakpoint + +section .text + +__NE_INT_0: + cld + + mov al, 0x20 + out 0x20, al + + push rcx + call idt_handle_generic + pop rcx + + std + + o64 iret + +__NE_INT_1: + cld + + mov al, 0x20 + out 0x20, al + + push rcx + call idt_handle_generic + pop rcx + + std + + o64 iret + +__NE_INT_2: + cld + + mov al, 0x20 + out 0x20, al + + push rcx + call idt_handle_generic + pop rcx + + std + + o64 iret + +;; @brief Triggers a breakpoint and freeze the process. RIP is also fetched. +__NE_INT_3: + cld + + mov al, 0x20 + out 0x20, al + + push rcx + mov rcx, rsp + call idt_handle_generic + pop rcx + + std + + o64 iret + +__NE_INT_4: + cld + + mov al, 0x20 + out 0x20, al + + + push rcx + call idt_handle_generic + pop rcx + + std + + o64 iret + +__NE_INT_5: + cld + + mov al, 0x20 + out 0x20, al + + std + + o64 iret + +;; Invalid opcode interrupt +__NE_INT_6: + cld + + mov al, 0x20 + out 0x20, al + + push rcx + call idt_handle_generic + pop rcx + + std + + o64 iret + +__NE_INT_7: + cld + + mov al, 0x20 + out 0x20, al + + push rcx + call idt_handle_generic + pop rcx + + std + + o64 iret + +;; Invalid opcode interrupt +__NE_INT_8: + cld + + mov al, 0x20 + out 0xA0, al + out 0x20, al + + push rcx + call idt_handle_generic + pop rcx + + std + + o64 iret + +IntNormal 9 +IntExp 10 +IntExp 11 + +IntExp 12 + +__NE_INT_13: + cld + + mov al, 0x20 + out 0xA0, al + out 0x20, al + + push rcx + call idt_handle_gpf + pop rcx + + std + + o64 iret + +__NE_INT_14: + cld + + mov al, 0x20 + out 0xA0, al + out 0x20, al + + push rcx + call idt_handle_pf + pop rcx + + std + + o64 iret + +IntNormal 15 +IntNormal 16 +IntExp 17 +IntNormal 18 +IntNormal 19 +IntNormal 20 +IntNormal 21 + +IntNormal 22 + +IntNormal 23 +IntNormal 24 +IntNormal 25 +IntNormal 26 +IntNormal 27 +IntNormal 28 +IntNormal 29 +IntExp 30 +IntNormal 31 + +[extern idt_handle_scheduler] + +__NE_INT_32: + cld + + mov al, 0x20 + out 0xA0, al + out 0x20, al + + push rax + mov rcx, rsp + call idt_handle_scheduler + pop rax + + std + + o64 iret + +IntNormal 33 + +IntNormal 34 +IntNormal 35 +IntNormal 36 +IntNormal 37 +IntNormal 38 +IntNormal 39 +IntNormal 40 + +IntNormal 41 + +IntNormal 42 +IntNormal 43 +IntNormal 44 +IntNormal 45 +IntNormal 46 +IntNormal 47 +IntNormal 48 +IntNormal 49 + +[extern hal_system_call_enter] +[extern hal_kernel_call_enter] + +__NE_INT_50: + cld + + mov al, 0x20 + out 0xA0, al + out 0x20, al + + push rax + mov rax, hal_system_call_enter + + mov rcx, r8 + mov rdx, r9 + + call rax + pop rax + + std + + o64 iret + +__NE_INT_51: + cld + + mov al, 0x20 + out 0xA0, al + out 0x20, al + + push rax + mov rax, hal_kernel_call_enter + + mov rcx, r8 + mov rdx, r9 + + call rax + pop rax + + std + + o64 iret + +IntNormal 52 + +IntNormal 53 +IntNormal 54 +IntNormal 55 +IntNormal 56 +IntNormal 57 +IntNormal 58 +IntNormal 59 +IntNormal 60 + +%assign i 61 +%rep 195 + IntNormal i +%assign i i+1 +%endrep + +section .text + +[global hal_load_gdt] + +hal_load_gdt: + cld + + lgdt [rcx] + + mov ax, 0x10 + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + mov ss, ax + + mov rax, 0x08 + push rax + push hal_reload_segments + + o64 retf + +extern hal_real_init + +hal_reload_segments: + std + jmp hal_real_init + ret + +global hal_load_idt + +hal_load_idt: + lidt [rcx] + + ; Master PIC initialization + mov al, 0x11 ; Start initialization in cascade mode + out 0x20, al ; Send initialization command to Master PIC + out 0xA0, al ; Send initialization command to Slave PIC + + ; Remap the PIC to use vectors 32-39 for Master and 40-47 for Slave + mov al, 0x20 ; Set Master PIC offset to 32 + out 0x21, al ; Send offset to Master PIC + + mov al, 0x28 ; Set Slave PIC offset to 40 + out 0xA1, al ; Send offset to Slave PIC + + ; Configure Master PIC to inform Slave PIC at IRQ2 + mov al, 0x04 ; Tell Master PIC there is a Slave PIC at IRQ2 + out 0x21, al + + ; Configure Slave PIC identity + mov al, 0x02 ; Tell Slave PIC its cascade identity + out 0xA1, al + + ; Set both PICs to 8086 mode + mov al, 0x01 ; 8086 mode + out 0x21, al + out 0xA1, al + + ret + +section .data + +kInterruptVectorTable: + %assign i 0 + %rep 256 + dq __NE_INT_%+i + %assign i i+1 + %endrep diff --git a/dev/kernel/HALKit/AMD64/HalKernelMain.cc b/dev/kernel/HALKit/AMD64/HalKernelMain.cc new file mode 100644 index 00000000..543e267b --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalKernelMain.cc @@ -0,0 +1,117 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +EXTERN_C NeOS::VoidPtr kInterruptVectorTable[]; +EXTERN_C NeOS::VoidPtr mp_user_switch_proc; +EXTERN_C NeOS::Char mp_user_switch_proc_stack_begin[]; + +STATIC NeOS::Void hal_init_scheduler_team() +{ + for (NeOS::SizeT i = 0U; i < NeOS::UserProcessScheduler::The().CurrentTeam().AsArray().Count(); ++i) + { + NeOS::UserProcessScheduler::The().CurrentTeam().AsArray()[i] = NeOS::UserProcess(); + NeOS::UserProcessScheduler::The().CurrentTeam().AsArray()[i].Status = NeOS::ProcessStatusKind::kKilled; + } +} + +STATIC NeOS::UInt64 hal_rdtsc_fn() +{ + NeOS::UInt32 lo, hi; + __asm__ volatile("rdtsc" + : "=a"(lo), "=d"(hi)); + + return ((NeOS::UInt64)hi << 32) | lo; +} + +STATIC NeOS::UInt64 kStartTim, kEndTim; + +/// @brief Kernel init procedure. +EXTERN_C void hal_init_platform( + NeOS::HEL::BootInfoHeader* handover_hdr) +{ + kStartTim = hal_rdtsc_fn(); + + kHandoverHeader = handover_hdr; + + if (kHandoverHeader->f_Magic != kHandoverMagic && + kHandoverHeader->f_Version != kHandoverVersion) + { + return; + } + + hal_init_scheduler_team(); + + /************************************** */ + /* INITIALIZE BIT MAP. */ + /************************************** */ + + kKernelBitMpSize = kHandoverHeader->f_BitMapSize; + kKernelBitMpStart = reinterpret_cast( + reinterpret_cast(kHandoverHeader->f_BitMapStart)); + + /************************************** */ + /* INITIALIZE GDT AND SEGMENTS. */ + /************************************** */ + + STATIC CONST auto kGDTEntriesCount = 6; + + /* GDT, mostly descriptors for user and kernel segments. */ + STATIC NeOS::HAL::Detail::NE_GDT_ENTRY ALIGN(0x08) kGDTArray[kGDTEntriesCount] = { + {.fLimitLow = 0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0x00, .fFlags = 0x00, .fBaseHigh = 0}, // Null entry + {.fLimitLow = 0x0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0x9A, .fFlags = 0xAF, .fBaseHigh = 0}, // Kernel code + {.fLimitLow = 0x0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0x92, .fFlags = 0xCF, .fBaseHigh = 0}, // Kernel data + {.fLimitLow = 0x0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0xFA, .fFlags = 0xAF, .fBaseHigh = 0}, // User code + {.fLimitLow = 0x0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0xF2, .fFlags = 0xCF, .fBaseHigh = 0}, // User data + }; + + // Load memory descriptors. + NeOS::HAL::RegisterGDT gdt_reg; + + gdt_reg.Base = reinterpret_cast(kGDTArray); + gdt_reg.Limit = (sizeof(NeOS::HAL::Detail::NE_GDT_ENTRY) * kGDTEntriesCount) - 1; + + FB::fb_clear_video(); + + //! GDT will load hal_read_init after it successfully loads the segments. + NeOS::HAL::GDTLoader gdt_loader; + gdt_loader.Load(gdt_reg); + + NeOS::ke_panic(RUNTIME_CHECK_BOOTSTRAP); +} + +EXTERN_C NeOS::Void hal_real_init(NeOS::Void) noexcept +{ + NeOS::NeFS::fs_init_nefs(); + + NeOS::HAL::mp_get_cores(kHandoverHeader->f_HardwareTables.f_VendorPtr); + + NeOS::HAL::Register64 idt_reg; + + idt_reg.Base = (NeOS::UIntPtr)kInterruptVectorTable; + + NeOS::HAL::IDTLoader idt_loader; + + kEndTim = hal_rdtsc_fn(); + + kout << "Cycles Spent Before Userland: " << NeOS::number(kEndTim - kStartTim) << kendl; + + idt_loader.Load(idt_reg); + + while (YES) + { + continue; + } +} diff --git a/dev/kernel/HALKit/AMD64/HalKernelPanic.cc b/dev/kernel/HALKit/AMD64/HalKernelPanic.cc new file mode 100644 index 00000000..f0595903 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalKernelPanic.cc @@ -0,0 +1,68 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Each error code is attributed with an ID, which will prompt a string onto the + * screen. Wait for debugger... */ + +namespace NeOS +{ + /// @brief Dumping factory class. + class RecoveryFactory final + { + public: + STATIC Void Recover() noexcept; + }; + + /***********************************************************************************/ + /// @brief Stops execution of the kernel. + /// @param id kernel stop ID. + /***********************************************************************************/ + Void ke_panic(const NeOS::Int32& id, const Char* message) + { + fb_init(); + + auto panic_text = RGB(0xff, 0xff, 0xff); + + auto y = 10; + auto x = 10; + + kout << "Kernel_Panic_MSG: " << message << kendl; + kout << "Kernel_Panic_ID: " << hex_number(id) << kendl; + kout << "Kernel_Panic_CR2: " << hex_number((UIntPtr)hal_read_cr2()) << kendl; + + RecoveryFactory::Recover(); + } + + Void RecoveryFactory::Recover() noexcept + { + while (YES) + { + HAL::rt_halt(); + } + } + + void ke_runtime_check(bool expr, const Char* file, const Char* line) + { + if (!expr) + { + kout << "Kernel_Panic_File: " << file << kendl; + kout << "Kernel_Panic_Line: " << line << kendl; + + ke_panic(RUNTIME_CHECK_FAILED, file); // Runtime Check failed + } + } +} // namespace NeOS diff --git a/dev/kernel/HALKit/AMD64/HalPagingMgrAMD64.cc b/dev/kernel/HALKit/AMD64/HalPagingMgrAMD64.cc new file mode 100644 index 00000000..fe9f0421 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalPagingMgrAMD64.cc @@ -0,0 +1,204 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: HalPagingMgr.cc + Purpose: Platform Paging Manager. + +------------------------------------------- */ + +#include +#include + +namespace NeOS::HAL +{ + typedef UInt32 PageTableIndex; + + /***********************************************************************************/ + /// \brief Page store type. + /***********************************************************************************/ + struct NE_PAGE_STORE final + { + struct + { + PDE* fPde{nullptr}; + PTE* fPte{nullptr}; + VoidPtr fPAddr{nullptr}; + } fInternalStore; + + Bool fStoreOp{No}; // Store operation is in progress. + + bool IsValidPage(PTE* pte) + { + return pte && pte->Present; + } + + bool IsWRPage(PTE* pte) + { + return pte && pte->Wr; + } + + bool IsUserPage(PTE* pte) + { + return pte && pte->User; + } + + static NE_PAGE_STORE& The() + { + static NE_PAGE_STORE the; + return the; + } + }; + + /// @brief Go over the Page structure and find the address of *virtual_address* + + UIntPtr hal_get_phys_address(VoidPtr virtual_address) + { + // Constants for table index bits + const UInt64 kPmlIndexMask = 0x1FFULL; // Mask for PML4, PDPT, PD, PT index (9 bits) + const UInt64 kPtIndexMask = 0xFFFULL; // Mask for page table index (12 bits) + + UInt64 cr3 = (UInt64)hal_read_cr3(); + + NE_PAGE_STORE& page_store = NE_PAGE_STORE::The(); + + // Extract the indices from the virtual address + UInt64 pml4_index = ((UIntPtr)virtual_address >> 39) & kPmlIndexMask; + UInt64 pdpt_index = ((UIntPtr)virtual_address >> 30) & kPmlIndexMask; + UInt64 pd_index = ((UIntPtr)virtual_address >> 21) & kPmlIndexMask; + UInt64 pt_index = ((UIntPtr)virtual_address >> 12) & kPmlIndexMask; + + page_store.fStoreOp = Yes; + + const auto kPmlEntrySize = 8; + + // Read the PML4 entry from memory + UInt64 pml4_base = cr3 & ~kPtIndexMask; // CR3 points to the PML4 table base, mask off lower bits + UInt64 pml4_entry = (pml4_base + pml4_index * kPmlEntrySize); // Each entry is 8 bytes + + // Read the PDPT entry + UInt64 pdpt_base = pml4_entry & ~kPtIndexMask; // Get the PDPT base physical address + UInt64 pdpt_entry = (pdpt_base + pdpt_index * kPmlEntrySize); + + // Read the PD entry + UInt64 pd_base = pdpt_entry & ~kPtIndexMask; // Get the Page Directory base physical address + UInt64 pd_entry = (pd_base + pd_index * kPmlEntrySize); + + // Read the PT entry + UInt64 pt_base = pd_entry & ~kPtIndexMask; // Get the Page Table base physical address + UInt64 pt_entry = (pt_base + pt_index * kPmlEntrySize); + + // Lastly, grab the pte entry. + NE_PDE* pde_struct = reinterpret_cast(pt_base); + + return pde_struct->fEntries[pt_entry]->PhysicalAddress; + } + + /***********************************************************************************/ + /// \brief Retrieve the page status of a PTE. + /// \param pte Page Table Entry pointer. + /***********************************************************************************/ + STATIC Void mmi_page_status(PTE* pte) + { + kout << (pte->Present ? "Present" : "Not Present") << kendl; + kout << (pte->Wr ? "W/R" : "Not W/R") << kendl; + kout << (pte->ExecDisable ? "NX" : "Not NX") << kendl; + kout << (pte->User ? "User" : "Not User") << kendl; + } + + STATIC Int32 mmi_map_page_table_entry(UInt32 physical_address, UInt32 flags, NE_PTE* pt_entry, NE_PDE* pd_entry); + + /***********************************************************************************/ + /// @brief Maps or allocates a page from virtual_address. + /// @param virtual_address a valid virtual address. + /// @param phys_addr point to physical address. + /// @param flags the flags to put on the page. + /// @return Status code of page manipulation process. + /***********************************************************************************/ + EXTERN_C Int32 mm_map_page(VoidPtr virtual_address, VoidPtr physical_address, UInt32 flags) + { + // Constants for table index bits + const UInt64 kPmlIndexMask = 0x1FFULL; // Mask for PML4, PDPT, PD, PT index (9 bits) + const UInt64 kPtIndexMask = 0xFFFULL; // Mask for page table index (12 bits) + + UInt64 cr3 = (UInt64)hal_read_cr3(); + + NE_PAGE_STORE& page_store = NE_PAGE_STORE::The(); + + // Extract the indices from the virtual address + UInt64 pml4_index = ((UIntPtr)virtual_address >> 39) & kPmlIndexMask; + UInt64 pdpt_index = ((UIntPtr)virtual_address >> 30) & kPmlIndexMask; + UInt64 pd_index = ((UIntPtr)virtual_address >> 21) & kPmlIndexMask; + UInt64 pt_index = ((UIntPtr)virtual_address >> 12) & kPmlIndexMask; + + page_store.fStoreOp = Yes; + + const auto kPmlEntrySize = 8; + + // Read the PML4 entry from memory + UInt64 pml4_base = cr3 & ~kPtIndexMask; // CR3 points to the PML4 table base, mask off lower bits + UInt64 pml4_entry = (pml4_base + pml4_index * kPmlEntrySize); // Each entry is 8 bytes + + // Read the PDPT entry + UInt64 pdpt_base = pml4_entry & ~kPtIndexMask; // Get the PDPT base physical address + UInt64 pdpt_entry = (pdpt_base + pdpt_index * kPmlEntrySize); + + // Read the PD entry + UInt64 pd_base = pdpt_entry & ~kPtIndexMask; // Get the Page Directory base physical address + UInt64 pd_entry = (pd_base + pd_index * kPmlEntrySize); + + // Read the PT entry + UInt64 pt_base = pd_entry & ~kPtIndexMask; // Get the Page Table base physical address + UInt64 pt_entry = (pt_base + pt_index * kPmlEntrySize); + + // Lastly, grab the pte entry. + NE_PDE* pde_struct = reinterpret_cast(pt_base); + + return mmi_map_page_table_entry((UInt32)(UInt64)physical_address, flags, pde_struct->fEntries[pt_entry], pde_struct); + } + + /***********************************************************************************/ + /// @brief Maps flags for a specific pte. + /// @internal Internal function. + /***********************************************************************************/ + STATIC Int32 mmi_map_page_table_entry(UInt32 physical_address, UInt32 flags, NE_PTE* pt_entry, NE_PDE* pd_entry) + { + if (!pt_entry) + return 1; + + pt_entry->Present = true; + + if (flags & kMMFlagsWr) + pt_entry->Wr = true; + else if (flags & ~kMMFlagsWr) + pt_entry->Wr = false; + + if (flags & kMMFlagsNX) + pt_entry->ExecDisable = true; + else if (flags & ~kMMFlagsNX) + pt_entry->ExecDisable = false; + + if (flags & kMMFlagsUser) + pt_entry->User = true; + else if (flags & ~kMMFlagsUser) + pt_entry->User = false; + + pt_entry->PhysicalAddress = physical_address; + + hal_invl_tlb(reinterpret_cast(pt_entry)); + + mmi_page_status(pt_entry); + + NE_PAGE_STORE& page_store = NE_PAGE_STORE::The(); + + // Update Internal store. + + page_store.fInternalStore.fPde = pd_entry; + page_store.fInternalStore.fPte = pt_entry; + page_store.fInternalStore.fPAddr = (VoidPtr)(UIntPtr)physical_address; + + page_store.fStoreOp = No; + + return 0; + } +} // namespace NeOS::HAL diff --git a/dev/kernel/HALKit/AMD64/HalProcessorAMD64.cc b/dev/kernel/HALKit/AMD64/HalProcessorAMD64.cc new file mode 100644 index 00000000..b3da8352 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalProcessorAMD64.cc @@ -0,0 +1,101 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: HalCPU.cc + Purpose: Platform processor routines. + +------------------------------------------- */ + +#include +#include + +/** + * @file HalCPU.cc + * @brief Common CPU API. + */ + +namespace NeOS::HAL +{ + Void lrt_out8(UInt16 port, UInt8 value) + { + asm volatile("outb %%al, %1" + : + : "a"(value), "Nd"(port) + : "memory"); + } + + Void lrt_out16(UInt16 port, UInt16 value) + { + asm volatile("outw %%ax, %1" + : + : "a"(value), "Nd"(port) + : "memory"); + } + + Void lrt_out32(UInt16 port, UInt32 value) + { + asm volatile("outl %%eax, %1" + : + : "a"(value), "Nd"(port) + : "memory"); + } + + UInt8 lrt_in8(UInt16 port) + { + UInt8 value = 0UL; + asm volatile("inb %1, %%al" + : "=a"(value) + : "Nd"(port) + : "memory"); + + return value; + } + + UInt16 lrt_in16(UInt16 port) + { + UInt16 value = 0UL; + asm volatile("inw %1, %%ax" + : "=a"(value) + : "Nd"(port) + : "memory"); + + return value; + } + + UInt32 lrt_in32(UInt16 port) + { + UInt32 value = 0UL; + asm volatile("inl %1, %%eax" + : "=a"(value) + : "Nd"(port) + : "memory"); + + return value; + } + + Void rt_halt() + { + asm volatile("hlt"); + } + + Void rt_cli() + { + asm volatile("cli"); + } + + Void rt_sti() + { + asm volatile("sti"); + } + + Void rt_cld() + { + asm volatile("cld"); + } + + Void rt_std() + { + asm volatile("std"); + } +} // namespace NeOS::HAL diff --git a/dev/kernel/HALKit/AMD64/HalRoutineWait.s b/dev/kernel/HALKit/AMD64/HalRoutineWait.s new file mode 100644 index 00000000..89051ba4 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalRoutineWait.s @@ -0,0 +1,11 @@ +.globl rt_wait_400ns + +.section .text +rt_wait_400ns: + jmp .loop + pause + .loop: + jmp .loop2 + pause + .loop2: + ret diff --git a/dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc b/dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc new file mode 100644 index 00000000..bf4b9d91 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc @@ -0,0 +1,52 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +namespace NeOS +{ + /***********************************************************************************/ + /// @brief Unimplemented function (crashes by default) + /// @param + /***********************************************************************************/ + + EXTERN_C Void __zka_pure_call(UserProcess* process) + { + if (process) + process->Crash(); + } + + /***********************************************************************************/ + /// @brief Validate user stack. + /// @param stack_ptr the frame pointer. + /***********************************************************************************/ + + EXTERN_C Bool hal_check_stack(HAL::StackFramePtr stack_ptr) + { + if (!stack_ptr) + return No; + + return stack_ptr->SP != 0 && stack_ptr->BP != 0; + } + + /// @brief Wakes up thread. + /// Wakes up thread from the hang state. + Void mp_wakeup_thread(HAL::StackFrame* stack) + { + NeOS::UserProcessHelper::StartScheduling(); + } + + /// @brief makes the thread sleep on a loop. + /// hooks and hangs thread to prevent code from executing. + Void mp_hang_thread(HAL::StackFrame* stack) + { + while (Yes) + { + /* Nothing to do, code is spinning */ + } + } +} // namespace NeOS diff --git a/dev/kernel/HALKit/AMD64/HalSystemCallInstall.cc b/dev/kernel/HALKit/AMD64/HalSystemCallInstall.cc new file mode 100644 index 00000000..e4e9daab --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalSystemCallInstall.cc @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright (C) 2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include diff --git a/dev/kernel/HALKit/AMD64/HalTimerAMD64.cc b/dev/kernel/HALKit/AMD64/HalTimerAMD64.cc new file mode 100644 index 00000000..53386d36 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalTimerAMD64.cc @@ -0,0 +1,86 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: HalTimer.cc + Purpose: HAL timer + + Revision History: + + 07/07/24: Added file (amlel) + +------------------------------------------- */ + +#include +#include +#include + +// timer slot 0 + +#define cHPETCounterRegValue (0x00) +#define cHPETConfigRegValue (0x20) +#define cHPETCompRegValue (0x24) +#define cHPETInterruptRegValue (0x2C) + +///! BUGS: 0 +///! @file HalTimer.cc +///! @brief Hardware Timer (HPET) + +namespace NeOS::Detail +{ + struct HPET_BLOCK : public NeOS::SDT + { + NeOS::UInt8 hardware_rev_id; + NeOS::UInt8 comparator_count : 5; + NeOS::UInt8 counter_size : 1; + NeOS::UInt8 reserved : 1; + NeOS::UInt8 legacy_replacement : 1; + NeOS::UInt16 pci_vendor_id; + ACPI_ADDRESS address; + NeOS::UInt8 hpet_number; + NeOS::UInt16 minimum_tick; + NeOS::UInt8 page_protection; + } PACKED; +} // namespace NeOS::Detail + +using namespace NeOS; + +HardwareTimer::HardwareTimer(Int64 ms) + : fWaitFor(ms) +{ + auto power = PowerFactoryInterface(kHandoverHeader->f_HardwareTables.f_VendorPtr); + + auto hpet = (Detail::HPET_BLOCK*)power.Find("HPET").Leak().Leak(); + MUST_PASS(hpet); + + fDigitalTimer = (IntPtr*)hpet->address.Address; +} + +HardwareTimer::~HardwareTimer() +{ + fDigitalTimer = nullptr; + fWaitFor = 0; +} + +BOOL HardwareTimer::Wait() noexcept +{ + if (fWaitFor < 1) + return NO; + + // if not enabled yet. + if (!(*(fDigitalTimer + cHPETConfigRegValue) & (1 << 0))) + { + *(fDigitalTimer + cHPETConfigRegValue) |= (1 << 0); // enable it + *(fDigitalTimer + cHPETConfigRegValue) |= (1 << 3); // one shot conf + } + + UInt64 ticks = fWaitFor / ((*(fDigitalTimer) >> 32) & __UINT32_MAX__); + UInt64 prev = *(fDigitalTimer + cHPETCounterRegValue); + + prev += ticks; + + while (*(fDigitalTimer + cHPETCounterRegValue) < (ticks)) + ; + + return YES; +} diff --git a/dev/kernel/HALKit/AMD64/HalUtils.asm b/dev/kernel/HALKit/AMD64/HalUtils.asm new file mode 100644 index 00000000..83453714 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalUtils.asm @@ -0,0 +1,26 @@ +;; /* +;; * ======================================================== +;; * +;; * NeKernel +;; * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. +;; * +;; * ======================================================== +;; */ + +[bits 64] + +[global rt_install_tib] + +section .text + +;; changed: rs, fs +;; expected: rcx, rdx + +rt_install_tib: + mov rcx, gs ;; TIB -> Thread Information Block + mov rdx, fs ;; PIB -> Process Information Block + ret + +;; //////////////////////////////////////////////////// ;; + +[extern kApicMadtAddressesCount] diff --git a/dev/kernel/HALKit/AMD64/Hypervisor.h b/dev/kernel/HALKit/AMD64/Hypervisor.h new file mode 100644 index 00000000..4c226eee --- /dev/null +++ b/dev/kernel/HALKit/AMD64/Hypervisor.h @@ -0,0 +1,25 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +namespace NeOS +{ + MAKE_STRING_ENUM(HYPERVISOR) + ENUM_STRING(Qemu, "TCGTCGTCGTCG"); + ENUM_STRING(KVM, " KVMKVMKVM "); + ENUM_STRING(VMWare, "VMwareVMware"); + ENUM_STRING(VirtualBox, "VBoxVBoxVBox"); + ENUM_STRING(Xen, "XenVMMXenVMM"); + ENUM_STRING(Microsoft, "Microsoft Hv"); + ENUM_STRING(Parallels, " prl hyperv "); + ENUM_STRING(ParallelsAlt, " lrpepyh vr "); + ENUM_STRING(Bhyve, "bhyve bhyve "); + ENUM_STRING(Qnx, " QNXQVMBSQG "); + END_STRING_ENUM() +} // namespace NeOS diff --git a/dev/kernel/HALKit/AMD64/MBCI/HalMBCI.cc b/dev/kernel/HALKit/AMD64/MBCI/HalMBCI.cc new file mode 100644 index 00000000..09632bc9 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/MBCI/HalMBCI.cc @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include diff --git a/dev/kernel/HALKit/AMD64/PCI/DMA.cc b/dev/kernel/HALKit/AMD64/PCI/DMA.cc new file mode 100644 index 00000000..c756a572 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/PCI/DMA.cc @@ -0,0 +1,87 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +namespace NeOS +{ + DMAWrapper::operator bool() + { + return this->fAddress; + } + + bool DMAWrapper::operator!() + { + return !this->fAddress; + } + + Boolean DMAWrapper::Check(UIntPtr offset) const + { + if (!this->fAddress) + return false; + + if (offset == 0) + return false; + + kout << "[DMAWrapper::IsIn] Checking offset..\n"; + return reinterpret_cast(this->fAddress) >= offset; + } + + bool DMAWrapper::Write(const UIntPtr& bit, const UInt32& offset) + { + kout << "[DMAWrapper::Read] Checking this->fAddress..\n"; + + if (!this->fAddress) + return false; + + kout << "[DMAWrapper::Write] Writing at address..\n"; + + auto addr = + (volatile UIntPtr*)(reinterpret_cast(this->fAddress) + offset); + *addr = bit; + + return true; + } + + UIntPtr DMAWrapper::Read(const UInt32& offset) + { + kout << "[DMAWrapper::Read] Checking this->fAddress..\n"; + + if (!this->fAddress) + return 0; + + kout << "[DMAWrapper::Read] Reading this->fAddress..\n"; + + return *(volatile UIntPtr*)(reinterpret_cast(this->fAddress) + offset); + ; + } + + UIntPtr DMAWrapper::operator[](const UIntPtr& offset) + { + return this->Read(offset); + } + + OwnPtr> DMAFactory::Construct(OwnPtr& dma) + { + if (!dma) + return {}; + + OwnPtr> dmaOwnPtr = + make_ptr, char*>(reinterpret_cast(dma->fAddress)); + + if (!dmaOwnPtr) + return {}; + + kout << "Returning the new OwnPtr>!\r"; + return dmaOwnPtr; + } + + DMAWrapper& DMAWrapper::operator=(voidPtr Ptr) + { + this->fAddress = Ptr; + return *this; + } +} // namespace NeOS diff --git a/dev/kernel/HALKit/AMD64/PCI/Database.cc b/dev/kernel/HALKit/AMD64/PCI/Database.cc new file mode 100644 index 00000000..c5aa1282 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/PCI/Database.cc @@ -0,0 +1,11 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +namespace NeOS +{ +} diff --git a/dev/kernel/HALKit/AMD64/PCI/Device.cc b/dev/kernel/HALKit/AMD64/PCI/Device.cc new file mode 100644 index 00000000..348e058a --- /dev/null +++ b/dev/kernel/HALKit/AMD64/PCI/Device.cc @@ -0,0 +1,171 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +#define PCI_BAR_IO 0x01 +#define PCI_BAR_LOWMEM 0x02 +#define PCI_BAR_64 0x04 +#define PCI_BAR_PREFETCH 0x08 + +NeOS::UInt NE_PCIReadRaw(NeOS::UInt bar, NeOS::UShort bus, NeOS::UShort dev, NeOS::UShort fun) +{ + NeOS::UInt target = 0x80000000 | ((NeOS::UInt)bus << 16) | + ((NeOS::UInt)dev << 11) | ((NeOS::UInt)fun << 8) | + (bar & 0xFC); + + NeOS::HAL::rt_out32((NeOS::UShort)NeOS::PCI::PciConfigKind::ConfigAddress, + target); + + NeOS::HAL::rt_wait_400ns(); + + return NeOS::HAL::rt_in32((NeOS::UShort)NeOS::PCI::PciConfigKind::ConfigData); +} + +void NE_PCISetCfgTarget(NeOS::UInt bar, NeOS::UShort bus, NeOS::UShort dev, NeOS::UShort fun) +{ + NeOS::UInt target = 0x80000000 | ((NeOS::UInt)bus << 16) | + ((NeOS::UInt)dev << 11) | ((NeOS::UInt)fun << 8) | + (bar & 0xFC); + + NeOS::HAL::rt_out32((NeOS::UShort)NeOS::PCI::PciConfigKind::ConfigAddress, + target); + + NeOS::HAL::rt_wait_400ns(); +} + +namespace NeOS::PCI +{ + Device::Device(UShort bus, UShort device, UShort func, UInt32 bar) + : fBus(bus), fDevice(device), fFunction(func), fBar(bar) + { + } + + Device::~Device() = default; + + UInt Device::Read(UInt bar, Size sz) + { + // Ensure aligned access by masking to 4-byte boundary + NE_PCISetCfgTarget(bar & 0xFC, fBus, fDevice, fFunction); + + // Read 4 bytes and shift out the correct value + UInt data = HAL::rt_in32((UShort)PciConfigKind::ConfigData); + + if (sz == 4) + return data; + if (sz == 2) + return (data >> ((bar & 2) * 8)) & 0xFFFF; + if (sz == 1) + return (data >> ((bar & 3) * 8)) & 0xFF; + + return (UShort)PciConfigKind::Invalid; + } + + void Device::Write(UInt bar, UIntPtr data, Size sz) + { + NE_PCISetCfgTarget(bar & 0xFC, fBus, fDevice, fFunction); + + if (sz == 4) + HAL::rt_out32((UShort)PciConfigKind::ConfigData, (UInt)data); + else if (sz == 2) + { + UInt temp = HAL::rt_in32((UShort)PciConfigKind::ConfigData); + temp &= ~(0xFFFF << ((bar & 2) * 8)); + temp |= (data & 0xFFFF) << ((bar & 2) * 8); + HAL::rt_out32((UShort)PciConfigKind::ConfigData, temp); + } + else if (sz == 1) + { + UInt temp = HAL::rt_in32((UShort)PciConfigKind::ConfigData); + temp &= ~(0xFF << ((bar & 3) * 8)); + temp |= (data & 0xFF) << ((bar & 3) * 8); + HAL::rt_out32((UShort)PciConfigKind::ConfigData, temp); + } + } + + UShort Device::DeviceId() + { + return (UShort)(NE_PCIReadRaw(0x0, fBus, fDevice, fFunction) >> 16); + } + + UShort Device::VendorId() + { + return (UShort)(NE_PCIReadRaw(0x0, fBus, fDevice, fFunction) & 0xFFFF); + } + + UShort Device::InterfaceId() + { + return (UShort)(NE_PCIReadRaw(0x0, fBus, fDevice, fFunction) >> 16); + } + + UChar Device::Class() + { + return (UChar)(NE_PCIReadRaw(0x08, fBus, fDevice, fFunction) >> 24); + } + + UChar Device::Subclass() + { + return (UChar)(NE_PCIReadRaw(0x08, fBus, fDevice, fFunction) >> 16); + } + + UChar Device::ProgIf() + { + return (UChar)(NE_PCIReadRaw(0x08, fBus, fDevice, fFunction) >> 8); + } + + UChar Device::HeaderType() + { + return (UChar)(NE_PCIReadRaw(0xC, fBus, fDevice, fFunction) >> 16); + } + + void Device::EnableMmio(UInt32 bar_in) + { + UInt32 enable = Read(bar_in, sizeof(UInt32)); + enable |= (1 << 1); + + Write(bar_in, enable, sizeof(UInt32)); + } + + void Device::BecomeBusMaster(UInt32 bar_in) + { + UInt32 enable = Read(bar_in, sizeof(UInt32)); + enable |= (1 << 2); + + Write(bar_in, enable, sizeof(UInt32)); + } + + UIntPtr Device::Bar(UInt32 bar_in) + { + UInt32 bar = NE_PCIReadRaw(bar_in & ~0x03, fBus, fDevice, fFunction); + + if (bar & PCI_BAR_IO) + return static_cast(bar & ~0x03); + + if (bar & PCI_BAR_64) + { + UInt32 high = NE_PCIReadRaw((bar_in + 4) & ~0x03, fBus, fDevice, fFunction); + return (static_cast(high) << 32) | (bar & ~0x0F); + } + + return static_cast(bar & ~0x0F); + } + + UShort Device::Vendor() + { + UShort vendor = VendorId(); + + if (vendor != (UShort)PciConfigKind::Invalid) + fDevice = (UShort)Read(0x0, sizeof(UShort)); + + return fDevice; + } + + Device::operator bool() + { + return VendorId() != (UShort)PciConfigKind::Invalid; + } +} // namespace NeOS::PCI diff --git a/dev/kernel/HALKit/AMD64/PCI/Express.cc b/dev/kernel/HALKit/AMD64/PCI/Express.cc new file mode 100644 index 00000000..487cbd39 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/PCI/Express.cc @@ -0,0 +1,11 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +namespace NeOS +{ +} diff --git a/dev/kernel/HALKit/AMD64/PCI/IO.cc b/dev/kernel/HALKit/AMD64/PCI/IO.cc new file mode 100644 index 00000000..c20e1b0e --- /dev/null +++ b/dev/kernel/HALKit/AMD64/PCI/IO.cc @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include diff --git a/dev/kernel/HALKit/AMD64/PCI/Iterator.cc b/dev/kernel/HALKit/AMD64/PCI/Iterator.cc new file mode 100644 index 00000000..bf215fe2 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/PCI/Iterator.cc @@ -0,0 +1,39 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +namespace NeOS::PCI +{ + Iterator::Iterator(const Types::PciDeviceKind& type) + { + // probe devices. + for (int bus = 0; bus < NE_BUS_COUNT; ++bus) + { + for (int device = 0; device < NE_DEVICE_COUNT; ++device) + { + for (int function = 0; function < NE_FUNCTION_COUNT; ++function) + { + Device dev(bus, device, function, 0x00); + + if (dev.Class() == type) + { + fDevices[bus] = dev; + } + } + } + } + } + + Iterator::~Iterator() + { + } + + Ref Iterator::operator[](const Size& at) + { + return fDevices[at]; + } +} // namespace NeOS::PCI diff --git a/dev/kernel/HALKit/AMD64/PCI/PCI.cc b/dev/kernel/HALKit/AMD64/PCI/PCI.cc new file mode 100644 index 00000000..01f2c23b --- /dev/null +++ b/dev/kernel/HALKit/AMD64/PCI/PCI.cc @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include diff --git a/dev/kernel/HALKit/AMD64/Paging.h b/dev/kernel/HALKit/AMD64/Paging.h new file mode 100644 index 00000000..4e2ac1b1 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/Paging.h @@ -0,0 +1,99 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +/** --------------------------------------------------- + + * THIS FILE CONTAINS CODE FOR X86_64 PAGING. + +------------------------------------------------------- */ + +#include + +#ifndef kPageMax +#define kPageMax (0x200) +#endif //! kPageMax + +#ifndef kPageAlign +#define kPageAlign (0x08) +#endif //! kPageAlign + +#ifndef kPageSize +#define kPageSize (0x1000) +#endif // !kPageSize + +#ifndef kAlign +#define kAlign __BIGGEST_ALIGNMENT__ +#endif // !kAlign + +EXTERN_C void hal_flush_tlb(); +EXTERN_C void hal_invl_tlb(NeOS::VoidPtr addr); +EXTERN_C void hal_write_cr3(NeOS::VoidPtr cr3); +EXTERN_C void hal_write_cr0(NeOS::VoidPtr bit); + +EXTERN_C NeOS::VoidPtr hal_read_cr0(); // @brief CPU control register. +EXTERN_C NeOS::VoidPtr hal_read_cr2(); // @brief Fault address. +EXTERN_C NeOS::VoidPtr hal_read_cr3(); // @brief Page table. + +namespace NeOS::HAL +{ + /// @brief Final page entry (Not PML, PDPT) + struct PACKED NE_PTE final + { + UInt64 Present : 1; + UInt64 Wr : 1; + UInt64 User : 1; + UInt64 Wt : 1; + UInt64 Cache : 1; + UInt64 Accessed : 1; + UInt64 Dirty : 1; + UInt64 MemoryType : 1; + UInt64 Global : 1; + UInt64 Resvered1 : 3; + UInt64 PhysicalAddress : 36; + UInt64 Reserved2 : 10; + UInt64 ProtectionKey : 5; + UInt64 ExecDisable : 1; + }; + + namespace Detail + { + enum class ControlRegisterBits + { + ProtectedModeEnable = 0, + MonitorCoProcessor = 1, + Emulation = 2, + TaskSwitched = 3, + ExtensionType = 4, + NumericError = 5, + WriteProtect = 16, + AlignementMask = 18, + NotWriteThrough = 29, + CacheDisable = 30, + PageEnable = 31, + }; + + inline UInt8 control_register_cast(ControlRegisterBits reg) + { + return static_cast(reg); + } + } // namespace Detail + + struct NE_PDE final + { + NE_PTE* ALIGN(kPageAlign) fEntries[kPageMax]; + }; + + auto mm_alloc_bitmap(Boolean wr, Boolean user, SizeT size, Bool is_page) -> VoidPtr; + auto mm_free_bitmap(VoidPtr page_ptr) -> Bool; +} // namespace NeOS::HAL + +namespace NeOS +{ + typedef HAL::NE_PTE PTE; + typedef HAL::NE_PDE PDE; +} // namespace NeOS diff --git a/dev/kernel/HALKit/AMD64/Processor.h b/dev/kernel/HALKit/AMD64/Processor.h new file mode 100644 index 00000000..d223c320 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/Processor.h @@ -0,0 +1,326 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: Prcoessor.h + Purpose: AMD64 processor abstraction. + + Revision History: + + 30/01/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +#include +#include +#include +#include +#include + +#define kPITControlPort (0x43) +#define kPITChannel0Port (0x40) +#define kPITFrequency (1193180) + +#define kPICCommand (0x20) +#define kPICData (0x21) +#define kPIC2Command (0xA0) +#define kPIC2Data (0xA1) + +EXTERN_C +{ +#include +} + +#include + +/// @brief Maximum entries of the interrupt descriptor table. +#define kKernelIdtSize (0x100) + +/// @brief interrupt for system call. +#define kKernelInterruptId (0x32) + +#define IsActiveLow(FLG) (FLG & 2) +#define IsLevelTriggered(FLG) (FLG & 8) + +#define kInterruptGate (0x8E) +#define kTrapGate (0xEF) +#define kTaskGate (0b10001100) +#define kIDTSelector (0x08) + +namespace NeOS +{ + namespace Detail::AMD64 + { + struct PACKED InterruptDescriptorAMD64 final + { + UInt16 OffsetLow; // offset bits 0..15 + UInt16 Selector; // a code segment selector in GDT or LDT + UInt8 Ist; + UInt8 TypeAttributes; + UInt16 OffsetMid; + UInt32 OffsetHigh; + UInt32 Zero; // reserved + }; + } // namespace Detail::AMD64 +} // namespace NeOS + +namespace NeOS::HAL +{ + /// @brief Memory Manager mapping flags. + enum + { + kMMFlagsInvalid = 0 << 0, + kMMFlagsPresent = 1 << 0, + kMMFlagsWr = 1 << 1, + kMMFlagsUser = 1 << 2, + kMMFlagsNX = 1 << 3, + kMMFlagsCount = 4, + }; + + struct PACKED Register64 final + { + UShort Limit; + UIntPtr Base; + }; + + struct PACKED RegisterGDT final + { + UShort Limit; + UIntPtr Base; + }; + + using RawRegister = UInt64; + using Reg = RawRegister; + using InterruptId = UInt16; /* For each element in the IVT */ + + /// @brief Stack frame (as retrieved from assembly.) + struct PACKED StackFrame final + { + RawRegister R8{0}; + RawRegister R9{0}; + RawRegister R10{0}; + RawRegister FS{0}; + RawRegister R12{0}; + RawRegister R13{0}; + RawRegister R14{0}; + RawRegister R15{0}; + RawRegister GS{0}; + RawRegister SP{0}; + RawRegister BP{0}; + }; + + typedef StackFrame* StackFramePtr; + + class InterruptDescriptor final + { + public: + UShort Offset; + UShort Selector; + UChar Ist; + UChar Atrributes; + + UShort SecondOffset; + UInt ThirdOffset; + UInt Zero; + + operator bool() + { + return Offset != 0xFFFF; + } + }; + + using InterruptDescriptorArray = Array; + + class SegmentDescriptor final + { + public: + UInt16 Base; + UInt8 BaseMiddle; + UInt8 BaseHigh; + + UShort Limit; + UChar Gran; + UChar AccessByte; + }; + + /*** + * @brief Segment Boolean operations + */ + class SegmentDescriptorComparator final + { + public: + Bool IsValid(SegmentDescriptor& seg) + { + return seg.Base > seg.Limit; + } + + Bool Equals(SegmentDescriptor& seg, SegmentDescriptor& segRight) + { + return seg.Base == segRight.Base && seg.Limit == segRight.Limit; + } + }; + + using SegmentArray = Array; + + class GDTLoader final + { + public: + static Void Load(RegisterGDT& gdt); + static Void Load(Ref& gdt); + }; + + class IDTLoader final + { + public: + static Void Load(Register64& idt); + static Void Load(Ref& idt); + }; + + /***********************************************************************************/ + /// @brief Is the current config SMP aware? + /// @return True if YES, False if not. + /***********************************************************************************/ + + Bool mp_is_smp(Void) noexcept; + + /***********************************************************************************/ + /// @brief Fetch and enable SMP scheduler. + /// @param vendor_ptr SMP containing structure. + /***********************************************************************************/ + Void mp_get_cores(VoidPtr vendor_ptr) noexcept; + + /***********************************************************************************/ + /// @brief Do a cpuid to check if MSR exists on CPU. + /// @retval true it does exists. + /// @retval false it doesn't. + /***********************************************************************************/ + inline Bool hal_has_msr() noexcept + { + static UInt32 eax, unused, edx; // eax, edx + + __get_cpuid(1, &eax, &unused, &unused, &edx); + + // edx returns the flag for MSR (which is 1 shifted to 5.) + return edx & (1 << 5); + } + + UIntPtr hal_get_phys_address(VoidPtr virtual_address); + + /***********************************************************************************/ + /// @brief Get Model specific register inside core. + /// @param msr MSR + /// @param lo low byte + /// @param hi high byte + /***********************************************************************************/ + inline UInt32 hal_get_msr(UInt32 msr, UInt32* lo, UInt32* hi) noexcept + { + if (!lo || !hi) + return 0; + + asm volatile("rdmsr" + : "=a"(*lo), "=d"(*hi) + : "c"(msr)); + + return *lo + *hi; + } + + /// @brief Set Model-specific register. + /// @param msr MSR + /// @param lo low byte + /// @param hi high byte + inline Void hal_set_msr(UInt32 msr, UInt32 lo, UInt32 hi) noexcept + { + asm volatile("wrmsr" + : + : "a"(lo), "d"(hi), "c"(msr)); + } + + /// @brief Processor specific namespace. + namespace Detail + { + /* @brief TSS struct. */ + struct NE_TSS final + { + UInt32 fReserved1; + UInt64 fRsp0; + UInt64 fRsp1; + UInt64 fRsp2; + UInt64 fReserved2; + UInt64 fIst1; + UInt64 fIst2; + UInt64 fIst3; + UInt64 fIst4; + UInt64 fIst5; + UInt64 fIst6; + UInt64 fIst7; + UInt64 fReserved3; + UInt16 fReserved4; + UInt16 fIopb; + }; + + /** + @brief Global descriptor table entry, either null, code or data. + */ + + struct PACKED NE_GDT_ENTRY final + { + UInt16 fLimitLow; + UInt16 fBaseLow; + UInt8 fBaseMid; + UInt8 fAccessByte; + UInt8 fFlags; + UInt8 fBaseHigh; + }; + } // namespace Detail + + class APICController final + { + public: + explicit APICController(VoidPtr base); + ~APICController() = default; + + NE_COPY_DEFAULT(APICController); + + public: + UInt32 Read(UInt32 reg) noexcept; + Void Write(UInt32 reg, UInt32 value) noexcept; + + private: + VoidPtr fApic{nullptr}; + }; + + /// @brief Set a PTE from pd_base. + /// @param virt_addr a valid virtual address. + /// @param phys_addr point to physical address. + /// @param flags the flags to put on the page. + /// @return Status code of page manip. + EXTERN_C Int32 mm_map_page(VoidPtr virtual_address, VoidPtr physical_address, UInt32 flags); + + EXTERN_C UInt8 rt_in8(UInt16 port); + EXTERN_C UInt16 rt_in16(UInt16 port); + EXTERN_C UInt32 rt_in32(UInt16 port); + + EXTERN_C Void rt_out16(UShort port, UShort byte); + EXTERN_C Void rt_out8(UShort port, UChar byte); + EXTERN_C Void rt_out32(UShort port, UInt byte); + + EXTERN_C Void rt_wait_400ns(); + EXTERN_C Void rt_halt(); + EXTERN_C Void rt_cli(); + EXTERN_C Void rt_sti(); + EXTERN_C Void rt_cld(); + EXTERN_C Void rt_std(); +} // namespace NeOS::HAL + +EXTERN_C NeOS::Void idt_handle_generic(NeOS::UIntPtr rsp); +EXTERN_C NeOS::Void idt_handle_gpf(NeOS::UIntPtr rsp); +EXTERN_C NeOS::Void idt_handle_math(NeOS::UIntPtr rsp); +EXTERN_C NeOS::Void idt_handle_pf(NeOS::UIntPtr rsp); + +EXTERN_C ATTRIBUTE(naked) NeOS::Void hal_load_idt(NeOS::HAL::Register64 ptr); +EXTERN_C ATTRIBUTE(naked) NeOS::Void hal_load_gdt(NeOS::HAL::RegisterGDT ptr); + +inline NeOS::VoidPtr kKernelBitMpStart = nullptr; +inline NeOS::UIntPtr kKernelBitMpSize = 0UL; diff --git a/dev/kernel/HALKit/AMD64/ReadMe.md b/dev/kernel/HALKit/AMD64/ReadMe.md new file mode 100644 index 00000000..02c8c86f --- /dev/null +++ b/dev/kernel/HALKit/AMD64/ReadMe.md @@ -0,0 +1,8 @@ +# AMD64 Hardware Abstraction Layer + +## Brief + +- Supported CPU: AMD64 BASED CPUs. +- Supported Firmware: EDK 2. + +###### Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. All rights reserved. diff --git a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc new file mode 100644 index 00000000..002266de --- /dev/null +++ b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc @@ -0,0 +1,424 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal El Mahrouss Corporation, all rights reserved. + +------------------------------------------- */ + +/** + * @file AHCI.cc + * @author Amlal El Mahrouss (amlalelmahrouss@icloud.com) + * @brief AHCI driver. + * @version 0.1 + * @date 2024-02-02 + * + * @copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. + * + */ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include + +#define kHBAErrTaskFile (1 << 30) +#define kHBAPxCmdST (0x0001) +#define kHBAPxCmdFre (0x0010) +#define kHBAPxCmdFR (0x4000) +#define kHBAPxCmdCR (0x8000) + +#define kSATALBAMode (1 << 6) + +#define kSATASRBsy (0x80) +#define kSATASRDrq (0x08) + +#define kHBABohcBiosOwned (1 << 0) +#define kHBABohcOSOwned (1 << 1) + +#define kSATAPortCnt (0x20) + +#define kSATASig (0x00000101) +#define kSATAPISig (0xEB140101) + +#define kSATAProgIfAHCI (0x01) +#define kSATASubClass (0x06) +#define kSATABar5 (0x24) + +using namespace NeOS; + +STATIC PCI::Device kSATADev; +STATIC HbaMem* kSATAHba; +STATIC Lba kSATASectorCount = 0UL; +STATIC UInt16 kSATAIndex = 0U; +STATIC Char kCurrentDiskModel[50] = {"UNKNOWN AHCI DRIVE"}; +STATIC UInt16 kSATAPortsImplemented = 0U; + +template +STATIC Void drv_std_input_output(UInt64 lba, UInt8* buffer, SizeT sector_sz, SizeT size_buffer) noexcept; + +STATIC Int32 drv_find_cmd_slot(HbaPort* port) noexcept; + +STATIC Void drv_compute_disk_ahci() noexcept; + +STATIC Void drv_compute_disk_ahci() noexcept +{ + kSATASectorCount = 0UL; + + const UInt16 kSzIdent = kib_cast(1); + + UInt8 identify_data[kSzIdent] = {0}; + + rt_set_memory(identify_data, 0, kSzIdent); + + drv_std_input_output(0, identify_data, kAHCISectorSize, kSzIdent); + + kSATASectorCount = (identify_data[61] << 16) | identify_data[60]; + + kout << "Disk Model: " << kCurrentDiskModel << kendl; + kout << "Disk Size: " << number(drv_get_size()) << kendl; + kout << "Disk Sector Count: " << number(kSATASectorCount) << kendl; +} + +STATIC Int32 drv_find_cmd_slot(HbaPort* port) noexcept +{ + UInt32 slots = (port->Sact | port->Ci); + + for (Int32 i = 0; i < kSATAPortCnt; ++i) + { + if ((slots & 1) == 0) + return i; + + slots >>= 1; + } + + return ~0; +} + +template +STATIC Void drv_std_input_output(UInt64 lba, UInt8* buffer, SizeT sector_sz, SizeT size_buffer) noexcept +{ + UIntPtr slot = 0UL; + + slot = drv_find_cmd_slot(&kSATAHba->Ports[kSATAIndex]); + + if (slot == ~0) + return; + + volatile HbaCmdHeader* command_header = ((HbaCmdHeader*)(((UInt64)kSATAHba->Ports[kSATAIndex].Clb))); + + command_header += slot; + + MUST_PASS(command_header); + + command_header->Cfl = sizeof(FisRegH2D) / sizeof(UInt32); + command_header->Write = Write; + command_header->Prdtl = (UInt16)((size_buffer - 1) >> 4) + 1; + + HbaCmdTbl* command_table = (HbaCmdTbl*)((VoidPtr)((UInt64)command_header->Ctba)); + + rt_set_memory(command_table, 0, sizeof(HbaCmdTbl) + (command_header->Prdtl - 1) * sizeof(HbaPrdtEntry)); + + MUST_PASS(command_table); + + UIntPtr buffer_phys = HAL::hal_get_phys_address(buffer); + + UInt16 prd_i = 0; + + for (; prd_i < (command_header->Prdtl - 1); prd_i++) + { + command_table->Prdt[prd_i].Dbc = ((size_buffer / command_header->Prdtl - 1) - 1); + command_table->Prdt[prd_i].Dba = ((UInt32)(UInt64)buffer_phys + (prd_i * command_table->Prdt[prd_i].Dbc)); + command_table->Prdt[prd_i].Dbau = (((UInt64)(buffer_phys) >> 32) + (prd_i * command_table->Prdt[prd_i].Dbc)); + command_table->Prdt[prd_i].Ie = YES; + } + + command_table->Prdt[prd_i].Dba = ((UInt32)(UInt64)buffer_phys + (prd_i * command_table->Prdt[prd_i].Dbc)); + command_table->Prdt[prd_i].Dbau = (((UInt64)(buffer_phys) >> 32) + (prd_i * command_table->Prdt[prd_i].Dbc)); + command_table->Prdt[prd_i].Dbc = ((size_buffer / command_header->Prdtl - 1) - 1); + command_table->Prdt[prd_i].Ie = YES; + + FisRegH2D* h2d_fis = (FisRegH2D*)(&command_table->Cfis); + + h2d_fis->FisType = kFISTypeRegH2D; + h2d_fis->CmdOrCtrl = CommandOrCTRL; + h2d_fis->Command = Write ? kAHCICmdWriteDmaEx : kAHCICmdReadDmaEx; + + if (Identify) + h2d_fis->Command = kAHCICmdIdentify; + + h2d_fis->Lba0 = (lba)&0xFF; + h2d_fis->Lba1 = (lba >> 8) & 0xFF; + h2d_fis->Lba2 = (lba >> 16) & 0xFF; + + h2d_fis->Device = Identify ? 0U : kSATALBAMode; + + h2d_fis->Lba3 = (lba >> 24) & 0xFF; + h2d_fis->Lba4 = (lba >> 32) & 0xFF; + h2d_fis->Lba5 = (lba >> 40) & 0xFF; + + h2d_fis->CountLow = (size_buffer)&0xFF; + h2d_fis->CountHigh = (size_buffer >> 8) & 0xFF; + + while (kSATAHba->Ports[kSATAIndex].Tfd & (kSATASRBsy | kSATASRDrq)) + { + ; + } + + kSATAHba->Ports[kSATAIndex].Ci = (1 << slot); + + while (YES) + { + if (!(kSATAHba->Ports[kSATAIndex].Ci & (1 << slot))) + break; + + if (kSATAHba->Is & kHBAErrTaskFile) + { + err_global_get() = kErrorDiskIsCorrupted; + return; + } + } + + if (kSATAHba->Is & kHBAErrTaskFile) + { + err_global_get() = kErrorDiskIsCorrupted; + return; + } +} + +/*** + @brief Gets the number of sectors inside the drive. + @return Sector size in bytes. + */ +SizeT drv_get_sector_count_ahci() +{ + return kSATASectorCount; +} + +/// @brief Get the drive size. +/// @return Disk size in bytes. +SizeT drv_get_size_ahci() +{ + return drv_get_sector_count() * kAHCISectorSize; +} + +/// @brief Enable Host and probe using the IDENTIFY command. +STATIC Void ahci_enable_and_probe() +{ + if (kSATAHba->Bohc & kHBABohcBiosOwned) + { + kSATAHba->Bohc |= kHBABohcOSOwned; + + while (kSATAHba->Bohc & kHBABohcBiosOwned) + { + ; + } + } + + // Poll until ready. + while (kSATAHba->Ports[kSATAIndex].Cmd & kHBAPxCmdCR) + { + ; + } + + kSATAHba->Ports[kSATAIndex].Cmd |= kHBAPxCmdFre; + kSATAHba->Ports[kSATAIndex].Cmd |= kHBAPxCmdST; + + drv_compute_disk_ahci(); +} + +/// @brief Initializes an AHCI disk. +/// @param pi the amount of ports that have been detected. +/// @param atapi reference value, tells whether we should detect ATAPI instead of SATA. +/// @return if the disk was successfully initialized or not. +STATIC Bool drv_std_init_ahci(UInt16& pi, BOOL& atapi) +{ + PCI::Iterator iterator(Types::PciDeviceKind::MassStorageController); + + for (SizeT device_index = 0; device_index < NE_BUS_COUNT; ++device_index) + { + kSATADev = iterator[device_index].Leak(); // Leak device. + + if (kSATADev.Subclass() == kSATASubClass && + kSATADev.ProgIf() == kSATAProgIfAHCI) + { + HbaMem* mem_ahci = (HbaMem*)kSATADev.Bar(kSATABar5); + + kSATADev.EnableMmio((UIntPtr)mem_ahci); + kSATADev.BecomeBusMaster((UIntPtr)mem_ahci); + + UInt32 ports_implemented = mem_ahci->Pi; + UInt16 ahci_index = 0; + + pi = ports_implemented; + + const UInt16 kMaxPortsImplemented = kSATAPortCnt; + const UInt32 kSATASignature = kSATASig; + const UInt32 kSATAPISignature = kSATAPISig; + const UInt8 kSATAPresent = 0x03; + const UInt8 kSATAIPMActive = 0x01; + + kSATAHba = mem_ahci; + + while (ports_implemented) + { + UInt8 ipm = (mem_ahci->Ports[ahci_index].Ssts >> 8) & 0x0F; + UInt8 det = mem_ahci->Ports[ahci_index].Ssts & 0x0F; + + if (det != kSATAPresent || ipm != kSATAIPMActive) + continue; + + if (mem_ahci->Ports[ahci_index].Sig == kSATASignature) + { + kout << "Detect: /dev/sat" << number(ahci_index) << kendl; + + kSATAIndex = ahci_index; + kSATAHba = mem_ahci; + + ahci_enable_and_probe(); + + break; + } + else if (atapi && kSATAPISignature == mem_ahci->Ports[ahci_index].Sig) + { + kout << "Detect: /dev/atp" << number(ahci_index) << kendl; + + kSATAIndex = ahci_index; + kSATAHba = mem_ahci; + + ahci_enable_and_probe(); + + break; + } + + ports_implemented >>= 1; + ++ahci_index; + } + + return YES; + } + } + + return NO; +} + +Bool drv_std_detected_ahci() +{ + return kSATADev.DeviceId() != (UShort)PCI::PciConfigKind::Invalid && kSATADev.Bar(kSATABar5) != 0; +} + +namespace NeOS +{ + UInt16 sk_init_ahci_device(BOOL atapi) + { + UInt16 pi = 0; + return drv_std_init_ahci(pi, atapi); + + kSATAPortsImplemented = pi; + + return pi; + } + + namespace Detail + { + /// @brief Read AHCI device. + /// @param self device + /// @param mnt mounted disk. + STATIC Void sk_io_read_ahci(IDeviceObject* self, MountpointInterface* mnt) + { + AHCIDeviceInterface* dev = (AHCIDeviceInterface*)self; + + if (!dev) + return; + + auto disk = mnt->GetAddressOf(dev->GetIndex()); + + if (!disk) + return; + + drv_std_input_output(disk->fPacket.fPacketLba, (UInt8*)disk->fPacket.fPacketContent, kAHCISectorSize, disk->fPacket.fPacketSize); + } + + /// @brief Write AHCI device. + /// @param self device + /// @param mnt mounted disk. + STATIC Void sk_io_write_ahci(IDeviceObject* self, MountpointInterface* mnt) + { + AHCIDeviceInterface* dev = (AHCIDeviceInterface*)self; + + if (!dev) + return; + + auto disk = mnt->GetAddressOf(dev->GetIndex()); + + if (!disk) + return; + + drv_std_input_output(disk->fPacket.fPacketLba, (UInt8*)disk->fPacket.fPacketContent, kAHCISectorSize, disk->fPacket.fPacketSize); + } + } // namespace Detail + + ErrorOr sk_acquire_ahci_device(Int32 drv_index) + { + if (!drv_std_detected_ahci()) + return ErrorOr(kErrorDisk); + + AHCIDeviceInterface device(Detail::sk_io_read_ahci, + Detail::sk_io_write_ahci, + nullptr); + + device.SetPortsImplemented(kSATAPortsImplemented); + device.SetIndex(drv_index); + + return ErrorOr(device); + } +} // namespace NeOS + +#ifdef __AHCI__ + +Void drv_std_write(UInt64 lba, Char* buffer, SizeT sector_sz, SizeT size_buffer) +{ + drv_std_input_output(lba, (UInt8*)buffer, sector_sz, size_buffer); +} + +Void drv_std_read(UInt64 lba, Char* buffer, SizeT sector_sz, SizeT size_buffer) +{ + drv_std_input_output(lba, (UInt8*)buffer, sector_sz, size_buffer); +} + +Bool drv_std_init(UInt16& pi) +{ + BOOL atapi = NO; + return drv_std_init_ahci(pi, atapi); +} + +Bool drv_std_detected(Void) +{ + return drv_std_detected_ahci(); +} + +/*** + @brief Gets the number of sectors inside the drive. + @return Sector size in bytes. + */ +SizeT drv_get_sector_count() +{ + return drv_get_sector_count_ahci(); +} + +/// @brief Get the drive size. +/// @return Disk size in bytes. +SizeT drv_get_size() +{ + return drv_get_size_ahci(); +} + +#endif // ifdef __AHCI__ diff --git a/dev/kernel/HALKit/AMD64/Storage/DMA+Generic.cc b/dev/kernel/HALKit/AMD64/Storage/DMA+Generic.cc new file mode 100644 index 00000000..e025d24d --- /dev/null +++ b/dev/kernel/HALKit/AMD64/Storage/DMA+Generic.cc @@ -0,0 +1,253 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +/** + * @file ATA-PIO.cc + * @author Amlal EL Mahrouss (amlalelmahrouss@icloud.com) + * @brief ATA driver (PIO mode). + * @version 0.1 + * @date 2024-02-02 + * + * @copyright Copyright (c) Amlal EL Mahrouss + * + */ + +#include +#include +#include + +#if defined(__ATA_DMA__) + +#define kATADataLen (256) + +using namespace NeOS; +using namespace NeOS::HAL; + +/// BUGS: 0 + +STATIC Boolean kATADetected = false; +STATIC Int32 kATADeviceType = kATADeviceCount; +STATIC Char kATAData[kATADataLen] = {0}; +STATIC NeOS::PCI::Device kATADevice; +STATIC Char kCurrentDiskModel[50] = {"UNKNOWN DMA DRIVE"}; + +Boolean drv_std_wait_io(UInt16 IO) +{ + for (int i = 0; i < 400; i++) + rt_in8(IO + ATA_REG_STATUS); + +ATAWaitForIO_Retry: + auto status_rdy = rt_in8(IO + ATA_REG_STATUS); + + if ((status_rdy & ATA_SR_BSY)) + goto ATAWaitForIO_Retry; + +ATAWaitForIO_Retry2: + status_rdy = rt_in8(IO + ATA_REG_STATUS); + + if (status_rdy & ATA_SR_ERR) + return false; + + if (!(status_rdy & ATA_SR_DRDY)) + goto ATAWaitForIO_Retry2; + + return true; +} + +Void drv_std_select(UInt16 Bus) +{ + if (Bus == ATA_PRIMARY_IO) + rt_out8(Bus + ATA_REG_HDDEVSEL, ATA_PRIMARY_SEL); + else + rt_out8(Bus + ATA_REG_HDDEVSEL, ATA_SECONDARY_SEL); +} + +Boolean drv_std_init(UInt16 Bus, UInt8 Drive, UInt16& OutBus, UInt8& OutMaster) +{ + PCI::Iterator iterator(Types::PciDeviceKind::MassStorageController); + + for (SizeT device_index = 0; device_index < NE_BUS_COUNT; ++device_index) + { + kATADevice = iterator[device_index].Leak(); // And then leak the reference. + + // if SATA and then interface is AHCI... + if (kATADevice.Subclass() == 0x01) + { + UInt16 IO = Bus; + + drv_std_select(IO); + + // Bus init, NEIN bit. + rt_out8(IO + ATA_REG_NEIN, 1); + + // identify until it's good. + ATAInit_Retry: + auto status_rdy = rt_in8(IO + ATA_REG_STATUS); + + if (status_rdy & ATA_SR_ERR) + { + return false; + } + + if ((status_rdy & ATA_SR_BSY)) + goto ATAInit_Retry; + + rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_IDENTIFY); + + /// fetch serial info + /// model, speed, number of sectors... + + drv_std_wait_io(IO); + + for (SizeT i = 0ul; i < kATADataLen; ++i) + { + drv_std_wait_io(IO); + kATAData[i] = NeOS::HAL::rt_in16(IO + ATA_REG_DATA); + drv_std_wait_io(IO); + } + + for (SizeT i = 0; i < 40; i += 2) + { + kCurrentDiskModel[i * 2] = kATAData[27 + i * 2] >> 8; + kCurrentDiskModel[i * 2 + 1] = kATAData[27 + i * 2] & 0xFF; + } + + kCurrentDiskModel[40] = '\0'; + + kout << "Drive Model: " << kCurrentDiskModel << kendl; + + OutBus = (Bus == ATA_PRIMARY_IO) ? ATA_PRIMARY_IO : ATA_SECONDARY_IO; + OutMaster = (Bus == ATA_PRIMARY_IO) ? ATA_MASTER : ATA_SLAVE; + + return YES; + } + } + + ke_panic(RUNTIME_CHECK_BOOTSTRAP, "Invalid ATA DMA driver, not detected"); + + return NO; +} + +namespace Detail +{ + using namespace NeOS; + + struct PRDEntry + { + UInt32 mAddress; + UInt16 mByteCount; + UInt16 mFlags; + }; +} // namespace Detail + +static UIntPtr kReadAddr = mib_cast(2); +static UIntPtr kWriteAddr = mib_cast(4); + +Void drv_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz, SizeT Size) +{ + Lba /= SectorSz; + + if (Size > kib_cast(64)) + ke_panic(RUNTIME_CHECK_FAILED, "ATA-DMA only supports < 64kb DMA transfers."); + + UInt8 Command = ((!Master) ? 0xE0 : 0xF0); + + rt_copy_memory((VoidPtr)Buf, (VoidPtr)kReadAddr, Size); + + drv_std_select(IO); + + rt_out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F)); + + rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz - 1) / SectorSz)); + + rt_out8(IO + ATA_REG_LBA0, (Lba)&0xFF); + rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); + rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); + rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); + + Detail::PRDEntry* prd = (Detail::PRDEntry*)(kATADevice.Bar(0x20) + 4); // The PRDEntry is not correct. + + prd->mAddress = (UInt32)(UIntPtr)kReadAddr; + prd->mByteCount = Size - 1; + prd->mFlags = 0x8000; // indicate the end of prd. + + rt_out32(kATADevice.Bar(0x20) + 0x04, (UInt32)(UIntPtr)prd); + + rt_out8(kATADevice.Bar(0x20) + ATA_REG_COMMAND, ATA_CMD_READ_DMA); + + rt_out8(kATADevice.Bar(0x20) + 0x00, 0x09); // Start DMA engine + + while (rt_in8(kATADevice.Bar(0x20) + ATA_REG_STATUS) & 0x01) + ; + + rt_out8(kATADevice.Bar(0x20) + 0x00, 0x00); // Stop DMA engine + + rt_copy_memory((VoidPtr)kReadAddr, (VoidPtr)Buf, Size); + + delete prd; + prd = nullptr; +} + +Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz, SizeT Size) +{ + Lba /= SectorSz; + + if (Size > kib_cast(64)) + ke_panic(RUNTIME_CHECK_FAILED, "ATA-DMA only supports < 64kb DMA transfers."); + + UInt8 Command = ((!Master) ? 0xE0 : 0xF0); + + rt_copy_memory((VoidPtr)Buf, (VoidPtr)kWriteAddr, Size); + + rt_out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F)); + + rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + (SectorSz - 1)) / SectorSz)); + + rt_out8(IO + ATA_REG_LBA0, (Lba)&0xFF); + rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); + rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); + rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); + + Detail::PRDEntry* prd = (Detail::PRDEntry*)(kATADevice.Bar(0x20) + 4); + prd->mAddress = (UInt32)(UIntPtr)kWriteAddr; + prd->mByteCount = Size - 1; + prd->mFlags = 0x8000; + + rt_out32(kATADevice.Bar(0x20) + 0x04, (UInt32)(UIntPtr)prd); + rt_out8(kATADevice.Bar(0x20) + ATA_REG_COMMAND, ATA_CMD_WRITE_DMA); + + rt_out8(IO + 0x00, 0x09); // Start DMA engine + + while (rt_in8(kATADevice.Bar(0x20) + ATA_REG_STATUS) & 0x01) + ; + + rt_out8(kATADevice.Bar(0x20) + 0x00, 0x00); // Stop DMA engine + + delete prd; + prd = nullptr; +} + +/// @brief is ATA detected? +Boolean drv_std_detected(Void) +{ + return kATADetected; +} + +/*** + @brief Getter, gets the number of sectors inside the drive. +*/ +NeOS::SizeT drv_get_sector_count() +{ + return (kATAData[61] << 16) | kATAData[60]; +} + +/// @brief Get the drive size. +NeOS::SizeT drv_get_size() +{ + return (drv_get_sector_count()) * kATASectorSize; +} + +#endif /* ifdef __ATA_DMA__ */ diff --git a/dev/kernel/HALKit/AMD64/Storage/PIO+Generic.cc b/dev/kernel/HALKit/AMD64/Storage/PIO+Generic.cc new file mode 100644 index 00000000..cb629478 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/Storage/PIO+Generic.cc @@ -0,0 +1,191 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +/** + * @file PIO.cc + * @author Amlal EL Mahrouss (amlalelmahrouss@icloud.com) + * @brief ATA driver (PIO mode). + * @version 0.1 + * @date 2024-02-02 + * + * @copyright Copyright (c) Amlal EL Mahrouss + * + */ + +#include +#include + +#ifdef __ATA_PIO__ + +using namespace NeOS; +using namespace NeOS::HAL; + +/// BUGS: 0 + +#define kATADataLen 512 + +STATIC Boolean kATADetected = false; +STATIC Int32 kATADeviceType = kATADeviceCount; +STATIC Char kATAData[kATADataLen] = {0}; +STATIC Char kCurrentDiskModel[50] = {"UNKNOWN PIO DRIVE"}; + +Boolean drv_std_wait_io(UInt16 IO) +{ + for (int i = 0; i < 400; i++) + rt_in8(IO + ATA_REG_STATUS); + +ATAWaitForIO_Retry: + auto stat_rdy = rt_in8(IO + ATA_REG_STATUS); + + if ((stat_rdy & ATA_SR_BSY)) + goto ATAWaitForIO_Retry; + +ATAWaitForIO_Retry2: + stat_rdy = rt_in8(IO + ATA_REG_STATUS); + + if (stat_rdy & ATA_SR_ERR) + return false; + + if (!(stat_rdy & ATA_SR_DRDY)) + goto ATAWaitForIO_Retry2; + + return true; +} + +Void drv_std_select(UInt16 Bus) +{ + if (Bus == ATA_PRIMARY_IO) + rt_out8(Bus + ATA_REG_HDDEVSEL, ATA_PRIMARY_SEL); + else + rt_out8(Bus + ATA_REG_HDDEVSEL, ATA_SECONDARY_SEL); +} + +Boolean drv_std_init(UInt16 Bus, UInt8 Drive, UInt16& OutBus, UInt8& OutMaster) +{ + UInt16 IO = Bus; + + drv_std_select(IO); + + // Bus init, NEIN bit. + rt_out8(IO + ATA_REG_NEIN, 1); + + // identify until it's good. +ATAInit_Retry: + auto stat_rdy = rt_in8(IO + ATA_REG_STATUS); + + if (stat_rdy & ATA_SR_ERR) + { + return false; + } + + if ((stat_rdy & ATA_SR_BSY)) + goto ATAInit_Retry; + + OutBus = (Bus == ATA_PRIMARY_IO) ? ATA_PRIMARY_IO : ATA_SECONDARY_IO; + OutMaster = (Bus == ATA_PRIMARY_IO) ? ATA_MASTER : ATA_SLAVE; + + rt_out8(OutBus + ATA_REG_COMMAND, ATA_CMD_IDENTIFY); + + drv_std_wait_io(IO); + + /// fetch serial info + /// model, speed, number of sectors... + + for (SizeT i = 0ul; i < kATADataLen; ++i) + { + kATAData[i] = HAL::rt_in16(OutBus + ATA_REG_DATA); + } + + for (Int32 i = 0; i < 20; i++) + { + kCurrentDiskModel[i * 2] = kATAData[27 + i] >> 8; + kCurrentDiskModel[i * 2 + 1] = kATAData[27 + i + 1] & 0xFF; + } + + kCurrentDiskModel[40] = '\0'; + + kout << "Detect: /dev/ata0" << kendl; + + kout << "Drive Model: " << kCurrentDiskModel << kendl; + + return true; +} + +Void drv_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz, SizeT Size) +{ + Lba /= SectorSz; + + UInt8 Command = ((!Master) ? 0xE0 : 0xF0); + + drv_std_wait_io(IO); + drv_std_select(IO); + + rt_out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F)); + + rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz) / SectorSz)); + + rt_out8(IO + ATA_REG_LBA0, (Lba)&0xFF); + rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); + rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); + rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); + + rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_READ_PIO); + + for (SizeT IndexOff = 0; IndexOff < Size; ++IndexOff) + { + drv_std_wait_io(IO); + Buf[IndexOff] = HAL::rt_in16(IO + ATA_REG_DATA); + } +} + +Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz, SizeT Size) +{ + Lba /= SectorSz; + + UInt8 Command = ((!Master) ? 0xE0 : 0xF0); + + drv_std_wait_io(IO); + drv_std_select(IO); + + rt_out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F)); + + rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + (SectorSz)) / SectorSz)); + + rt_out8(IO + ATA_REG_LBA0, (Lba)&0xFF); + rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); + rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); + rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); + + rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_WRITE_PIO); + + for (SizeT IndexOff = 0; IndexOff < Size; ++IndexOff) + { + drv_std_wait_io(IO); + rt_out16(IO + ATA_REG_DATA, Buf[IndexOff]); + } +} + +/// @brief is ATA detected? +Boolean drv_std_detected(Void) +{ + return kATADetected; +} + +/*** + @brief Getter, gets the number of sectors inside the drive. + */ +SizeT drv_get_sector_count() +{ + return (kATAData[61] << 16) | kATAData[60]; +} + +/// @brief Get the drive size. +SizeT drv_get_size() +{ + return (drv_get_sector_count()) * kATASectorSize; +} + +#endif /* ifdef __ATA_PIO__ */ \ No newline at end of file diff --git a/dev/kernel/HALKit/AMD64/make_ap_blob.sh b/dev/kernel/HALKit/AMD64/make_ap_blob.sh new file mode 100755 index 00000000..3f079187 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/make_ap_blob.sh @@ -0,0 +1,3 @@ +# !/bin/sh + +nasm -f bin HalApplicationProcessorStartup.asm -o HalApplicationProcessorStartup.bin \ No newline at end of file diff --git a/dev/kernel/HALKit/ARM64/APM/APM+IO.cc b/dev/kernel/HALKit/ARM64/APM/APM+IO.cc new file mode 100644 index 00000000..752f29f9 --- /dev/null +++ b/dev/kernel/HALKit/ARM64/APM/APM+IO.cc @@ -0,0 +1,37 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +using namespace NeOS; + +/// @brief Send APM command to it's space. +/// @param base_dma the IO base port. +/// @param cmd the command. +/// @return status code. +EXTERN_C Int32 apm_send_io_command(UInt16 cmd, APMPowerCmd value) +{ + switch (cmd) + { + case kAPMPowerCommandReboot: { + asm volatile( + "ldr x0, =0x84000004\n" + "svc #0\n"); + + return kErrorSuccess; + } + case kAPMPowerCommandShutdown: { + asm volatile( + "ldr x0, =0x84000008\n" + "svc #0\n"); + + return kErrorSuccess; + } + default: + return kErrorInvalidData; + } +} diff --git a/dev/kernel/HALKit/ARM64/ApplicationProcessor.h b/dev/kernel/HALKit/ARM64/ApplicationProcessor.h new file mode 100644 index 00000000..d263f9b8 --- /dev/null +++ b/dev/kernel/HALKit/ARM64/ApplicationProcessor.h @@ -0,0 +1,19 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include + +/************************************************** */ +/* INITIALIZE THE GIC ON CPU. */ +/************************************************** */ + +namespace NeOS +{ + BOOL mp_initialize_gic(NeOS::Void); +} \ No newline at end of file diff --git a/dev/kernel/HALKit/ARM64/HalACPIFactoryInterface.cc b/dev/kernel/HALKit/ARM64/HalACPIFactoryInterface.cc new file mode 100644 index 00000000..a25112ae --- /dev/null +++ b/dev/kernel/HALKit/ARM64/HalACPIFactoryInterface.cc @@ -0,0 +1,32 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include +#include + +namespace NeOS +{ + ACPIFactoryInterface::ACPIFactoryInterface(VoidPtr rsp_ptr) + : fRsdp(rsp_ptr), fEntries(0) + { + } + + BOOL ACPIFactoryInterface::Shutdown() + { + apm_send_io_command(kAPMPowerCommandShutdown, 0); + return NO; + } + + /// @brief Reboot machine in either ACPI or by triple faulting. + /// @return nothing it's a reboot. + Void ACPIFactoryInterface::Reboot() + { + apm_send_io_command(kAPMPowerCommandReboot, 0); + } +} // namespace NeOS diff --git a/dev/kernel/HALKit/ARM64/HalApplicationProcessor.cc b/dev/kernel/HALKit/ARM64/HalApplicationProcessor.cc new file mode 100644 index 00000000..660af502 --- /dev/null +++ b/dev/kernel/HALKit/ARM64/HalApplicationProcessor.cc @@ -0,0 +1,145 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include + +#define GICD_BASE 0x08000000 // Distributor base address +#define GICC_BASE 0x08010000 // CPU interface base address + +#define GICD_CTLR 0x000 // Distributor Control Register +#define GICD_ISENABLER 0x100 // Interrupt Set-Enable Registers +#define GICD_ICENABLER 0x180 // Interrupt Clear-Enable Registers +#define GICD_ISPENDR 0x200 // Interrupt Set-Pending Registers +#define GICD_ICPENDR 0x280 // Interrupt Clear-Pending Registers +#define GICD_IPRIORITYR 0x400 // Interrupt Priority Registers +#define GICD_ITARGETSR 0x800 // Interrupt Processor Targets Registers +#define GICD_ICFGR 0xC00 // Interrupt Configuration Registers + +#define GICC_CTLR 0x000 // CPU Interface Control Register +#define GICC_PMR 0x004 // Interrupt Priority Mask Register +#define GICC_IAR 0x00C // Interrupt Acknowledge Register +#define GICC_EOIR 0x010 // End of Interrupt Register + +// ================================================================= // + +namespace NeOS +{ + struct PROCESS_CONTROL_BLOCK final + { + HAL::StackFramePtr mFrame; + }; + + STATIC PROCESS_CONTROL_BLOCK kProcessBlocks[kSchedProcessLimitPerTeam] = {0}; + + namespace Detail + { + STATIC BOOL kGICEnabled = NO; + + STATIC void mp_hang_fn(void) + { + while (YES) + ; + + dbg_break_point(); + } + + Void mp_setup_gic_el0(Void) + { + // enable distributor. + ke_dma_write(GICD_BASE, GICD_CTLR, YES); + + UInt32 gicc_ctlr = ke_dma_read(GICC_BASE, GICC_CTLR); + + const auto kEnableSignalInt = YES; + + gicc_ctlr |= kEnableSignalInt; // Enable signaling of interrupts + gicc_ctlr |= (kEnableSignalInt << 1); // Allow Group 1 interrupts in EL0 + + ke_dma_write(GICC_BASE, GICC_CTLR, gicc_ctlr); + + // Set priority mask (accept all priorities) + ke_dma_write(GICC_BASE, GICC_PMR, 0xFF); + + UInt32 icfgr = ke_dma_read(GICD_BASE, GICD_ICFGR + (0x20 / 0x10) * 4); + + icfgr |= (0x2 << ((32 % 16) * 2)); // Edge-triggered + ke_dma_write(GICD_BASE, GICD_ICFGR + (0x20 / 0x10) * 4, icfgr); + + // Target interrupt 32 to CPU 1 + ke_dma_write(GICD_BASE, GICD_ITARGETSR + (0x20 / 0x04) * 4, 0x2 << ((32 % 4) * 8)); + + // Set interrupt 32 priority to lowest (0xFF) + ke_dma_write(GICD_BASE, GICD_IPRIORITYR + (0x20 / 0x04) * 4, 0xFF << ((32 % 4) * 8)); + + // Enable interrupt 32 for AP. + ke_dma_write(GICD_BASE, GICD_ISENABLER + 4, 0x01); + } + + BOOL mp_handle_gic_interrupt_el0(Void) + { + // Read the interrupt ID + UInt32 interrupt_id = ke_dma_read(GICC_BASE, GICC_IAR); + + // Check if it's a valid interrupt (not spurious) + if ((interrupt_id & 0x3FF) < 1020) + { + auto interrupt = interrupt_id & 0x3FF; + + const UInt16 kInterruptScheduler = 0x20; + + kout << "Handling interrupt for AP: " << interrupt << kendl; + + switch (interrupt) + { + case kInterruptScheduler: { + ke_dma_write(GICC_BASE, GICC_EOIR, interrupt_id); + UserProcessHelper::StartScheduling(); + break; + } + default: { + ke_dma_write(GICC_BASE, GICC_EOIR, interrupt_id); + break; + } + } + + return YES; + } + + // spurious interrupt + return NO; + } + } // namespace Detail + + EXTERN_C HAL::StackFramePtr mp_get_current_context(ProcessID pid) + { + return kProcessBlocks[pid % kSchedProcessLimitPerTeam].mFrame; + } + + EXTERN_C Bool mp_register_process(HAL::StackFramePtr stack_frame, ProcessID pid) + { + MUST_PASS(stack_frame); + + const auto process_index = pid % kSchedProcessLimitPerTeam; + + kProcessBlocks[process_index].mFrame = stack_frame; + + return YES; + } + + BOOL mp_initialize_gic(Void) + { + if (!Detail::kGICEnabled) + { + Detail::kGICEnabled = YES; + Detail::mp_setup_gic_el0(); + } + + return Detail::kGICEnabled; + } +} // namespace NeOS \ No newline at end of file diff --git a/dev/kernel/HALKit/ARM64/HalDebugOutput.cc b/dev/kernel/HALKit/ARM64/HalDebugOutput.cc new file mode 100644 index 00000000..8d54739f --- /dev/null +++ b/dev/kernel/HALKit/ARM64/HalDebugOutput.cc @@ -0,0 +1,83 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include + +namespace NeOS +{ + EXTERN_C void ke_io_write(IDeviceObject* self, const Char* bytes) + { +#ifdef __DEBUG__ + if (*bytes == 0) + return; + + SizeT index = 0; + SizeT len = 0; + + index = 0; + len = rt_string_len(bytes, 256U); + + volatile UInt8* uart_ptr = (UInt8*)0x09000000; + + while (index < len) + { + if (bytes[index] == '\r') + *uart_ptr = '\r'; + + *uart_ptr = bytes[index] == '\r' ? '\n' : bytes[index]; + ++index; + } +#endif // __DEBUG__ + } + + TerminalDevice::~TerminalDevice() = default; + + EXTERN_C void ke_io_read(IDeviceObject* self, const Char* bytes) + { +#ifdef __DEBUG__ + SizeT index = 0; + + volatile UInt8* uart_ptr = (UInt8*)0x09000000; + + ///! TODO: Look on how to wait for the UART to complete. + while (Yes) + { + auto in = *uart_ptr; + + ///! If enter pressed then break. + if (in == 0xD) + { + break; + } + + if (in < '0' || in < 'A' || in < 'a') + { + if (in != '@' || in != '!' || in != '?' || in != '.' || in != '/' || + in != ':') + { + continue; + } + } + + ((char*)bytes)[index] = in; + + ++index; + } + + ((char*)bytes)[index] = 0; +#endif // __DEBUG__ + } + + TerminalDevice TerminalDevice::The() noexcept + { + TerminalDevice out(NeOS::ke_io_write, NeOS::ke_io_read); + return out; + } + +} // namespace NeOS diff --git a/dev/kernel/HALKit/ARM64/HalFlushTLB.S b/dev/kernel/HALKit/ARM64/HalFlushTLB.S new file mode 100644 index 00000000..8fcf40ff --- /dev/null +++ b/dev/kernel/HALKit/ARM64/HalFlushTLB.S @@ -0,0 +1,5 @@ +.text + +hal_flush_tlb: + tlbi + ret diff --git a/dev/kernel/HALKit/ARM64/HalKernelMain.cc b/dev/kernel/HALKit/ARM64/HalKernelMain.cc new file mode 100644 index 00000000..55caca94 --- /dev/null +++ b/dev/kernel/HALKit/ARM64/HalKernelMain.cc @@ -0,0 +1,54 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +EXTERN_C void hal_init_platform( + NeOS::HEL::BootInfoHeader* handover_hdr) +{ + + /************************************************** */ + /* INITIALIZE AND VALIDATE HEADER. */ + /************************************************** */ + + kHandoverHeader = handover_hdr; + + if (kHandoverHeader->f_Magic != kHandoverMagic && + kHandoverHeader->f_Version != kHandoverVersion) + { + return; + } + + /************************************** */ + /* INITIALIZE BIT MAP. */ + /************************************** */ + + kKernelBitMpSize = kHandoverHeader->f_BitMapSize; + kKernelBitMpStart = reinterpret_cast( + reinterpret_cast(kHandoverHeader->f_BitMapStart)); + + /// @note do initialize the interrupts after it. + + NeOS::mp_initialize_gic(); + + while (YES) + { + } +} diff --git a/dev/kernel/HALKit/ARM64/HalKernelPanic.cc b/dev/kernel/HALKit/ARM64/HalKernelPanic.cc new file mode 100644 index 00000000..5037f440 --- /dev/null +++ b/dev/kernel/HALKit/ARM64/HalKernelPanic.cc @@ -0,0 +1,80 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Each error code is attributed with an ID, which will prompt a string onto the + * screen. Wait for debugger... */ + +namespace NeOS +{ + /// @brief Dumping factory class. + class RecoveryFactory final + { + public: + STATIC Void Recover() noexcept; + }; + + /***********************************************************************************/ + /// @brief Stops execution of the kernel. + /// @param id kernel stop ID. + /***********************************************************************************/ + Void ke_panic(const NeOS::Int32& id, const Char* message) + { + fb_init(); + + auto panic_text = RGB(0xff, 0xff, 0xff); + + auto y = 10; + auto x = 10; + + Char* message_apicid = new Char[128]; + rt_set_memory(message_apicid, 0, 128); + + rt_copy_memory((VoidPtr) "panic id: ", message_apicid, rt_string_len("panic id: ")); + rt_to_string(message_apicid + rt_string_len("panic id: "), (UIntPtr)id, 10); + + fb_render_string(message_apicid, y, x, panic_text); + + y += 10; + + fb_render_string((message ? message : "message: panic raised, going nowhere after this!"), y, x, panic_text); + + y += 10; + + fb_clear(); + + RecoveryFactory::Recover(); + } + + Void RecoveryFactory::Recover() noexcept + { + while (YES) + { + HAL::rt_halt(); + } + } + + void ke_runtime_check(bool expr, const Char* file, const Char* line) + { + if (!expr) + { + kout << "FAILED: FILE: " << file << kendl; + kout << "FAILED: LINE: " << line << kendl; + + ke_panic(RUNTIME_CHECK_FAILED, file); // Runtime Check failed + } + } +} // namespace NeOS diff --git a/dev/kernel/HALKit/ARM64/HalPagingMgrARM64.cc b/dev/kernel/HALKit/ARM64/HalPagingMgrARM64.cc new file mode 100644 index 00000000..4ec45b51 --- /dev/null +++ b/dev/kernel/HALKit/ARM64/HalPagingMgrARM64.cc @@ -0,0 +1,86 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: HalPagingMgr.cc + Purpose: Platform Paging Manager. + +------------------------------------------- */ + +#include +#include + +namespace NeOS::HAL +{ + typedef UInt32 PageTableIndex; + + /// \brief Page store type. + struct NE_PAGE_STORE final + { + struct + { + PDE* fPde{nullptr}; + PTE* fPte{nullptr}; + VoidPtr fVAddr{nullptr}; + } fInternalStore; + + Bool fStoreOp{No}; // Store operation in progress. + + static NE_PAGE_STORE& The() + { + static NE_PAGE_STORE the; + return the; + } + }; + + /// \brief Retrieve the page status of a PTE. + STATIC Void mmi_page_status(PTE* pte) + { + } + + STATIC Int32 mmi_map_page_table_entry(VoidPtr virtual_address, UInt32 flags, PTE* pt_entry); + + /// @brief Maps or allocates a page from virtual_address. + /// @param virtual_address a valid virtual address. + /// @param phys_addr point to physical address. + /// @param flags the flags to put on the page. + /// @return Status code of page manipulation process. + EXTERN_C Int32 mm_map_page(VoidPtr virtual_address, VoidPtr physical_address, UInt32 flags) + { + if (!virtual_address || + !flags) + return 0; + + NE_PAGE_STORE& page_store = NE_PAGE_STORE::The(); + + while (page_store.fStoreOp) + ; + + page_store.fStoreOp = Yes; + + if (page_store.fInternalStore.fVAddr == virtual_address) + { + page_store.fStoreOp = No; + return mmi_map_page_table_entry(page_store.fInternalStore.fVAddr, flags, page_store.fInternalStore.fPte); + } + + return 1; + } + + /// @brief Maps flags for a specific pte. + /// @internal Internal function. + STATIC Int32 mmi_map_page_table_entry(VoidPtr virtual_address, UInt32 flags, PTE* pt_entry) + { + NE_PAGE_STORE& page_store = NE_PAGE_STORE::The(); + + // Update internal store. + + page_store.fInternalStore.fPde = nullptr; + page_store.fInternalStore.fPte = pt_entry; + page_store.fInternalStore.fVAddr = virtual_address; + + page_store.fStoreOp = No; + + return 0; + } +} // namespace NeOS::HAL diff --git a/dev/kernel/HALKit/ARM64/HalSchedulerCoreARM64.cc b/dev/kernel/HALKit/ARM64/HalSchedulerCoreARM64.cc new file mode 100644 index 00000000..55c8aab5 --- /dev/null +++ b/dev/kernel/HALKit/ARM64/HalSchedulerCoreARM64.cc @@ -0,0 +1,24 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +namespace NeOS +{ + /// @brief Wakes up thread. + /// Wakes up thread from the hang state. + Void mp_wakeup_thread(HAL::StackFrame* stack) + { + NE_UNUSED(stack); + } + + /// @brief makes the thread sleep on a loop. + /// hooks and hangs thread to prevent code from executing. + Void mp_hang_thread(HAL::StackFrame* stack) + { + NE_UNUSED(stack); + } +} // namespace NeOS diff --git a/dev/kernel/HALKit/ARM64/HalSchedulerCorePrimitivesARM64.cc b/dev/kernel/HALKit/ARM64/HalSchedulerCorePrimitivesARM64.cc new file mode 100644 index 00000000..3a9b7074 --- /dev/null +++ b/dev/kernel/HALKit/ARM64/HalSchedulerCorePrimitivesARM64.cc @@ -0,0 +1,35 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +namespace NeOS +{ + /***********************************************************************************/ + /// @brief Unimplemented function (crashes by default) + /// @param void + /***********************************************************************************/ + + EXTERN_C Void __zka_pure_call(UserProcess* process) + { + if (process) + process->Crash(); + } + + /***********************************************************************************/ + /// @brief Validate user stack. + /// @param stack_ptr the frame pointer. + /***********************************************************************************/ + + EXTERN_C Bool hal_check_stack(HAL::StackFramePtr stack_ptr) + { + if (!stack_ptr) + return No; + + return stack_ptr->SP != 0 && stack_ptr->BP != 0; + } +} // namespace NeOS diff --git a/dev/kernel/HALKit/ARM64/HalTimerARM64.cc b/dev/kernel/HALKit/ARM64/HalTimerARM64.cc new file mode 100644 index 00000000..785d2d5c --- /dev/null +++ b/dev/kernel/HALKit/ARM64/HalTimerARM64.cc @@ -0,0 +1,14 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: HalTimer.cc + Purpose: HAL timer + + Revision History: + + 07/07/24: Added file (amlel) + +------------------------------------------- */ + +#include diff --git a/dev/kernel/HALKit/ARM64/MBCI/MBCI.cc b/dev/kernel/HALKit/ARM64/MBCI/MBCI.cc new file mode 100644 index 00000000..d2df66e6 --- /dev/null +++ b/dev/kernel/HALKit/ARM64/MBCI/MBCI.cc @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright (C) 2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include \ No newline at end of file diff --git a/dev/kernel/HALKit/ARM64/Paging.h b/dev/kernel/HALKit/ARM64/Paging.h new file mode 100644 index 00000000..3c24f757 --- /dev/null +++ b/dev/kernel/HALKit/ARM64/Paging.h @@ -0,0 +1,120 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +/** --------------------------------------------------- + + * THIS FILE CONTAINS CODE FOR ARMV8 PAGING. + +------------------------------------------------------- */ + +#include + +#ifndef kPageMax +#define kPageMax (0x200) +#endif //! kPageMax + +#ifndef kPageAlign +#define kPageAlign (0x1000) +#endif //! kPageAlign + +#ifndef kPageSize +#define kPageSize (0x1000) +#endif // !kPageSize + +//! short format address range + +#define c16KBPage 0b000 +#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 \ + } + +namespace NeOS::HAL +{ + struct PACKED PTE_4KB final + { + UInt64 Valid : 1; + UInt64 Table : 1; + UInt64 AttrIndex : 3; + UInt64 NS : 1; + UInt64 AP : 2; + UInt64 SH : 2; + UInt64 AF : 1; + UInt64 NG : 1; + UInt64 Reserved1 : 1; + UInt64 Contiguous : 1; + UInt64 Dirty : 1; + UInt64 Reserved : 2; + UInt64 PhysicalAddress : 36; + UInt64 Reserved3 : 4; + UInt64 PXN : 1; + UInt64 XN : 1; + UInt64 Reserved4 : 9; + }; + + namespace Detail + { + enum class ControlRegisterBits + { + ProtectedModeEnable = 0, + MonitorCoProcessor = 1, + Emulation = 2, + TaskSwitched = 3, + ExtensionType = 4, + NumericError = 5, + WriteProtect = 16, + AlignementMask = 18, + NotWriteThrough = 29, + CacheDisable = 30, + PageEnable = 31, + }; + + inline UInt8 control_register_cast(ControlRegisterBits reg) + { + return static_cast(reg); + } + } // namespace Detail + + struct PDE_4KB final + { + PTE_4KB ALIGN(kPageAlign) fEntries[kPageMax]; + }; + + auto mm_alloc_bitmap(Boolean wr, Boolean user, SizeT size, Bool is_page) -> VoidPtr; + auto mm_free_bitmap(VoidPtr page_ptr) -> Bool; +} // namespace NeOS::HAL + +namespace NeOS +{ + typedef HAL::PTE_4KB PTE; + typedef HAL::PDE_4KB PDE; +} // namespace NeOS + +EXTERN_C void hal_flush_tlb(); diff --git a/dev/kernel/HALKit/ARM64/Processor.h b/dev/kernel/HALKit/ARM64/Processor.h new file mode 100644 index 00000000..940cfbe9 --- /dev/null +++ b/dev/kernel/HALKit/ARM64/Processor.h @@ -0,0 +1,91 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include +#include + +#define kCPUBackendName "ARMv8" + +namespace NeOS::HAL +{ + struct PACKED Register64 final + { + UShort Limit; + UIntPtr Base; + }; + + /// @brief Memory Manager mapping flags. + enum + { + kMMFlagsPresent = 1 << 0, + kMMFlagsWr = 1 << 1, + kMMFlagsUser = 1 << 2, + kMMFlagsNX = 1 << 3, + kMMFlagsCount = 3, + }; + + /// @brief Set a PTE from pd_base. + /// @param virt_addr a valid virtual address. + /// @param phys_addr point to physical address. + /// @param flags the flags to put on the page. + /// @return Status code of page manip. + EXTERN_C Int32 mm_map_page(VoidPtr virtual_address, VoidPtr physical_address, UInt32 flags); + + typedef UIntPtr Reg; + typedef Register64 Register; + + /// @note let's keep the same name as AMD64 HAL. + struct PACKED StackFrame final + { + Reg R8{0}; + Reg R9{0}; + Reg R10{0}; + Reg R11{0}; + Reg R12{0}; + Reg R13{0}; + Reg R14{0}; + Reg R15{0}; + Reg SP{0}; + Reg BP{0}; + }; + + typedef StackFrame* StackFramePtr; + + inline Void rt_halt() noexcept + { + while (Yes) + { + } + } + + template + inline void hal_dma_write(UIntPtr address, DataKind value) + { + *reinterpret_cast(address) = value; + } + + template + inline DataKind hal_dma_read(UIntPtr address) + { + return *reinterpret_cast(address); + } + + inline Void hal_wfi(Void) + { + asm volatile("wfi"); + } +} // namespace NeOS::HAL + +inline NeOS::VoidPtr kKernelBitMpStart = nullptr; +inline NeOS::UIntPtr kKernelBitMpSize = 0UL; + +inline NeOS::VoidPtr kKernelPhysicalStart = nullptr; + +#include diff --git a/dev/kernel/HALKit/ARM64/ReadMe.md b/dev/kernel/HALKit/ARM64/ReadMe.md new file mode 100644 index 00000000..c51229f2 --- /dev/null +++ b/dev/kernel/HALKit/ARM64/ReadMe.md @@ -0,0 +1,3 @@ +# ARM64 Hardware Abstraction Layer + +- Supported Firmware: CoreBoot/EDK/OpenMobileBoot diff --git a/dev/kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc b/dev/kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc new file mode 100644 index 00000000..94d20878 --- /dev/null +++ b/dev/kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc @@ -0,0 +1,119 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifdef NE_USE_MBCI_FLASH + +#include +#include +#include +#include + +/// @file MBCI+Flash.cc +/// @brief MBCI Flash support. + +#define MBCI_MAX_SLOTS (8U) + +namespace NeOS +{ + /// /Mount/Flash/n + constexpr auto kFlashBridgeMagic = 0x70768372; + constexpr auto kFlashBridgeRevision = 1; + + STATIC BOOL kFlashEnabled = NO; + STATIC SizeT kFlashSize[MBCI_MAX_SLOTS] = {}; + STATIC SizeT kFlashSectorSz[MBCI_MAX_SLOTS] = {}; + STATIC IMBCIHost* kFlashMetaPackets[MBCI_MAX_SLOTS] = {}; + STATIC IMBCIHost* kFlashDataPackets[MBCI_MAX_SLOTS] = {}; + + STATIC Void drv_std_io(Int32 slot, UInt64 lba, Char* buf, SizeT sector_sz, SizeT buf_sz); + + /// @brief Enable flash memory builtin. + STATIC Void drv_enable_flash(Int32 slot); + + /// @brief Disable flash memory builtin. + STATIC Void drv_disable_flash(Int32 slot); + + /// @brief get slot sector count. + /// @return slot sector count. + SizeT drv_get_sector_count(Int32 slot) + { + if (slot > MBCI_MAX_SLOTS) + return 0; + + return kFlashSectorSz[slot]; + } + + /// @brief get slot full size (in bytes). + /// @return drive slot size + SizeT drv_get_size(Int32 slot) + { + if (slot > MBCI_MAX_SLOTS) + return 0; + + return kFlashSize[slot]; + } + + /// @brief Enable flash memory at slot. + BOOL drv_enable_at(Int32 slot) + { + if (slot > MBCI_MAX_SLOTS) + return NO; + + kFlashMetaPackets[slot]->InterruptEnable = YES; + + kout << "Enabled hardware slot at: " << number(slot) << kendl; + + return YES; + } + + /// @brief Disable flash memory at slot. + BOOL drv_disable_at(Int32 slot) + { + if (slot > MBCI_MAX_SLOTS) + return NO; + + kFlashMetaPackets[slot]->InterruptEnable = NO; + + kout << "Disabled hardware slot at: " << number(slot) << kendl; + + return YES; + } + + STATIC Void drv_std_io(Int32 slot, UInt64 lba, Char* buf, SizeT sector_sz, SizeT buf_sz) + { + UInt64* packet_frame = (UInt64*)kFlashDataPackets[slot]->BaseAddressRegister; + + if (packet_frame[0] != (UInt64)kFlashBridgeMagic) + return; + + if (packet_frame[8] != (UInt64)kFlashBridgeRevision) + return; + + packet_frame[16 + 0] = lba; + packet_frame[16 + 4] = sector_sz; + packet_frame[16 + 8] = lba; + packet_frame[16 + 12] = buf_sz; + packet_frame[16 + 14] = (UIntPtr)HAL::hal_get_phys_address(buf); + + while (packet_frame[0] == lba) + ; + } + + Void drv_std_read(Int32 slot, UInt64 lba, Char* buf, SizeT sector_sz, SizeT buf_sz) + { + rt_set_memory(buf, 0, buf_sz); + + drv_std_io(slot, lba, buf, sector_sz, buf_sz); + } + + Void drv_std_write(Int32 slot, UInt64 lba, Char* buf, SizeT sector_sz, SizeT buf_sz) + { + drv_std_io(slot, lba, buf, sector_sz, buf_sz); + } + +} // namespace NeOS + +#endif // if NE_USE_MBCI_FLASH diff --git a/dev/kernel/HALKit/ARM64/Storage/UFS+Generic.cc b/dev/kernel/HALKit/ARM64/Storage/UFS+Generic.cc new file mode 100644 index 00000000..20d06671 --- /dev/null +++ b/dev/kernel/HALKit/ARM64/Storage/UFS+Generic.cc @@ -0,0 +1,11 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +/// @file UFS.cc +/// @brief UFS Flash Memory support. + +#define UFS_PCI_VENDOR_ID (0x01001) /* AKER */ +#define UFS_PCI_DEVICE_ID (0xAEAEA) /* AKER */ \ No newline at end of file diff --git a/dev/kernel/HALKit/AXP/CR.s b/dev/kernel/HALKit/AXP/CR.s new file mode 100644 index 00000000..4d68257d --- /dev/null +++ b/dev/kernel/HALKit/AXP/CR.s @@ -0,0 +1,11 @@ +.globl read_lr1 +.globl read_lr0 + +.section .text + read_lr0: + movq %r30, %cr3 + ret + + hal_read_cr0: + movq %r30, %cr0 + ret \ No newline at end of file diff --git a/dev/kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp b/dev/kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp new file mode 100644 index 00000000..e69de29b diff --git a/dev/kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp b/dev/kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp new file mode 100644 index 00000000..f77186fd --- /dev/null +++ b/dev/kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp @@ -0,0 +1,24 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +/// @brief Internal call for syscall, to work with C++. +/// @param stack +/// @return nothing. +EXTERN_C void rt_syscall_handle(NeOS::HAL::StackFrame* stack) +{ + if (stack->Rcx <= (kSyscalls.Count() - 1)) + { + kout << "syscall: enter.\r"; + + if (kSyscalls[stack->Rcx].Leak().Leak().fHooked) + (kSyscalls[stack->Rcx].Leak().Leak().fProc)(stack); + + kout << "syscall: exit.\r"; + } +} diff --git a/dev/kernel/HALKit/AXP/HAL.s b/dev/kernel/HALKit/AXP/HAL.s new file mode 100644 index 00000000..0178527f --- /dev/null +++ b/dev/kernel/HALKit/AXP/HAL.s @@ -0,0 +1,13 @@ +.globl rt_wait_400ns + +.section .text +rt_wait_400ns: + jmp .L +.L: + jmp .L2 + wtint ;; wait for interrupt +.L2: + + ret + + diff --git a/dev/kernel/HALKit/AXP/Processor.h b/dev/kernel/HALKit/AXP/Processor.h new file mode 100644 index 00000000..bb14c9c6 --- /dev/null +++ b/dev/kernel/HALKit/AXP/Processor.h @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once diff --git a/dev/kernel/HALKit/AXP/SYSCALL.s b/dev/kernel/HALKit/AXP/SYSCALL.s new file mode 100644 index 00000000..19cab808 --- /dev/null +++ b/dev/kernel/HALKit/AXP/SYSCALL.s @@ -0,0 +1,10 @@ +.section .text +system_handle_user_call: + .cfi_startproc + + push %r0 + jmp %r1 + mov %r30, %r2 + + .cfi_endproc + retsys \ No newline at end of file diff --git a/dev/kernel/HALKit/AXP/VM.s b/dev/kernel/HALKit/AXP/VM.s new file mode 100644 index 00000000..7024086b --- /dev/null +++ b/dev/kernel/HALKit/AXP/VM.s @@ -0,0 +1,5 @@ +.global hal_flush_tlb + +.section .text +hal_flush_tlb: + swppal \ No newline at end of file diff --git a/dev/kernel/HALKit/POWER/.gitkeep b/dev/kernel/HALKit/POWER/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/kernel/HALKit/POWER/AP.h b/dev/kernel/HALKit/POWER/AP.h new file mode 100644 index 00000000..e0ef3ffb --- /dev/null +++ b/dev/kernel/HALKit/POWER/AP.h @@ -0,0 +1,39 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: AP.h + Purpose: POWER hardware threads. + + Revision History: + + 14/04/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +#include + +namespace NeOS +{ + struct HAL_HARDWARE_THREAD; + + /// @brief hardware thread indentification type. + typedef NeOS::Int32 hal_ap_kind; + + /// @brief Hardware thread information structure. + typedef struct HAL_HARDWARE_THREAD + { + NeOS::UIntPtr fStartAddress; + NeOS::UInt8 fPrivleged : 1; + NeOS::UInt32 fPageMemoryFlags; + hal_ap_kind fIdentNumber; + } HAL_HARDWARE_THREAD; + + /// @brief Set PC to specific hart. + /// @param hart the hart + /// @param epc the pc. + /// @return + EXTERN_C NeOS::Void hal_set_pc_to_hart(HAL_HARDWARE_THREAD* hart, NeOS::VoidPtr epc); +} // namespace NeOS diff --git a/dev/kernel/HALKit/POWER/APM/.gitkeep b/dev/kernel/HALKit/POWER/APM/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/kernel/HALKit/POWER/HalAP.cc b/dev/kernel/HALKit/POWER/HalAP.cc new file mode 100644 index 00000000..32f91a5f --- /dev/null +++ b/dev/kernel/HALKit/POWER/HalAP.cc @@ -0,0 +1,40 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include + +using namespace NeOS; + +namespace NeOS::Detail +{ + STATIC void mp_hang_fn(void) + { + while (YES) + ; + } +} // namespace NeOS::Detail + +/// @brief wakes up thread. +/// wakes up thread from hang. +void mp_wakeup_thread(HAL::StackFramePtr stack) +{ + if (!stack) + return; + + hal_set_pc_to_hart(reinterpret_cast(stack->R15), reinterpret_cast(stack->BP)); +} + +/// @brief makes thread sleep. +/// hooks and hangs thread to prevent code from executing. +void mp_hang_thread(HAL::StackFramePtr stack) +{ + if (!stack) + return; + + hal_set_pc_to_hart(reinterpret_cast(stack->R15), reinterpret_cast(NeOS::Detail::mp_hang_fn)); +} diff --git a/dev/kernel/HALKit/POWER/HalDebugOutput.cc b/dev/kernel/HALKit/POWER/HalDebugOutput.cc new file mode 100644 index 00000000..e9b2c85a --- /dev/null +++ b/dev/kernel/HALKit/POWER/HalDebugOutput.cc @@ -0,0 +1,27 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +using namespace NeOS; + +/// @brief Writes to COM1. +/// @param bytes +void ke_io_write(const Char* bytes) +{ + if (!bytes) + return; + + SizeT index = 0; + SizeT len = rt_string_len(bytes, 256U); + + while (index < len) + { + // TODO + ++index; + } +} diff --git a/dev/kernel/HALKit/POWER/HalStartSequence.s b/dev/kernel/HALKit/POWER/HalStartSequence.s new file mode 100644 index 00000000..2882be80 --- /dev/null +++ b/dev/kernel/HALKit/POWER/HalStartSequence.s @@ -0,0 +1,14 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +.globl __ImageStart +.extern hal_init_platform +.align 4 +.text + +__ImageStart: + bl hal_init_platform + blr diff --git a/dev/kernel/HALKit/POWER/HalThread.cc b/dev/kernel/HALKit/POWER/HalThread.cc new file mode 100644 index 00000000..0d2e140b --- /dev/null +++ b/dev/kernel/HALKit/POWER/HalThread.cc @@ -0,0 +1,8 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include diff --git a/dev/kernel/HALKit/POWER/HalVirtualMemory.cc b/dev/kernel/HALKit/POWER/HalVirtualMemory.cc new file mode 100644 index 00000000..d3d4b694 --- /dev/null +++ b/dev/kernel/HALKit/POWER/HalVirtualMemory.cc @@ -0,0 +1,49 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include + +/// @note Refer to SoC documentation. + +using namespace NeOS; + +EXTERN_C Void hal_write_tlb(UInt32 mas0, UInt32 mas1, UInt32 mas2, UInt32 mas3, UInt32 mas7) +{ + hal_mtspr(MAS0, mas0); + hal_mtspr(MAS1, mas1); + hal_mtspr(MAS2, mas2); + hal_mtspr(MAS3, mas3); + hal_mtspr(MAS7, mas7); + + hal_flush_tlb(); +} + +EXTERN_C Bool hal_set_tlb(UInt8 tlb, UInt32 epn, UInt64 rpn, UInt8 perms, UInt8 wimge, UInt8 ts, UInt8 esel, UInt8 tsize, UInt8 iprot) +{ + if ((hal_mfspr(SPRN_MMUCFG) & MMUCFG_MAVN) == MMUCFG_MAVN_V1 && (tsize & 1)) + { + // this MMU does not allow odd tsize values + return false; + } + + UInt32 mas0 = FSL_BOOKE_MAS0(tlb, esel, 0); + UInt32 mas1 = FSL_BOOKE_MAS1(1, iprot, 0, ts, tsize); + UInt32 mas2 = FSL_BOOKE_MAS2(epn, wimge); + UInt32 mas3 = FSL_BOOKE_MAS3(rpn, 0, perms); + UInt32 mas7 = FSL_BOOKE_MAS7(rpn); + + hal_write_tlb(mas0, mas1, mas2, mas3, mas7); + + return true; +} + +/// @brief Flush TLB +EXTERN_C void hal_flush_tlb() +{ + asm volatile("isync;tlbwe;msync;isync"); +} diff --git a/dev/kernel/HALKit/POWER/MBCI/.gitkeep b/dev/kernel/HALKit/POWER/MBCI/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/kernel/HALKit/POWER/MBCI/HalMBCIHost.cc b/dev/kernel/HALKit/POWER/MBCI/HalMBCIHost.cc new file mode 100644 index 00000000..0d2e140b --- /dev/null +++ b/dev/kernel/HALKit/POWER/MBCI/HalMBCIHost.cc @@ -0,0 +1,8 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include diff --git a/dev/kernel/HALKit/POWER/Processor.h b/dev/kernel/HALKit/POWER/Processor.h new file mode 100644 index 00000000..bbcfd01f --- /dev/null +++ b/dev/kernel/HALKit/POWER/Processor.h @@ -0,0 +1,62 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + Purpose: POWER processor header. + +------------------------------------------- */ + +#pragma once + +#include +#include + +#define NoOp() asm volatile("mr 0, 0") +#define kHalPPCAlignment __attribute__((aligned(4))) + +namespace NeOS::HAL +{ + typedef UIntPtr Reg; + + /// @brief Stack frame (as retrieved from assembly.) + struct PACKED StackFrame final + { + Reg R8{0}; + Reg R9{0}; + Reg R10{0}; + Reg R11{0}; + Reg R12{0}; + Reg R13{0}; + Reg R14{0}; + Reg R15{0}; + Reg SP{0}; + Reg BP{0}; + }; + + typedef StackFrame* StackFramePtr; + + inline void rt_halt() + { + while (true) + { + NoOp(); // no oop. + } + } + + inline void rt_cli() + { + NoOp(); // no oop + } +} // namespace NeOS::HAL + +EXTERN_C NeOS::Void int_handle_math(NeOS::UIntPtr sp); +EXTERN_C NeOS::Void int_handle_pf(NeOS::UIntPtr sp); + +/// @brief Set TLB. +NeOS::Bool hal_set_tlb(NeOS::UInt8 tlb, NeOS::UInt32 epn, NeOS::UInt64 rpn, NeOS::UInt8 perms, NeOS::UInt8 wimge, NeOS::UInt8 ts, NeOS::UInt8 esel, NeOS::UInt8 tsize, NeOS::UInt8 iprot); + +/// @brief Write TLB. +NeOS::Void hal_write_tlb(NeOS::UInt32 mas0, NeOS::UInt32 mas1, NeOS::UInt32 mas2, NeOS::UInt32 mas3, NeOS::UInt32 mas7); + +/// @brief Flush TLB. +EXTERN_C NeOS::Void hal_flush_tlb(); diff --git a/dev/kernel/HALKit/POWER/ReadMe.md b/dev/kernel/HALKit/POWER/ReadMe.md new file mode 100644 index 00000000..a9751581 --- /dev/null +++ b/dev/kernel/HALKit/POWER/ReadMe.md @@ -0,0 +1,4 @@ +POWER Hardware Abstraction Layer + +- Supported CPU: POWER +- Supported Firmware: CoreBoot \ No newline at end of file diff --git a/dev/kernel/HALKit/RISCV/.keep b/dev/kernel/HALKit/RISCV/.keep new file mode 100644 index 00000000..e69de29b diff --git a/dev/kernel/HALKit/RISCV/AP.h b/dev/kernel/HALKit/RISCV/AP.h new file mode 100644 index 00000000..c198a404 --- /dev/null +++ b/dev/kernel/HALKit/RISCV/AP.h @@ -0,0 +1,35 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: AP.h + Purpose: RISC-V hardware threads. + + Revision History: + + 30/01/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +#include + +namespace NeOS +{ + typedef Int64 hal_ap_kind; + + typedef struct HAL_HARDWARE_THREAD + { + NeOS::UIntPtr fStartAddress; + NeOS::UInt8 fPrivleged : 1; + NeOS::UInt32 fPageMemoryFlags; + hal_ap_kind fIdentNumber; + } HAL_HARDWARE_THREAD; + + /// @brief Set PC to specific hart. + /// @param hart the hart + /// @param epc the pc. + /// @return + EXTERN_C NeOS::Void hal_set_pc_to_hart(HAL_HARDWARE_THREAD* hart, NeOS::VoidPtr epc); +} // namespace NeOS diff --git a/dev/kernel/HALKit/RISCV/APM/.gitkeep b/dev/kernel/HALKit/RISCV/APM/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/kernel/HALKit/RISCV/HalAP.cc b/dev/kernel/HALKit/RISCV/HalAP.cc new file mode 100644 index 00000000..788acf0f --- /dev/null +++ b/dev/kernel/HALKit/RISCV/HalAP.cc @@ -0,0 +1,40 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include + +using namespace NeOS; + +namespace NeOS::Detail +{ + STATIC void mp_hang_fn(void) + { + while (YES) + ; + } +} // namespace NeOS::Detail + +/// @brief wakes up thread. +/// wakes up thread from hang. +void mp_wakeup_thread(HAL::StackFramePtr stack) +{ + if (!stack) + return; + + hal_set_pc_to_hart(reinterpret_cast(stack->R15), reinterpret_cast(stack->BP)); +} + +/// @brief makes thread sleep. +/// hooks and hangs thread to prevent code from executing. +void mp_hang_thread(HAL::StackFramePtr stack) +{ + if (!stack) + return; + + hal_set_pc_to_hart(reinterpret_cast(stack->R15), reinterpret_cast(NeOS::Detail::mp_hang_fn)); +} diff --git a/dev/kernel/HALKit/RISCV/ReadMe.md b/dev/kernel/HALKit/RISCV/ReadMe.md new file mode 100644 index 00000000..b099aa31 --- /dev/null +++ b/dev/kernel/HALKit/RISCV/ReadMe.md @@ -0,0 +1,4 @@ +RISCV64 Hardware Abstraction Layer + +- Supported CPU: RISCV64 +- Supported Firmware: CoreBoot \ No newline at end of file diff --git a/dev/kernel/HALKit/RISCV/Storage/.gitkeep b/dev/kernel/HALKit/RISCV/Storage/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/kernel/HALKit/X86S/.gitkeep b/dev/kernel/HALKit/X86S/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/kernel/HALKit/X86S/ACPI/.gitkeep b/dev/kernel/HALKit/X86S/ACPI/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/kernel/HALKit/X86S/Storage/.gitkeep b/dev/kernel/HALKit/X86S/Storage/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/kernel/KernelKit/BinaryMutex.h b/dev/kernel/KernelKit/BinaryMutex.h new file mode 100644 index 00000000..21b2ca6d --- /dev/null +++ b/dev/kernel/KernelKit/BinaryMutex.h @@ -0,0 +1,43 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +namespace NeOS +{ + class UserProcess; + + typedef UserProcess& UserProcessRef; + + /// @brief Access control class, which locks a task until one is done. + class BinaryMutex final + { + public: + explicit BinaryMutex() = default; + ~BinaryMutex() = default; + + public: + bool IsLocked() const; + bool Unlock() noexcept; + + public: + BOOL WaitForProcess(const Int16& sec) noexcept; + + public: + bool Lock(UserProcess& process); + bool LockOrWait(UserProcess& process, TimerInterface* timer); + + public: + NE_COPY_DEFAULT(BinaryMutex); + + private: + UserProcessRef fLockingProcess; + }; +} // namespace NeOS diff --git a/dev/kernel/KernelKit/CodeMgr.h b/dev/kernel/KernelKit/CodeMgr.h new file mode 100644 index 00000000..5f83c74b --- /dev/null +++ b/dev/kernel/KernelKit/CodeMgr.h @@ -0,0 +1,37 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: CodeMgr.h + Purpose: Code Mgr. + + Revision History: + + 30/01/24: Added file (amlel) + 3/8/24: Add UPP struct. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +namespace NeOS +{ + /// @brief Main process entrypoint. + typedef void (*rtl_main_kind)(const SizeT argc, Char** argv, Char** envp, const SizeT envp_len); + + /// @brief C++ Constructor entrypoint. + typedef void (*rtl_ctor_kind)(void); + + /// @brief C++ Destructor entrypoint. + typedef void (*rtl_dtor_kind)(void); + + /// @brief Executes a new process from a function. Kernel code only. + /// @note This sets up a new stack, anything on the main function that calls the Kernel will not be accessible. + /// @param main the start of the process. + /// @return The team's process id. + ProcessID rtl_create_process(rtl_main_kind main, const Char* process_name) noexcept; +} // namespace NeOS diff --git a/dev/kernel/KernelKit/DebugOutput.h b/dev/kernel/KernelKit/DebugOutput.h new file mode 100644 index 00000000..cfadd38d --- /dev/null +++ b/dev/kernel/KernelKit/DebugOutput.h @@ -0,0 +1,213 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include +#include + +#define kDebugMaxPorts 56 + +#define kDebugUnboundPort 0x0FEED + +#define kDebugMag0 'Z' +#define kDebugMag1 'D' +#define kDebugMag2 'B' +#define kDebugMag3 'G' + +#define kDebugSourceFile 0 +#define kDebugLine 33 +#define kDebugTeam 43 +#define kDebugEOP 49 + +namespace NeOS +{ + class TerminalDevice; + class DTraceDevice; + + inline TerminalDevice end_line(); + inline TerminalDevice number(const Long& x); + inline TerminalDevice hex_number(const Long& x); + + // @brief Emulates a VT100 terminal. + class TerminalDevice final NE_DEVICE + { + public: + TerminalDevice(void (*print)(IDeviceObject*, const Char*), void (*gets)(IDeviceObject*, const Char*)) + : IDeviceObject(print, gets) + { + } + + ~TerminalDevice() override; + + /// @brief returns device name (terminal name) + /// @return string type (const Char*) + const Char* Name() const override + { + return ("TerminalDevice"); + } + + NE_COPY_DEFAULT(TerminalDevice); + + STATIC TerminalDevice The() noexcept; + }; + + inline TerminalDevice end_line() + { + TerminalDevice self = TerminalDevice::The(); + + self.operator<<("\r"); + return self; + } + + inline TerminalDevice carriage_return() + { + TerminalDevice self = TerminalDevice::The(); + + self.operator<<("\r"); + return self; + } + + inline TerminalDevice tabulate() + { + TerminalDevice self = TerminalDevice::The(); + + self.operator<<("\t"); + return self; + } + + /// @brief emulate a terminal bell, like the VT100 does. + inline TerminalDevice bell() + { + TerminalDevice self = TerminalDevice::The(); + + self.operator<<("\a"); + return self; + } + + namespace Detail + { + inline TerminalDevice _write_number(const Long& x, TerminalDevice& term) + { + UInt64 y = (x > 0 ? x : -x) / 10; + UInt64 h = (x > 0 ? x : -x) % 10; + + if (y) + _write_number(y, term); + + /* fail if the number is not base-10 */ + if (h > 10) + { + _write_number('?', term); + return term; + } + + if (y < 0) + y = -y; + + const Char kNumbers[11] = "0123456789"; + + Char buf[2]; + buf[0] = kNumbers[h]; + buf[1] = 0; + + term.operator<<(buf); + return term; + } + + inline TerminalDevice _write_number_hex(const Long& x, TerminalDevice& term) + { + UInt64 y = (x > 0 ? x : -x) / 16; + UInt64 h = (x > 0 ? x : -x) % 16; + + if (y) + _write_number_hex(y, term); + + /* fail if the hex number is not base-16 */ + if (h > 16) + { + _write_number_hex('?', term); + return term; + } + + if (y < 0) + y = -y; + + const Char kNumbers[17] = "0123456789ABCDEF"; + + Char buf[2]; + buf[0] = kNumbers[h]; + buf[1] = 0; + + term.operator<<(buf); + return term; + } + } // namespace Detail + + inline TerminalDevice hex_number(const Long& x) + { + TerminalDevice self = TerminalDevice::The(); + + Detail::_write_number_hex(x, self); + self.operator<<("h"); + + return self; + } + + inline TerminalDevice number(const Char* x) + { + TerminalDevice self = TerminalDevice::The(); + + self << "?"; + + return self; + } + + inline TerminalDevice number(const Long& x) + { + TerminalDevice self = TerminalDevice::The(); + + Detail::_write_number(x, self); + + return self; + } + + inline TerminalDevice get_console_in(Char* buf) + { + TerminalDevice self = TerminalDevice::The(); + + self >> buf; + + return self; + } + + constexpr SizeT kDebugTypeLen = 256U; + + typedef Char rt_debug_type[kDebugTypeLen]; + + class DebuggerPortHeader final + { + public: + Int16 fPort[kDebugMaxPorts]; + Int16 fPortCnt; + }; + + inline TerminalDevice& operator<<(TerminalDevice& src, const Long& num) + { + src = number(num); + return src; + } +} // namespace NeOS + +#ifdef kout +#undef kout +#endif // ifdef kout + +#define kout NeOS::TerminalDevice::The() << "[NeKernel] *" << __FILE__ << "*: " + +#define kendl NeOS::TerminalDevice::The() << NeOS::end_line() diff --git a/dev/kernel/KernelKit/Defines.h b/dev/kernel/KernelKit/Defines.h new file mode 100644 index 00000000..d86988a7 --- /dev/null +++ b/dev/kernel/KernelKit/Defines.h @@ -0,0 +1,15 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +#define KERNELKIT_VERSION "1.0.2" +#define KERNELKIT_VERSION_BCD 0x01020 + +class UserProcessScheduler; +class UserProcess; diff --git a/dev/kernel/KernelKit/DeviceMgr.h b/dev/kernel/KernelKit/DeviceMgr.h new file mode 100644 index 00000000..fa68d2e7 --- /dev/null +++ b/dev/kernel/KernelKit/DeviceMgr.h @@ -0,0 +1,140 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +/* ------------------------------------------- + + Revision History: + + 31/01/24: Add kDeviceCnt (amlel) + 15/11/24: Add NE_DEVICE macro, to inherit from device object. + + ------------------------------------------- */ + +#pragma once + +/* @note Device Mgr. */ +/* @file KernelKit/DeviceMgr.h */ +/* @brief Device abstraction and I/O buffer. */ + +#include +#include + +#define kDeviceMgrRootDirPath "/Devices/" + +#define NE_DEVICE : public ::NeOS::IDeviceObject + +// Last Rev: Wed, Apr 3, 2024 9:09:41 AM + +namespace NeOS +{ + template + class IDeviceObject; + + /***********************************************************************************/ + /// @brief Device contract interface, represents an HW device. + /***********************************************************************************/ + template + class IDeviceObject + { + public: + explicit IDeviceObject(void (*Out)(IDeviceObject*, T), void (*In)(IDeviceObject*, T)) + : fOut(Out), fIn(In) + { + } + + virtual ~IDeviceObject() = default; + + public: + IDeviceObject& operator=(const IDeviceObject&) = default; + IDeviceObject(const IDeviceObject&) = default; + + public: + virtual IDeviceObject& operator<<(T Data) + { + fOut(this, Data); + return *this; + } + + virtual IDeviceObject& operator>>(T Data) + { + fIn(this, Data); + return *this; + } + + virtual const char* Name() const + { + return "/dev/null"; + } + + operator bool() + { + return fOut && fIn; + } + + Bool operator!() + { + return !fOut || !fIn; + } + + protected: + Void (*fOut)(IDeviceObject*, T Data) = {nullptr}; + Void (*fIn)(IDeviceObject*, T Data) = {nullptr}; + }; + + /// + /// @brief Input Output abstract class. + /// Used mainly to communicate between OS to hardware. + /// + template + class IOBuf final + { + public: + explicit IOBuf(T dma_addr) + : fData(dma_addr) + { + // At least pass something valid when instancating this struct. + MUST_PASS(fData); + } + + IOBuf& operator=(const IOBuf&) = default; + IOBuf(const IOBuf&) = default; + + ~IOBuf() = default; + + public: + template + R operator->() const + { + return fData; + } + + template + R& operator[](Size index) const + { + return fData[index]; + } + + private: + T fData; + }; + + ///! @brief Device enum types. + enum + { + kDeviceTypeIDE, + kDeviceTypeEthernet, + kDeviceTypeWiFi, + kDeviceTypeFW, + kDeviceTypeBT, + kDeviceTypeRS232, + kDeviceTypeSCSI, + kDeviceTypeAHCI, + kDeviceTypeMBCI, + kDeviceTypeUSB, + kDeviceTypeMediaCtrl, // MM controller + kDeviceTypeCount, + }; +} // namespace NeOS diff --git a/dev/kernel/KernelKit/DriveMgr.h b/dev/kernel/KernelKit/DriveMgr.h new file mode 100644 index 00000000..87bd2714 --- /dev/null +++ b/dev/kernel/KernelKit/DriveMgr.h @@ -0,0 +1,191 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef INC_DRIVE_MANAGER_H +#define INC_DRIVE_MANAGER_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#define kDriveMaxCount (4U) +#define kDriveSectorSz (512U) +#define kDriveInvalidID (-1) +#define kDriveNameLen (32) + +#define drv_sector_cnt(SIZE, SECTOR_SZ) (((SIZE) + (SECTOR_SZ)) / (SECTOR_SZ)) + +namespace NeOS +{ + enum + { + kInvalidDrive = -1, + + /// Storage types, combine with flags. + kBlockDevice = 0xAD, + kMassStorageDrive = 0xDA, + kFloppyDrive = 0xCD, + kOpticalDrive = 0xDC, // CD-ROM/DVD-ROM/Blu-Ray + kTapeDrive = 0xD7, + + /// Storage flags, combine with types. + kReadOnlyDrive = 0x10, // Read only drive + kEPMDrive = 0x11, // Explicit Partition Map. + kEPTDrive = 0x12, // ESP w/ EPM partition. + kMBRDrive = 0x13, // PC classic partition scheme + kGPTDrive = 0x14, // PC new partition scheme + kUnformattedDrive = 0x15, + kStorageCount = 9, + }; + + /// @brief Media drive trait type. + struct DriveTrait final + { + Char fName[kDriveNameLen]; // /System, /boot, //./Devices/USB... + Int32 fKind; // fMassStorage, fFloppy, fOpticalDrive. + Int32 fFlags; // fReadOnly, fEPMDrive... + + /// @brief Packet drive (StorageKit compilant.) + struct DrivePacket final + { + VoidPtr fPacketContent{nullptr}; //! packet body. + Char fPacketMime[kDriveNameLen] = "*/*"; //! identify what we're sending. + SizeT fPacketSize{0UL}; //! packet size + UInt32 fPacketCRC32{0UL}; //! sanity crc, in case if good is set to false + Boolean fPacketGood{YES}; + Lba fPacketLba{0UL}; + Boolean fPacketReadOnly{NO}; + } fPacket; + + Lba fLbaStart{0}, fLbaEnd{0}; + SizeT fSectorSz{512}; + + Void (*fInput)(DrivePacket packet); + Void (*fOutput)(DrivePacket packet); + Void (*fVerify)(DrivePacket packet); + Void (*fInit)(DrivePacket packet); + const Char* (*fDriveKind)(Void); + }; + + ///! drive as a device. + typedef DriveTrait* DriveTraitPtr; + + /** + * @brief Mounted drives interface. + * @note This class has all of it's drive set to nullptr, allocate them using + * GetAddressOf(index). + */ + class MountpointInterface final + { + public: + explicit MountpointInterface() = default; + ~MountpointInterface() = default; + + NE_COPY_DEFAULT(MountpointInterface); + + public: + DriveTrait& A() + { + return mA; + } + + DriveTrait& B() + { + return mB; + } + + DriveTrait& C() + { + return mC; + } + + DriveTrait& D() + { + return mD; + } + + enum + { + kDriveIndexA = 0, + kDriveIndexB, + kDriveIndexC, + kDriveIndexD, + kDriveIndexInvalid, + }; + + DriveTraitPtr GetAddressOf(const Int32& index) + { + err_local_get() = kErrorSuccess; + + switch (index) + { + case kDriveIndexA: + return &mA; + case kDriveIndexB: + return &mB; + case kDriveIndexC: + return &mC; + case kDriveIndexD: + return &mD; + default: { + err_local_get() = kErrorNoSuchDisk; + kout << "No such disc letter.\n"; + + break; + } + } + + return nullptr; + } + + private: + DriveTrait mA, mB, mC, mD; + }; + + /// @brief Unimplemented drive. + /// @param pckt the packet to read. + /// @return + Void io_drv_unimplemented(DriveTrait::DrivePacket* pckt) noexcept; + + /// @brief Gets the drive kind (ATA, SCSI, AHCI...) + /// @param void none. + /// @return the drive kind (ATA, Flash, NVM) + const Char* io_drv_kind(Void); + + /// @brief Makes a new drive. + /// @return the new drive as a trait. + DriveTrait io_construct_blank_drive(Void) noexcept; + + /// @brief Fetches the main drive. + /// @return the new drive as a trait. + DriveTrait io_construct_main_drive(Void) noexcept; + + namespace Detect + { + Void io_detect_drive(DriveTrait& trait); + } + + /// @brief Read from newfs disk. + /// @param Mnt mounted interface. + /// @param DrvTrait drive info + /// @param DrvIndex drive index. + /// @return + Int32 fs_ifs_read(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex); + + /// @brief Write to ifs disk. + /// @param Mnt mounted interface. + /// @param DrvTrait drive info + /// @param DrvIndex drive index. + /// @return + Int32 fs_ifs_write(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex); +} // namespace NeOS + +#endif /* ifndef INC_DRIVE_MANAGER_H */ diff --git a/dev/kernel/KernelKit/FileMgr.h b/dev/kernel/KernelKit/FileMgr.h new file mode 100644 index 00000000..7374df9d --- /dev/null +++ b/dev/kernel/KernelKit/FileMgr.h @@ -0,0 +1,392 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss Labs, all rights reserved. + + File: FileMgr.h + Purpose: Kernel file manager. + +------------------------------------------- */ + +/* ------------------------------------------- + + Revision History: + + 31/01/24: Update documentation (amlel) + 05/07/24: NeFS support, and fork support, updated constants and specs + as well. + 18/01/25: Patches to FileStream class. + + ------------------------------------------- */ + +#ifndef INC_FILEMGR_H +#define INC_FILEMGR_H + +#ifdef __FSKIT_INCLUDES_NEFS__ +#include +#endif // __FSKIT_INCLUDES_NEFS__ + +#ifdef __FSKIT_INCLUDES_HeFS__ +#include +#endif // __FSKIT_INCLUDES_HeFS__ + +#include +#include +#include +#include +#include +#include +#include +#include + +/// @brief Filesystem manager, abstraction over mounted filesystem. +/// Works like the VFS or IFS. + +#define kRestrictR "r" +#define kRestrictRB "rb" +#define kRestrictW "w" +#define kRestrictWB "rw" +#define kRestrictRWB "rwb" + +#define kRestrictMax (5U) + +#define node_cast(PTR) reinterpret_cast(PTR) + +/** + @note Refer to first enum. +*/ +#define kFileOpsCount (4U) +#define kFileMimeGeneric "n-application-kind/all" + +/** @brief invalid position. (n-pos) */ +#define kNPos (SizeT)(-1); + +namespace NeOS +{ + enum + { + kFileWriteAll = 100, + kFileReadAll = 101, + kFileReadChunk = 102, + kFileWriteChunk = 103, + kFileIOCnt = (kFileWriteChunk - kFileWriteAll) + 1, + // file flags + kFileFlagRsrc = 104, + kFileFlagData = 105, + }; + + typedef VoidPtr NodePtr; + + /** + @brief Filesystem Mgr Interface class + @brief Used to provide common I/O for a specific filesystem. +*/ + class IFilesystemMgr + { + public: + explicit IFilesystemMgr() = default; + virtual ~IFilesystemMgr() = default; + + public: + NE_COPY_DEFAULT(IFilesystemMgr); + + public: + /// @brief Mounts a new filesystem into an active state. + /// @param interface the filesystem interface + /// @return + static bool Mount(IFilesystemMgr* interface); + + /// @brief Unmounts the active filesystem + /// @return + static IFilesystemMgr* Unmount(); + + /// @brief Getter, gets the active filesystem. + /// @return + static IFilesystemMgr* GetMounted(); + + public: + virtual NodePtr Create(_Input const Char* path) = 0; + virtual NodePtr CreateAlias(_Input const Char* path) = 0; + virtual NodePtr CreateDirectory(_Input const Char* path) = 0; + virtual NodePtr CreateSwapFile(const Char* path) = 0; + + public: + virtual bool Remove(_Input const Char* path) = 0; + + public: + 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 _Output VoidPtr Read(_Input NodePtr node, + _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; + + virtual _Output VoidPtr Read(_Input const Char* name, + _Input NodePtr node, + _Input Int32 flags, + _Input SizeT sz) = 0; + + public: + virtual bool Seek(_Input NodePtr node, _Input SizeT off) = 0; + + public: + virtual SizeT Tell(_Input NodePtr node) = 0; + virtual bool Rewind(_Input NodePtr node) = 0; + }; + +#ifdef __FSKIT_INCLUDES_NEFS__ + /** + * @brief Based of IFilesystemMgr, takes care of managing NeFS + * disks. + */ + class NeFileSystemMgr final : public IFilesystemMgr + { + public: + explicit NeFileSystemMgr(); + ~NeFileSystemMgr() override; + + public: + NE_COPY_DEFAULT(NeFileSystemMgr); + + public: + NodePtr Create(const Char* path) override; + NodePtr CreateAlias(const Char* path) override; + NodePtr CreateDirectory(const Char* path) override; + NodePtr CreateSwapFile(const Char* path) override; + + public: + bool Remove(_Input const Char* path) override; + NodePtr Open(_Input const Char* path, _Input const Char* r) override; + Void Write(_Input NodePtr node, _Input VoidPtr data, _Input Int32 flags, _Input SizeT sz) override; + VoidPtr Read(_Input NodePtr node, _Input Int32 flags, _Input SizeT sz) override; + bool Seek(_Input NodePtr node, _Input SizeT off) override; + SizeT Tell(_Input NodePtr node) override; + bool Rewind(_Input NodePtr node) override; + + Void Write(_Input const Char* name, + _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; + + public: + /// @brief Get NeFS parser class. + /// @return The filesystem parser class. + NeFileSystemParser* GetParser() noexcept; + + private: + NeFileSystemParser* mParser{nullptr}; + }; + +#endif // ifdef __FSKIT_INCLUDES_NEFS__ + + /** + * FileStream class. + * @tparam Encoding file encoding (char, wchar_t...) + * @tparam FSClass Filesystem contract who takes care of it. + */ + template + class FileStream final + { + public: + explicit FileStream(const Encoding* path, const Encoding* restrict_type); + ~FileStream(); + + public: + FileStream& operator=(const FileStream&); + FileStream(const FileStream&); + + public: + ErrorOr Write(const SizeT offset, const VoidPtr data, SizeT len) noexcept + { + if (this->fFileRestrict != kFileMgrRestrictReadWrite && + this->fFileRestrict != kFileMgrRestrictReadWriteBinary && + this->fFileRestrict != kFileMgrRestrictWrite && + this->fFileRestrict != kFileMgrRestrictWriteBinary) + return ErrorOr(kErrorInvalidData); + + if (data == nullptr) + return ErrorOr(kErrorInvalidData); + + auto man = FSClass::GetMounted(); + + if (man) + { + man->Write(offset, fFile, data, len); + return ErrorOr(0); + } + + return ErrorOr(kErrorInvalidData); + } + + ErrorOr Write(const Char* name, const VoidPtr data, SizeT len) noexcept + { + if (this->fFileRestrict != kFileMgrRestrictReadWrite && + this->fFileRestrict != kFileMgrRestrictReadWriteBinary && + this->fFileRestrict != kFileMgrRestrictWrite && + this->fFileRestrict != kFileMgrRestrictWriteBinary) + return ErrorOr(kErrorInvalidData); + + if (data == nullptr) + return ErrorOr(kErrorInvalidData); + + auto man = FSClass::GetMounted(); + + if (man) + { + man->Write(name, fFile, data, 0, len); + return ErrorOr(0); + } + + return ErrorOr(kErrorInvalidData); + } + + VoidPtr Read(const Char* name, const SizeT sz) noexcept + { + if (this->fFileRestrict != kFileMgrRestrictReadWrite && + this->fFileRestrict != kFileMgrRestrictReadWriteBinary && + this->fFileRestrict != kFileMgrRestrictRead && + this->fFileRestrict != kFileMgrRestrictReadBinary) + return nullptr; + + auto man = FSClass::GetMounted(); + + if (man) + { + VoidPtr ret = man->Read(name, fFile, kFileReadAll, 0); + return ret; + } + + return nullptr; + } + + VoidPtr Read(SizeT offset, const SizeT sz) + { + if (this->fFileRestrict != kFileMgrRestrictReadWrite && + this->fFileRestrict != kFileMgrRestrictReadWriteBinary && + this->fFileRestrict != kFileMgrRestrictRead && + this->fFileRestrict != kFileMgrRestrictReadBinary) + return nullptr; + + auto man = FSClass::GetMounted(); + + if (man) + { + man->Seek(fFile, offset); + auto ret = man->Read(fFile, kFileReadChunk, sz); + + return ret; + } + + return nullptr; + } + + public: + /// @brief Leak node pointer. + /// @return The node pointer. + NodePtr Leak() + { + return fFile; + } + + /// @brief Leak MIME. + /// @return The MIME. + Char* MIME() noexcept + { + return const_cast(fMime); + } + + enum + { + kFileMgrRestrictRead, + kFileMgrRestrictReadBinary, + kFileMgrRestrictWrite, + kFileMgrRestrictWriteBinary, + kFileMgrRestrictReadWrite, + kFileMgrRestrictReadWriteBinary, + }; + + private: + NodePtr fFile{nullptr}; + Int32 fFileRestrict{kFileMgrRestrictReadBinary}; + const Char* fMime{kFileMimeGeneric}; + }; + + using FileStreamUTF8 = FileStream; + using FileStreamUTF16 = FileStream; + + typedef UInt64 CursorType; + + inline static const auto kRestrictStrLen = 8U; + + /// @brief restrict information about the file descriptor. + struct FileRestrictKind final + { + Char fRestrict[kRestrictStrLen]; + Int32 fMappedTo; + }; + + /// @brief constructor + template + inline FileStream::FileStream(const Encoding* path, + const Encoding* restrict_type) + : fFile(Class::GetMounted()->Open(path, restrict_type)) + { + const SizeT kRestrictCount = kRestrictMax; + const FileRestrictKind kRestrictList[] = { + { + .fRestrict = kRestrictR, + .fMappedTo = kFileMgrRestrictRead, + }, + { + .fRestrict = kRestrictRB, + .fMappedTo = kFileMgrRestrictReadBinary, + }, + { + .fRestrict = kRestrictRWB, + .fMappedTo = kFileMgrRestrictReadWriteBinary, + }, + { + .fRestrict = kRestrictW, + .fMappedTo = kFileMgrRestrictWrite, + }, + { + .fRestrict = kRestrictWB, + .fMappedTo = kFileMgrRestrictReadWrite, + }}; + + for (SizeT index = 0; index < kRestrictCount; ++index) + { + if (rt_string_cmp(restrict_type, kRestrictList[index].fRestrict, + rt_string_len(kRestrictList[index].fRestrict)) == 0) + { + fFileRestrict = kRestrictList[index].fMappedTo; + break; + } + } + + kout << "new file: " << path << ".\r"; + } + + /// @brief destructor of the file stream. + template + inline FileStream::~FileStream() + { + mm_delete_heap(fFile); + } +} // namespace NeOS + +#endif // ifndef INC_FILEMGR_H diff --git a/dev/kernel/KernelKit/HardwareThreadScheduler.h b/dev/kernel/KernelKit/HardwareThreadScheduler.h new file mode 100644 index 00000000..1866686e --- /dev/null +++ b/dev/kernel/KernelKit/HardwareThreadScheduler.h @@ -0,0 +1,149 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef __INC_MP_MANAGER_H__ +#define __INC_MP_MANAGER_H__ + +#include +#include +#include + +/// @note Last Rev Sun 28 Jul CET 2024 +/// @note Last Rev Thu, Aug 1, 2024 9:07:38 AM + +#define kMaxAPInsideSched (8U) + +namespace NeOS +{ + class HardwareThread; + class HardwareThreadScheduler; + + using ThreadID = UInt32; + + enum ThreadKind + { + kAPInvalid, + kAPSystemReserved, // System reserved thread, well user can't use it + kAPStandard, // user thread, cannot be used by Kernel + kAPRealTime, // fallback thread, cannot be used by user if not clear or + // used by Kernel. + kAPBoot, // The core we booted from, the mama. + kAPCount, + }; + + typedef enum ThreadKind ThreadKind; + typedef ThreadID ThreadID; + + /***********************************************************************************/ + /// + /// \name HardwareThread + /// \brief Abstraction over the CPU's core, used to run processes or threads. + /// + /***********************************************************************************/ + + class HardwareThread final + { + public: + explicit HardwareThread(); + ~HardwareThread(); + + public: + NE_COPY_DEFAULT(HardwareThread) + + public: + operator bool(); + + public: + void Wake(const bool wakeup = false) noexcept; + void Busy(const bool busy = false) noexcept; + + public: + bool Switch(VoidPtr image, Ptr8 stack_ptr, HAL::StackFramePtr frame, const ThreadID& pid); + bool IsWakeup() noexcept; + + public: + HAL::StackFramePtr StackFrame() noexcept; + const ThreadKind& Kind() noexcept; + bool IsBusy() noexcept; + const ThreadID& ID() noexcept; + + private: + HAL::StackFramePtr fStack{nullptr}; + ThreadKind fKind{ThreadKind::kAPStandard}; + ThreadID fID{0}; + ThreadID fPID{0}; + Bool fWakeup{NO}; + Bool fBusy{NO}; + UInt64 fPTime{0}; + + private: + friend class HardwareThreadScheduler; + friend class UserProcessHelper; + }; + + /// + /// \name HardwareThreadScheduler + /// \brief Class to manage the thread scheduling. + /// + + class HardwareThreadScheduler final : public ISchedulable + { + private: + friend class UserProcessHelper; + + public: + explicit HardwareThreadScheduler(); + ~HardwareThreadScheduler(); + NE_COPY_DEFAULT(HardwareThreadScheduler); + + public: + HAL::StackFramePtr Leak() noexcept; + + public: + Ref operator[](const SizeT& idx); + bool operator!() noexcept; + operator bool() noexcept; + + const Bool IsUser() override + { + return Yes; + } + + const Bool IsKernel() override + { + return No; + } + + const Bool HasMP() override + { + return kHandoverHeader->f_HardwareTables.f_MultiProcessingEnabled; + } + + public: + /// @brief Shared instance of the MP Mgr. + /// @return the reference to the mp manager class. + STATIC HardwareThreadScheduler& The(); + + public: + /// @brief Returns the amount of threads present in the system. + /// @returns SizeT the amount of cores present. + SizeT Capacity() noexcept; + + private: + Array fThreadList; + ThreadID fCurrentThread{0}; + }; + + /// @brief wakes up thread. + /// wakes up thread from hang. + Void mp_wakeup_thread(HAL::StackFramePtr stack); + + /// @brief makes thread sleep. + /// hooks and hangs thread to prevent code from executing. + Void mp_hang_thread(HAL::StackFramePtr stack); +} // namespace NeOS + +#endif // !__INC_MP_MANAGER_H__ diff --git a/dev/kernel/KernelKit/IDylibObject.h b/dev/kernel/KernelKit/IDylibObject.h new file mode 100644 index 00000000..c872b86f --- /dev/null +++ b/dev/kernel/KernelKit/IDylibObject.h @@ -0,0 +1,48 @@ +/* + * ======================================================== + * + * Kernel + * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + * + * ======================================================== + */ + +#pragma once + +#include +#include + +#define NE_DYLIB_OBJECT : public IDylibObject + +namespace NeOS +{ + /// @brief DLL class object. A handle to a shared library. + class IDylibObject + { + public: + explicit IDylibObject() = default; + virtual ~IDylibObject() = default; + + struct DLL_TRAITS final + { + VoidPtr ImageObject{nullptr}; + VoidPtr ImageEntrypointOffset{nullptr}; + + Bool IsValid() + { + return ImageObject && ImageEntrypointOffset; + } + }; + + NE_COPY_DEFAULT(IDylibObject); + + virtual DLL_TRAITS** GetAddressOf() = 0; + virtual DLL_TRAITS* Get() = 0; + + virtual Void Mount(DLL_TRAITS* to_mount) = 0; + virtual Void Unmount() = 0; + }; + + /// @brief Pure implementation, missing method/function handler. + EXTERN_C void __zka_pure_call(void); +} // namespace NeOS diff --git a/dev/kernel/KernelKit/IPEFDylibObject.h b/dev/kernel/KernelKit/IPEFDylibObject.h new file mode 100644 index 00000000..20f87410 --- /dev/null +++ b/dev/kernel/KernelKit/IPEFDylibObject.h @@ -0,0 +1,106 @@ +/* + * ======================================================== + * + * Kernel + * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + * + * ======================================================== + */ + +#ifndef __KERNELKIT_SHARED_OBJECT_H__ +#define __KERNELKIT_SHARED_OBJECT_H__ + +#include +#include +#include +#include +#include + +namespace NeOS +{ + /** + * @brief Shared Library class + * Load library from this class + */ + class IPEFDylibObject final NE_DYLIB_OBJECT + { + public: + explicit IPEFDylibObject() = default; + ~IPEFDylibObject() = default; + + public: + NE_COPY_DEFAULT(IPEFDylibObject); + + private: + DLL_TRAITS* fMounted{nullptr}; + + public: + DLL_TRAITS** GetAddressOf() + { + return &fMounted; + } + + DLL_TRAITS* Get() + { + return fMounted; + } + + public: + void Mount(DLL_TRAITS* to_mount) + { + if (!to_mount || !to_mount->ImageObject) + return; + + fMounted = to_mount; + + if (fLoader && to_mount) + { + delete fLoader; + fLoader = nullptr; + } + + if (!fLoader) + { + fLoader = new PEFLoader(fMounted->ImageObject); + } + } + + void Unmount() + { + if (fMounted) + fMounted = nullptr; + }; + + template + SymbolType Load(const Char* symbol_name, SizeT len, Int32 kind) + { + if (symbol_name == nullptr || *symbol_name == 0) + return nullptr; + if (len > kPathLen || len < 1) + return nullptr; + + auto ret = + reinterpret_cast(fLoader->FindSymbol(symbol_name, kind)); + + if (!ret) + { + if (kind == kPefCode) + return (VoidPtr)&__zka_pure_call; + + return nullptr; + } + + return ret; + } + + private: + PEFLoader* fLoader{nullptr}; + }; + + typedef IPEFDylibObject* IDylibRef; + + EXTERN_C IDylibRef rtl_init_dylib(UserProcess& header); + EXTERN_C Void rtl_fini_dylib(UserProcess& header, IDylibRef lib, Bool* successful); +} // namespace NeOS + +#endif /* ifndef __KERNELKIT_SHARED_OBJECT_H__ */ diff --git a/dev/kernel/KernelKit/LPC.h b/dev/kernel/KernelKit/LPC.h new file mode 100644 index 00000000..d76eeff1 --- /dev/null +++ b/dev/kernel/KernelKit/LPC.h @@ -0,0 +1,70 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +/// @file LPC.h +/// @brief Local Process Codes. + +#define err_local_ok() (NeOS::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode() == NeOS::kErrorSuccess) +#define err_local_fail() (NeOS::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode() != NeOS::kErrorSuccess) +#define err_local_get() (NeOS::UserProcessScheduler::The().CurrentProcess().Leak().GetLocalCode()) + +#define err_global_ok() (NeOS::kErrorLocalNumber == NeOS::kErrorSuccess) +#define err_global_fail() (NeOS::kErrorLocalNumber != NeOS::kErrorSuccess) +#define err_global_get() (NeOS::kErrorLocalNumber) + +namespace NeOS +{ + typedef Int32 HError; + + inline HError kErrorLocalNumber = 0UL; + + inline constexpr HError kErrorSuccess = 0; + inline constexpr HError kErrorExecutable = 33; + inline constexpr HError kErrorExecutableLib = 34; + 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 kErrorIPC = 59; + inline constexpr HError kErrorSign = 60; + inline constexpr HError kErrorInvalidCreds = 61; + inline constexpr HError kErrorCDTrayBroken = 62; + inline constexpr HError kErrorUnrecoverableDisk = 63; + inline constexpr HError kErrorFileLocked = 64; + inline constexpr HError kErrorUnimplemented = -1; + + /// @brief Raises a bug check stop code. + Void err_bug_check_raise(Void) noexcept; + + /// @brief Does a system wide bug check. + /// @param void no params are needed. + /// @return if error-free: false, otherwise true. + Boolean err_bug_check(Void) noexcept; +} // namespace NeOS diff --git a/dev/kernel/KernelKit/LoaderInterface.h b/dev/kernel/KernelKit/LoaderInterface.h new file mode 100644 index 00000000..04e197aa --- /dev/null +++ b/dev/kernel/KernelKit/LoaderInterface.h @@ -0,0 +1,34 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include +#include + +namespace NeOS +{ + /// @brief This interface is used to make loader contracts (MSCOFF, PEF). + /// @author @Amlal-El-Mahrouss + class LoaderInterface + { + public: + explicit LoaderInterface() = default; + virtual ~LoaderInterface() = default; + + NE_COPY_DEFAULT(LoaderInterface); + + public: + virtual _Output ErrorOr GetBlob() = 0; + virtual _Output const Char* AsString() = 0; + virtual _Output const Char* MIME() = 0; + virtual _Output const Char* Path() = 0; + virtual _Output ErrorOr FindStart() = 0; + virtual _Output VoidPtr FindSymbol(_Input const Char* name, _Input Int32 kind) = 0; + }; +} // namespace NeOS diff --git a/dev/kernel/KernelKit/LockDelegate.h b/dev/kernel/KernelKit/LockDelegate.h new file mode 100644 index 00000000..a657caa0 --- /dev/null +++ b/dev/kernel/KernelKit/LockDelegate.h @@ -0,0 +1,69 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include + +namespace NeOS +{ + enum + { + kLockDone = 200, + kLockTimedOut, + }; + + /// @brief Lock condition pointer. + typedef Boolean* LockPtr; + + /// @brief Locking delegate class, hangs until limit. + /// @tparam N the amount of cycles to wait. + template + class LockDelegate final + { + public: + LockDelegate() = delete; + + public: + explicit LockDelegate(LockPtr expr) + { + auto spin = 0U; + + while (spin < N) + { + if (*expr) + { + fLockStatus | kLockDone; + break; + } + + ++spin; + } + + if (spin > N) + fLockStatus | kLockTimedOut; + } + + ~LockDelegate() = default; + + LockDelegate& operator=(const LockDelegate&) = delete; + LockDelegate(const LockDelegate&) = delete; + + bool Done() + { + return fLockStatus[kLockDone] == kLockDone; + } + + bool HasTimedOut() + { + return fLockStatus[kLockTimedOut] != kLockTimedOut; + } + + private: + Atom fLockStatus; + }; +} // namespace NeOS diff --git a/dev/kernel/KernelKit/MBCI/.keep b/dev/kernel/KernelKit/MBCI/.keep new file mode 100644 index 00000000..e69de29b diff --git a/dev/kernel/KernelKit/MSDOS.h b/dev/kernel/KernelKit/MSDOS.h new file mode 100644 index 00000000..1a3df13b --- /dev/null +++ b/dev/kernel/KernelKit/MSDOS.h @@ -0,0 +1,52 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: MSDOS.h + Purpose: MS-DOS header for Kernel. + + Revision History: + + 30/01/24: Added file (amlel) + +------------------------------------------- */ + +#ifndef __MSDOS_EXEC__ +#define __MSDOS_EXEC__ + +#include +#include + +// Last Rev +// Sat Feb 24 CET 2024 + +#define kMagMz0 'M' +#define kMagMz1 'Z' + +typedef NeOS::UInt32 DosWord; +typedef NeOS::Long DosLong; + +typedef struct _DosHeader +{ + NeOS::UInt8 eMagic[2]; + DosWord eMagLen; + DosWord ePagesCount; + DosWord eCrlc; + DosWord eCParHdr; + DosWord eMinAlloc; + DosWord eMaxAlloc; + DosWord eStackSeg; + DosWord eStackPtr; + DosWord eChksum; + DosWord eIp; + DosWord eCs; + DosWord eLfarlc; + DosWord eOvno; + DosWord eRes[4]; + DosWord eOemid; + DosWord eOeminfo; + DosWord eRes2[10]; + DosLong eLfanew; +} DosHeader, *DosHeaderPtr; + +#endif /* ifndef __MSDOS_EXEC__ */ diff --git a/dev/kernel/KernelKit/MemoryMgr.h b/dev/kernel/KernelKit/MemoryMgr.h new file mode 100644 index 00000000..93718493 --- /dev/null +++ b/dev/kernel/KernelKit/MemoryMgr.h @@ -0,0 +1,87 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef INC_KERNEL_HEAP_H +#define INC_KERNEL_HEAP_H + +/// @date 30/01/24 +/// @file: MemoryMgr.h +/// @brief: heap allocation support. + +#include +#include +#include + +namespace NeOS +{ + /// @brief Declare pointer as free. + /// @param heap_ptr the pointer. + /// @return a status code regarding the deallocation. + Int32 mm_delete_heap(VoidPtr heap_ptr); + + /// @brief Declare a new size for heap_ptr. + /// @param heap_ptr the pointer. + /// @return unsupported always returns nullptr. + VoidPtr mm_realloc_heap(VoidPtr heap_ptr, SizeT new_sz); + + /// @brief Check if pointer is a valid Kernel pointer. + /// @param heap_ptr the pointer + /// @return if it exists it returns true. + Boolean mm_is_valid_heap(VoidPtr heap_ptr); + + /// @brief Allocate chunk of memory. + /// @param sz Size of pointer + /// @param wr Read Write bit. + /// @param user User enable bit. + /// @return The newly allocated pointer, or nullptr. + VoidPtr mm_new_heap(const SizeT sz, const Bool wr, const Bool user); + + /// @brief Protect the heap with a CRC value. + /// @param heap_ptr pointer. + /// @return if it valid: point has crc now., otherwise fail. + Boolean mm_protect_heap(VoidPtr heap_ptr); + + /// @brief Makes a Kernel page. + /// @param heap_ptr the page pointer. + /// @return status code + Int32 mm_make_page(VoidPtr heap_ptr); + + /// @brief Overwrites and set the flags of a heap header. + /// @param heap_ptr the pointer to update. + /// @param flags the flags to set. + Int32 mm_make_flags(VoidPtr heap_ptr, UInt64 flags); + + /// @brief Gets the flags of a heap header. + /// @param heap_ptr the pointer to get. + UInt64 mm_get_flags(VoidPtr heap_ptr); + + /// @brief Allocate C++ class. + /// @param cls The class to allocate. + /// @param args The args to pass. + template + inline BOOL mm_new_class(_Input _Output T** cls, _Input Args&&... args) + { + if (*cls) + { + err_global_get() = NeOS::kErrorInvalidData; + return NO; + } + + *cls = new T(move(args)...); + return *cls; + } + + /// @brief Delete and nullify C++ class. + /// @param cls The class to delete. + template + inline Void mm_delete_class(_Input _Output T** cls) + { + delete *cls; + *cls = nullptr; + } +} // namespace NeOS + +#endif // !INC_KERNEL_HEAP_H diff --git a/dev/kernel/KernelKit/PCI/DMA.h b/dev/kernel/KernelKit/PCI/DMA.h new file mode 100644 index 00000000..68f3fa37 --- /dev/null +++ b/dev/kernel/KernelKit/PCI/DMA.h @@ -0,0 +1,81 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include +#include +#include + +namespace NeOS +{ + enum class DmaKind + { + PCI, // Bus mastering is required to be turned on. Basiaclly a request + // control system. 64-Bit access depends on the PAE bit and the device + // (if Double Address Cycle is available) + ISA, // Four DMA channels 0-3; 8 bit transfers and only a megabyte of RAM. + Invalid, + }; + + class DMAWrapper final + { + public: + explicit DMAWrapper() = delete; + + public: + explicit DMAWrapper(nullPtr) = delete; + explicit DMAWrapper(voidPtr Ptr, DmaKind Kind = DmaKind::PCI) + : fAddress(Ptr), fKind(Kind) + { + } + + public: + DMAWrapper& operator=(voidPtr Ptr); + + public: + DMAWrapper& operator=(const DMAWrapper&) = default; + DMAWrapper(const DMAWrapper&) = default; + + public: + ~DMAWrapper() = default; + + template + T* operator->(); + + template + T* Get(const UIntPtr off = 0); + + public: + operator bool(); + bool operator!(); + + public: + bool Write(const UIntPtr& bit, const UInt32& offset); + UIntPtr Read(const UInt32& offset); + Boolean Check(UIntPtr offset) const; + + public: + UIntPtr operator[](const UIntPtr& offset); + + private: + voidPtr fAddress{nullptr}; + DmaKind fKind{DmaKind::Invalid}; + + private: + friend class DMAFactory; + }; + + class DMAFactory final + { + public: + static OwnPtr> Construct(OwnPtr& dma); + }; +} // namespace NeOS + +#include diff --git a/dev/kernel/KernelKit/PCI/DMA.inl b/dev/kernel/KernelKit/PCI/DMA.inl new file mode 100644 index 00000000..d9c6e551 --- /dev/null +++ b/dev/kernel/KernelKit/PCI/DMA.inl @@ -0,0 +1,20 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +namespace NeOS +{ + template + T* DMAWrapper::operator->() + { + return this->fAddress; + } + + template + T* DMAWrapper::Get(const UIntPtr offset) + { + return reinterpret_cast((UIntPtr)this->fAddress + offset); + } +} // namespace NeOS diff --git a/dev/kernel/KernelKit/PCI/Database.h b/dev/kernel/KernelKit/PCI/Database.h new file mode 100644 index 00000000..cb12a731 --- /dev/null +++ b/dev/kernel/KernelKit/PCI/Database.h @@ -0,0 +1,58 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ +#pragma once + +#include +#include + +namespace NeOS +{ + namespace Types + { + // https://wiki.osdev.org/PCI + enum class PciDeviceKind : UChar + { + MassStorageController = 0x1, + NetworkController = 0x2, + DisplayController = 0x3, + MultimediaController = 0x4, + MemoryController = 0x5, + Bridge = 0x6, + CommunicationController = 0x7, + GenericSystemPeripheral = 0x8, + InputDeviceController = 0x9, + DockingStation = 0xa, + Processor = 0xb, + SerialBusController = 0xc, + WirelessController = 0xd, + IntelligentController = 0xe, + SatelliteCommunicationsController = 0xf, + CoProcessor = 0x40, + Unassgined = 0xf, + Invalid = Unassgined, + }; + } // namespace Types +} // namespace NeOS + +inline BOOL operator!=(const NeOS::Types::PciDeviceKind& lhs, NeOS::UChar rhs) +{ + return rhs != (NeOS::UChar)lhs; +} + +inline BOOL operator==(const NeOS::Types::PciDeviceKind& lhs, NeOS::UChar rhs) +{ + return rhs == (NeOS::UChar)lhs; +} + +inline BOOL operator!=(NeOS::UChar lhs, const NeOS::Types::PciDeviceKind& rhs) +{ + return lhs != (NeOS::UChar)rhs; +} + +inline BOOL operator==(NeOS::UChar lhs, const NeOS::Types::PciDeviceKind& rhs) +{ + return lhs == (NeOS::UChar)rhs; +} \ No newline at end of file diff --git a/dev/kernel/KernelKit/PCI/Device.h b/dev/kernel/KernelKit/PCI/Device.h new file mode 100644 index 00000000..9870f618 --- /dev/null +++ b/dev/kernel/KernelKit/PCI/Device.h @@ -0,0 +1,81 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ +#pragma once + +#include + +namespace NeOS::PCI +{ + enum class PciConfigKind : UShort + { + ConfigAddress = 0xCF8, + ConfigData = 0xCFC, + CommandReg = 0x0004, + Invalid = 0xFFFF, + }; + + class Device final + { + public: + Device() = default; + + public: + explicit Device(UShort bus, UShort device, UShort function, UInt32 bar); + + Device& operator=(const Device&) = default; + + Device(const Device&) = default; + + ~Device(); + + public: + UInt Read(UInt bar, Size szData); + void Write(UInt bar, UIntPtr data, Size szData); + + public: + operator bool(); + + public: + template + UInt Read(UInt bar) + { + static_assert(sizeof(T) <= 4, "64-bit PCI addressing is unsupported"); + return Read(bar, sizeof(T)); + } + + template + void Write(UInt bar, UIntPtr data) + { + static_assert(sizeof(T) <= 4, "64-bit PCI addressing is unsupported"); + Write(bar, data, sizeof(T)); + } + + public: + UShort DeviceId(); + UShort VendorId(); + UShort InterfaceId(); + UChar Class(); + UChar Subclass(); + UChar ProgIf(); + UChar HeaderType(); + UIntPtr Bar(UInt32 bar_in); + + public: + void EnableMmio(UInt32 bar_in); + void BecomeBusMaster(UInt32 bar_in); // for PCI-DMA, PC-DMA does not need that. + + UShort Vendor(); + + private: + UShort fBus; + UShort fDevice; + UShort fFunction; + UInt32 fBar; + }; +} // namespace NeOS::PCI + +EXTERN_C void NewOSPCISetCfgTarget(NeOS::UInt bar); +EXTERN_C NeOS::UInt NewOSPCIReadRaw(NeOS::UInt bar); diff --git a/dev/kernel/KernelKit/PCI/Express.h b/dev/kernel/KernelKit/PCI/Express.h new file mode 100644 index 00000000..c437a1cb --- /dev/null +++ b/dev/kernel/KernelKit/PCI/Express.h @@ -0,0 +1,12 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include + +#define PCI_EXPRESS_BUS_COUNT (4096) diff --git a/dev/kernel/KernelKit/PCI/IO.h b/dev/kernel/KernelKit/PCI/IO.h new file mode 100644 index 00000000..1d60df8e --- /dev/null +++ b/dev/kernel/KernelKit/PCI/IO.h @@ -0,0 +1,75 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include +#include + +namespace NeOS +{ + template + class IOArray final + { + public: + IOArray() = delete; + + IOArray(nullPtr) = delete; + + explicit IOArray(Array& ports) + : fPorts(ports) + { + } + + ~IOArray() + { + } + + IOArray& operator=(const IOArray&) = default; + + IOArray(const IOArray&) = default; + + operator bool() + { + return !fPorts.Empty(); + } + + public: + template + T In(SizeT index); + + template + void Out(SizeT index, T value); + + private: + Array fPorts; + }; + + inline constexpr UInt16 kMaxPorts = 16; + + using IOArray16 = IOArray; + + template + inline Array make_ports(UShort base) + { + Array ports; + + for (UShort i = 0; i < Sz; ++i) + { + ports[i] = base + i; + } + + return ports; + } +} // namespace NeOS + +#ifdef __x86_64__ +#include +#else +#error Please provide platform specific code for the I/O +#endif // ifdef __x86_64__ diff --git a/dev/kernel/KernelKit/PCI/IOArray+AMD64.inl b/dev/kernel/KernelKit/PCI/IOArray+AMD64.inl new file mode 100644 index 00000000..2630fa98 --- /dev/null +++ b/dev/kernel/KernelKit/PCI/IOArray+AMD64.inl @@ -0,0 +1,54 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: IO-Impl-AMD64.h + Purpose: I/O for AMD64. + + Revision History: + + 30/01/24: Add file. (amlel) + 02/02/24: Update I/O routines. (amlel) + +------------------------------------------- */ + +namespace NeOS +{ + template + template + T IOArray::In(SizeT index) + { + switch (sizeof(T)) + { +#ifdef __NE_AMD64__ + case 4: + return HAL::rt_in32(fPorts[index].Leak()); + case 2: + return HAL::rt_in16(fPorts[index].Leak()); + case 1: + return HAL::rt_in8(fPorts[index].Leak()); +#endif + default: + return 0xFFFF; + } + } + + template + template + void IOArray::Out(SizeT index, T value) + { + switch (sizeof(T)) + { +#ifdef __NE_AMD64__ + case 4: + HAL::rt_out32(fPorts[index].Leak(), value); + case 2: + HAL::rt_out16(fPorts[index].Leak(), value); + case 1: + HAL::rt_out8(fPorts[index].Leak(), value); +#endif + default: + break; + } + } +} // namespace NeOS \ No newline at end of file diff --git a/dev/kernel/KernelKit/PCI/Iterator.h b/dev/kernel/KernelKit/PCI/Iterator.h new file mode 100644 index 00000000..2a788450 --- /dev/null +++ b/dev/kernel/KernelKit/PCI/Iterator.h @@ -0,0 +1,43 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef __PCI_ITERATOR_H__ +#define __PCI_ITERATOR_H__ + +#include +#include +#include +#include +#include + +#define NE_BUS_COUNT (256) +#define NE_DEVICE_COUNT (33) +#define NE_FUNCTION_COUNT (8) + +namespace NeOS::PCI +{ + class Iterator final + { + public: + Iterator() = delete; + + public: + explicit Iterator(const Types::PciDeviceKind& deviceType); + + Iterator& operator=(const Iterator&) = default; + Iterator(const Iterator&) = default; + + ~Iterator(); + + public: + Ref operator[](const Size& sz); + + private: + Array fDevices; + }; +} // namespace NeOS::PCI + +#endif // __PCI_ITERATOR_H__ diff --git a/dev/kernel/KernelKit/PCI/PCI.h b/dev/kernel/KernelKit/PCI/PCI.h new file mode 100644 index 00000000..7eec9ec1 --- /dev/null +++ b/dev/kernel/KernelKit/PCI/PCI.h @@ -0,0 +1,59 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +#define kPCIConfigAddressPort (0xCF8) +#define kPCIConfigDataPort (0xCFC) + +#define kPCIDeviceCount (32) +#define kPCIFuncCount (8) +#define kPCIBusCount (256U) + +namespace NeOS::PCI +{ + // model + struct DeviceHeader + { + UInt16 VendorId; + UInt16 DeviceId; + UInt8 Command; + UInt8 Status; + UInt8 RevisionId; + UInt8 ProgIf; + UInt8 SubClass; + UInt8 Class; + UInt8 CacheLineSz; + UInt8 LatencyTimer; + UInt8 HeaderType; + UInt8 Bist; + UInt8 Bus; + UInt8 Device; + UInt8 Function; + }; + + namespace Detail + { + class BAR + { + public: + UIntPtr BAR; + SizeT Size; + }; + } // namespace Detail + + class BAR + { + public: + Detail::BAR BAR1; + Detail::BAR BAR2; + Detail::BAR BAR3; + Detail::BAR BAR4; + Detail::BAR BAR5; + }; +} // namespace NeOS::PCI diff --git a/dev/kernel/KernelKit/PE.h b/dev/kernel/KernelKit/PE.h new file mode 100644 index 00000000..dbcf2ded --- /dev/null +++ b/dev/kernel/KernelKit/PE.h @@ -0,0 +1,143 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: PE.h + Purpose: Portable Executable for Kernel. + + Revision History: + + 30/01/24: Added file (amlel) + +------------------------------------------- */ + +#ifndef __KERNELKIT_INC_PE_H__ +#define __KERNELKIT_INC_PE_H__ + +#include + +#define kPeSignature 0x00004550 + +#define kPeDLLBase 0x4000000 +#define kPeEXEBase 0x1000000 + +#define kPeMagic32 0x010b +#define kPeMagic64 0x020b + +#define kPeMachineAMD64 0x8664 +#define kPeMachineARM64 0xaa64 + +typedef struct LDR_EXEC_HEADER final +{ + NeOS::UInt32 Signature; + NeOS::UInt16 Machine; + NeOS::UInt16 NumberOfSections; + NeOS::UInt32 TimeDateStamp; + NeOS::UInt32 PointerToSymbolTable; + NeOS::UInt32 NumberOfSymbols; + NeOS::UInt16 SizeOfOptionalHeader; + NeOS::UInt16 Characteristics; +} LDR_EXEC_HEADER, *LDR_EXEC_HEADER_PTR; + +typedef struct LDR_OPTIONAL_HEADER final +{ + NeOS::UInt16 Magic; // 0x010b - PE32, 0x020b - PE32+ (64 bit) + NeOS::UInt8 MajorLinkerVersion; + NeOS::UInt8 MinorLinkerVersion; + NeOS::UInt32 SizeOfCode; + NeOS::UInt32 SizeOfInitializedData; + NeOS::UInt32 SizeOfUninitializedData; + NeOS::UInt32 AddressOfEntryPoint; + NeOS::UInt32 BaseOfCode; + NeOS::UInt32 BaseOfData; + NeOS::UInt32 ImageBase; + NeOS::UInt32 SectionAlignment; + NeOS::UInt32 FileAlignment; + NeOS::UInt16 MajorOperatingSystemVersion; + NeOS::UInt16 MinorOperatingSystemVersion; + NeOS::UInt16 MajorImageVersion; + NeOS::UInt16 MinorImageVersion; + NeOS::UInt16 MajorSubsystemVersion; + NeOS::UInt16 MinorSubsystemVersion; + NeOS::UInt32 Win32VersionValue; + NeOS::UInt32 SizeOfImage; + NeOS::UInt32 SizeOfHeaders; + NeOS::UInt32 CheckSum; + NeOS::UInt16 Subsystem; + NeOS::UInt16 DllCharacteristics; + NeOS::UInt32 SizeOfStackReserve; + NeOS::UInt32 SizeOfStackCommit; + NeOS::UInt32 SizeOfHeapReserve; + NeOS::UInt32 SizeOfHeapCommit; + NeOS::UInt32 LoaderFlags; + NeOS::UInt32 NumberOfRvaAndSizes; +} LDR_OPTIONAL_HEADER, *LDR_OPTIONAL_HEADER_PTR; + +typedef struct LDR_SECTION_HEADER final +{ + NeOS::Char Name[8]; + NeOS::UInt32 VirtualSize; + NeOS::UInt32 VirtualAddress; + NeOS::UInt32 SizeOfRawData; + NeOS::UInt32 PointerToRawData; + NeOS::UInt32 PointerToRelocations; + NeOS::UInt32 PointerToLineNumbers; + NeOS::UInt16 NumberOfRelocations; + NeOS::UInt16 NumberOfLinenumbers; + NeOS::UInt32 Characteristics; +} LDR_SECTION_HEADER, *LDR_SECTION_HEADER_PTR; + +enum kExecDataDirParams +{ + kExecExport, + kExecImport, + kExecInvalid, + kExecCount, +}; + +typedef struct LDR_EXPORT_DIRECTORY +{ + NeOS::UInt32 Characteristics; + NeOS::UInt32 TimeDateStamp; + NeOS::UInt16 MajorVersion; + NeOS::UInt16 MinorVersion; + NeOS::UInt32 Name; + NeOS::UInt32 Base; + NeOS::UInt32 NumberOfFunctions; + NeOS::UInt32 NumberOfNames; + NeOS::UInt32 AddressOfFunctions; // export table rva + NeOS::UInt32 AddressOfNames; + NeOS::UInt32 AddressOfNameOrdinal; // ordinal table rva +} LDR_EXPORT_DIRECTORY, *LDR_EXPORT_DIRECTORY_PTR; + +typedef struct LDR_IMPORT_DIRECTORY +{ + union { + NeOS::UInt32 Characteristics; + NeOS::UInt32 OriginalFirstThunk; + }; + NeOS::UInt32 TimeDateStamp; + NeOS::UInt32 ForwarderChain; + NeOS::UInt32 NameRva; + NeOS::UInt32 ThunkTableRva; +} LDR_IMPORT_DIRECTORY, *LDR_IMPORT_DIRECTORY_PTR; + +typedef struct LDR_DATA_DIRECTORY +{ + NeOS::UInt32 VirtualAddress; + NeOS::UInt32 Size; +} LDR_DATA_DIRECTORY, *LDR_DATA_DIRECTORY_PTR; + +typedef struct LDR_IMAGE_HEADER +{ + LDR_EXEC_HEADER Header; + LDR_OPTIONAL_HEADER OptHdr; +} LDR_IMAGE_HEADER, *LDR_IMAGE_HEADER_PTR; + +enum +{ + kUserSection = 0x00000020, + kPEResourceId = 0xFFaadd00, +}; + +#endif /* ifndef __KERNELKIT_INC_PE_H__ */ diff --git a/dev/kernel/KernelKit/PECodeMgr.h b/dev/kernel/KernelKit/PECodeMgr.h new file mode 100644 index 00000000..1e445b9f --- /dev/null +++ b/dev/kernel/KernelKit/PECodeMgr.h @@ -0,0 +1,24 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: PECodeMgr.h + Purpose: PE32+ Code Mgr and DLL mgr. + + Revision History: + + 12/02/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +//////////////////////////////////////////////////// + +// LAST REV: Mon Feb 12 13:52:01 CET 2024 + +//////////////////////////////////////////////////// + +#include +#include +#include diff --git a/dev/kernel/KernelKit/PEF.h b/dev/kernel/KernelKit/PEF.h new file mode 100644 index 00000000..dfdaed12 --- /dev/null +++ b/dev/kernel/KernelKit/PEF.h @@ -0,0 +1,117 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: PEF.h + Purpose: Preferred Executable Format for Kernel. + + Revision History: + + ?/?/23: Added file (amlel) + +------------------------------------------- */ + +#ifndef KERNELKIT_PEF_H +#define KERNELKIT_PEF_H + +#include +#include +#include + +#define kPefMagic "Joy!" +#define kPefMagicFat "yoJ!" + +#define kPefMagicLen 5 + +#define kPefVersion 3 +#define kPefNameLen 256U + +/* not mandatory, only for non fork based filesystems. */ +#define kPefExt ".o" +#define kPefDylibExt ".dylib" +#define kPefLibExt ".lib" +#define kPefObjectExt ".obj" +#define kPefDebugExt ".dbg" +#define kPefDriverExt ".sys" + +// Kernel System Binary Interface. +#define kPefAbi (0x5046) + +#define kPefBaseOrigin (0x40000000) + +#define kPefStart "__ImageStart" + +#define kPefForkKind kPefMagic +#define kPefForkKindFAT kPefMagicFat + +namespace NeOS +{ + enum + { + kPefArchIntel86S, + kPefArchAMD64, + kPefArchRISCV, + kPefArch64x0, /* 64x0. ISA */ + kPefArch32x0, /* 32x0. ISA */ + kPefArchPowerPC, + kPefArchARM64, + kPefArchCount = (kPefArchPowerPC - kPefArchIntel86S) + 1, + kPefArchInvalid = 0xFF, + }; + + enum + { + kPefSubArchAMD, + kPefSubArchIntel, + kPefSubArchARM, + kPefSubArchGeneric, + kPefSubArchIBM, + }; + + enum + { + kPefKindExec = 1, /* .o */ + kPefKindDylib = 2, /* .dylib */ + kPefKindObject = 4, /* .obj */ + kPefKindDebug = 5, /* .dbg */ + kPefKindDriver = 6, + kPefKindCount, + }; + + typedef struct PEFContainer final + { + Char Magic[kPefMagicLen]; + UInt32 Linker; + UInt32 Version; + UInt32 Kind; + UInt32 Abi; + UInt32 Cpu; + UInt32 SubCpu; /* Cpu specific information */ + UIntPtr Start; + SizeT HdrSz; /* Size of header */ + SizeT Count; /* container header count */ + } PACKED PEFContainer; + + /* First PEFCommandHeader starts after PEFContainer */ + + typedef struct PEFCommandHeader final + { + Char Name[kPefNameLen]; /* container name */ + UInt32 Cpu; /* container cpu */ + UInt32 SubCpu; /* container sub-cpu */ + UInt32 Flags; /* container flags */ + UInt16 Kind; /* container kind */ + UIntPtr Offset; /* content offset */ + SizeT Size; /* content Size */ + } PACKED PEFCommandHeader; + + enum + { + kPefCode = 0xC, + kPefData = 0xD, + kPefZero = 0xE, + kPefLinkerID = 0x1, + }; +} // namespace NeOS + +#endif /* ifndef KERNELKIT_PEF_H */ diff --git a/dev/kernel/KernelKit/PEFCodeMgr.h b/dev/kernel/KernelKit/PEFCodeMgr.h new file mode 100644 index 00000000..47aea432 --- /dev/null +++ b/dev/kernel/KernelKit/PEFCodeMgr.h @@ -0,0 +1,72 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef _INC_CODE_MANAGER_PEF_H_ +#define _INC_CODE_MANAGER_PEF_H_ + +#include +#include +#include +#include + +#ifndef INC_PROCESS_SCHEDULER_H +#include +#endif + +#define kPefApplicationMime "application/vnd-zka-executable" + +namespace NeOS +{ + /// + /// \name PEFLoader + /// \brief PEF loader class. + /// + class PEFLoader : public LoaderInterface + { + private: + explicit PEFLoader() = delete; + + public: + explicit PEFLoader(const VoidPtr blob); + explicit PEFLoader(const Char* path); + ~PEFLoader() override; + + public: + NE_COPY_DEFAULT(PEFLoader); + + public: + const Char* Path() override; + const Char* AsString() override; + const Char* MIME() override; + + public: + ErrorOr FindStart() override; + VoidPtr FindSymbol(const Char* name, Int32 kind) override; + ErrorOr GetBlob() override; + + public: + bool IsLoaded() noexcept; + + private: +#ifdef __FSKIT_INCLUDES_NEFS__ + OwnPtr> fFile; +#else + OwnPtr> fFile; +#endif // __FSKIT_INCLUDES_NEFS__ + + Ref fPath; + VoidPtr fCachedBlob; + bool fFatBinary; + bool fBad; + }; + + namespace Utils + { + ProcessID rtl_create_process(PEFLoader& exec, const Int32& procKind) noexcept; + } // namespace Utils +} // namespace NeOS + +#endif // ifndef _INC_CODE_MANAGER_PEF_H_ diff --git a/dev/kernel/KernelKit/Semaphore.h b/dev/kernel/KernelKit/Semaphore.h new file mode 100644 index 00000000..ac810c62 --- /dev/null +++ b/dev/kernel/KernelKit/Semaphore.h @@ -0,0 +1,16 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +namespace NeOS +{ + typedef Int64 Semaphore; +} // namespace NeOS \ No newline at end of file diff --git a/dev/kernel/KernelKit/ThreadLocalStorage.h b/dev/kernel/KernelKit/ThreadLocalStorage.h new file mode 100644 index 00000000..573b40b8 --- /dev/null +++ b/dev/kernel/KernelKit/ThreadLocalStorage.h @@ -0,0 +1,69 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef KERNELKIT_TLS_H +#define KERNELKIT_TLS_H + +#include +#include + +///! @brief Thread Local Storage for neoskrnl. + +#define kCookieMag0Idx 0 +#define kCookieMag1Idx 1 +#define kCookieMag2Idx 2 + +#define kCookieMag0 'Z' +#define kCookieMag1 'K' +#define kCookieMag2 'A' + +#define kTLSCookieLen (3U) + +struct THREAD_INFORMATION_BLOCK; + +/// @brief Thread Information Block. +/// Located in GS on AMD64, other architectures have their own stuff. (64x0, 32x0, ARM64) +struct PACKED THREAD_INFORMATION_BLOCK final +{ + NeOS::Char Cookie[kTLSCookieLen]{0}; //! Thread magic number. + NeOS::VoidPtr Record{nullptr}; //! Thread information record. +}; + +///! @brief Cookie Sanity check. +NeOS::Boolean tls_check_tib(THREAD_INFORMATION_BLOCK* the_tib); + +///! @brief new ptr syscall. +template +T* tls_new_ptr(void) noexcept; + +///! @brief delete ptr syscall. +template +NeOS::Boolean tls_delete_ptr(T* ptr) noexcept; + +//! @brief Delete process pointer. +//! @param obj The pointer to delete. +template +inline NeOS::Bool tls_delete_ptr(NeOS::ErrorOr obj) noexcept; + +//! @brief Delete process pointer. +//! @param obj The pointer to delete. +template +inline NeOS::Bool tls_delete_ptr(NeOS::ErrorOr obj) noexcept; + +template +T* tls_new_class(Args&&... args); + +/// @brief TLS install TIB and PIB. (syscall) +EXTERN_C NeOS::Void rt_install_tib(THREAD_INFORMATION_BLOCK* TIB, THREAD_INFORMATION_BLOCK* PIB); + +/// @brief TLS check (syscall) +EXTERN_C NeOS::Bool tls_check_syscall_impl(NeOS::VoidPtr TIB) noexcept; + +#include + +// last rev 7/7/24 + +#endif /* ifndef KERNELKIT_TLS_H */ diff --git a/dev/kernel/KernelKit/ThreadLocalStorage.inl b/dev/kernel/KernelKit/ThreadLocalStorage.inl new file mode 100644 index 00000000..d912f5aa --- /dev/null +++ b/dev/kernel/KernelKit/ThreadLocalStorage.inl @@ -0,0 +1,99 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +//! @file ThreadLocalStorage.inl +//! @brief Allocate resources from the process's heap storage. + +#ifndef INC_PROCESS_SCHEDULER_H +#include +#endif + +template +inline T* tls_new_ptr(void) noexcept +{ + using namespace NeOS; + + auto ref_process = UserProcessScheduler::The().CurrentProcess(); + MUST_PASS(ref_process); + + auto pointer = ref_process.Leak().New(sizeof(T)); + + if (pointer.Error()) + return nullptr; + + return reinterpret_cast(pointer.Leak().Leak()); +} + +//! @brief Delete process pointer. +//! @param obj The pointer to delete. +template +inline NeOS::Bool tls_delete_ptr(T* obj) noexcept +{ + using namespace NeOS; + + if (!obj) + return No; + + auto ref_process = UserProcessScheduler::The().CurrentProcess(); + MUST_PASS(ref_process); + + ErrorOr obj_wrapped{obj}; + + return ref_process.Leak().Delete(obj_wrapped, sizeof(T)); +} + +//! @brief Delete process pointer. +//! @param obj The pointer to delete. +template +inline NeOS::Bool tls_delete_ptr(NeOS::ErrorOr obj) noexcept +{ + return tls_delete_ptr(obj.Leak()); +} + +//! @brief Delete process pointer. +//! @param obj The pointer to delete. +template +inline NeOS::Bool tls_delete_ptr(NeOS::ErrorOr obj) noexcept +{ + return tls_delete_ptr(obj->Leak()); +} + +/// @brief Allocate a C++ class, and then call the constructor of it. +/// @tparam T class type. +/// @tparam ...Args varg class type. +/// @param args arguments list. +/// @return Class instance. +template +T* tls_new_class(Args&&... args) +{ + using namespace NeOS; + + T* obj = tls_new_ptr(); + + if (obj) + { + *obj = T(forward(args)...); + return obj; + } + + return nullptr; +} + +/// @brief Delete a C++ class (call constructor first.) +/// @tparam T +/// @param obj +/// @return +template +inline NeOS::Bool tls_delete_class(T* obj) +{ + using namespace NeOS; + + if (!obj) + return No; + + obj->~T(); + return tls_delete_ptr(obj); +} diff --git a/dev/kernel/KernelKit/Timer.h b/dev/kernel/KernelKit/Timer.h new file mode 100644 index 00000000..abca5352 --- /dev/null +++ b/dev/kernel/KernelKit/Timer.h @@ -0,0 +1,83 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include + +namespace NeOS +{ + class SoftwareTimer; + class TimerInterface; + + inline constexpr Int16 kTimeUnit = 1000; + + class TimerInterface + { + public: + /// @brief Default constructor + explicit TimerInterface() = default; + virtual ~TimerInterface() = default; + + public: + NE_COPY_DEFAULT(TimerInterface); + + public: + virtual BOOL Wait() noexcept; + }; + + class SoftwareTimer final : public TimerInterface + { + public: + explicit SoftwareTimer(Int64 seconds); + ~SoftwareTimer() override; + + public: + NE_COPY_DEFAULT(SoftwareTimer); + + public: + BOOL Wait() noexcept override; + + private: + IntPtr* fDigitalTimer{nullptr}; + Int64 fWaitFor{0}; + }; + + class HardwareTimer final : public TimerInterface + { + public: + explicit HardwareTimer(Int64 seconds); + ~HardwareTimer() override; + + public: + NE_COPY_DEFAULT(HardwareTimer); + + public: + BOOL Wait() noexcept override; + + private: + IntPtr* fDigitalTimer{nullptr}; + Int64 fWaitFor{0}; + }; + + inline Int64 rtl_ms(Int64 time) + { + if (time < 0) + return 0; + + // TODO: nanoseconds maybe? + return kTimeUnit * kTimeUnit * time; + } + + inline Int64 rtl_seconds(Int64 time) + { + if (time < 0) + return 0; + + return kTimeUnit * rtl_ms(time); + } +} // namespace NeOS diff --git a/dev/kernel/KernelKit/User.h b/dev/kernel/KernelKit/User.h new file mode 100644 index 00000000..9ab2b02e --- /dev/null +++ b/dev/kernel/KernelKit/User.h @@ -0,0 +1,95 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef INC_USER_H +#define INC_USER_H + +/* ------------------------------------------- + + Revision History: + + 04/03/25: Set users directory as /user/ instead of /usr/ + + ------------------------------------------- */ + +#include +#include +#include +#include + +///! We got the Super, Standard (%s format) and Guest user, +///! all are used to make authorization operations on the OS. +#define kSuperUser "OS AUTHORITY/SUPER/%s" +#define kGuestUser "OS AUTHORITY/GUEST/%s" +#define kStdUser "OS AUTHORITY/STD/%s" + +#define kUsersDir "/user/" + +#define kMaxUserNameLen (256U) +#define kMaxUserTokenLen (256U) + +namespace NeOS +{ + class User; + + enum class UserRingKind + { + kRingInvalid = 0, + kRingStdUser = 1, + kRingSuperUser = 2, + kRingGuestUser = 5, + kRingCount = 3, + }; + + typedef Char* UserPublicKey; + typedef Char UserPublicKeyType; + + /// @brief User class. + class User final + { + public: + User() = delete; + + User(const Int32& sel, const Char* username); + User(const UserRingKind& kind, const Char* username); + + ~User(); + + public: + NE_COPY_DEFAULT(User); + + public: + bool operator==(const User& lhs); + bool operator!=(const User& lhs); + + public: + /// @brief Get software ring + const UserRingKind& Ring() noexcept; + + /// @brief Get user name + Char* Name() noexcept; + + /// @brief Is he a standard user? + Bool IsStdUser() noexcept; + + /// @brief Is she a super user? + Bool IsSuperUser() noexcept; + + /// @brief Saves a password from the public key. + Bool Save(const UserPublicKey password) noexcept; + + /// @brief Checks if a password matches the **password**. + /// @param password the password to check. + Bool Matches(const UserPublicKey password) noexcept; + + private: + UserRingKind mUserRing{UserRingKind::kRingStdUser}; + Char mUserName[kMaxUserNameLen] = {0}; + Char mUserKey[kMaxUserTokenLen] = {0}; + }; +} // namespace NeOS + +#endif /* ifndef INC_USER_H */ diff --git a/dev/kernel/KernelKit/UserProcessScheduler.h b/dev/kernel/KernelKit/UserProcessScheduler.h new file mode 100644 index 00000000..10a08e0f --- /dev/null +++ b/dev/kernel/KernelKit/UserProcessScheduler.h @@ -0,0 +1,343 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef INC_PROCESS_SCHEDULER_H +#define INC_PROCESS_SCHEDULER_H + +#include +#include +#include +#include + +#define kSchedMinMicroTime (AffinityKind::kStandard) +#define kSchedInvalidPID (-1) +#define kSchedProcessLimitPerTeam (32U) + +#define kSchedMaxMemoryLimit gib_cast(128) /* max physical memory limit */ +#define kSchedMaxStackSz mib_cast(8) /* maximum stack size */ + +#define kProcessInvalidID (-1) +#define kProcessNameLen (128U) + +//////////////////////////////////////////////////// +// The current date is: Thu 11/28/2024 // +//////////////////////////////////////////////////// + +namespace NeOS +{ + //! @note Forward class declarations. + + class IDylibObject; + class UserProcess; + class UserProcessTeam; + class UserProcessScheduler; + class UserProcessHelper; + + typedef UInt64 PTime; + + //! @brief Local Process identifier. + typedef Int64 ProcessID; + + //! @brief Local Process status enum. + enum class ProcessStatusKind : Int32 + { + kInvalid, + kStarting, + kRunning, + kKilled, + kFrozen, + kFinished, + kCount, + }; + + //! @brief Affinity is the amount of nano-seconds this process is going + //! to run. + enum class AffinityKind : Int32 + { + kRealTime = 500, + kVeryHigh = 250, + kHigh = 200, + kStandard = 1000, + kLowUsage = 1500, + kVeryLowUsage = 2000, + }; + + // operator overloading. + + inline bool operator<(AffinityKind lhs, AffinityKind rhs) + { + Int32 lhs_int = static_cast(lhs); + Int32 rhs_int = static_cast(rhs); + + return lhs_int < rhs_int; + } + + inline bool operator>(AffinityKind lhs, AffinityKind rhs) + { + Int32 lhs_int = static_cast(lhs); + Int32 rhs_int = static_cast(rhs); + + return lhs_int > rhs_int; + } + + inline bool operator<=(AffinityKind lhs, AffinityKind rhs) + { + Int32 lhs_int = static_cast(lhs); + Int32 rhs_int = static_cast(rhs); + + return lhs_int <= rhs_int; + } + + inline bool operator>=(AffinityKind lhs, AffinityKind rhs) + { + Int32 lhs_int = static_cast(lhs); + Int32 rhs_int = static_cast(rhs); + + return lhs_int >= rhs_int; + } + + // end of operator overloading. + + enum class ProcessSubsystem : Int32 + { + kProcessSubsystemSecurity = 100, + kProcessSubsystemApplication, + kProcessSubsystemService, + kProcessSubsystemDriver, + kProcessSubsystemInvalid = 256U, + kProcessSubsystemCount = 4, + }; + + using ProcessTime = UInt64; + using PID = Int64; + + // for permission manager, tells where we run the code. + enum class ProcessLevelRing : Int32 + { + kRingStdUser = 1, + kRingSuperUser = 2, + kRingGuestUser = 5, + kRingCount = 5, + }; + + /// @brief Helper type to describe a code image. + using ImagePtr = VoidPtr; + + struct UserProcessImage final + { + explicit UserProcessImage() = default; + + ImagePtr fCode; + ImagePtr fBlob; + + Bool HasCode() + { + return this->fCode != nullptr; + } + + Bool HasImage() + { + return this->fBlob != nullptr; + } + }; + + /// @name UserProcess + /// @brief User process class, holds information about the running process/thread. + class UserProcess final + { + public: + explicit UserProcess(); + ~UserProcess(); + + public: + NE_COPY_DEFAULT(UserProcess); + + public: + Char Name[kProcessNameLen] = {"Process"}; + ProcessSubsystem SubSystem{ProcessSubsystem::kProcessSubsystemInvalid}; + User* Owner{nullptr}; + HAL::StackFramePtr StackFrame{nullptr}; + AffinityKind Affinity{AffinityKind::kStandard}; + ProcessStatusKind Status{ProcessStatusKind::kFinished}; + UInt8* StackReserve{nullptr}; + UserProcessImage Image{}; + SizeT StackSize{kSchedMaxStackSz}; + IDylibObject* DylibDelegate{nullptr}; + SizeT MemoryCursor{0UL}; + SizeT MemoryLimit{kSchedMaxMemoryLimit}; + SizeT UsedMemory{0UL}; + + struct ProcessMemoryHeapList final + { + VoidPtr MemoryEntry{nullptr}; + SizeT MemoryEntrySize{0UL}; + SizeT MemoryEntryPad{0UL}; + + struct ProcessMemoryHeapList* MemoryPrev{nullptr}; + struct ProcessMemoryHeapList* MemoryNext{nullptr}; + }; + + struct UserProcessSignal final + { + UIntPtr SignalArg; + ProcessStatusKind PreviousStatus; + UIntPtr SignalID; + }; + + UserProcessSignal ProcessSignal; + ProcessMemoryHeapList* ProcessMemoryHeap{nullptr}; + UserProcessTeam* ProcessParentTeam; + + VoidPtr VMRegister{0UL}; + + enum + { + kInvalidExecutableKind, + kExectuableKind, + kExectuableDylibKind, + kExectuableKindCount, + }; + + ProcessTime PTime{0}; //! @brief Process allocated tine. + + PID ProcessId{kSchedInvalidPID}; + Int32 Kind{kExectuableKind}; + + public: + //! @brief boolean operator, check status. + operator bool(); + + ///! @brief Crashes the app, exits with code ~0. + Void Crash(); + + ///! @brief Exits the app. + Void Exit(const Int32& exit_code = 0); + + ///! @brief TLS allocate. + ///! @param sz size of new ptr. + ErrorOr New(const SizeT& sz, const SizeT& pad_amount = 0); + + ///! @brief TLS free. + ///! @param ptr the pointer to free. + ///! @param sz the size of it. + template + Boolean Delete(ErrorOr ptr, const SizeT& sz); + + ///! @brief Wakes up threads. + Void Wake(const Bool wakeup = false); + + public: + //! @brief Gets the local exit code. + const UInt32& GetExitCode() noexcept; + + ///! @brief Get the process's name + ///! @example 'C Runtime Library' + const Char* GetName() noexcept; + + //! @brief return local error code of process. + //! @return Int32 local error code. + Int32& GetLocalCode() noexcept; + + const User* GetOwner() noexcept; + const ProcessStatusKind& GetStatus() noexcept; + const AffinityKind& GetAffinity() noexcept; + + private: + UInt32 fLastExitCode{0}; + Int32 fLocalCode{0}; + + friend UserProcessScheduler; + friend UserProcessHelper; + }; + + /// \brief Processs Team (contains multiple processes inside it.) + /// Equivalent to a process batch + class UserProcessTeam final + { + public: + explicit UserProcessTeam(); + ~UserProcessTeam() = default; + + NE_COPY_DEFAULT(UserProcessTeam); + + Array& AsArray(); + Ref& AsRef(); + ProcessID& Id() noexcept; + + public: + Array mProcessList; + Ref mCurrentProcess; + ProcessID mTeamId{0}; + ProcessID mProcessCount{0}; + }; + + typedef Array UserThreadArray; + + using UserProcessRef = UserProcess&; + + /// @brief Process scheduler class. + /// The main class which you call to schedule user processes. + class UserProcessScheduler final : public ISchedulable + { + friend class UserProcessHelper; + + public: + explicit UserProcessScheduler() = default; + ~UserProcessScheduler() override = default; + + NE_COPY_DEFAULT(UserProcessScheduler) + + operator bool(); + bool operator!(); + + public: + UserProcessTeam& CurrentTeam(); + + public: + ProcessID Spawn(const Char* name, VoidPtr code, VoidPtr image); + const Bool Remove(ProcessID process_id); + + const Bool IsUser() override; + const Bool IsKernel() override; + const Bool HasMP() override; + + public: + Ref& CurrentProcess(); + const SizeT Run() noexcept; + + public: + STATIC UserProcessScheduler& The(); + + private: + UserProcessTeam mTeam{}; + }; + + /* + * \brief UserProcess helper class, which contains needed utilities for the scheduler. + */ + + class UserProcessHelper final + { + public: + STATIC Bool Switch(VoidPtr image_ptr, UInt8* stack_ptr, HAL::StackFramePtr frame_ptr, const PID& new_pid); + STATIC Bool CanBeScheduled(const UserProcess& process); + STATIC ErrorOr TheCurrentPID(); + STATIC SizeT StartScheduling(); + }; + + const UInt32& sched_get_exit_code(void) noexcept; +} // namespace NeOS + +#include +#include + +//////////////////////////////////////////////////// + +// END + +//////////////////////////////////////////////////// + +#endif /* ifndef INC_PROCESS_SCHEDULER_H */ diff --git a/dev/kernel/KernelKit/UserProcessScheduler.inl b/dev/kernel/KernelKit/UserProcessScheduler.inl new file mode 100644 index 00000000..6b3b9300 --- /dev/null +++ b/dev/kernel/KernelKit/UserProcessScheduler.inl @@ -0,0 +1,62 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + FILE: UserProcessScheduler.inl + PURPOSE: Low level/Ring-3 Process scheduler. + +------------------------------------------- */ + +namespace NeOS +{ + /***********************************************************************************/ + /** @brief Free pointer from usage. */ + /***********************************************************************************/ + + template + Boolean UserProcess::Delete(ErrorOr ptr, const SizeT& sz) + { + if (!ptr) + return No; + + if (!this->ProcessMemoryHeap) + { + kout << "Process Memory is empty.\r"; + return No; + } + + ProcessMemoryHeapList* entry = this->ProcessMemoryHeap; + + while (entry != nullptr) + { + if (entry->MemoryEntry == ptr.Leak().Leak()) + { + this->UsedMemory -= entry->MemoryEntrySize; + +#ifdef __NE_AMD64__ + auto pd = hal_read_cr3(); + + hal_write_cr3(this->VMRegister); + + auto ret = mm_delete_heap(entry->MemoryEntry); + + hal_write_cr3(pd); + + return ret == kErrorSuccess; +#else + Bool ret = mm_delete_heap(ptr.Leak().Leak()); + + return ret == kErrorSuccess; +#endif + } + + entry = entry->MemoryNext; + } + + kout << "Invalid Pointer: Trying to free a pointer which doesn't exist.\r"; + + this->Crash(); + + return No; + } +} // namespace NeOS diff --git a/dev/kernel/KernelKit/XCOFF.h b/dev/kernel/KernelKit/XCOFF.h new file mode 100644 index 00000000..5e59e717 --- /dev/null +++ b/dev/kernel/KernelKit/XCOFF.h @@ -0,0 +1,51 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: XCOFF.h + Purpose: XCOFF for Kernel. + + Revision History: + + 04/07/24: Added file (amlel) + +------------------------------------------- */ + +#ifndef INC_XOCFF_H +#define INC_XOCFF_H + +#include + +#define kXCOFF64Magic (0x01F7) + +#define kXCOFFRelFlg (0x0001) +#define kXCOFFExecutable (0x0002) +#define kXCOFFLnno (0x0004) +#define kXCOFFLSyms (0x0008) + +struct XCoffFileHeader; +struct XCoffForkHeader; + +/// @brief XCoff file header, meant for POWER apps. +typedef struct XCoffFileHeader +{ + NeOS::UInt16 fMagic; + NeOS::UInt16 fTarget; + NeOS::UInt16 fNumSecs; + NeOS::UInt32 fTimeDat; + NeOS::UIntPtr fSymPtr; + NeOS::UInt32 fNumSyms; + NeOS::UInt16 fOptHdr; // ?: Number of bytes in optional header +} XCoffFileHeader64; + +#define kForkNameLen (256U) + +/// @brief This the executable manifest fork. +typedef struct XCoffForkHeader +{ + NeOS::Char fPropertiesXMLFork[kForkNameLen]; + NeOS::Char fDynamicLoaderFork[kForkNameLen]; + NeOS::Char fCodeSignFork[kForkNameLen]; +} XCoffForkHeader; + +#endif // ifndef INC_XOCFF_H diff --git a/dev/kernel/KernelRsrc.rsrc b/dev/kernel/KernelRsrc.rsrc new file mode 100644 index 00000000..d437c176 --- /dev/null +++ b/dev/kernel/KernelRsrc.rsrc @@ -0,0 +1,25 @@ +#include "CompilerKit/Version.h" + +1 VERSIONINFO +FILEVERSION 1,0,0,0 +PRODUCTVERSION 1,0,0,0 +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080904E4" + BEGIN + VALUE "CompanyName", "Amlal El Mahrouss." + VALUE "FileDescription", "NeKernel." + VALUE "FileVersion", KERNEL_VERSION + VALUE "InternalName", "neoskrnl" + VALUE "LegalCopyright", "(c) 2024 Amlal El Mahrouss, all rights reserved." + VALUE "OriginalFilename", "neoskrnl.exe" + VALUE "ProductName", "NeKernel." + VALUE "ProductVersion", KERNEL_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x809, 1252 + END +END diff --git a/dev/kernel/MoveAll.ARM64.sh b/dev/kernel/MoveAll.ARM64.sh new file mode 100755 index 00000000..35e0909e --- /dev/null +++ b/dev/kernel/MoveAll.ARM64.sh @@ -0,0 +1,7 @@ +#! /bin/sh + +for file in *.o; do + mv -- "$file" "${file%.o}.obj" +done + +mv *.obj obj/ diff --git a/dev/kernel/MoveAll.X64.sh b/dev/kernel/MoveAll.X64.sh new file mode 100755 index 00000000..1c135d06 --- /dev/null +++ b/dev/kernel/MoveAll.X64.sh @@ -0,0 +1,7 @@ +#! /bin/sh + +for file in *.o; do + mv -- "$file" "${file%.o}.obj" +done + +mv *.obj HALKit/AMD64/*.obj obj/ diff --git a/dev/kernel/NetworkKit/IP.h b/dev/kernel/NetworkKit/IP.h new file mode 100644 index 00000000..4a552d87 --- /dev/null +++ b/dev/kernel/NetworkKit/IP.h @@ -0,0 +1,83 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include +#include + +namespace NeOS +{ + class RawIPAddress6; + class RawIPAddress; + class IPFactory; + + class RawIPAddress final + { + private: + explicit RawIPAddress(char bytes[4]); + ~RawIPAddress() = default; + + RawIPAddress& operator=(const RawIPAddress&) = delete; + RawIPAddress(const RawIPAddress&) = default; + + public: + Char* Address(); + + Char& operator[](const Size& index); + + BOOL operator==(const RawIPAddress& ipv6); + BOOL operator!=(const RawIPAddress& ipv6); + + private: + Char fAddr[4]; + + friend IPFactory; // it is the one creating these addresses, thus this + // is why the constructors are private. + }; + + /** + * @brief IPv6 address. + */ + class RawIPAddress6 final + { + private: + explicit RawIPAddress6(char Bytes[8]); + ~RawIPAddress6() = default; + + RawIPAddress6& operator=(const RawIPAddress6&) = delete; + RawIPAddress6(const RawIPAddress6&) = default; + + public: + char* Address() + { + return fAddr; + } + + char& operator[](const Size& index); + + bool operator==(const RawIPAddress6& ipv6); + bool operator!=(const RawIPAddress6& ipv6); + + private: + char fAddr[8]; + + friend IPFactory; + }; + + /** + * @brief IP Creation helpers + */ + class IPFactory final + { + public: + static ErrorOr ToKString(Ref& ipv6); + static ErrorOr ToKString(Ref& ipv4); + static bool IpCheckVersion4(const Char* ip); + }; +} // namespace NeOS diff --git a/dev/kernel/NetworkKit/IPC.h b/dev/kernel/NetworkKit/IPC.h new file mode 100644 index 00000000..e8f0898f --- /dev/null +++ b/dev/kernel/NetworkKit/IPC.h @@ -0,0 +1,91 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.. + + File: IPC.h. + Purpose: IPC protocol. + +------------------------------------------- */ + +#ifndef INC_IPC_H +#define INC_IPC_H + +#include +#include +#include + +/// @file IPC.h +/// @brief IPC comm. protocol. + +/// IA separator. +#define kIPCRemoteSeparator ":" + +/// Interchange address, consists of PID:TEAM. +#define kIPCRemoteInvalid "00:00" + +#define kIPCHeaderMagic (0x4950434) + +namespace NeOS +{ + struct IPC_ADDR; + struct IPC_MSG; + + /// @brief 128-bit IPC address. + struct PACKED IPC_ADDR final + { + UInt64 UserProcessID; + UInt64 UserProcessTeam; + + //////////////////////////////////// + // some operators. + //////////////////////////////////// + + bool operator==(const IPC_ADDR& addr) noexcept; + + bool operator==(IPC_ADDR& addr) noexcept; + + bool operator!=(const IPC_ADDR& addr) noexcept; + + bool operator!=(IPC_ADDR& addr) noexcept; + }; + + typedef struct IPC_ADDR IPC_ADDR; + + enum + { + kIPCLittleEndian = 0, + kIPCBigEndian = 1, + kIPCMixedEndian = 2, + }; + + constexpr inline auto kIPCMsgSize = 6094U; + + /// @brief IPC connection header, message cannot be greater than 6K. + typedef struct IPC_MSG final + { + UInt32 IpcHeaderMagic; // cRemoteHeaderMagic + UInt8 IpcEndianess; // 0 : LE, 1 : BE + SizeT IpcPacketSize; + IPC_ADDR IpcFrom; + IPC_ADDR IpcTo; + UInt32 IpcCRC32; + UInt32 IpcMsg; + UInt32 IpcMsgSz; + UInt8 IpcData[kIPCMsgSize]; + + /// @brief Passes the message to target, could be anything, HTTP packet, JSON or whatever. + static Bool Pass(IPC_MSG* self, IPC_MSG* target) noexcept; + } PACKED IPC_MSG; + + /// @brief Sanitize packet function + /// @retval true packet is correct. + /// @retval false packet is incorrect and process has crashed. + Bool ipc_sanitize_packet(_Input IPC_MSG* pckt_in); + + /// @brief Construct packet function + /// @retval true packet is correct. + /// @retval false packet is incorrect and process has crashed. + Bool ipc_construct_packet(_Output _Input IPC_MSG** pckt_in); +} // namespace NeOS + +#endif // INC_IPC_H diff --git a/dev/kernel/NetworkKit/LTE.h b/dev/kernel/NetworkKit/LTE.h new file mode 100644 index 00000000..e0a0ff64 --- /dev/null +++ b/dev/kernel/NetworkKit/LTE.h @@ -0,0 +1,16 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.. + + File: LTE.h. + Purpose: LTE protocol classes. + +------------------------------------------- */ + +#ifndef _INC_NETWORK_LTE_H_ +#define _INC_NETWORK_LTE_H_ + +#include +#include + +#endif // ifndef _INC_NETWORK_LTE_H_ diff --git a/dev/kernel/NetworkKit/MAC.h b/dev/kernel/NetworkKit/MAC.h new file mode 100644 index 00000000..f7283708 --- /dev/null +++ b/dev/kernel/NetworkKit/MAC.h @@ -0,0 +1,36 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +#define kMACAddrLen (12) + +namespace NeOS +{ + class MacAddressGetter; + + /// \brief This retrieves the MAC address of the device. + /// \note Listens for the current NIC. + class MacAddressGetter final + { + public: + MacAddressGetter() = default; + ~MacAddressGetter() = default; + + NE_COPY_DEFAULT(MacAddressGetter); + + public: + Array& AsBytes(); + + private: + Array fMacAddress; + }; + +} // namespace NeOS diff --git a/dev/kernel/NetworkKit/NetworkDevice.h b/dev/kernel/NetworkKit/NetworkDevice.h new file mode 100644 index 00000000..c95573f3 --- /dev/null +++ b/dev/kernel/NetworkKit/NetworkDevice.h @@ -0,0 +1,83 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef __INC_NETWORK_DEVICE_H__ +#define __INC_NETWORK_DEVICE_H__ + +#include +#include + +/// @note Can either work with: Ethernet, GPRS, WiFi + +namespace NeOS +{ + struct NetworkDeviceCommand; + class NetworkDevice; + + /** + * \brief Network device interface, establishes a connection to the NIC. + */ + class NetworkDevice final : public IDeviceObject + { + public: + NetworkDevice(void (*out)(IDeviceObject*, NetworkDeviceCommand), + void (*in)(IDeviceObject*, NetworkDeviceCommand), + void (*onCleanup)(void) = nullptr); + + ~NetworkDevice() override; + + public: + NetworkDevice& operator=(const NetworkDevice&) = default; + NetworkDevice(const NetworkDevice&) = default; + + public: + const Char* Name() const override; + Boolean Name(const Char* newStr); + + private: + static constexpr auto cNetworkNameLen = 512; + + Void (*fCleanup)(void); + Char fNetworkName[cNetworkNameLen]; + }; + + struct NetworkDeviceCommand final + { + UInt32 CommandName; + UInt32 CommandType; + UInt32 CommandFlags; + VoidPtr CommandBuffer; + SizeT CommandSizeBuffer; + }; + + /// @brief TCP device. + using TCPNetworkDevice = NetworkDevice; + + /// @brief UDP device. + using UDPNetworkDevice = NetworkDevice; + + /// @brief PPP device. + using PPPNetworkDevice = NetworkDevice; + + /// @brief IPC device. + using IPCNetworkDevice = NetworkDevice; + + /// @brief GRPS device. + using GPRSNetworkDevice = NetworkDevice; + + /// @brief GSM device. + using GSMNetworkDevice = NetworkDevice; + + /// @brief Bluetooth device. + using BTNetworkDevice = NetworkDevice; + + /// @brief LTE device. + using LTENetworkDevice = NetworkDevice; +} // namespace NeOS + +#include + +#endif // !__INC_NETWORK_DEVICE_H__ diff --git a/dev/kernel/NetworkKit/NetworkDevice.inl b/dev/kernel/NetworkKit/NetworkDevice.inl new file mode 100644 index 00000000..dceae66e --- /dev/null +++ b/dev/kernel/NetworkKit/NetworkDevice.inl @@ -0,0 +1,32 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +/*** + Dtor and ctors. +*/ + +namespace NeOS +{ + NetworkDevice::NetworkDevice(void (*out)(IDeviceObject*, NetworkDeviceCommand), + void (*in)(IDeviceObject*, NetworkDeviceCommand), + void (*on_cleanup)(void)) + : IDeviceObject(out, in), fCleanup(on_cleanup) + { + kout << "NetworkDevice initialized.\r"; + + MUST_PASS(out && in && on_cleanup); + } + + NetworkDevice::~NetworkDevice() + { + MUST_PASS(fCleanup); + + kout << "NetworkDevice cleanup.\r"; + + if (fCleanup) + fCleanup(); + } +} // namespace NeOS diff --git a/dev/kernel/NewKit/Array.h b/dev/kernel/NewKit/Array.h new file mode 100644 index 00000000..54c09636 --- /dev/null +++ b/dev/kernel/NewKit/Array.h @@ -0,0 +1,65 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +namespace NeOS +{ + template + class Array final + { + public: + explicit Array() = default; + ~Array() = default; + + Array& operator=(const Array&) = default; + Array(const Array&) = default; + + T& operator[](const SizeT& at) + { + MUST_PASS(at < this->Count()); + return fArray[at]; + } + + Boolean Empty() + { + return this->Count() > 0; + } + + const SizeT Capacity() + { + return N; + } + + const SizeT Count() + { + return N; + } + + const T* CData() + { + return fArray; + } + + operator bool() + { + return !Empty(); + } + + private: + T fArray[N]; + }; + + template + auto make_list(ValueType val) + { + return Array{val}; + } +} // namespace NeOS diff --git a/dev/kernel/NewKit/ArrayList.h b/dev/kernel/NewKit/ArrayList.h new file mode 100644 index 00000000..06763b5a --- /dev/null +++ b/dev/kernel/NewKit/ArrayList.h @@ -0,0 +1,63 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +namespace NeOS +{ + template + class ArrayList final + { + public: + explicit ArrayList(T* list, SizeT length) + : fList(reinterpret_cast(list)) + { + } + + ~ArrayList() = default; + + ArrayList& operator=(const ArrayList&) = default; + ArrayList(const ArrayList&) = default; + + T* Data() + { + return fList; + } + + const T* CData() + { + return fList; + } + + T& operator[](int index) const + { + MUST_PASS(index < this->Count()); + return fList[index]; + } + + operator bool() + { + return fList; + } + + SizeT Count() const + { + return fLen; + } + + private: + T* fList{nullptr}; + SizeT fLen{0}; + }; + + template + ArrayList make_list(ValueType val) + { + return ArrayList{val}; + } +} // namespace NeOS diff --git a/dev/kernel/NewKit/Atom.h b/dev/kernel/NewKit/Atom.h new file mode 100644 index 00000000..3979b0d1 --- /dev/null +++ b/dev/kernel/NewKit/Atom.h @@ -0,0 +1,47 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ +#pragma once + +#include + +namespace NeOS +{ + template + class Atom final + { + public: + explicit Atom() = default; + ~Atom() = default; + + public: + Atom& operator=(const Atom&) = delete; + Atom(const Atom&) = delete; + + public: + T operator[](Size bit) + { + return (fArrayOfAtoms & (1 << bit)); + } + + void operator|(Size bit) + { + fArrayOfAtoms |= (1 << bit); + } + + friend Boolean operator==(Atom& atomic, const T& idx) + { + return atomic[idx] == idx; + } + + friend Boolean operator!=(Atom& atomic, const T& idx) + { + return atomic[idx] == idx; + } + + private: + T fArrayOfAtoms; + }; +} // namespace NeOS diff --git a/dev/kernel/NewKit/Crc32.h b/dev/kernel/NewKit/Crc32.h new file mode 100644 index 00000000..c3e14413 --- /dev/null +++ b/dev/kernel/NewKit/Crc32.h @@ -0,0 +1,23 @@ +/* + * ======================================================== + * + * NeKernel + * Date Added: 13/02/2023 + * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + * + * ======================================================== + */ + +#ifndef CRC32_H +#define CRC32_H + +#include + +#define kCrcCnt (256) + +namespace NeOS +{ + UInt32 ke_calculate_crc32(const Char* crc, Int32 len) noexcept; +} // namespace NeOS + +#endif // !CRC32_H diff --git a/dev/kernel/NewKit/CxxAbi.h b/dev/kernel/NewKit/CxxAbi.h new file mode 100644 index 00000000..e6d83e07 --- /dev/null +++ b/dev/kernel/NewKit/CxxAbi.h @@ -0,0 +1,28 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ +#pragma once + +#include + +#ifndef __TOOLCHAINKIT__ + +#define kAtExitMacDestructors (128) + +struct atexit_func_entry_t +{ + void (*destructor_func)(void*); + void* obj_ptr; + void* dso_handle; +}; + +typedef unsigned uarch_t; + +namespace cxxabiv1 +{ + typedef void* __guard; +} + +#endif // __GNUC__ diff --git a/dev/kernel/NewKit/Defines.h b/dev/kernel/NewKit/Defines.h new file mode 100644 index 00000000..0b0b97e5 --- /dev/null +++ b/dev/kernel/NewKit/Defines.h @@ -0,0 +1,200 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +#define NEWKIT_VERSION_STR "1.1.0" +#define NEWKIT_VERSION_BCD 0x01100 + +#ifndef __cplusplus +#error NeOS compiles with a C++ compiler. +#endif + +#if __cplusplus <= 201703L +#define char8_t char +#endif + +#ifdef __has_feature +#if !__has_feature(cxx_nullptr) +#if !__has_nullptr +#error !!! You must at least have nullptr featured on your C++ compiler. !!! +#endif +#endif +#endif + +/// @brief The **Kernel** namespace where it's API resides. +namespace NeOS +{ + using voidPtr = void*; + using VoidPtr = void*; + using nullPtr = decltype(nullptr); + using NullPtr = decltype(nullptr); + + using Int = int; + using Int32 = int; + using UShort = unsigned short; + using UInt16 = unsigned short; + using Short = short; + using Int16 = short; + using UInt = unsigned int; + using UInt32 = unsigned int; + using Long = __INT64_TYPE__; + using Int64 = __INT64_TYPE__; + using ULong = __UINT64_TYPE__; + using UInt64 = __UINT64_TYPE__; + using Boolean = bool; + using Bool = bool; + using Char = char; + using UChar = unsigned char; + using UInt8 = unsigned char; + + using SSize = Int64; + using SSizeT = Int64; + using Size = __SIZE_TYPE__; + using SizeT = __SIZE_TYPE__; + using IntPtr = __INTPTR_TYPE__; + using UIntPtr = __UINTPTR_TYPE__; + using IntFast = __INT_FAST32_TYPE__; + using IntFast64 = __INT_FAST64_TYPE__; + using PtrDiff = __PTRDIFF_TYPE__; + + using SInt16 = Int16; + using SInt32 = Int32; + using SInt64 = Int64; + + typedef UIntPtr* Ptr64; + typedef UInt32* Ptr32; + typedef UInt8* Ptr8; + + using Utf8Char = char8_t; + using Utf16Char = char16_t; + using WideChar = wchar_t; + using Utf32Char = char32_t; + + using LongDouble = long double; + using Double = double; + using Float = float; + + typedef UInt32 PhysicalAddressKind; + typedef UIntPtr VirtualAddressKind; + + using Void = void; + + using Lba = UInt64; + + using Char16 = char16_t; + + enum class Endian : UInt8 + { + kEndianInvalid, + kEndianBig, + kEndianLittle, + kEndianMixed, + kEndianCount + }; + + /// @brief Forward object. + /// @tparam Args the object type. + /// @param arg the object. + /// @return object's rvalue + template + inline Args&& forward(Args& arg) + { + return static_cast(arg); + } + + /// @brief Move object. + /// @tparam Args the object type. + /// @param arg the object. + /// @return object's rvalue + template + inline Args&& move(Args&& arg) + { + return static_cast(arg); + } + + /// @brief Encoding interface, used as a proxy to convert T to Char* + /// Used to cast A to B or B to A. + class ICodec + { + public: + explicit ICodec() = default; + virtual ~ICodec() = default; + + ICodec& operator=(const ICodec&) = default; + ICodec(const ICodec&) = default; + + public: + /// @brief Convert type to bytes. + /// @tparam T the type. + /// @param type (a1) the data. + /// @return a1 as Char* + template + Char* AsBytes(T type) noexcept + { + return nullptr; + } + + /// @brief Construct from type to class. + /// @tparam T the type to convert. + /// @param type (a1) the data. + /// @return a1 as Char* + template + OutputClass* Construct(Char* type) noexcept + { + FactoryClass class_fac; + return class_fac.template From(type); + } + + /// @brief Convert T class to Y class. + /// @tparam T the class type of type. + /// @tparam Y the result class. + /// @param type the class to cast. + /// @return the class as Y. + template + Y As(T type) noexcept + { + if (type.template IsSerializable()) + { + return reinterpret_cast(type); + } + + return type.template As(); + } + }; + + /// \brief Scheduler interface, represents a scheduler object. + /// @note This is used to schedule tasks, such as threads, drivers, user threads, etc. + class ISchedulable + { + public: + explicit ISchedulable() = default; + virtual ~ISchedulable() = default; + + ISchedulable& operator=(const ISchedulable&) = default; + ISchedulable(const ISchedulable&) = default; + + /// @brief Is this object only accepting user tasks? + virtual const Bool IsUser() + { + return NO; + } + + /// @brief Is this object only accepting kernel tasks? + virtual const Bool IsKernel() + { + return NO; + } + + /// @brief Is this object offloading to another CPU? + virtual const Bool HasMP() + { + return NO; + } + }; +} // namespace NeOS diff --git a/dev/kernel/NewKit/ErrorOr.h b/dev/kernel/NewKit/ErrorOr.h new file mode 100644 index 00000000..7c879cc8 --- /dev/null +++ b/dev/kernel/NewKit/ErrorOr.h @@ -0,0 +1,82 @@ +/* + * ======================================================== + * + * NeKernel + * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + * + * ======================================================== + */ + +#pragma once + +#include +#include + +namespace NeOS +{ + using ErrorT = UInt; + + template + class ErrorOr final + { + public: + ErrorOr() = default; + ~ErrorOr() = default; + + public: + explicit ErrorOr(Int32 err) + : mId(err) + { + } + + explicit ErrorOr(nullPtr Null) + { + } + + explicit ErrorOr(T* Class) + : mRef(Class) + { + } + + explicit ErrorOr(T Class) + : mRef(Class) + { + } + + ErrorOr& operator=(const ErrorOr&) = default; + ErrorOr(const ErrorOr&) = default; + + ErrorOr& operator=(const Ref& refErr) + { + mRef = refErr; + return *this; + } + + Ref& Leak() + { + return mRef; + } + + Int32 Error() + { + return mId; + } + + operator bool() + { + return mRef; + } + + BOOL HasError() + { + return this->mId > 0; + } + + private: + Ref mRef; + UInt32 mId{0}; + }; + + using ErrorOrAny = ErrorOr; + +} // namespace NeOS diff --git a/dev/kernel/NewKit/Function.h b/dev/kernel/NewKit/Function.h new file mode 100644 index 00000000..d25c06c1 --- /dev/null +++ b/dev/kernel/NewKit/Function.h @@ -0,0 +1,53 @@ +#ifndef _INC_FUNCTION_H__ +#define _INC_FUNCTION_H__ + +#include + +namespace NeOS +{ + template + class Function final + { + public: + Function() = default; + + public: + explicit Function(T (*Fn)(Args... args)) + : fFn(Fn) + { + } + + ~Function() = default; + + Function& operator=(const Function&) = default; + Function(const Function&) = default; + + template + T operator()(Args... args) + { + return fFn(args...); + } + + template + T Call(Args... args) + { + return fFn(args...); + } + + operator bool() + { + return fFn; + } + + bool operator!() + { + return !fFn; + } + + private: + T(*fFn) + (Args... args); + }; +} // namespace NeOS + +#endif // !_INC_FUNCTION_H__ diff --git a/dev/kernel/NewKit/Json.h b/dev/kernel/NewKit/Json.h new file mode 100644 index 00000000..7b53fa4a --- /dev/null +++ b/dev/kernel/NewKit/Json.h @@ -0,0 +1,151 @@ + +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +// last-rev: 30/01/24 + +#include +#include +#include +#include +#include + +#define kMaxJsonPath 8196 +#define kJSONLen 256 +#define kJSONNull "[]" + +namespace NeOS +{ + /// @brief JavaScript object class + class Json final + { + public: + explicit Json() + { + auto len = kJSONLen; + KString key = KString(len); + key += kJSONNull; + + this->AsKey() = key; + this->AsValue() = key; + } + + explicit Json(SizeT lhsLen, SizeT rhsLen) + : fKey(lhsLen), fValue(rhsLen) + { + } + + ~Json() = default; + + NE_COPY_DEFAULT(Json); + + const Bool& IsUndefined() + { + return fUndefined; + } + + private: + Bool fUndefined; // is this instance undefined? + KString fKey; + KString fValue; + + public: + /// @brief returns the key of the json + /// @return the key as string view. + KString& AsKey() + { + return fKey; + } + + /// @brief returns the value of the json. + /// @return the key as string view. + KString& AsValue() + { + return fValue; + } + + static Json kNull; + }; + + /// @brief Json stream reader helper. + struct JsonStreamReader final + { + STATIC Json In(const Char* full_array) + { + auto start_val = '{'; + auto end_val = '}'; + Boolean probe_value = false; + + if (full_array[0] != start_val) + { + if (full_array[0] != '[') + return Json::kNull; + + start_val = '['; + end_val = ']'; + + probe_value = true; + } + + SizeT len = rt_string_len(full_array); + + SizeT key_len = 0; + SizeT value_len = 0; + + Json type(kMaxJsonPath, kMaxJsonPath); + + for (SizeT i = 1; i < len; ++i) + { + if (full_array[i] == '\r' || + full_array[i] == '\n') + continue; + + if (probe_value) + { + if (full_array[i] == end_val || + full_array[i] == ',') + { + probe_value = false; + + ++value_len; + } + else + { + type.AsValue().Data()[value_len] = full_array[i]; + + ++value_len; + } + } + else + { + if (start_val == '[') + continue; + + if (full_array[i] == ':') + { + probe_value = true; + type.AsKey().Data()[key_len] = 0; + ++key_len; + } + else + { + type.AsKey().Data()[key_len] = full_array[i]; + + ++key_len; + } + } + } + + type.AsValue().Data()[value_len] = 0; + + return type; + } + }; + + using JsonStream = Stream; +} // namespace NeOS diff --git a/dev/kernel/NewKit/KString.h b/dev/kernel/NewKit/KString.h new file mode 100644 index 00000000..e7525a9c --- /dev/null +++ b/dev/kernel/NewKit/KString.h @@ -0,0 +1,94 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include +#include +#include + +#define cMinimumStringSize 8196 + +namespace NeOS +{ + /// @brief Kernel string class, not dynamic. + class KString final + { + public: + explicit KString() + { + fDataSz = cMinimumStringSize; + + fData = new Char[fDataSz]; + MUST_PASS(fData); + + rt_set_memory(fData, 0, fDataSz); + } + + explicit KString(const SizeT& Sz) + : fDataSz(Sz) + { + MUST_PASS(Sz > 1); + + fData = new Char[Sz]; + MUST_PASS(fData); + + rt_set_memory(fData, 0, Sz); + } + + ~KString() + { + if (fData) + { + delete[] fData; + fData = nullptr; + } + } + + NE_COPY_DEFAULT(KString); + + Char* Data(); + const Char* CData() const; + Size Length() const; + + bool operator==(const Char* rhs) const; + bool operator!=(const Char* rhs) const; + + bool operator==(const KString& rhs) const; + bool operator!=(const KString& rhs) const; + + KString& operator+=(const Char* rhs); + KString& operator+=(const KString& rhs); + + operator bool() + { + return fData; + } + + bool operator!() + { + return fData; + } + + private: + Char* fData{nullptr}; + Size fDataSz{0}; + Size fCur{0}; + + friend class KStringBuilder; + }; + + struct KStringBuilder final + { + static ErrorOr Construct(const Char* data); + static const Char* FromBool(const Char* fmt, bool n); + static const Char* Format(const Char* fmt, const Char* from); + static bool Equals(const Char* lhs, const Char* rhs); + static bool Equals(const WideChar* lhs, const WideChar* rhs); + }; +} // namespace NeOS diff --git a/dev/kernel/NewKit/KernelPanic.h b/dev/kernel/NewKit/KernelPanic.h new file mode 100644 index 00000000..11f9a05d --- /dev/null +++ b/dev/kernel/NewKit/KernelPanic.h @@ -0,0 +1,74 @@ + +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +namespace NeOS +{ + void ke_runtime_check(bool expr, const Char* file, const Char* line); +} + +#define MUST_PASS_COMPILER(EXPR, MSG) static_assert(EXPR, MSG) + +#ifdef TRY +#undef TRY +#endif + +#define TRY(X) \ + { \ + auto fn = X; \ + if ((fn()) == NO) \ + { \ + MUST_PASS(NO); \ + } \ + } + +#ifdef __MUST_PASS +#undef __MUST_PASS +#endif + +#define __MUST_PASS(EXPR, FILE, LINE) \ + NeOS::ke_runtime_check(EXPR, FILE, STRINGIFY(LINE)) + +#ifdef __DEBUG__ +#define MUST_PASS(EXPR) __MUST_PASS((EXPR), __FILE__, __LINE__) +#define assert(EXPR) MUST_PASS(EXPR) +#else +#define MUST_PASS(EXPR) (NeOS::Void)(EXPR) +#define assert(EXPR) (NeOS::Void)(EXPR) +#endif + +enum RUNTIME_CHECK +{ + RUNTIME_CHECK_FAILED = 1111, + RUNTIME_CHECK_POINTER, + RUNTIME_CHECK_EXPRESSION, + RUNTIME_CHECK_FILE, + RUNTIME_CHECK_IPC, + RUNTIME_CHECK_TLS, + RUNTIME_CHECK_HANDSHAKE, + RUNTIME_CHECK_ACPI, + RUNTIME_CHECK_INVALID_PRIVILEGE, + RUNTIME_CHECK_PROCESS, + RUNTIME_CHECK_BAD_BEHAVIOR, + RUNTIME_CHECK_BOOTSTRAP, + RUNTIME_CHECK_UNEXCPECTED, + RUNTIME_CHECK_FILESYSTEM, + RUNTIME_CHECK_VIRTUAL_OUT_OF_MEM, + RUNTIME_CHECK_PAGE, + RUNTIME_CHECK_INVALID, + RUNTIME_CHECK_COUNT, +}; + +typedef enum RUNTIME_CHECK RTL_RUNTIME_CHECK; + +namespace NeOS +{ + void ke_panic(const Int32& id, const Char* message = nullptr); +} // namespace NeOS diff --git a/dev/kernel/NewKit/Macros.h b/dev/kernel/NewKit/Macros.h new file mode 100644 index 00000000..637a2a30 --- /dev/null +++ b/dev/kernel/NewKit/Macros.h @@ -0,0 +1,149 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#ifndef KIB +#define KIB(X) (NeOS::UInt64)((X) / 1024) +#endif + +#ifndef kib_cast +#define kib_cast(X) (NeOS::UInt64)((X)*1024) +#endif + +#ifndef MIB +#define MIB(X) (NeOS::UInt64)((NeOS::UInt64)KIB(X) / 1024) +#endif + +#ifndef mib_cast +#define mib_cast(X) (NeOS::UInt64)((NeOS::UInt64)kib_cast(X) * 1024) +#endif + +#ifndef GIB +#define GIB(X) (NeOS::UInt64)((NeOS::UInt64)MIB(X) / 1024) +#endif + +#ifndef gib_cast +#define gib_cast(X) (NeOS::UInt64)((NeOS::UInt64)mib_cast(X) * 1024) +#endif + +#ifndef TIB +#define TIB(X) (NeOS::UInt64)((NeOS::UInt64)GIB(X) / 1024) +#endif + +#ifndef tib_cast +#define tib_cast(X) ((NeOS::UInt64)gib_cast(X) * 1024) +#endif + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) \ + (((sizeof(a) / sizeof(*(a))) / \ + (static_cast(!(sizeof(a) % sizeof(*(a))))))) +#endif + +#define DEPRECATED ATTRIBUTE(deprecated) + +#ifndef ALIGN +#define ALIGN(X) __attribute__((aligned(X))) +#endif // #ifndef ALIGN + +#ifndef ATTRIBUTE +#define ATTRIBUTE(...) __attribute__((__VA_ARGS__)) +#endif // #ifndef ATTRIBUTE + +#ifndef __NE_VER__ +#define __NE_VER__ (2024) +#endif // !__NE_VER__ + +#ifndef EXTERN +#define EXTERN extern +#endif + +#ifndef EXTERN_C +#define EXTERN_C extern "C" +#endif + +#ifndef MAKE_ENUM +#define MAKE_ENUM(NAME) \ + enum NAME \ + { +#endif + +#ifndef END_ENUM +#define END_ENUM() \ + } \ + ; +#endif + +#ifndef MAKE_STRING_ENUM +#define MAKE_STRING_ENUM(NAME) \ + namespace NAME \ + { +#endif + +#ifndef ENUM_STRING +#define ENUM_STRING(NAME, VAL) inline constexpr const char* e##NAME = VAL +#endif + +#ifndef END_STRING_ENUM +#define END_STRING_ENUM() } +#endif + +#ifndef RTL_ALLOCA +#define RTL_ALLOCA(sz) __builtin_alloca(sz) +#endif // #ifndef RTL_ALLOCA + +#ifndef CANT_REACH +#define CANT_REACH() __builtin_unreachable() +#endif + +#define kInvalidAddress 0xFBFBFBFBFBFBFBFB +#define kBadAddress 0x0000000000000000 +#define kMaxAddr 0xFFFFFFFFFFFFFFFF +#define kPathLen 0x100 + +#define PACKED ATTRIBUTE(packed) +#define NO_EXEC ATTRIBUTE(noexec) + +#define EXTERN extern +#define STATIC static + +#define CONST const + +#define STRINGIFY(X) #X +#define NE_UNUSED(X) ((NeOS::Void)X) + +#ifndef RGB +#define RGB(R, G, B) (NeOS::UInt32)(R | G << 0x8 | B << 0x10) +#endif // !RGB + +#ifdef __NE_AMD64__ +#define dbg_break_point() asm volatile("int $3") +#else +#define dbg_break_point() ((void)0) +#endif + +#define RTL_ENDIAN(address, value) \ + (((reinterpret_cast(address)[0]) == (value)) \ + ? (NeOS::Endian::kEndianBig) \ + : (NeOS::Endian::kEndianLittle)) + +#define Yes true +#define No false + +#define YES true +#define NO false + +#define TRUE true +#define FALSE false + +#define BOOL NeOS::Boolean + +#ifdef RTL_INIT_OBJECT +#undef RTL_INIT_OBJECT +#endif // ifdef RTL_INIT_OBJECT + +#define RTL_INIT_OBJECT(OBJ, TYPE, ...) TYPE OBJ = TYPE(__VA_ARGS__) diff --git a/dev/kernel/NewKit/MutableArray.h b/dev/kernel/NewKit/MutableArray.h new file mode 100644 index 00000000..bfb432de --- /dev/null +++ b/dev/kernel/NewKit/MutableArray.h @@ -0,0 +1,239 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ +#pragma once + +#include +#include +#include + +#define TRY_FIND_NODE(NAME, NODE) \ + auto* NAME = NODE; \ + while (NAME) \ + { \ + if (NAME->fIndex == Index) \ + return NAME->fVal; \ + NAME = NAME->fNext; \ + } + +#define TRY_FIND_NODE2(NAME, NODE) \ + auto* NAME = NODE; \ + while (NAME) \ + { \ + if (NAME->fIndex == Index) \ + return Ref{NAME->fVal}; \ + NAME = NAME->fNext; \ + } + +#define TRY_REMOVE_NODE(NODE) \ + if (NODE && NODE->fIndex == Index) \ + { \ + NODE->fUsed = false; \ + NODE->fIndex = 0; \ + \ + return true; \ + } + +// FIXME: this is a shitty algorithm, which is consumer hungry. +// Remove and occurences of that, and remove that class. +namespace NeOS +{ + template + class MutableArray; + + template + class NullableMutableArray; + + template + class MutableLinkedList + { + public: + T fVal; + SizeT fIndex{0}; + Boolean fUsed{false}; + + MutableLinkedList* fPrev{nullptr}; + MutableLinkedList* fNext{nullptr}; + }; + + template + class NullableMutableArray + { + public: + // explicit this. + explicit NullableMutableArray() + : fFirstNode(new MutableLinkedList()) + { + } + + /* + * We free all the nodes allocated by the array + * and store the next one inside "NextIt" + */ + + virtual ~NullableMutableArray() + { + auto* It = fFirstNode; + MutableLinkedList* NextIt = nullptr; + + while (It) + { + NextIt = It->fNext; + delete It; + + It = NextIt; + } + } + + NullableMutableArray& operator=(const NullableMutableArray&) = default; + NullableMutableArray(const NullableMutableArray&) = default; + + operator bool() + { + return Count() > 1; + } + + public: + T operator[](const SizeT& Index) const + { + TRY_FIND_NODE(first, fFirstNode); + TRY_FIND_NODE(last, fLastNode); + + return _PlaceHolderValue; + } + + SizeT Count() const + { + return fNodeCount; + } + + public: + Boolean Remove(const SizeT& Index) + { + TRY_REMOVE_NODE(fFirstNode); + TRY_REMOVE_NODE(fLastNode); + + return false; + } + + Boolean Add(const T val) + { + auto* iterationNode = fFirstNode; + MUST_PASS(iterationNode); + + while (iterationNode) + { + if (!iterationNode->fUsed) + { + iterationNode->fVal = val; + iterationNode->fIndex = 0; + + iterationNode->fUsed = true; + + ++fNodeCount; + + return true; + } + + iterationNode = iterationNode->fNext; + } + + return false; + } + + private: + /* Avoid useless lookups */ + MutableLinkedList* fLastNode{nullptr}; + MutableLinkedList* fFirstNode{nullptr}; + + /* Number of nodes inside of this dynamic array. */ + NeOS::SizeT fNodeCount{0}; + + private: + // don't remove that + friend MutableArray; + }; + + template + class MutableArray : public NullableMutableArray + { + public: + // explicit this. + explicit MutableArray() = default; + virtual ~MutableArray() = default; + + NE_COPY_DEFAULT(MutableArray) + + public: + Boolean Add(const T val) + { + auto* iterationNode = fFirstNode; + + if (!iterationNode) + { + fFirstNode = new MutableLinkedList(); + iterationNode = fFirstNode; + } + + MUST_PASS(iterationNode); + + while (iterationNode) + { + if (!iterationNode->fUsed) + { + iterationNode->fVal = val; + iterationNode->fIndex = 0; + + iterationNode->fUsed = true; + + ++fNodeCount; + + return true; + } + + iterationNode = iterationNode->fNext; + } + + return false; + } + + public: + Ref operator[](const SizeT& Index) const + { + TRY_FIND_NODE2(first, fFirstNode); + TRY_FIND_NODE2(last, fLastNode); + + return {}; + } + + SizeT Count() const + { + return fNodeCount; + } + + bool Contains(T& value) noexcept + { + MutableLinkedList* first = fFirstNode; + + while (first) + { + if (first->fVal == value && first->fUsed) + return true; + + first = first->fNext; + } + + return false; + } + + private: + /* Avoid useless lookups */ + MutableLinkedList* fLastNode{nullptr}; + MutableLinkedList* fFirstNode{nullptr}; + + /* Number of nodes inside of this dynamic array. */ + NeOS::SizeT fNodeCount{0}; + }; +} // namespace NeOS diff --git a/dev/kernel/NewKit/New.h b/dev/kernel/NewKit/New.h new file mode 100644 index 00000000..5e1545db --- /dev/null +++ b/dev/kernel/NewKit/New.h @@ -0,0 +1,20 @@ + +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +/// @note compatible with tk too. +typedef __SIZE_TYPE__ size_t; + +void* operator new(size_t ptr); +void* operator new[](size_t ptr); + +void operator delete(void* ptr); +void operator delete(void* ptr, unsigned long); +void operator delete[](void* ptr); diff --git a/dev/kernel/NewKit/NewKit.h b/dev/kernel/NewKit/NewKit.h new file mode 100644 index 00000000..69d39824 --- /dev/null +++ b/dev/kernel/NewKit/NewKit.h @@ -0,0 +1,20 @@ + +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/dev/kernel/NewKit/OwnPtr.h b/dev/kernel/NewKit/OwnPtr.h new file mode 100644 index 00000000..169f16d9 --- /dev/null +++ b/dev/kernel/NewKit/OwnPtr.h @@ -0,0 +1,94 @@ + +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +namespace NeOS +{ + template + class OwnPtr; + + template + class NonNullRefPtr; + + template + class OwnPtr final + { + public: + OwnPtr() + { + } + ~OwnPtr() + { + this->Delete(); + } + + OwnPtr& operator=(const OwnPtr&) = default; + OwnPtr(const OwnPtr&) = default; + + public: + template + bool New(Args&&... arg) + { + if (fCls) + { + return false; + } + + fCls = new T(arg...); + return fCls; + } + + void Delete() + { + if (fCls) + delete fCls; + + fCls = nullptr; + } + + T* operator->() const + { + return fCls; + }; + T* Raw() + { + return fCls; + } + + Ref AsRef() + { + return Ref(fCls); + } + + operator bool() + { + return fCls; + } + bool operator!() + { + return !fCls; + } + + private: + T* fCls; + }; + + template + OwnPtr make_ptr(Args... args) + { + OwnPtr ret; + ret.template New(forward(args)...); + MUST_PASS(ret); + + return ret; + } +} // namespace NeOS diff --git a/dev/kernel/NewKit/PageMgr.h b/dev/kernel/NewKit/PageMgr.h new file mode 100644 index 00000000..3d8e1f9a --- /dev/null +++ b/dev/kernel/NewKit/PageMgr.h @@ -0,0 +1,81 @@ +// a way to create and find our pages. +// I'm thinking about a separate way of getting a paged area. + +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include + +namespace NeOS +{ + class PageMgr; + + class PTEWrapper final + { + public: + explicit PTEWrapper(Boolean Rw = false, Boolean User = false, Boolean ExecDisable = false, UIntPtr Address = 0); + + ~PTEWrapper(); + + PTEWrapper& operator=(const PTEWrapper&) = default; + PTEWrapper(const PTEWrapper&) = default; + + public: + const UIntPtr VirtualAddress(); + + Void NoExecute(const bool enable = false); + Bool NoExecute(); + + operator bool() + { + return fVirtAddr; + } + + bool Reclaim(); + bool Shareable(); + bool Present(); + bool Access(); + + private: + Boolean fRw; + Boolean fUser; + Boolean fExecDisable; + UIntPtr fVirtAddr; + Boolean fCache; + Boolean fShareable; + Boolean fWt; + Boolean fPresent; + Boolean fAccessed; + + private: + friend class PageMgr; + friend class Pmm; + }; + + struct PageMgr final + { + public: + PageMgr() = default; + ~PageMgr() = default; + + PageMgr& operator=(const PageMgr&) = default; + PageMgr(const PageMgr&) = default; + + public: + PTEWrapper Request(Boolean Rw, Boolean User, Boolean ExecDisable, SizeT Sz); + bool Free(Ref& wrapper); + + private: + void FlushTLB(); + + private: + friend PTEWrapper; + friend class Pmm; + }; +} // namespace NeOS diff --git a/dev/kernel/NewKit/Pair.h b/dev/kernel/NewKit/Pair.h new file mode 100644 index 00000000..05a95ff3 --- /dev/null +++ b/dev/kernel/NewKit/Pair.h @@ -0,0 +1,14 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +namespace NeOS +{ + class Pair; +} // namespace NeOS diff --git a/dev/kernel/NewKit/Pmm.h b/dev/kernel/NewKit/Pmm.h new file mode 100644 index 00000000..97bdc0eb --- /dev/null +++ b/dev/kernel/NewKit/Pmm.h @@ -0,0 +1,44 @@ + +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include + +namespace NeOS +{ + class Pmm; + class PTEWrapper; + + class Pmm final + { + public: + explicit Pmm(); + ~Pmm(); + + Pmm& operator=(const Pmm&) = delete; + Pmm(const Pmm&) = default; + + Ref RequestPage(Boolean user = false, Boolean readWrite = false); + Boolean FreePage(Ref refPage); + + Boolean ToggleRw(Ref refPage, Boolean enable = true); + Boolean TogglePresent(Ref refPage, Boolean enable = true); + Boolean ToggleUser(Ref refPage, Boolean enable = true); + Boolean ToggleShare(Ref refPage, Boolean enable = true); + + /// @brief Get the page manager of this. + Ref& Leak() + { + return fPageMgr; + } + + private: + Ref fPageMgr; + }; +} // namespace NeOS diff --git a/dev/kernel/NewKit/Ref.h b/dev/kernel/NewKit/Ref.h new file mode 100644 index 00000000..e41bf3bc --- /dev/null +++ b/dev/kernel/NewKit/Ref.h @@ -0,0 +1,108 @@ + +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef _NEWKIT_REF_H_ +#define _NEWKIT_REF_H_ + +#include +#include +#include + +namespace NeOS +{ + template + class Ref final + { + public: + Ref() = default; + + ~Ref() + { + if (mm_is_valid_heap(fClass)) + delete fClass; + } + + public: + Ref(T* cls) + : fClass(cls) + { + } + + Ref(T cls) + : fClass(&cls) + { + } + + Ref& operator=(T ref) + { + if (!fClass) + return *this; + + fClass = &ref; + return *this; + } + + public: + T operator->() const + { + MUST_PASS(*fClass); + return *fClass; + } + + T& Leak() noexcept + { + return *fClass; + } + + T& TryLeak() const noexcept + { + MUST_PASS(*fClass); + return *fClass; + } + + T operator*() + { + return *fClass; + } + + operator bool() noexcept + { + return fClass; + } + + private: + T* fClass{nullptr}; + }; + + template + class NonNullRef final + { + public: + NonNullRef() = delete; + NonNullRef(nullPtr) = delete; + + NonNullRef(T* ref) + : fRef(ref) + { + MUST_PASS(ref); + } + + Ref& operator->() + { + MUST_PASS(fRef); + return fRef; + } + + NonNullRef& operator=(const NonNullRef& ref) = delete; + NonNullRef(const NonNullRef& ref) = default; + + private: + Ref fRef{nullptr}; + }; +} // namespace NeOS + +#endif // ifndef _NEWKIT_REF_H_ diff --git a/dev/kernel/NewKit/Stream.h b/dev/kernel/NewKit/Stream.h new file mode 100644 index 00000000..541d3389 --- /dev/null +++ b/dev/kernel/NewKit/Stream.h @@ -0,0 +1,58 @@ + +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include + +namespace NeOS +{ + template + class Stream final + { + public: + explicit Stream(Ref ref) + : fStream(ref) + { + } + + ~Stream() = default; + + Stream& operator=(const Stream&) = default; + Stream(const Stream&) = default; + + template + friend Stream& operator>>(Stream& Ks, Ref& Buf) + { + Ks.fKind = Ks.fStream->In(Buf); + return *Ks; + } + + template + friend Stream& operator<<(Stream& Ks, Ref& Buf) + { + Ks.fKind = Buf; + Ks.fStream->Out(Buf.Leak()); + return *Ks; + } + + Ref& AsStreamTrait() + { + return fStream; + } + + Ref& AsType() + { + return fKind; + } + + private: + Ref fStream; + Ref fKind; + }; +} // namespace NeOS diff --git a/dev/kernel/NewKit/Utils.h b/dev/kernel/NewKit/Utils.h new file mode 100644 index 00000000..3df823ef --- /dev/null +++ b/dev/kernel/NewKit/Utils.h @@ -0,0 +1,30 @@ + +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +namespace NeOS +{ + Int rt_copy_memory(const voidPtr src, voidPtr dst, Size len); + Int rt_move_memory(const voidPtr src, voidPtr dst, Size len); + voidPtr rt_set_memory(voidPtr dst, UInt32 val, Size len); + void rt_zero_memory(voidPtr pointer, Size len); + Int rt_string_cmp(const Char* src, const Char* cmp, Size len); + const Char* rt_alloc_string(const Char* text); + Size rt_string_len(const Char* str); + Size rt_string_len(const Char* str, SizeT _len); + Boolean rt_to_string(Char* str_out, UInt64 base, Int32 limit); + Boolean rt_is_newln(Char chr); + Boolean rt_is_space(Char chr); + Int32 rt_is_alnum(Int32 character); + Int rt_to_uppercase(Int c); + Int rt_to_lower(Int c); + voidPtr rt_string_in_string(const Char* in, const Char* needle); + char* rt_string_has_char(Char* str, const Char chr); +} // namespace NeOS diff --git a/dev/kernel/NewKit/Variant.h b/dev/kernel/NewKit/Variant.h new file mode 100644 index 00000000..82be6636 --- /dev/null +++ b/dev/kernel/NewKit/Variant.h @@ -0,0 +1,72 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +namespace NeOS +{ + class Variant final + { + public: + enum class VariantKind + { + kString, + kBlob, + kNull, + kJson, + kXML, + }; + + public: + explicit Variant() = delete; + + public: + NE_COPY_DEFAULT(Variant); + + ~Variant() = default; + + public: + explicit Variant(KString* stringView) + : fPtr((VoidPtr)stringView), fKind(VariantKind::kString) + { + } + + explicit Variant(Json* json) + : fPtr((VoidPtr)json), fKind(VariantKind::kJson) + { + } + + explicit Variant(nullPtr ptr) + : fPtr(ptr), fKind(VariantKind::kNull) + { + } + + explicit Variant(VoidPtr ptr) + : fPtr(ptr), fKind(VariantKind::kBlob) + { + } + + public: + const Char* ToString(); + VoidPtr Leak(); + + template + T* As() + { + return reinterpret_cast(fPtr); + } + + VariantKind& Kind(); + + private: + voidPtr fPtr{nullptr}; + VariantKind fKind{VariantKind::kNull}; + }; +} // namespace NeOS diff --git a/dev/kernel/SignalKit/Signals.h b/dev/kernel/SignalKit/Signals.h new file mode 100644 index 00000000..09d392f6 --- /dev/null +++ b/dev/kernel/SignalKit/Signals.h @@ -0,0 +1,22 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +typedef NeOS::UInt32 SignalKind; + +#define SIGKILL 0 +#define SIGPAUS 1 +#define SIGEXEC 2 +#define SIGTRAP 3 +#define SIGABRT 4 +#define SIGCONT 5 + +#define SIGBREK 666 +#define SIGATCH 661 +#define SIGDTCH 662 \ No newline at end of file diff --git a/dev/kernel/StorageKit/AHCI.h b/dev/kernel/StorageKit/AHCI.h new file mode 100644 index 00000000..43e81ba0 --- /dev/null +++ b/dev/kernel/StorageKit/AHCI.h @@ -0,0 +1,60 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +namespace NeOS +{ + class AHCIDeviceInterface NE_DEVICE + { + public: + explicit AHCIDeviceInterface(void (*out)(IDeviceObject* self, MountpointInterface* out), + void (*in)(IDeviceObject* self, MountpointInterface* in), + void (*cleanup)(void)); + + virtual ~AHCIDeviceInterface() override; + + public: + AHCIDeviceInterface& operator=(const AHCIDeviceInterface&) = default; + AHCIDeviceInterface(const AHCIDeviceInterface&) = default; + + const Char* Name() const override; + + const UInt16& GetPortsImplemented() + { + return this->fPortsImplemented; + } + + Void SetPortsImplemented(const UInt16& pi) + { + MUST_PASS(pi > 0); + this->fPortsImplemented = pi; + } + + const UInt32& GetIndex() + { + return this->fDriveIndex; + } + + Void SetIndex(const UInt32& drv) + { + MUST_PASS(MountpointInterface::kDriveIndexInvalid != drv); + this->fDriveIndex = drv; + } + + private: + Void (*fCleanup)(Void) = {nullptr}; + UInt16 fPortsImplemented{0U}; + UInt32 fDriveIndex{0U}; + }; + + UInt16 sk_init_ahci_device(BOOL atapi); + ErrorOr sk_acquire_ahci_device(Int32 drv_index); +} // namespace NeOS diff --git a/dev/kernel/StorageKit/ATA.h b/dev/kernel/StorageKit/ATA.h new file mode 100644 index 00000000..5698fe85 --- /dev/null +++ b/dev/kernel/StorageKit/ATA.h @@ -0,0 +1,39 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include +#include + +namespace NeOS +{ + /// @brief ATA device interface type. + class ATADeviceInterface : public IDeviceObject + { + public: + explicit ATADeviceInterface(void (*Out)(IDeviceObject*, MountpointInterface* outpacket), + void (*In)(IDeviceObject*, MountpointInterface* inpacket), + void (*Cleanup)(void)); + + virtual ~ATADeviceInterface(); + + public: + ATADeviceInterface& operator<<(MountpointInterface* Data) override; + ATADeviceInterface& operator>>(MountpointInterface* Data) override; + + public: + ATADeviceInterface& operator=(const ATADeviceInterface&) = default; + ATADeviceInterface(const ATADeviceInterface&) = default; + + const Char* Name() const override; + + private: + void (*fCleanup)(void) = {nullptr}; + }; +} // namespace NeOS diff --git a/dev/kernel/StorageKit/NVME.h b/dev/kernel/StorageKit/NVME.h new file mode 100644 index 00000000..22300726 --- /dev/null +++ b/dev/kernel/StorageKit/NVME.h @@ -0,0 +1,34 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include + +namespace NeOS +{ + class NVMEDeviceInterface final NE_DEVICE + { + public: + explicit NVMEDeviceInterface(Void (*out)(IDeviceObject*, MountpointInterface* out_packet), + Void (*in)(IDeviceObject*, MountpointInterface* in_packet), + Void (*cleanup)(Void)); + + ~NVMEDeviceInterface() override; + + public: + NE_COPY_DEFAULT(NVMEDeviceInterface); + + const Char* Name() const override; + + public: + OwnPtr operator()(UInt32 dma_low, UInt32 dma_high, SizeT dma_sz); + + private: + Void (*fCleanup)(Void) = {nullptr}; + }; +} // namespace NeOS diff --git a/dev/kernel/StorageKit/PRDT.h b/dev/kernel/StorageKit/PRDT.h new file mode 100644 index 00000000..40ba11e0 --- /dev/null +++ b/dev/kernel/StorageKit/PRDT.h @@ -0,0 +1,36 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +#define kPrdtTransferSize (sizeof(NeOS::UShort)) + +namespace NeOS +{ + /// @brief Tranfer information about PRD. + enum kPRDTTransfer + { + kPRDTTransferInProgress, + kPRDTTransferIsDone, + kPRDTTransferCount, + }; + + /// @brief Physical Region Descriptor Table. + struct PRDT + { + UInt32 fPhysAddress; + UInt32 fSectorCount; + UInt8 fEndBit; + }; + + void construct_prdt(Ref& prd); + + EXTERN_C Int32 kPRDTTransferStatus; +} // namespace NeOS diff --git a/dev/kernel/StorageKit/SCSI.h b/dev/kernel/StorageKit/SCSI.h new file mode 100644 index 00000000..fc526447 --- /dev/null +++ b/dev/kernel/StorageKit/SCSI.h @@ -0,0 +1,11 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +extern const scsi_packet_type<12> kCDRomPacketTemplate; diff --git a/dev/kernel/StorageKit/StorageKit.h b/dev/kernel/StorageKit/StorageKit.h new file mode 100644 index 00000000..a0f1a2d1 --- /dev/null +++ b/dev/kernel/StorageKit/StorageKit.h @@ -0,0 +1,22 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#define kDriveSectorSizeHDD (512U) +#define kDriveSectorSizeSSD (512U) +#define kDriveSectorSizeOptical (2048) + +namespace NeOS +{ + template + class IDeviceObject; + + class NVMEDeviceInterface; + class AHCIDeviceInterface; + class ATADeviceInterface; + class SCSIDeviceInterface; +} // namespace NeOS diff --git a/dev/kernel/SystemKit/SwapDisk.h b/dev/kernel/SystemKit/SwapDisk.h new file mode 100644 index 00000000..11cc6332 --- /dev/null +++ b/dev/kernel/SystemKit/SwapDisk.h @@ -0,0 +1,46 @@ + +/* ------------------------------------------- + + Copyright (C) 2024-2025 Amlal EL Mahrouss Labs, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include + +#define kSwapBlockMaxSize (mib_cast(16)) +#define kSwapPageFile "/boot/pagefile.sys" + +/// @file SwapDisk.h +/// @brief Virtual memory swap disk. + +namespace NeOS +{ + struct SWAP_DISK_HEADER; + + /// @brief This class is a disk swap delegate for any data. available as a syscall too. + class SwapDisk final + { + public: + explicit SwapDisk() = default; + ~SwapDisk() = default; + + NE_COPY_DEFAULT(SwapDisk); + + BOOL Write(const Char* fork_name, const SizeT fork_name_len, SWAP_DISK_HEADER* data, const SizeT data_len); + SWAP_DISK_HEADER* Read(const Char* fork_name, const SizeT fork_name_len, const SizeT data_len); + }; + + typedef struct SWAP_DISK_HEADER + { + UInt32 fMagic; + SizeT fHeaderSz; + UInt64 fTeamID; + UInt64 fProcessID; + UInt64 fVirtualAddress; + SizeT fBlobSz; + Char fBlob[]; + } PACKED SWAP_DISK_HEADER; +} // namespace NeOS diff --git a/dev/kernel/amd64-ci.make b/dev/kernel/amd64-ci.make new file mode 100644 index 00000000..534e896c --- /dev/null +++ b/dev/kernel/amd64-ci.make @@ -0,0 +1,79 @@ +################################################## +# (c) Amlal EL Mahrouss, all rights reserved. +# This is the neoskrnl's makefile. +################################################## + +CXX = x86_64-w64-mingw32-g++ +LD = x86_64-w64-mingw32-ld +CCFLAGS = -fshort-wchar -c -D__NE_AMD64__ -mno-red-zone -fno-rtti -fno-exceptions -std=c++20 -D__NE_SUPPORT_NX__ -O0 -I../Vendor -D__FSKIT_INCLUDES_NEFS__ -D__NEOSKRNL__ -D__HAVE_NE_APIS__ -D__FREESTANDING__ -D__NE_VIRTUAL_MEMORY_SUPPORT__ -D__NE_AUTO_FORMAT__ -D__NE__ -I./ -I../ -I../zba + +ASM = nasm + +DISK_DRV = + +ifneq ($(ATA_PIO_SUPPORT), ) +DISK_DRV = -D__ATA_PIO__ +endif + +ifneq ($(ATA_DMA_SUPPORT), ) +DISK_DRV = -D__ATA_DMA__ +endif + +ifneq ($(AHCI_SUPPORT), ) +DISK_DRV = -D__AHCI__ +endif + +ifneq ($(DEBUG_SUPPORT), ) +DEBUG_MACRO = -D__DEBUG__ +endif + +COPY = cp + +# Add assembler, linker, and object files variables. +ASMFLAGS = -f win64 + +# Kernel subsystem is 17 and entrypoint is hal_init_platform +LDFLAGS = -e hal_init_platform --subsystem=17 --image-base 0x4000000 +LDOBJ = obj/*.obj + +# This file is the Kernel, responsible of task, memory, driver, sci, disk and device management. +KERNEL_IMG = neoskrnl.exe + +.PHONY: error +error: + @echo "=== ERROR ===" + @echo "=> Use a specific target." + +MOVEALL=./MoveAll.X64.sh +WINDRES=x86_64-w64-mingw32-windres + +.PHONY: newos-amd64-epm +newos-amd64-epm: clean + $(WINDRES) KernelRsrc.rsrc -O coff -o KernelRsrc.obj + $(CXX) $(CCFLAGS) $(DISK_DRV) $(DEBUG_MACRO) $(wildcard src/*.cc) $(wildcard HALKit/AMD64/PCI/*.cc) $(wildcard src/Network/*.cc) $(wildcard src/Storage/*.cc) $(wildcard src/FS/*.cc) $(wildcard HALKit/AMD64/Storage/*.cc) $(wildcard HALKit/AMD64/*.cc) $(wildcard src/System/*.cc) $(wildcard HALKit/AMD64/*.s) + $(ASM) $(ASMFLAGS) HALKit/AMD64/HalInterruptAPI.asm + $(ASM) $(ASMFLAGS) HALKit/AMD64/HalCommonAPI.asm + $(ASM) $(ASMFLAGS) HALKit/AMD64/HalBoot.asm + $(ASM) $(ASMFLAGS) HALKit/AMD64/HalUtils.asm + $(MOVEALL) + +OBJCOPY=x86_64-w64-mingw32-objcopy + +.PHONY: link-amd64-epm +link-amd64-epm: + $(LD) $(LDFLAGS) $(LDOBJ) -o $(KERNEL_IMG) + +.PHONY: all +all: newos-amd64-epm link-amd64-epm + @echo "Kernel => OK." + +.PHONY: help +help: + @echo "=== HELP ===" + @echo "all: Build Kernel and link it." + @echo "link-amd64-epm: Link Kernel for EPM based disks." + @echo "newos-amd64-epm: Build Kernel for EPM based disks." + +.PHONY: clean +clean: + rm -f $(LDOBJ) $(wildcard *.o) $(KERNEL_IMG) diff --git a/dev/kernel/amd64-desktop.make b/dev/kernel/amd64-desktop.make new file mode 100644 index 00000000..534e896c --- /dev/null +++ b/dev/kernel/amd64-desktop.make @@ -0,0 +1,79 @@ +################################################## +# (c) Amlal EL Mahrouss, all rights reserved. +# This is the neoskrnl's makefile. +################################################## + +CXX = x86_64-w64-mingw32-g++ +LD = x86_64-w64-mingw32-ld +CCFLAGS = -fshort-wchar -c -D__NE_AMD64__ -mno-red-zone -fno-rtti -fno-exceptions -std=c++20 -D__NE_SUPPORT_NX__ -O0 -I../Vendor -D__FSKIT_INCLUDES_NEFS__ -D__NEOSKRNL__ -D__HAVE_NE_APIS__ -D__FREESTANDING__ -D__NE_VIRTUAL_MEMORY_SUPPORT__ -D__NE_AUTO_FORMAT__ -D__NE__ -I./ -I../ -I../zba + +ASM = nasm + +DISK_DRV = + +ifneq ($(ATA_PIO_SUPPORT), ) +DISK_DRV = -D__ATA_PIO__ +endif + +ifneq ($(ATA_DMA_SUPPORT), ) +DISK_DRV = -D__ATA_DMA__ +endif + +ifneq ($(AHCI_SUPPORT), ) +DISK_DRV = -D__AHCI__ +endif + +ifneq ($(DEBUG_SUPPORT), ) +DEBUG_MACRO = -D__DEBUG__ +endif + +COPY = cp + +# Add assembler, linker, and object files variables. +ASMFLAGS = -f win64 + +# Kernel subsystem is 17 and entrypoint is hal_init_platform +LDFLAGS = -e hal_init_platform --subsystem=17 --image-base 0x4000000 +LDOBJ = obj/*.obj + +# This file is the Kernel, responsible of task, memory, driver, sci, disk and device management. +KERNEL_IMG = neoskrnl.exe + +.PHONY: error +error: + @echo "=== ERROR ===" + @echo "=> Use a specific target." + +MOVEALL=./MoveAll.X64.sh +WINDRES=x86_64-w64-mingw32-windres + +.PHONY: newos-amd64-epm +newos-amd64-epm: clean + $(WINDRES) KernelRsrc.rsrc -O coff -o KernelRsrc.obj + $(CXX) $(CCFLAGS) $(DISK_DRV) $(DEBUG_MACRO) $(wildcard src/*.cc) $(wildcard HALKit/AMD64/PCI/*.cc) $(wildcard src/Network/*.cc) $(wildcard src/Storage/*.cc) $(wildcard src/FS/*.cc) $(wildcard HALKit/AMD64/Storage/*.cc) $(wildcard HALKit/AMD64/*.cc) $(wildcard src/System/*.cc) $(wildcard HALKit/AMD64/*.s) + $(ASM) $(ASMFLAGS) HALKit/AMD64/HalInterruptAPI.asm + $(ASM) $(ASMFLAGS) HALKit/AMD64/HalCommonAPI.asm + $(ASM) $(ASMFLAGS) HALKit/AMD64/HalBoot.asm + $(ASM) $(ASMFLAGS) HALKit/AMD64/HalUtils.asm + $(MOVEALL) + +OBJCOPY=x86_64-w64-mingw32-objcopy + +.PHONY: link-amd64-epm +link-amd64-epm: + $(LD) $(LDFLAGS) $(LDOBJ) -o $(KERNEL_IMG) + +.PHONY: all +all: newos-amd64-epm link-amd64-epm + @echo "Kernel => OK." + +.PHONY: help +help: + @echo "=== HELP ===" + @echo "all: Build Kernel and link it." + @echo "link-amd64-epm: Link Kernel for EPM based disks." + @echo "newos-amd64-epm: Build Kernel for EPM based disks." + +.PHONY: clean +clean: + rm -f $(LDOBJ) $(wildcard *.o) $(KERNEL_IMG) diff --git a/dev/kernel/arm64-desktop.make b/dev/kernel/arm64-desktop.make new file mode 100644 index 00000000..1b3521d5 --- /dev/null +++ b/dev/kernel/arm64-desktop.make @@ -0,0 +1,64 @@ +################################################## +# (c) Amlal EL Mahrouss, all rights reserved. +# This is the microKernel makefile. +################################################## + +CC = clang++ +LD = lld-link +CCFLAGS = -fshort-wchar -c -ffreestanding -MMD -mno-red-zone -D__NE_ARM64__ -fno-rtti -fno-exceptions -I./ \ + -target aarch64-unknown-windows \ + -std=c++20 -O3 -D__NEOSKRNL__ -D__NE_MINIMAL_OS__ -D__NE_NO_BUILTIN__ -D__HAVE_NE_APIS__ -D__NE__ -I../ + +ASM = clang++ + +DISKDRIVER = -D__USE_FLASH_MEM__ + +ifneq ($(DEBUG_SUPPORT), ) +DEBUG = -D__DEBUG__ +endif + +COPY = cp + +LDFLAGS = -subsystem:efi_application -entry:hal_init_platform /nodefaultlib +LDOBJ = obj/*.obj + +# This file is the Kernel, responsible of task management and memory. +KERNEL = neoskrnl.exe + +.PHONY: error +error: + @echo "=== ERROR ===" + @echo "=> Use a specific target." + +MOVEALL=./MoveAll.ARM64.sh + +.PHONY: newos-arm64-epm +newos-arm64-epm: clean + $(CC) $(CCFLAGS) $(DISKDRIVER) $(DEBUG) $(wildcard src/*.cc) \ + $(wildcard src/FS/*.cc) $(wildcard HALKit/ARM64/Storage/*.cc) \ + $(wildcard HALKit/ARM64/PCI/*.cc) $(wildcard src/Network/*.cc) $(wildcard src/Storage/*.cc) \ + $(wildcard HALKit/ARM64/*.cc) $(wildcard HALKit/ARM64/*.cpp) \ + $(wildcard HALKit/ARM64/*.s) $(wildcard HALKit/ARM64/APM/*.cc) + + $(MOVEALL) + +OBJCOPY=x86_64-w64-mingw32-objcopy + +.PHONY: link-arm64-epm +link-arm64-epm: + $(LD) $(LDFLAGS) $(LDOBJ) /out:$(KERNEL) + +.PHONY: all +all: newos-arm64-epm link-arm64-epm + @echo "Kernel => OK." + +.PHONY: help +help: + @echo "=== HELP ===" + @echo "all: Build Kernel and link it." + @echo "link-arm64-epm: Link Kernel for EPM based disks." + @echo "newos-arm64-epm: Build Kernel for EPM based disks." + +.PHONY: clean +clean: + rm -f $(LDOBJ) $(wildcard *.o) $(KERNEL) diff --git a/dev/kernel/arm64-mobile.make b/dev/kernel/arm64-mobile.make new file mode 100644 index 00000000..1b3521d5 --- /dev/null +++ b/dev/kernel/arm64-mobile.make @@ -0,0 +1,64 @@ +################################################## +# (c) Amlal EL Mahrouss, all rights reserved. +# This is the microKernel makefile. +################################################## + +CC = clang++ +LD = lld-link +CCFLAGS = -fshort-wchar -c -ffreestanding -MMD -mno-red-zone -D__NE_ARM64__ -fno-rtti -fno-exceptions -I./ \ + -target aarch64-unknown-windows \ + -std=c++20 -O3 -D__NEOSKRNL__ -D__NE_MINIMAL_OS__ -D__NE_NO_BUILTIN__ -D__HAVE_NE_APIS__ -D__NE__ -I../ + +ASM = clang++ + +DISKDRIVER = -D__USE_FLASH_MEM__ + +ifneq ($(DEBUG_SUPPORT), ) +DEBUG = -D__DEBUG__ +endif + +COPY = cp + +LDFLAGS = -subsystem:efi_application -entry:hal_init_platform /nodefaultlib +LDOBJ = obj/*.obj + +# This file is the Kernel, responsible of task management and memory. +KERNEL = neoskrnl.exe + +.PHONY: error +error: + @echo "=== ERROR ===" + @echo "=> Use a specific target." + +MOVEALL=./MoveAll.ARM64.sh + +.PHONY: newos-arm64-epm +newos-arm64-epm: clean + $(CC) $(CCFLAGS) $(DISKDRIVER) $(DEBUG) $(wildcard src/*.cc) \ + $(wildcard src/FS/*.cc) $(wildcard HALKit/ARM64/Storage/*.cc) \ + $(wildcard HALKit/ARM64/PCI/*.cc) $(wildcard src/Network/*.cc) $(wildcard src/Storage/*.cc) \ + $(wildcard HALKit/ARM64/*.cc) $(wildcard HALKit/ARM64/*.cpp) \ + $(wildcard HALKit/ARM64/*.s) $(wildcard HALKit/ARM64/APM/*.cc) + + $(MOVEALL) + +OBJCOPY=x86_64-w64-mingw32-objcopy + +.PHONY: link-arm64-epm +link-arm64-epm: + $(LD) $(LDFLAGS) $(LDOBJ) /out:$(KERNEL) + +.PHONY: all +all: newos-arm64-epm link-arm64-epm + @echo "Kernel => OK." + +.PHONY: help +help: + @echo "=== HELP ===" + @echo "all: Build Kernel and link it." + @echo "link-arm64-epm: Link Kernel for EPM based disks." + @echo "newos-arm64-epm: Build Kernel for EPM based disks." + +.PHONY: clean +clean: + rm -f $(LDOBJ) $(wildcard *.o) $(KERNEL) diff --git a/dev/kernel/obj/.hgkeep b/dev/kernel/obj/.hgkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/kernel/power64-cb.make b/dev/kernel/power64-cb.make new file mode 100644 index 00000000..83ab3235 --- /dev/null +++ b/dev/kernel/power64-cb.make @@ -0,0 +1,4 @@ +################################################## +# (c) Amlal EL Mahrouss, all rights reserved. +# This is the microKernel makefile. +################################################## diff --git a/dev/kernel/riscv64-cb.make b/dev/kernel/riscv64-cb.make new file mode 100644 index 00000000..e69de29b diff --git a/dev/kernel/src/ACPIFactoryInterface.cc b/dev/kernel/src/ACPIFactoryInterface.cc new file mode 100644 index 00000000..3cc76e44 --- /dev/null +++ b/dev/kernel/src/ACPIFactoryInterface.cc @@ -0,0 +1,101 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include + +namespace NeOS +{ + /// @brief Finds a descriptor table inside ACPI XSDT. + ErrorOr ACPIFactoryInterface::Find(const Char* signature) + { + MUST_PASS(this->fRsdp); + + if (!signature) + return ErrorOr{-1}; + + if (*signature == 0) + return ErrorOr{-1}; + + RSDP* rsp_ptr = reinterpret_cast(this->fRsdp); + + if (rsp_ptr->Revision <= 1) + return ErrorOr{-1}; + + RSDT* xsdt = reinterpret_cast(rsp_ptr->RsdtAddress); + + Int64 num = (xsdt->Length - sizeof(SDT)) / sizeof(Int64); + + /*** + crucial to avoid underflows. + */ + if (num < 1) + { + /// stop here, we should have entries... + ke_panic(RUNTIME_CHECK_ACPI); + return ErrorOr{-1}; + } + + this->fEntries = num; + + kout << "ACPI: Number of entries: " << number(this->fEntries) << kendl; + kout << "ACPI: Revision: " << number(xsdt->Revision) << kendl; + kout << "ACPI: Signature: " << xsdt->Signature << kendl; + kout << "ACPI: Address of XSDT: " << hex_number((UIntPtr)xsdt) << kendl; + + const short cAcpiSignatureLength = 4; + + for (Size index = 0; index < this->fEntries; ++index) + { + SDT* sdt = reinterpret_cast(xsdt->AddressArr[index]); + + kout << "ACPI: Checksum: " << number(sdt->Checksum) << kendl; + kout << "ACPI: Revision: " << number(sdt->Revision) << kendl; + + for (short signature_index = 0; signature_index < cAcpiSignatureLength; ++signature_index) + { + if (sdt->Signature[signature_index] != signature[signature_index]) + break; + + if (signature_index == (cAcpiSignatureLength - 1)) + { + kout << "ACPI: SDT Signature: " << sdt->Signature << kendl; + kout << "ACPI: SDT OEM ID: " << sdt->OemId << kendl; + return ErrorOr(reinterpret_cast(xsdt->AddressArr[index])); + } + } + } + + return ErrorOr{-1}; + } + + /*** + @brief Checksum on SDT header. + @param checksum the header to checksum + @param len the length of it. + */ + bool ACPIFactoryInterface::Checksum(const Char* checksum, SSizeT len) + { + if (len == 0) + return 1; + + char chr = 0; + + for (int index = 0; index < len; ++index) + { + chr += checksum[index]; + } + + return chr == 0; + } + + ErrorOr ACPIFactoryInterface::operator[](const Char* signature) + { + return this->Find(signature); + } +} // namespace NeOS diff --git a/dev/kernel/src/Array.cc b/dev/kernel/src/Array.cc new file mode 100644 index 00000000..29baf162 --- /dev/null +++ b/dev/kernel/src/Array.cc @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include diff --git a/dev/kernel/src/ArrayList.cc b/dev/kernel/src/ArrayList.cc new file mode 100644 index 00000000..f7221b19 --- /dev/null +++ b/dev/kernel/src/ArrayList.cc @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include diff --git a/dev/kernel/src/Atom.cc b/dev/kernel/src/Atom.cc new file mode 100644 index 00000000..92620c27 --- /dev/null +++ b/dev/kernel/src/Atom.cc @@ -0,0 +1,10 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +// @file Atom.cpp +// @brief Atomic primitives diff --git a/dev/kernel/src/BinaryMutex.cc b/dev/kernel/src/BinaryMutex.cc new file mode 100644 index 00000000..4fdaa8f4 --- /dev/null +++ b/dev/kernel/src/BinaryMutex.cc @@ -0,0 +1,74 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +namespace NeOS +{ + /***********************************************************************************/ + /// @brief Unlocks the semaphore. + /***********************************************************************************/ + Bool BinaryMutex::Unlock() noexcept + { + if (fLockingProcess) + { + fLockingProcess = UserProcess(); + fLockingProcess.Status = ProcessStatusKind::kFrozen; + return Yes; + } + + return No; + } + + /***********************************************************************************/ + /// @brief Locks process in the semaphore. + /***********************************************************************************/ + Bool BinaryMutex::Lock(UserProcess& process) + { + if (!process || fLockingProcess) + return No; + + fLockingProcess = process; + + return Yes; + } + + /***********************************************************************************/ + /// @brief Checks if process is locked. + /***********************************************************************************/ + Bool BinaryMutex::IsLocked() const + { + return fLockingProcess.Status == ProcessStatusKind::kRunning; + } + + /***********************************************************************************/ + /// @brief Try lock or wait. + /***********************************************************************************/ + Bool BinaryMutex::LockOrWait(UserProcess& process, TimerInterface* timer) + { + if (timer == nullptr) + return No; + + this->Lock(process); + + timer->Wait(); + + return this->Lock(process); + } + + /***********************************************************************************/ + /// @brief Wait for process **sec** until we check if it's free. + /// @param sec seconds. + /***********************************************************************************/ + BOOL BinaryMutex::WaitForProcess(const Int16& sec) noexcept + { + HardwareTimer hw_timer(rtl_seconds(sec)); + hw_timer.Wait(); + + return !this->IsLocked(); + } +} // namespace NeOS diff --git a/dev/kernel/src/BitMapMgr.cc b/dev/kernel/src/BitMapMgr.cc new file mode 100644 index 00000000..18b1a156 --- /dev/null +++ b/dev/kernel/src/BitMapMgr.cc @@ -0,0 +1,195 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +#ifdef __NE_AMD64__ +#include +#elif defined(__NE_ARM64__) +#include +#endif + +#include +#include + +#define kBitMapMagic (0x10210U) +#define kBitMapPadSize (mib_cast(16)) + +#define kBitMapMagIdx (0U) +#define kBitMapSizeIdx (1U) +#define kBitMapUsedIdx (2U) + +namespace NeOS +{ + namespace HAL + { + namespace Detail + { + /// \brief Proxy Interface to allocate a bitmap. + class IBitMapProxy final + { + public: + explicit IBitMapProxy() = default; + ~IBitMapProxy() = default; + + NE_COPY_DELETE(IBitMapProxy); + + auto IsBitMap(VoidPtr page_ptr) -> Bool + { + if (!page_ptr) + return No; + + UIntPtr* ptr_bit_set = reinterpret_cast(page_ptr); + + if (!ptr_bit_set[kBitMapMagIdx] || + ptr_bit_set[kBitMapMagIdx] != kBitMapMagic) + return No; + + return Yes; + } + + auto FreeBitMap(VoidPtr page_ptr) -> Bool + { + if (this->IsBitMap(page_ptr) == No) + return No; + + UIntPtr* ptr_bit_set = reinterpret_cast(page_ptr); + + ptr_bit_set[kBitMapMagIdx] = kBitMapMagic; + ptr_bit_set[kBitMapUsedIdx] = No; + + this->GetBitMapStatus(ptr_bit_set); + + return Yes; + } + + UInt32 MakeMMFlags(Bool wr, Bool user) + { + UInt32 flags = kMMFlagsPresent; + + if (wr) + flags |= kMMFlagsWr; + + if (user) + flags |= kMMFlagsUser; + + return flags; + } + + /// @brief Iterate over availables pages for a free one. + /// @return The new address which was found. + auto FindBitMap(VoidPtr base_ptr, SizeT size, Bool wr, Bool user) -> VoidPtr + { + if (!size) + return nullptr; + + VoidPtr base = reinterpret_cast(((UIntPtr)base_ptr) + kPageSize); + + static SizeT biggest_block = 0UL; + + while (YES) + { + UIntPtr* ptr_bit_set = reinterpret_cast(base); + + if (ptr_bit_set[kBitMapMagIdx] == kBitMapMagic && + ptr_bit_set[kBitMapSizeIdx] == size) + { + if (ptr_bit_set[kBitMapUsedIdx] == No) + { + ptr_bit_set[kBitMapSizeIdx] = size; + ptr_bit_set[kBitMapUsedIdx] = Yes; + + this->GetBitMapStatus(ptr_bit_set); + + UInt32 flags = this->MakeMMFlags(wr, user); + mm_map_page(ptr_bit_set, ptr_bit_set, flags); + + if (biggest_block < size) + biggest_block = size; + + return (VoidPtr)ptr_bit_set; + } + } + else if (ptr_bit_set[kBitMapMagIdx] != kBitMapMagic) + { + ptr_bit_set[kBitMapMagIdx] = kBitMapMagic; + ptr_bit_set[kBitMapSizeIdx] = size; + ptr_bit_set[kBitMapUsedIdx] = Yes; + + this->GetBitMapStatus(ptr_bit_set); + + UInt32 flags = this->MakeMMFlags(wr, user); + mm_map_page(ptr_bit_set, ptr_bit_set, flags); + + if (biggest_block < size) + biggest_block = size; + + return (VoidPtr)ptr_bit_set; + } + + base = reinterpret_cast(reinterpret_cast(base) + ((ptr_bit_set[kBitMapMagIdx] != kBitMapMagic) ? (size) : ptr_bit_set[kBitMapSizeIdx])); + } + + return nullptr; + } + + /// @brief Print Bitmap status + auto GetBitMapStatus(UIntPtr* ptr_bit_set) -> Void + { + if (!this->IsBitMap(ptr_bit_set)) + { + kout << "Not a BitMap: " << hex_number((UIntPtr)ptr_bit_set) << kendl; + return; + } + + kout << "Magic Number: " << hex_number(ptr_bit_set[kBitMapMagIdx]) << kendl; + kout << "Is Allocated: " << (ptr_bit_set[kBitMapUsedIdx] ? "Yes" : "No") << kendl; + kout << "Size of BitMap (B): " << number(ptr_bit_set[kBitMapSizeIdx]) << kendl; + kout << "Size of BitMap (KIB): " << number(KIB(ptr_bit_set[kBitMapSizeIdx])) << kendl; + kout << "Size of BitMap (MIB): " << number(MIB(ptr_bit_set[kBitMapSizeIdx])) << kendl; + kout << "Size of BitMap (GIB): " << number(GIB(ptr_bit_set[kBitMapSizeIdx])) << kendl; + kout << "Size of BitMap (TIB): " << number(TIB(ptr_bit_set[kBitMapSizeIdx])) << kendl; + kout << "Address Of BitMap Header: " << hex_number((UIntPtr)ptr_bit_set) << kendl; + } + }; + } // namespace Detail + + auto mm_is_bitmap(VoidPtr ptr) -> Bool + { + Detail::IBitMapProxy bitmp; + return bitmp.IsBitMap(ptr); + } + + /// @brief Allocate a new page to be used by the OS. + /// @param wr read/write bit. + /// @param user user bit. + /// @return a new bitmap allocated pointer. + auto mm_alloc_bitmap(Boolean wr, Boolean user, SizeT size, Bool is_page) -> VoidPtr + { + VoidPtr ptr_new = nullptr; + Detail::IBitMapProxy bitmp; + + ptr_new = bitmp.FindBitMap(kKernelBitMpStart, size, wr, user); + + MUST_PASS(ptr_new); + + return (UIntPtr*)ptr_new; + } + + /// @brief Free Bitmap, and mark it as absent. + /// @param ptr the pointer to free. + auto mm_free_bitmap(VoidPtr ptr) -> Bool + { + if (!ptr) + return No; + + Detail::IBitMapProxy bitmp; + Bool ret = bitmp.FreeBitMap(ptr); + + return ret; + } + } // namespace HAL +} // namespace NeOS diff --git a/dev/kernel/src/CodeMgr.cc b/dev/kernel/src/CodeMgr.cc new file mode 100644 index 00000000..c639155d --- /dev/null +++ b/dev/kernel/src/CodeMgr.cc @@ -0,0 +1,28 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include + +namespace NeOS +{ + /***********************************************************************************/ + /// @brief Executes a new process from a function. Kernel code only. + /// @note This sets up a new stack, anything on the main function that calls the Kernel will not be accessible. + /// @param main the start of the process. + /// @return if the process was started or not. + /***********************************************************************************/ + + ProcessID rtl_create_process(rtl_main_kind main, const Char* process_name) noexcept + { + if (!process_name || + *process_name == 0) + return kProcessInvalidID; + + return UserProcessScheduler::The().Spawn(process_name, reinterpret_cast(main), nullptr); + } +} // namespace NeOS diff --git a/dev/kernel/src/Crc32.cc b/dev/kernel/src/Crc32.cc new file mode 100644 index 00000000..98821602 --- /dev/null +++ b/dev/kernel/src/Crc32.cc @@ -0,0 +1,82 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +// @file CRC32.cpp +// @brief Check sequence implementation. + +namespace NeOS +{ + /// @brief The CRC32 seed table. + UInt32 kCrcTbl[kCrcCnt] = { + 0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, 0xC79A971FL, + 0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, 0x8AD958CFL, 0x78B2DBCCL, + 0x6BE22838L, 0x9989AB3BL, 0x4D43CFD0L, 0xBF284CD3L, 0xAC78BF27L, + 0x5E133C24L, 0x105EC76FL, 0xE235446CL, 0xF165B798L, 0x030E349BL, + 0xD7C45070L, 0x25AFD373L, 0x36FF2087L, 0xC494A384L, 0x9A879FA0L, + 0x68EC1CA3L, 0x7BBCEF57L, 0x89D76C54L, 0x5D1D08BFL, 0xAF768BBCL, + 0xBC267848L, 0x4E4DFB4BL, 0x20BD8EDEL, 0xD2D60DDDL, 0xC186FE29L, + 0x33ED7D2AL, 0xE72719C1L, 0x154C9AC2L, 0x061C6936L, 0xF477EA35L, + 0xAA64D611L, 0x580F5512L, 0x4B5FA6E6L, 0xB93425E5L, 0x6DFE410EL, + 0x9F95C20DL, 0x8CC531F9L, 0x7EAEB2FAL, 0x30E349B1L, 0xC288CAB2L, + 0xD1D83946L, 0x23B3BA45L, 0xF779DEAEL, 0x05125DADL, 0x1642AE59L, + 0xE4292D5AL, 0xBA3A117EL, 0x4851927DL, 0x5B016189L, 0xA96AE28AL, + 0x7DA08661L, 0x8FCB0562L, 0x9C9BF696L, 0x6EF07595L, 0x417B1DBCL, + 0xB3109EBFL, 0xA0406D4BL, 0x522BEE48L, 0x86E18AA3L, 0x748A09A0L, + 0x67DAFA54L, 0x95B17957L, 0xCBA24573L, 0x39C9C670L, 0x2A993584L, + 0xD8F2B687L, 0x0C38D26CL, 0xFE53516FL, 0xED03A29BL, 0x1F682198L, + 0x5125DAD3L, 0xA34E59D0L, 0xB01EAA24L, 0x42752927L, 0x96BF4DCCL, + 0x64D4CECFL, 0x77843D3BL, 0x85EFBE38L, 0xDBFC821CL, 0x2997011FL, + 0x3AC7F2EBL, 0xC8AC71E8L, 0x1C661503L, 0xEE0D9600L, 0xFD5D65F4L, + 0x0F36E6F7L, 0x61C69362L, 0x93AD1061L, 0x80FDE395L, 0x72966096L, + 0xA65C047DL, 0x5437877EL, 0x4767748AL, 0xB50CF789L, 0xEB1FCBADL, + 0x197448AEL, 0x0A24BB5AL, 0xF84F3859L, 0x2C855CB2L, 0xDEEEDFB1L, + 0xCDBE2C45L, 0x3FD5AF46L, 0x7198540DL, 0x83F3D70EL, 0x90A324FAL, + 0x62C8A7F9L, 0xB602C312L, 0x44694011L, 0x5739B3E5L, 0xA55230E6L, + 0xFB410CC2L, 0x092A8FC1L, 0x1A7A7C35L, 0xE811FF36L, 0x3CDB9BDDL, + 0xCEB018DEL, 0xDDE0EB2AL, 0x2F8B6829L, 0x82F63B78L, 0x709DB87BL, + 0x63CD4B8FL, 0x91A6C88CL, 0x456CAC67L, 0xB7072F64L, 0xA457DC90L, + 0x563C5F93L, 0x082F63B7L, 0xFA44E0B4L, 0xE9141340L, 0x1B7F9043L, + 0xCFB5F4A8L, 0x3DDE77ABL, 0x2E8E845FL, 0xDCE5075CL, 0x92A8FC17L, + 0x60C37F14L, 0x73938CE0L, 0x81F80FE3L, 0x55326B08L, 0xA759E80BL, + 0xB4091BFFL, 0x466298FCL, 0x1871A4D8L, 0xEA1A27DBL, 0xF94AD42FL, + 0x0B21572CL, 0xDFEB33C7L, 0x2D80B0C4L, 0x3ED04330L, 0xCCBBC033L, + 0xA24BB5A6L, 0x502036A5L, 0x4370C551L, 0xB11B4652L, 0x65D122B9L, + 0x97BAA1BAL, 0x84EA524EL, 0x7681D14DL, 0x2892ED69L, 0xDAF96E6AL, + 0xC9A99D9EL, 0x3BC21E9DL, 0xEF087A76L, 0x1D63F975L, 0x0E330A81L, + 0xFC588982L, 0xB21572C9L, 0x407EF1CAL, 0x532E023EL, 0xA145813DL, + 0x758FE5D6L, 0x87E466D5L, 0x94B49521L, 0x66DF1622L, 0x38CC2A06L, + 0xCAA7A905L, 0xD9F75AF1L, 0x2B9CD9F2L, 0xFF56BD19L, 0x0D3D3E1AL, + 0x1E6DCDEEL, 0xEC064EEDL, 0xC38D26C4L, 0x31E6A5C7L, 0x22B65633L, + 0xD0DDD530L, 0x0417B1DBL, 0xF67C32D8L, 0xE52CC12CL, 0x1747422FL, + 0x49547E0BL, 0xBB3FFD08L, 0xA86F0EFCL, 0x5A048DFFL, 0x8ECEE914L, + 0x7CA56A17L, 0x6FF599E3L, 0x9D9E1AE0L, 0xD3D3E1ABL, 0x21B862A8L, + 0x32E8915CL, 0xC083125FL, 0x144976B4L, 0xE622F5B7L, 0xF5720643L, + 0x07198540L, 0x590AB964L, 0xAB613A67L, 0xB831C993L, 0x4A5A4A90L, + 0x9E902E7BL, 0x6CFBAD78L, 0x7FAB5E8CL, 0x8DC0DD8FL, 0xE330A81AL, + 0x115B2B19L, 0x020BD8EDL, 0xF0605BEEL, 0x24AA3F05L, 0xD6C1BC06L, + 0xC5914FF2L, 0x37FACCF1L, 0x69E9F0D5L, 0x9B8273D6L, 0x88D28022L, + 0x7AB90321L, 0xAE7367CAL, 0x5C18E4C9L, 0x4F48173DL, 0xBD23943EL, + 0xF36E6F75L, 0x0105EC76L, 0x12551F82L, 0xE03E9C81L, 0x34F4F86AL, + 0xC69F7B69L, 0xD5CF889DL, 0x27A40B9EL, 0x79B737BAL, 0x8BDCB4B9L, + 0x988C474DL, 0x6AE7C44EL, 0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, + 0xAD7D5351L}; + + /// @brief Calculate CRC32 of p + /// @param p the data to compute. + /// @param len the length of the data. + /// @return CRC32 of **p**. + UInt32 ke_calculate_crc32(const Char* p, Int32 len) noexcept + { + UInt32 crc = 0xffffffff; + + while (--len > 0) + crc = kCrcTbl[((UInt8)crc ^ *(p++))] ^ (crc >> 8); + + return ~crc; + } +} // namespace NeOS diff --git a/dev/kernel/src/CxxAbi-AMD64.cc b/dev/kernel/src/CxxAbi-AMD64.cc new file mode 100644 index 00000000..f0e57077 --- /dev/null +++ b/dev/kernel/src/CxxAbi-AMD64.cc @@ -0,0 +1,90 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifdef __NE_AMD64__ + +#include +#include +#include + +atexit_func_entry_t __atexit_funcs[kAtExitMacDestructors]; + +uarch_t __atexit_func_count; + +/// @brief dynamic shared object Handle. +NeOS::UIntPtr __dso_handle; + +EXTERN_C NeOS::Void __cxa_pure_virtual(void* self) +{ + kout << "object: " << NeOS::number(reinterpret_cast(self)); + kout << ", has unimplemented virtual functions.\r"; +} + +EXTERN_C void ___chkstk_ms(void) +{ +} + +EXTERN_C int atexit(void (*f)(void*), void* arg, void* dso) +{ + if (__atexit_func_count >= kAtExitMacDestructors) + return 1; + + __atexit_funcs[__atexit_func_count].destructor_func = f; + __atexit_funcs[__atexit_func_count].obj_ptr = arg; + __atexit_funcs[__atexit_func_count].dso_handle = dso; + + __atexit_func_count++; + + return 0; +} + +EXTERN_C void __cxa_finalize(void* f) +{ + uarch_t i = __atexit_func_count; + if (!f) + { + while (i--) + { + if (__atexit_funcs[i].destructor_func) + { + (*__atexit_funcs[i].destructor_func)(__atexit_funcs[i].obj_ptr); + }; + } + + return; + } + + while (i--) + { + if (__atexit_funcs[i].destructor_func) + { + (*__atexit_funcs[i].destructor_func)(__atexit_funcs[i].obj_ptr); + __atexit_funcs[i].destructor_func = 0; + }; + } +} + +namespace cxxabiv1 +{ + EXTERN_C int __cxa_guard_acquire(__guard* g) + { + (void)g; + return 0; + } + + EXTERN_C int __cxa_guard_release(__guard* g) + { + *(char*)g = 1; + return 0; + } + + EXTERN_C void __cxa_guard_abort(__guard* g) + { + (void)g; + } +} // namespace cxxabiv1 + +#endif // ifdef __NE_AMD64__ diff --git a/dev/kernel/src/CxxAbi-ARM64.cc b/dev/kernel/src/CxxAbi-ARM64.cc new file mode 100644 index 00000000..b52be160 --- /dev/null +++ b/dev/kernel/src/CxxAbi-ARM64.cc @@ -0,0 +1,107 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifdef __NE_ARM64__ + +#include +#include +#include + +atexit_func_entry_t __atexit_funcs[kAtExitMacDestructors]; + +uarch_t __atexit_func_count; + +/// @brief dynamic shared object Handle. +NeOS::UIntPtr __dso_handle; + +EXTERN_C void __chkstk(void) +{ +} + +EXTERN_C int atexit(void (*f)(void*), void* arg, void* dso) +{ + if (__atexit_func_count >= kAtExitMacDestructors) + return 1; + + __atexit_funcs[__atexit_func_count].destructor_func = f; + __atexit_funcs[__atexit_func_count].obj_ptr = arg; + __atexit_funcs[__atexit_func_count].dso_handle = dso; + + __atexit_func_count++; + + return 0; +} + +EXTERN_C void __cxa_finalize(void* f) +{ + uarch_t i = __atexit_func_count; + if (!f) + { + while (i--) + { + if (__atexit_funcs[i].destructor_func) + { + (*__atexit_funcs[i].destructor_func)(__atexit_funcs[i].obj_ptr); + }; + } + + return; + } + + while (i--) + { + if (__atexit_funcs[i].destructor_func) + { + (*__atexit_funcs[i].destructor_func)(__atexit_funcs[i].obj_ptr); + __atexit_funcs[i].destructor_func = 0; + }; + } +} + +namespace cxxabiv1 +{ + EXTERN_C int __cxa_guard_acquire(__guard* g) + { + (void)g; + return 0; + } + + EXTERN_C int __cxa_guard_release(__guard* g) + { + *(char*)g = 1; + return 0; + } + + EXTERN_C void __cxa_guard_abort(__guard* g) + { + (void)g; + } +} // namespace cxxabiv1 + +EXTERN_C NeOS::Void _purecall(void* self) +{ + kout << "object: " << NeOS::number(reinterpret_cast(self)); + kout << ", has unimplemented virtual functions.\r"; +} + +EXTERN_C NeOS::Void _Init_thread_footer(NeOS::Int* thread_obj) +{ + NE_UNUSED(thread_obj); +} + +EXTERN_C NeOS::Void _Init_thread_epoch(NeOS::Void) +{ + NE_UNUSED(0); +} + +EXTERN_C NeOS::Void _Init_thread_header(NeOS::Int* thread_obj) +{ + NE_UNUSED(0); +} + +EXTERN_C NeOS::Int _tls_index = 0UL; + +#endif // ifdef __NE_ARM64__ diff --git a/dev/kernel/src/Defines.cc b/dev/kernel/src/Defines.cc new file mode 100644 index 00000000..c29afcf4 --- /dev/null +++ b/dev/kernel/src/Defines.cc @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include diff --git a/dev/kernel/src/DeviceMgr.cc b/dev/kernel/src/DeviceMgr.cc new file mode 100644 index 00000000..760d17d9 --- /dev/null +++ b/dev/kernel/src/DeviceMgr.cc @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include diff --git a/dev/kernel/src/DriveMgr+IO.cc b/dev/kernel/src/DriveMgr+IO.cc new file mode 100644 index 00000000..8381087f --- /dev/null +++ b/dev/kernel/src/DriveMgr+IO.cc @@ -0,0 +1,96 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +/************************************************************* + * + * File: DriveMgr+IO.cc + * Purpose: Filesystem to mountpoint interface. + * Date: 3/26/24 + * + * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + * + *************************************************************/ + +/// Useful macros. + +#define rtl_nefs_write(DRV, TRAITS, MP) (MP->DRV()).fOutput(TRAITS) +#define rtl_nefs_read(DRV, TRAITS, MP) (MP->DRV()).fInput(TRAITS) + +namespace NeOS +{ + /// @brief Read from newfs disk. + /// @param Mnt mounted interface. + /// @param DrvTrait drive info + /// @param DrvIndex drive index. + /// @return + Int32 fs_ifs_read(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex) + { + if (!Mnt) + return 1; + + DrvTrait.fPacket.fPacketGood = false; + + switch (DrvIndex) + { + case MountpointInterface::kDriveIndexA: { + rtl_nefs_read(A, DrvTrait.fPacket, Mnt); + break; + } + case MountpointInterface::kDriveIndexB: { + rtl_nefs_read(B, DrvTrait.fPacket, Mnt); + break; + } + case MountpointInterface::kDriveIndexC: { + rtl_nefs_read(C, DrvTrait.fPacket, Mnt); + break; + } + case MountpointInterface::kDriveIndexD: { + rtl_nefs_read(D, DrvTrait.fPacket, Mnt); + break; + } + } + + return DrvTrait.fPacket.fPacketGood; + } + + /// @brief Write to newfs disk. + /// @param Mnt mounted interface. + /// @param DrvTrait drive info + /// @param DrvIndex drive index. + /// @return + Int32 fs_ifs_write(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex) + { + if (!Mnt) + return 1; + + DrvTrait.fPacket.fPacketGood = false; + + switch (DrvIndex) + { + case MountpointInterface::kDriveIndexA: { + rtl_nefs_write(A, DrvTrait.fPacket, Mnt); + break; + } + case MountpointInterface::kDriveIndexB: { + rtl_nefs_write(B, DrvTrait.fPacket, Mnt); + break; + } + case MountpointInterface::kDriveIndexC: { + rtl_nefs_write(C, DrvTrait.fPacket, Mnt); + break; + } + case MountpointInterface::kDriveIndexD: { + rtl_nefs_write(D, DrvTrait.fPacket, Mnt); + break; + } + } + + return DrvTrait.fPacket.fPacketGood; + } +} // namespace NeOS \ No newline at end of file diff --git a/dev/kernel/src/DriveMgr.cc b/dev/kernel/src/DriveMgr.cc new file mode 100644 index 00000000..039f7e08 --- /dev/null +++ b/dev/kernel/src/DriveMgr.cc @@ -0,0 +1,235 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include + +/***********************************************************************************/ +/// @file DriveMgr.cc +/// @brief Drive Manager of kernel. +/***********************************************************************************/ + +namespace NeOS +{ +#if defined(__ATA_PIO__) || defined(__ATA_DMA__) + STATIC UInt16 kATAIO = 0U; + STATIC UInt8 kATAMaster = 0U; +#endif + +#if defined(__AHCI__) + STATIC UInt16 kAHCIPortsImplemented = 0UL; +#endif + + /// @brief reads from an ATA drive. + /// @param pckt Packet structure (fPacketContent must be non null) + /// @return + Void io_drv_input(DriveTrait::DrivePacket pckt) + { +#ifdef __AHCI__ + drv_std_read(pckt.fPacketLba, (Char*)pckt.fPacketContent, kAHCISectorSize, pckt.fPacketSize); +#elif defined(__ATA_PIO__) || defined(__ATA_DMA__) + drv_std_read(pckt.fPacketLba, kATAIO, kATAMaster, (Char*)pckt.fPacketContent, kATASectorSize, pckt.fPacketSize); +#endif + } + + /// @brief Writes to an ATA drive. + /// @param pckt the packet to write. + /// @return + Void io_drv_output(DriveTrait::DrivePacket pckt) + { + if (pckt.fPacketReadOnly) + { + pckt.fPacketGood = NO; + return; + } + +#ifdef __AHCI__ + drv_std_write(pckt.fPacketLba, (Char*)pckt.fPacketContent, kAHCISectorSize, pckt.fPacketSize); +#elif defined(__ATA_PIO__) || defined(__ATA_DMA__) + drv_std_write(pckt.fPacketLba, kATAIO, kATAMaster, (Char*)pckt.fPacketContent, kATASectorSize, pckt.fPacketSize); +#endif + } + + /// @brief Executes a disk check on the ATA drive. + /// @param pckt the packet to read. + /// @return + Void io_drv_init(DriveTrait::DrivePacket pckt) + { +#if defined(__ATA_PIO__) || defined(__ATA_DMA__) + kATAMaster = 0; + kATAIO = 0; + + kATAMaster = YES; + kATAIO = ATA_PRIMARY_IO; + + if (drv_std_init(kATAIO, kATAMaster, kATAIO, kATAMaster)) + { + pckt.fPacketGood = YES; + return; + } + + kATAMaster = NO; + kATAIO = ATA_SECONDARY_IO; + + if (!drv_std_init(kATAIO, kATAMaster, kATAIO, kATAMaster)) + { + pckt.fPacketGood = YES; + return; + } + + pckt.fPacketGood = YES; +#elif defined(__AHCI__) + kAHCIPortsImplemented = 0; + + if (!drv_std_init(kAHCIPortsImplemented)) + { + return; + } + + pckt.fPacketGood = YES; +#endif // if defined(__ATA_PIO__) || defined (__ATA_DMA__) + } + +/// @brief Gets the drive kind (ATA, SCSI, AHCI...) +/// @param void no arguments. +/// @return no arguments. +#ifdef __ATA_PIO__ + const Char* io_drv_kind(Void) + { + return "ATA-PIO"; + } +#endif +#ifdef __ATA_DMA__ + const Char* io_drv_kind(Void) + { + return "ATA-DMA"; + } +#endif +#ifdef __AHCI__ + const Char* io_drv_kind(Void) + { + return "AHCI"; + } +#endif +#ifdef __NE_MINIMAL_OS__ + const Char* io_drv_kind(Void) + { + return "Not Loaded"; + } +#endif + + /// @brief Unimplemented drive function. + /// @param pckt the packet to read. + Void io_drv_unimplemented(DriveTrait::DrivePacket pckt) noexcept + { + NE_UNUSED(pckt); + } + + /// @brief Makes a new drive. + /// @return the new blank drive. + DriveTrait io_construct_blank_drive() noexcept + { + DriveTrait trait; + + constexpr auto kBlankDrive = "/media/blank/"; + + rt_copy_memory((VoidPtr)kBlankDrive, trait.fName, rt_string_len(kBlankDrive)); + trait.fKind = kInvalidDrive; + + trait.fInput = io_drv_unimplemented; + trait.fOutput = io_drv_unimplemented; + trait.fVerify = io_drv_unimplemented; + trait.fInit = io_drv_unimplemented; + trait.fDriveKind = io_drv_kind; + + kout << "Construct: " << trait.fName << "\r"; + + return trait; + } + + namespace Detail + { + Void io_detect_drive(DriveTrait& trait) + { + trait.fInit(trait.fPacket); + + EPM_PART_BLOCK block_struct; + + trait.fPacket.fPacketLba = kEPMBootBlockLba; + trait.fPacket.fPacketSize = sizeof(EPM_PART_BLOCK); + trait.fPacket.fPacketContent = &block_struct; + + rt_copy_memory((VoidPtr) "fs/detect-packet", trait.fPacket.fPacketMime, + rt_string_len("fs/detect-packet")); + + trait.fInput(trait.fPacket); + + if (rt_string_cmp(((EPM_PART_BLOCK*)trait.fPacket.fPacketContent)->Magic, kEPMMagic, kEPMMagicLength) == 0) + { + trait.fPacket.fPacketReadOnly = NO; + trait.fKind = kMassStorageDrive | kEPMDrive; + + kout << "Disk is EPM.\r"; + + trait.fSectorSz = block_struct.SectorSz; + trait.fLbaEnd = block_struct.LbaEnd; + trait.fLbaStart = block_struct.LbaStart; + } + else + { + trait.fPacket.fPacketReadOnly = YES; + trait.fKind = kMassStorageDrive | kUnformattedDrive | kReadOnlyDrive; + + if (block_struct.Name[0] == 0 || + !rt_is_alnum(block_struct.Name[0])) + { + kout << "Disk partition is empty (Read Only)\r"; + } + else + { + kout << "Scheme Found: " << block_struct.Name << kendl; + } + } + + rt_copy_memory((VoidPtr) "*/*", trait.fPacket.fPacketMime, + rt_string_len("*/*")); + + trait.fPacket.fPacketLba = 0; + trait.fPacket.fPacketSize = 0UL; + trait.fPacket.fPacketContent = nullptr; + } + } // namespace Detail + + /// @brief Fetches the main drive. + /// @return the new drive. (returns kEPMDrive if EPM formatted) + DriveTrait io_construct_main_drive() noexcept + { + DriveTrait trait; + + constexpr auto kMainDrive = "/media/sda/"; + + rt_copy_memory((VoidPtr)kMainDrive, trait.fName, rt_string_len(kMainDrive)); + + MUST_PASS(trait.fName[0] != 0); + + trait.fVerify = io_drv_unimplemented; + trait.fOutput = io_drv_output; + trait.fInput = io_drv_input; + trait.fInit = io_drv_init; + trait.fDriveKind = io_drv_kind; + + kout << "Detecting partition scheme of: " << trait.fName << ".\r"; + + Detail::io_detect_drive(trait); + + return trait; + } +} // namespace NeOS diff --git a/dev/kernel/src/ErrorOr.cc b/dev/kernel/src/ErrorOr.cc new file mode 100644 index 00000000..7a55715c --- /dev/null +++ b/dev/kernel/src/ErrorOr.cc @@ -0,0 +1,12 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +/***********************************************************************************/ +/// @file ErrorOr.cc /// +/// @brief ErrorOr container class. /// +/***********************************************************************************/ diff --git a/dev/kernel/src/FS/HeFS.cc b/dev/kernel/src/FS/HeFS.cc new file mode 100644 index 00000000..7615ed77 --- /dev/null +++ b/dev/kernel/src/FS/HeFS.cc @@ -0,0 +1,22 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifdef __FSKIT_INCLUDES_HeFS__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // ifdef __FSKIT_INCLUDES_HeFS__ diff --git a/dev/kernel/src/FS/NeFS+FileMgr.cc b/dev/kernel/src/FS/NeFS+FileMgr.cc new file mode 100644 index 00000000..0ac6384d --- /dev/null +++ b/dev/kernel/src/FS/NeFS+FileMgr.cc @@ -0,0 +1,245 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +#ifndef __NE_MINIMAL_OS__ +#ifdef __FSKIT_INCLUDES_NEFS__ + +/// @brief NeFS File manager. +/// BUGS: 0 + +namespace NeOS +{ + /// @brief C++ constructor + NeFileSystemMgr::NeFileSystemMgr() + { + NeFileSystemParser* mParser = new NeFileSystemParser(); + MUST_PASS(mParser); + + kout << "We are done allocating NeFileSystemParser...\r"; + } + + NeFileSystemMgr::~NeFileSystemMgr() + { + if (mParser) + { + kout << "Destroying NeFileSystemParser...\r"; + mm_delete_class(&mParser); + } + } + + /// @brief Removes a node from the filesystem. + /// @param path The filename + /// @return If it was deleted or not. + bool NeFileSystemMgr::Remove(_Input const Char* path) + { + if (path == nullptr || *path == 0) + return false; + + return mParser->RemoveCatalog(path); + } + + /// @brief Creates a node with the specified. + /// @param path The filename path. + /// @return The Node pointer. + NodePtr NeFileSystemMgr::Create(_Input const Char* path) + { + return node_cast(mParser->CreateCatalog(path)); + } + + /// @brief Creates a node with is a directory. + /// @param path The filename path. + /// @return The Node pointer. + NodePtr NeFileSystemMgr::CreateDirectory(const Char* path) + { + return node_cast(mParser->CreateCatalog(path, 0, kNeFSCatalogKindDir)); + } + + /// @brief Creates a node with is a alias. + /// @param path The filename path. + /// @return The Node pointer. + NodePtr NeFileSystemMgr::CreateAlias(const Char* path) + { + return node_cast(mParser->CreateCatalog(path, 0, kNeFSCatalogKindAlias)); + } + + /// @brief Creates a node with is a page file. + /// @param path The filename path. + /// @return The Node pointer. + NodePtr NeFileSystemMgr::CreateSwapFile(const Char* path) + { + return node_cast(mParser->CreateCatalog(path, 0, kNeFSCatalogKindPage)); + } + + /// @brief Gets the root directory. + /// @return + const Char* NeFileSystemHelper::Root() + { + return kNeFSRoot; + } + + /// @brief Gets the up-dir directory. + /// @return + const Char* NeFileSystemHelper::UpDir() + { + return kNeFSUpDir; + } + + /// @brief Gets the separator character. + /// @return + const Char NeFileSystemHelper::Separator() + { + return kNeFSSeparator; + } + + /// @brief Gets the metafile character. + /// @return + const Char NeFileSystemHelper::MetaFile() + { + return kNeFSMetaFilePrefix; + } + + /// @brief Opens a new file. + /// @param path + /// @param r + /// @return + _Output NodePtr NeFileSystemMgr::Open(_Input const Char* path, _Input const Char* r) + { + if (!path || *path == 0) + return nullptr; + + if (!r || *r == 0) + return nullptr; + + auto catalog = mParser->GetCatalog(path); + + return node_cast(catalog); + } + + /// @brief Writes to a catalog's fork. + /// @param node the node ptr. + /// @param data the data. + /// @param flags the size. + /// @return + Void NeFileSystemMgr::Write(_Input NodePtr node, _Input VoidPtr data, _Input Int32 flags, _Input SizeT size) + { + if (!node) + return; + if (!size) + return; + + constexpr auto kDataForkName = kNeFSDataFork; + this->Write(kDataForkName, node, data, flags, size); + } + + /// @brief Read from filesystem fork. + /// @param node the catalog node. + /// @param flags the flags with it. + /// @param sz the size to read. + /// @return + _Output VoidPtr NeFileSystemMgr::Read(_Input NodePtr node, _Input Int32 flags, _Input SizeT size) + { + if (!node) + return nullptr; + if (!size) + return nullptr; + + constexpr auto kDataForkName = kNeFSDataFork; + return this->Read(kDataForkName, node, flags, size); + } + + Void NeFileSystemMgr::Write(_Input const Char* name, + _Input NodePtr node, + _Input VoidPtr data, + _Input Int32 flags, + _Input SizeT size) + { + if (!size || + size > kNeFSForkSize) + return; + + if (!data) + return; + + NE_UNUSED(flags); + + if ((reinterpret_cast(node))->Kind == kNeFSCatalogKindFile) + mParser->WriteCatalog(reinterpret_cast(node)->Name, (flags & kFileFlagRsrc ? true : false), data, size, + name); + } + + _Output VoidPtr NeFileSystemMgr::Read(_Input const Char* name, + _Input NodePtr node, + _Input Int32 flags, + _Input SizeT sz) + { + if (sz > kNeFSForkSize) + return nullptr; + + if (!sz) + return nullptr; + + NE_UNUSED(flags); + + if ((reinterpret_cast(node))->Kind == kNeFSCatalogKindFile) + return mParser->ReadCatalog(reinterpret_cast(node), (flags & kFileFlagRsrc ? true : false), sz, + name); + + return nullptr; + } + + /// @brief Seek from Catalog. + /// @param node + /// @param off + /// @retval true always returns false, this is unimplemented. + /// @retval false always returns this, it is unimplemented. + + _Output Bool NeFileSystemMgr::Seek(NodePtr node, SizeT off) + { + if (!node || off == 0) + return false; + + return mParser->Seek(reinterpret_cast(node), off); + } + + /// @brief Tell where the catalog is. + /// @param node + /// @retval true always returns false, this is unimplemented. + /// @retval false always returns this, it is unimplemented. + + _Output SizeT NeFileSystemMgr::Tell(NodePtr node) + { + if (!node) + return kNPos; + + return mParser->Tell(reinterpret_cast(node)); + } + + /// @brief Rewinds the catalog. + /// @param node + /// @retval true always returns false, this is unimplemented. + /// @retval false always returns this, it is unimplemented. + + _Output Bool NeFileSystemMgr::Rewind(NodePtr node) + { + if (!node) + return false; + + return this->Seek(node, 0); + } + + /// @brief Returns the filesystem parser. + /// @return the Filesystem parser class. + _Output NeFileSystemParser* NeFileSystemMgr::GetParser() noexcept + { + return mParser; + } +} // namespace NeOS + +#endif // ifdef __FSKIT_INCLUDES_NEFS__ +#endif // ifndef __NE_MINIMAL_OS__ diff --git a/dev/kernel/src/FS/NeFS.cc b/dev/kernel/src/FS/NeFS.cc new file mode 100644 index 00000000..30d4fb85 --- /dev/null +++ b/dev/kernel/src/FS/NeFS.cc @@ -0,0 +1,1065 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifdef __FSKIT_INCLUDES_NEFS__ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace NeOS; + +#ifdef __NE_NO_BUILTIN__ +/***********************************************************************************/ +/** + Define those external symbols, to make the editor shutup +*/ +/***********************************************************************************/ + +/***********************************************************************************/ +/// @brief get sector count. +/***********************************************************************************/ +NeOS::SizeT drv_get_sector_count(); + +/***********************************************************************************/ +/// @brief get device size. +/***********************************************************************************/ +NeOS::SizeT drv_get_size(); + +#endif + +///! BUGS: 0 + +/***********************************************************************************/ +/// This file implements the New extended File System. +/// New extended File System implements a B-Tree based algortihm. +/// / +/// /Path1/ /ath2/ +/// /readme.rtf /ListContents.pef /readme.lnk <-- symlink. +/// /Path1/readme.rtf +/***********************************************************************************/ + +STATIC MountpointInterface kMountpoint; + +/***********************************************************************************/ +/// @brief Creates a new fork inside the New filesystem partition. +/// @param catalog it's catalog +/// @param the_fork the fork itself. +/// @return the fork +/***********************************************************************************/ +_Output BOOL NeFileSystemParser::CreateFork(_Input NEFS_FORK_STRUCT& the_fork) +{ + if (the_fork.ForkName[0] != 0 && + the_fork.CatalogName[0] != 0 && + the_fork.DataSize > 0) + { + auto catalog = this->GetCatalog(the_fork.CatalogName); + + if (!catalog) + return NO; + + Lba lba = catalog->DataFork; + + kout << "Fork LBA: " << hex_number(lba) << kendl; + + if (lba < kNeFSCatalogStartAddress) + return NO; + + auto& drv = kMountpoint.A(); + + Lba lba_prev = lba; + + NEFS_FORK_STRUCT prev_fork; + NEFS_FORK_STRUCT cur_fork; + + /// do not check for anything. Loop until we get what we want, that is a free fork zone. + while (drv.fPacket.fPacketGood) + { + drv.fPacket.fPacketLba = lba; + drv.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT); + drv.fPacket.fPacketContent = &cur_fork; + + drv.fInput(drv.fPacket); + + kout << "Next fork: " << hex_number(cur_fork.NextSibling) << kendl; + + if (cur_fork.Flags & kNeFSFlagCreated) + { + kout << "Error: Fork does exists.\r"; + + /// sanity check. + if (KStringBuilder::Equals(cur_fork.ForkName, the_fork.ForkName) && + KStringBuilder::Equals(cur_fork.CatalogName, the_fork.CatalogName)) + break; + + lba_prev = lba; + lba = cur_fork.NextSibling; + + prev_fork = cur_fork; + } + else + { + /// This is a check that we have, in order to link the previous fork + /// entry. + if (lba >= kNeFSCatalogStartAddress) + { + drv.fPacket.fPacketLba = lba_prev; + drv.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT); + drv.fPacket.fPacketContent = &prev_fork; + + prev_fork.NextSibling = lba; + + /// write to disk. + drv.fOutput(drv.fPacket); + } + + break; + } + } + + the_fork.Flags |= kNeFSFlagCreated; + the_fork.DataOffset = lba - sizeof(NEFS_FORK_STRUCT); + the_fork.PreviousSibling = lba_prev; + the_fork.NextSibling = the_fork.DataOffset - the_fork.DataSize; + + drv.fPacket.fPacketLba = lba; + drv.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT); + drv.fPacket.fPacketContent = &the_fork; + + kout << "Allocating fork block...\r"; + + // drv.fOutput(drv.fPacket); + + fs_ifs_write(&kMountpoint, drv, MountpointInterface::kDriveIndexA); + + /// log what we have now. + kout << "Fork offset is at: " << hex_number(the_fork.DataOffset) + << kendl; + + kout << "Wrote fork metadata at: " << hex_number(lba) << kendl; + + return YES; + } + + return NO; +} + +/***********************************************************************************/ +/// @brief Find fork inside filesystem. +/// @param catalog the catalog. +/// @param name the fork name. +/// @return the newly found fork. +/***********************************************************************************/ +_Output NEFS_FORK_STRUCT* NeFileSystemParser::FindFork(_Input NEFS_CATALOG_STRUCT* catalog, + _Input const Char* name, + _Input Boolean is_data) +{ + auto& drive = kMountpoint.A(); + NEFS_FORK_STRUCT* the_fork = nullptr; + + Lba lba = is_data ? catalog->DataFork : catalog->ResourceFork; + + while (lba != 0) + { + drive.fPacket.fPacketLba = lba; + drive.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT); + drive.fPacket.fPacketContent = (VoidPtr)the_fork; + + rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime, 16); + + if (auto res = + fs_ifs_read(&kMountpoint, drive, this->mDriveIndex); + res) + { + switch (res) + { + case 1: + err_global_get() = kErrorDiskReadOnly; + break; + case 2: + err_global_get() = kErrorDiskIsFull; + break; + case 3: + err_global_get() = kErrorNoSuchDisk; + break; + + default: + break; + } + return nullptr; + } + + if (KStringBuilder::Equals(the_fork->ForkName, name)) + { + break; + } + + lba = the_fork->NextSibling; + } + + return the_fork; +} + +/***********************************************************************************/ +/// @brief Simpler factory to create a catalog (assumes you want to create a +/// file.) +/// @param name +/// @return catalog pointer. +/***********************************************************************************/ +_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char* name) +{ + return this->CreateCatalog(name, 0, kNeFSCatalogKindFile); +} + +/***********************************************************************************/ +/// @brief Creates a new catalog into the disk. +/// @param name the catalog name. +/// @param flags the flags of the catalog. +/// @param kind the catalog kind. +/// @return catalog pointer. +/***********************************************************************************/ +_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char* name, + _Input const Int32& flags, + _Input const Int32& kind) +{ + kout << "CreateCatalog(*...*)\r"; + + Lba out_lba = 0UL; + + kout << "Checking for path separator...\r"; + + /// a directory should have a slash in the end. + if (kind == kNeFSCatalogKindDir && + name[rt_string_len(name) - 1] != NeFileSystemHelper::Separator()) + return nullptr; + + /// a file shouldn't have a slash in the end. + if (kind != kNeFSCatalogKindDir && + name[rt_string_len(name) - 1] == NeFileSystemHelper::Separator()) + return nullptr; + + NEFS_CATALOG_STRUCT* catalog_copy = this->FindCatalog(name, out_lba); + + if (catalog_copy) + { + kout << "Catalog already exists: " << name << ".\r"; + err_global_get() = kErrorFileExists; + + delete catalog_copy; + catalog_copy = nullptr; + + return nullptr; + } + + Char parent_name[kNeFSCatalogNameLen] = {0}; + + for (SizeT indexName = 0UL; indexName < rt_string_len(name); ++indexName) + { + parent_name[indexName] = name[indexName]; + } + + if (*parent_name == 0) + { + kout << "Parent name is NUL.\r"; + err_global_get() = kErrorFileNotFound; + return nullptr; + } + + /// Locate parent catalog, to then allocate right after it. + + for (SizeT index_fill = 0; index_fill < rt_string_len(name); ++index_fill) + { + parent_name[index_fill] = name[index_fill]; + } + + SizeT index_reverse_copy = rt_string_len(parent_name); + + // zero character it. + parent_name[--index_reverse_copy] = 0; + + // mandatory / character, zero it. + parent_name[--index_reverse_copy] = 0; + + while (parent_name[index_reverse_copy] != NeFileSystemHelper::Separator()) + { + parent_name[index_reverse_copy] = 0; + --index_reverse_copy; + } + + NEFS_CATALOG_STRUCT* catalog = this->FindCatalog(parent_name, out_lba); + + auto& drive = kMountpoint.A(); + + constexpr auto kNeFSCatalogPadding = 4; + + if (catalog && catalog->Kind == kNeFSCatalogKindFile) + { + kout << "Parent is a file.\r"; + delete catalog; + + return nullptr; + } + else if (!catalog) + { + Char part_block[sizeof(NEFS_ROOT_PARTITION_BLOCK)] = {0}; + + drive.fPacket.fPacketContent = part_block; + drive.fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); + drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress; + + drive.fInput(drive.fPacket); + + NEFS_ROOT_PARTITION_BLOCK* blk_nefs = (NEFS_ROOT_PARTITION_BLOCK*)part_block; + out_lba = blk_nefs->StartCatalog; + } + + if (drive.fPacket.fPacketReadOnly) + return nullptr; + + NEFS_CATALOG_STRUCT* child_catalog = new NEFS_CATALOG_STRUCT(); + + child_catalog->Checksum = 0; + child_catalog->ResourceForkSize = 0UL; + child_catalog->DataForkSize = 0UL; + child_catalog->CatalogFlags = kNeFSStatusUnlocked; + child_catalog->NextSibling = out_lba; + child_catalog->PrevSibling = out_lba; + child_catalog->Kind = kind; + child_catalog->Flags |= kNeFSFlagCreated; + child_catalog->CatalogFlags = flags; + + SizeT i = rt_string_len(name); + + // get rid pf \0 + --i; + + if (kind == kNeFSCatalogKindDir) + --i; + + while (name[i] != '/') + --i; + + rt_copy_memory((VoidPtr)(name + i), (VoidPtr)child_catalog->Name, + rt_string_len(name)); + + NEFS_CATALOG_STRUCT temporary_catalog{}; + + Lba start_free = out_lba; + + rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime, + rt_string_len("fs/nefs-packet")); + + Char buf_part_block[sizeof(NEFS_ROOT_PARTITION_BLOCK)] = {0}; + + drive.fPacket.fPacketContent = buf_part_block; + drive.fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); + drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress; + + drive.fInput(drive.fPacket); + + NEFS_ROOT_PARTITION_BLOCK* part_block = (NEFS_ROOT_PARTITION_BLOCK*)buf_part_block; + + drive.fPacket.fPacketContent = &temporary_catalog; + drive.fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT); + drive.fPacket.fPacketLba = start_free; + + drive.fInput(drive.fPacket); + + if (part_block->FreeCatalog < 1) + { + delete child_catalog; + child_catalog = nullptr; + + return nullptr; + } + + kout << "Start finding catalog to allocate or empty space...\r"; + + while (start_free >= part_block->StartCatalog) + { + // ========================== // + // Allocate catalog now... + // ========================== // + if ((temporary_catalog.Flags & kNeFSFlagCreated) == 0) + { + child_catalog->NextSibling = + start_free + (sizeof(NEFS_CATALOG_STRUCT) * kNeFSCatalogPadding); + + drive.fPacket.fPacketContent = &temporary_catalog; + drive.fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT); + drive.fPacket.fPacketLba = start_free; + + drive.fOutput(drive.fPacket); + + child_catalog->DataFork = part_block->DiskSize - start_free; + child_catalog->ResourceFork = child_catalog->DataFork; + + drive.fPacket.fPacketContent = child_catalog; + drive.fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT); + drive.fPacket.fPacketLba = start_free; + + drive.fOutput(drive.fPacket); + + // Get NeFS partition's block. + + drive.fPacket.fPacketContent = buf_part_block; + drive.fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); + drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress; + + drive.fInput(drive.fPacket); + + part_block->FreeSectors -= 1; + part_block->CatalogCount += 1; + part_block->FreeCatalog -= 1; + + drive.fOutput(drive.fPacket); + + kout << "Create new catalog with flags: " + << hex_number(child_catalog->Flags) << kendl; + kout << "Create new catalog with name: " << child_catalog->Name + << kendl; + + delete catalog; + catalog = nullptr; + + NEFS_CATALOG_STRUCT* found_catalog = new NEFS_CATALOG_STRUCT(); + rt_copy_memory(&temporary_catalog, found_catalog, sizeof(NEFS_CATALOG_STRUCT)); + + return found_catalog; + } + else if ((temporary_catalog.Flags & kNeFSFlagCreated) && + KStringBuilder::Equals(temporary_catalog.Name, name)) + { + rt_copy_memory(&temporary_catalog, child_catalog, sizeof(NEFS_CATALOG_STRUCT)); + + return child_catalog; + } + + start_free = start_free + (sizeof(NEFS_CATALOG_STRUCT) * kNeFSCatalogPadding); + + drive.fPacket.fPacketContent = &temporary_catalog; + drive.fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT); + drive.fPacket.fPacketLba = start_free; + + drive.fInput(drive.fPacket); + } + + delete catalog; + return nullptr; +} + +/// @brief Make a EPM+NeFS drive out of the disk. +/// @param drive The drive to write on. +/// @return If it was sucessful, see err_global_get(). +bool NeFileSystemParser::Format(_Input _Output DriveTrait* drive, _Input const Lba endLba, _Input const Int32 flags, const Char* part_name) +{ + if (*part_name == 0 || + endLba == 0) + return false; + + // verify disk. + drive->fVerify(drive->fPacket); + + rt_copy_memory((VoidPtr) "fs/nefs-packet", drive->fPacket.fPacketMime, + rt_string_len("fs/nefs-packet")); + + // if disk isn't good, then error out. + if (false == drive->fPacket.fPacketGood) + { + err_global_get() = kErrorDiskIsCorrupted; + return false; + } + + Char fs_buf[sizeof(NEFS_ROOT_PARTITION_BLOCK)] = {0}; + + Lba start = kNeFSRootCatalogStartAddress; + + drive->fPacket.fPacketContent = fs_buf; + drive->fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); + drive->fPacket.fPacketLba = start; + + drive->fInput(drive->fPacket); + + if (flags & kNeFSPartitionTypeBoot) + { + // make it bootable when needed. + Char buf_epm[kNeFSSectorSz] = {0}; + + EPM_PART_BLOCK* epm_boot = (EPM_PART_BLOCK*)buf_epm; + + // Write a new EPM entry. + + constexpr auto kFsName = "NeFS"; + constexpr auto kBlockName = "ZkaOS:"; + + rt_copy_memory(reinterpret_cast(const_cast(kFsName)), epm_boot->Fs, rt_string_len(kFsName)); + + epm_boot->FsVersion = kNeFSVersionInteger; + epm_boot->LbaStart = start; + epm_boot->SectorSz = kNeFSSectorSz; + + rt_copy_memory(reinterpret_cast(const_cast(kBlockName)), epm_boot->Name, rt_string_len(kBlockName)); + rt_copy_memory(reinterpret_cast(const_cast(kEPMMagic)), epm_boot->Magic, rt_string_len(kEPMMagic)); + + Lba outEpmLba = kEPMBootBlockLba; + + Char buf[kNeFSSectorSz]; + + Lba prevStart = 0; + SizeT cnt = 0; + + while (drive->fPacket.fPacketGood) + { + drive->fPacket.fPacketContent = buf; + drive->fPacket.fPacketSize = sizeof(EPM_PART_BLOCK); + drive->fPacket.fPacketLba = outEpmLba; + + drive->fInput(drive->fPacket); + + if (buf[0] == 0) + { + epm_boot->LbaStart = prevStart; + + if (epm_boot->LbaStart) + epm_boot->LbaStart = outEpmLba; + + epm_boot->LbaEnd = endLba; + epm_boot->NumBlocks = cnt; + + drive->fPacket.fPacketContent = buf_epm; + drive->fPacket.fPacketSize = sizeof(EPM_PART_BLOCK); + drive->fPacket.fPacketLba = outEpmLba; + + drive->fOutput(drive->fPacket); + + break; + } + else + { + prevStart = ((EPM_PART_BLOCK*)buf)->LbaStart + ((EPM_PART_BLOCK*)buf)->LbaEnd; + } + + outEpmLba += sizeof(EPM_PART_BLOCK); + ++cnt; + } + } + + // disk isnt faulty and data has been fetched. + while (drive->fPacket.fPacketGood) + { + NEFS_ROOT_PARTITION_BLOCK* part_block = (NEFS_ROOT_PARTITION_BLOCK*)fs_buf; + + // check for an empty partition here. + if (part_block->PartitionName[0] == 0 && + rt_string_cmp(part_block->Ident, kNeFSIdent, kNeFSIdentLen)) + { + // partition is free and valid. + + part_block->Version = kNeFSVersionInteger; + + const auto kNeFSUntitledHD = part_name; + + rt_copy_memory((VoidPtr)kNeFSIdent, (VoidPtr)part_block->Ident, + kNeFSIdentLen); + + rt_copy_memory((VoidPtr)kNeFSUntitledHD, (VoidPtr)part_block->PartitionName, + rt_string_len(kNeFSUntitledHD)); + + SizeT catalogCount = 0UL; + + SizeT sectorCount = drv_get_sector_count(); + SizeT diskSize = drv_get_size(); + + part_block->Kind = kNeFSPartitionTypeStandard; + part_block->StartCatalog = kNeFSCatalogStartAddress; + part_block->Flags = kNeFSPartitionTypeStandard; + part_block->CatalogCount = sectorCount / sizeof(NEFS_CATALOG_STRUCT); + part_block->FreeSectors = sectorCount / sizeof(NEFS_CATALOG_STRUCT); + part_block->SectorCount = sectorCount; + part_block->DiskSize = diskSize; + part_block->FreeCatalog = sectorCount / sizeof(NEFS_CATALOG_STRUCT); + + drive->fPacket.fPacketContent = fs_buf; + drive->fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); + drive->fPacket.fPacketLba = kNeFSRootCatalogStartAddress; + + drive->fOutput(drive->fPacket); + + kout << "drive kind: " << drive->fDriveKind() << kendl; + + kout << "partition name: " << part_block->PartitionName << kendl; + kout << "start: " << hex_number(part_block->StartCatalog) << kendl; + kout << "number of catalogs: " << hex_number(part_block->CatalogCount) << kendl; + kout << "free catalog: " << hex_number(part_block->FreeCatalog) << kendl; + kout << "free sectors: " << hex_number(part_block->FreeSectors) << kendl; + kout << "sector size: " << hex_number(part_block->SectorSize) << kendl; + + // write the root catalog. + this->CreateCatalog(kNeFSRoot, 0, kNeFSCatalogKindDir); + + return true; + } + + kout << "partition block already exists.\r"; + + start += part_block->DiskSize; + + drive->fPacket.fPacketContent = fs_buf; + drive->fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); + drive->fPacket.fPacketLba = start; + + drive->fInput(drive->fPacket); + } + + return false; +} + +/// @brief Writes the data fork into a specific catalog. +/// @param catalog the catalog itself +/// @param data the data. +/// @return if the catalog w rote the contents successfully. +bool NeFileSystemParser::WriteCatalog(_Input const Char* catalog_name, Bool is_rsrc_fork, _Input VoidPtr data, _Input SizeT size_of_data, _Input const Char* fork_name) +{ + if (size_of_data < 1) + return No; + + auto buf = new UInt8[size_of_data]; + rt_set_memory(buf, 0, size_of_data); + + rt_copy_memory(data, buf, size_of_data); + + auto& drive = kMountpoint.A(); + + rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime, + rt_string_len("fs/nefs-packet")); + + auto catalog = this->GetCatalog(catalog_name); + + if (!catalog) + { + delete[] buf; + buf = nullptr; + return NO; + } + + auto startFork = (!is_rsrc_fork) ? catalog->DataFork + : catalog->ResourceFork; + + delete catalog; + catalog = nullptr; + + NEFS_FORK_STRUCT* fork_data_input = new NEFS_FORK_STRUCT(); + NEFS_FORK_STRUCT prev_fork{}; + + kout << hex_number(startFork) << kendl; + + // sanity check of the fork position as the condition to run the loop. + while (startFork >= kNeFSCatalogStartAddress) + { + drive.fPacket.fPacketContent = fork_data_input; + drive.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT); + drive.fPacket.fPacketLba = startFork; + + drive.fInput(drive.fPacket); + + kout << hex_number(fork_data_input->DataSize) << kendl; + kout << hex_number(size_of_data) << kendl; + kout << hex_number(fork_data_input->Flags) << kendl; + kout << fork_name << kendl; + kout << fork_data_input->ForkName << kendl; + kout << fork_data_input->CatalogName << kendl; + kout << catalog_name << kendl; + + if ((fork_data_input->Flags & kNeFSFlagCreated) && + KStringBuilder::Equals(fork_data_input->ForkName, fork_name) && + KStringBuilder::Equals(fork_data_input->CatalogName, catalog_name) && + fork_data_input->DataSize == size_of_data) + { + // ===================================================== // + // Store the blob now. + // ===================================================== // + + drive.fPacket.fPacketContent = buf; + drive.fPacket.fPacketSize = size_of_data; + drive.fPacket.fPacketLba = fork_data_input->DataOffset; + + kout << "data offset: " << hex_number(fork_data_input->DataOffset) << kendl; + + drive.fOutput(drive.fPacket); + + kout << "wrote data at offset: " << hex_number(fork_data_input->DataOffset) << kendl; + + delete fork_data_input; + delete[] buf; + + return true; + } + + // stumble upon a fork, store it. + + prev_fork = *fork_data_input; + + startFork = fork_data_input->NextSibling; + } + + delete[] buf; + delete fork_data_input; + + return false; +} + +/// @brief +/// @param catalog_name the catalog name. +/// @return the newly found catalog. +_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::FindCatalog(_Input const Char* catalog_name, + Lba& out_lba, + Bool search_hidden, + Bool local_search) +{ + if (!catalog_name || + *catalog_name == 0) + return nullptr; + + NEFS_ROOT_PARTITION_BLOCK part{0}; + auto& drive = kMountpoint.A(); + + rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime, + rt_string_len("fs/nefs-packet")); + + drive.fPacket.fPacketContent = ∂ + drive.fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); + drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress; + + drive.fInput(drive.fPacket); + + auto start_catalog_lba = kNeFSCatalogStartAddress; + const auto kStartCatalogList = start_catalog_lba; + + if (!KStringBuilder::Equals(catalog_name, NeFileSystemHelper::Root()) && local_search) + { + Char parent_name[kNeFSCatalogNameLen] = {0}; + + for (SizeT indexFill = 0; indexFill < rt_string_len(catalog_name); ++indexFill) + { + parent_name[indexFill] = catalog_name[indexFill]; + } + + SizeT indexReverseCopy = rt_string_len(parent_name); + + // zero character. + parent_name[--indexReverseCopy] = 0; + + // mandatory '/' character. + parent_name[--indexReverseCopy] = 0; + + while (parent_name[indexReverseCopy] != NeFileSystemHelper::Separator()) + { + parent_name[indexReverseCopy] = 0; + --indexReverseCopy; + } + + NEFS_CATALOG_STRUCT* parent_catalog = this->FindCatalog(parent_name, out_lba); + + if (parent_catalog && + !KStringBuilder::Equals(parent_name, NeFileSystemHelper::Root())) + { + start_catalog_lba = parent_catalog->NextSibling; + + delete parent_catalog; + parent_catalog = nullptr; + + local_search = YES; + } + else if (parent_catalog) + { + start_catalog_lba = parent_catalog->NextSibling; + + local_search = YES; + + delete parent_catalog; + parent_catalog = nullptr; + } + else if (!parent_catalog) + { + return nullptr; + } + } + + NEFS_CATALOG_STRUCT temporary_catalog{}; + + SizeT i = rt_string_len(catalog_name); + + // get rid of \0 + --i; + + if (catalog_name[i] == '/') + --i; + + while (catalog_name[i] != '/') + --i; + + const Char* tmp_name = (catalog_name + i); + +kNeFSSearchThroughCatalogList: + while (drive.fPacket.fPacketGood) + { + drive.fPacket.fPacketLba = start_catalog_lba; + drive.fPacket.fPacketContent = &temporary_catalog; + drive.fPacket.fPacketSize = sizeof(NEFS_CATALOG_STRUCT); + + drive.fInput(drive.fPacket); + + if (KStringBuilder::Equals(tmp_name, temporary_catalog.Name)) + { + if (temporary_catalog.Status == kNeFSStatusLocked && + !search_hidden) + { + err_global_get() = kErrorFileLocked; + + goto NeFSContinueSearch; + } + + /// ignore unallocated catalog, break + if (!(temporary_catalog.Flags & kNeFSFlagCreated)) + { + err_global_get() = kErrorFileNotFound; + + goto NeFSContinueSearch; + } + + kout << "Found available catalog at: " << hex_number(start_catalog_lba) << kendl; + kout << "Found available catalog at: " << temporary_catalog.Name << kendl; + + NEFS_CATALOG_STRUCT* catalog_ptr = new NEFS_CATALOG_STRUCT(); + rt_copy_memory(&temporary_catalog, catalog_ptr, sizeof(NEFS_CATALOG_STRUCT)); + + out_lba = start_catalog_lba; + return catalog_ptr; + } + + NeFSContinueSearch: + start_catalog_lba = temporary_catalog.NextSibling; + + if (start_catalog_lba < part.StartCatalog) + break; + } + + if (local_search) + { + local_search = false; + start_catalog_lba = part.StartCatalog; + + goto kNeFSSearchThroughCatalogList; + } + + err_global_get() = kErrorFileNotFound; + + out_lba = 0UL; + + return nullptr; +} + +/// @brief Get catalog from filesystem. +/// @param name the catalog's name/ +/// @return +_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::GetCatalog(_Input const Char* name) +{ + Lba unused = 0; + return this->FindCatalog(name, unused, YES); +} + +/// @brief Closes a catalog, (frees it). +/// @param catalog the catalog to close. +/// @return +_Output Boolean NeFileSystemParser::CloseCatalog(_Input _Output NEFS_CATALOG_STRUCT* catalog) +{ + if (!catalog) + return false; + + delete catalog; + catalog = nullptr; + + return true; +} + +/// @brief Mark catalog as removed. +/// @param catalog The catalog structure. +/// @return if the catalog was removed or not. +_Output Boolean NeFileSystemParser::RemoveCatalog(_Input const Char* catalog_name) +{ + if (!catalog_name || + KStringBuilder::Equals(catalog_name, NeFileSystemHelper::Root())) + { + err_global_get() = kErrorInternal; + return false; + } + + Lba out_lba = 0; + auto catalog = this->FindCatalog(catalog_name, out_lba); + + if (out_lba >= kNeFSCatalogStartAddress || + catalog->Flags & kNeFSFlagCreated) + { + catalog->Flags &= (~kNeFSFlagCreated); + catalog->Flags |= kNeFSFlagDeleted; + + auto& drive = kMountpoint.A(); + + rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime, + rt_string_len("fs/nefs-packet")); + + drive.fPacket.fPacketLba = out_lba; // the catalog position. + drive.fPacket.fPacketSize = + sizeof(NEFS_CATALOG_STRUCT); // size of catalog. roughly the sector size. + drive.fPacket.fPacketContent = catalog; // the catalog itself. + + drive.fOutput(drive.fPacket); // send packet. + + Char partitionBlockBuf[sizeof(NEFS_ROOT_PARTITION_BLOCK)] = {0}; + + drive.fPacket.fPacketLba = kNeFSRootCatalogStartAddress; + drive.fPacket.fPacketContent = partitionBlockBuf; + drive.fPacket.fPacketSize = sizeof(NEFS_ROOT_PARTITION_BLOCK); + + drive.fInput(drive.fPacket); + + NEFS_ROOT_PARTITION_BLOCK* part_block = + reinterpret_cast(partitionBlockBuf); + + --part_block->CatalogCount; + ++part_block->FreeSectors; + + drive.fOutput(drive.fPacket); + + return true; + } + + delete catalog; + catalog = nullptr; + + return false; +} + +/// ***************************************************************** /// +/// Reading,Seek,Tell are unimplemented on catalogs, refer to forks I/O instead. +/// ***************************************************************** /// + +/***********************************************************************************/ +/// @brief Read the catalog data fork. +/// @param catalog +/// @param dataSz +/// @return +/***********************************************************************************/ + +VoidPtr NeFileSystemParser::ReadCatalog(_Input _Output NEFS_CATALOG_STRUCT* catalog, + _Input Bool is_rsrc_fork, + _Input SizeT dataSz, + _Input const Char* forkName) +{ + if (!catalog) + { + err_global_get() = kErrorInvalidData; + return nullptr; + } + + Lba dataForkLba = (!is_rsrc_fork) ? catalog->DataFork : catalog->ResourceFork; + Size dataForkSize = (!is_rsrc_fork) ? catalog->DataForkSize : catalog->ResourceForkSize; + + kout << "catalog " << catalog->Name + << ", fork: " << hex_number(dataForkLba) << kendl; + + NEFS_FORK_STRUCT* fs_buf = new NEFS_FORK_STRUCT(); + auto& drive = kMountpoint.A(); + + rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime, + rt_string_len("fs/nefs-packet")); + + NEFS_FORK_STRUCT* fs_fork_data = nullptr; + + while (dataForkLba > kNeFSCatalogStartAddress) + { + drive.fPacket.fPacketLba = dataForkLba; + drive.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT); + drive.fPacket.fPacketContent = fs_buf; + + drive.fInput(drive.fPacket); + + fs_fork_data = fs_buf; + + kout << "ForkName: " << fs_fork_data->ForkName << kendl; + kout << "CatalogName: " << fs_fork_data->CatalogName << kendl; + + if (KStringBuilder::Equals(forkName, fs_fork_data->ForkName) && + KStringBuilder::Equals(catalog->Name, fs_fork_data->CatalogName)) + break; + + dataForkLba = fs_fork_data->NextSibling; + } + + if (dataForkLba < kNeFSCatalogStartAddress) + { + delete fs_buf; + return nullptr; + } + + return fs_fork_data; +} + +/***********************************************************************************/ +/// @brief Seek in the data fork. +/// @param catalog the catalog offset. +/// @param off where to seek. +/// @return if the seeking was successful. +/***********************************************************************************/ + +bool NeFileSystemParser::Seek(_Input _Output NEFS_CATALOG_STRUCT* catalog, SizeT off) +{ + err_global_get() = kErrorUnimplemented; + return false; +} + +/***********************************************************************************/ +/// @brief Tell where we are inside the data fork. +/// @param catalog +/// @return The position on the file. +/***********************************************************************************/ + +SizeT NeFileSystemParser::Tell(_Input _Output NEFS_CATALOG_STRUCT* catalog) +{ + err_global_get() = kErrorUnimplemented; + return 0; +} + +namespace NeOS::NeFS +{ + /***********************************************************************************/ + /// @brief Construct NeFS drives. + /***********************************************************************************/ + Boolean fs_init_nefs(Void) noexcept + { + kout << "Creating main disk...\r"; + + kMountpoint.A() = io_construct_main_drive(); + + if (kMountpoint.A().fPacket.fPacketReadOnly == YES) + ke_panic(RUNTIME_CHECK_FILESYSTEM, "Main filesystem cannot be mounted."); + + return YES; + } +} // namespace NeOS::NeFS + +#endif // ifdef __FSKIT_INCLUDES_NEFS__ diff --git a/dev/kernel/src/FileMgr.cc b/dev/kernel/src/FileMgr.cc new file mode 100644 index 00000000..b803253d --- /dev/null +++ b/dev/kernel/src/FileMgr.cc @@ -0,0 +1,52 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +/// @file FileMgr.cc +//! @brief File System Manager API. + +namespace NeOS +{ + STATIC IFilesystemMgr* kMountedFilesystem = nullptr; + + /// @brief FilesystemMgr getter. + /// @return The mounted filesystem. + _Output IFilesystemMgr* IFilesystemMgr::GetMounted() + { + return kMountedFilesystem; + } + + /// @brief Unmount filesystem. + /// @return The unmounted filesystem. + _Output IFilesystemMgr* IFilesystemMgr::Unmount() + { + if (kMountedFilesystem) + { + auto mount = kMountedFilesystem; + kMountedFilesystem = nullptr; + + return mount; + } + + return nullptr; + } + + /// @brief Mount filesystem. + /// @param mount_ptr The filesystem to mount. + /// @return if it succeeded true, otherwise false. + _Output Bool IFilesystemMgr::Mount(_Input IFilesystemMgr* mount_ptr) + { + if (mount_ptr != nullptr) + { + kMountedFilesystem = mount_ptr; + return Yes; + } + + return No; + } +} // namespace NeOS diff --git a/dev/kernel/src/GUIDWizard.cc b/dev/kernel/src/GUIDWizard.cc new file mode 100644 index 00000000..96e15d85 --- /dev/null +++ b/dev/kernel/src/GUIDWizard.cc @@ -0,0 +1,72 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: GUIDWizard.cc + Purpose: GUID helper code + + Revision History: + +------------------------------------------- */ + +#include +#include + +// begin of ascii 'readable' characters. (A, C, C, 1, 2) +#define kUUIDAsciiBegin 47 +// @brief Size of UUID. +#define kUUIDSize 37 + +namespace CFKit::XRN::Version1 +{ + auto cf_make_sequence(const ArrayList& uuidSeq) -> Ref + { + GUIDSequence* seq = new GUIDSequence(); + MUST_PASS(seq); + + Ref seq_ref{seq}; + + seq_ref.Leak()->fMs1 = uuidSeq[0]; + seq_ref.Leak()->fMs2 = uuidSeq[1]; + seq_ref.Leak()->fMs3 = uuidSeq[2]; + seq_ref.Leak()->fMs4[0] = uuidSeq[3]; + seq_ref.Leak()->fMs4[1] = uuidSeq[4]; + seq_ref.Leak()->fMs4[2] = uuidSeq[5]; + seq_ref.Leak()->fMs4[3] = uuidSeq[6]; + seq_ref.Leak()->fMs4[4] = uuidSeq[7]; + seq_ref.Leak()->fMs4[5] = uuidSeq[8]; + seq_ref.Leak()->fMs4[6] = uuidSeq[9]; + seq_ref.Leak()->fMs4[7] = uuidSeq[10]; + + return seq_ref; + } + + // @brief Tries to make a guid out of a string. + // This function is not complete for now + auto cf_try_guid_to_string(Ref& seq) -> ErrorOr> + { + Char buf[kUUIDSize]; + + for (SizeT index = 0; index < 16; ++index) + { + buf[index] = seq.Leak()->u8[index] + kUUIDAsciiBegin; + } + + for (SizeT index = 16; index < 24; ++index) + { + buf[index] = seq.Leak()->u16[index] + kUUIDAsciiBegin; + } + + for (SizeT index = 24; index < 28; ++index) + { + buf[index] = seq.Leak()->u32[index] + kUUIDAsciiBegin; + } + + auto view = KStringBuilder::Construct(buf); + + if (view) + return ErrorOr>{view.Leak()}; + + return ErrorOr>{-1}; + } +} // namespace CFKit::XRN::Version1 diff --git a/dev/kernel/src/GUIDWrapper.cc b/dev/kernel/src/GUIDWrapper.cc new file mode 100644 index 00000000..cd4a6aa3 --- /dev/null +++ b/dev/kernel/src/GUIDWrapper.cc @@ -0,0 +1,11 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +namespace CFKit::XRN +{ +} diff --git a/dev/kernel/src/HardwareThreadScheduler.cc b/dev/kernel/src/HardwareThreadScheduler.cc new file mode 100644 index 00000000..70502d40 --- /dev/null +++ b/dev/kernel/src/HardwareThreadScheduler.cc @@ -0,0 +1,225 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include + +/***********************************************************************************/ +///! @file HardwareThreadScheduler.cc +///! @brief This file handles multi processing in the Kernel. +///! @brief Multi processing is needed for multi-tasking operations. +/***********************************************************************************/ + +namespace NeOS +{ + /***********************************************************************************/ + /// @note Those symbols are needed in order to switch and validate the stack. + /***********************************************************************************/ + + EXTERN_C Bool hal_check_stack(HAL::StackFramePtr frame); + EXTERN_C Bool mp_register_process(HAL::StackFramePtr frame, ProcessID pid); + + STATIC HardwareThreadScheduler kHardwareThreadScheduler; + + ///! A HardwareThread class takes care of it's owned hardware thread. + ///! It has a stack for it's core. + + /***********************************************************************************/ + ///! @brief C++ constructor. + /***********************************************************************************/ + HardwareThread::HardwareThread() = default; + + /***********************************************************************************/ + ///! @brief C++ destructor. + /***********************************************************************************/ + HardwareThread::~HardwareThread() = default; + + /***********************************************************************************/ + //! @brief returns the id of the thread. + /***********************************************************************************/ + const ThreadID& HardwareThread::ID() noexcept + { + return fID; + } + + /***********************************************************************************/ + //! @brief returns the kind of thread we have. + /***********************************************************************************/ + const ThreadKind& HardwareThread::Kind() noexcept + { + return fKind; + } + + /***********************************************************************************/ + //! @brief is the thread busy? + //! @return whether the thread is busy or not. + /***********************************************************************************/ + Bool HardwareThread::IsBusy() noexcept + { + STATIC Int64 busy_timer = 0U; + constexpr Int64 kTimeoutMax = 0x1000000; // an arbitrary value used to tell if the timeout hasn't been reached yet. + + if (fBusy && (busy_timer > kTimeoutMax)) + { + busy_timer = 0U; + fBusy = No; + + return No; + } + + ++busy_timer; + + return fBusy; + } + + /***********************************************************************************/ + /// @brief Get processor stack frame. + /***********************************************************************************/ + + HAL::StackFramePtr HardwareThread::StackFrame() noexcept + { + MUST_PASS(this->fStack); + return this->fStack; + } + + Void HardwareThread::Busy(const Bool busy) noexcept + { + this->fBusy = busy; + } + + HardwareThread::operator bool() + { + return this->fStack && !this->fBusy; + } + + /***********************************************************************************/ + /// @brief Wakeup the processor. + /***********************************************************************************/ + + Void HardwareThread::Wake(const bool wakeup) noexcept + { + this->fWakeup = wakeup; + } + + /***********************************************************************************/ + /// @brief Switch to hardware thread. + /// @param stack the new hardware thread. + /// @retval true stack was changed, code is running. + /// @retval false stack is invalid, previous code is running. + /***********************************************************************************/ + Bool HardwareThread::Switch(VoidPtr image_ptr, Ptr8 stack_ptr, HAL::StackFramePtr frame, const ThreadID& pid) + { + if (this->IsBusy()) + return NO; + + this->fStack = frame; + this->fPID = pid; + + this->fStack->BP = reinterpret_cast(image_ptr); + this->fStack->SP = reinterpret_cast(stack_ptr); + + Bool ret = mp_register_process(fStack, this->fPID); + + if (ret) + this->Busy(YES); + + return ret; + } + + /***********************************************************************************/ + ///! @brief Tells if processor is waked up. + /***********************************************************************************/ + bool HardwareThread::IsWakeup() noexcept + { + return this->fWakeup; + } + + /***********************************************************************************/ + ///! @brief Constructor and destructors. + ///! @brief Default constructor. + /***********************************************************************************/ + + HardwareThreadScheduler::HardwareThreadScheduler() = default; + + /***********************************************************************************/ + ///! @brief Default destructor. + /***********************************************************************************/ + HardwareThreadScheduler::~HardwareThreadScheduler() = default; + + /***********************************************************************************/ + /// @brief Shared singleton function + /***********************************************************************************/ + HardwareThreadScheduler& HardwareThreadScheduler::The() + { + return kHardwareThreadScheduler; + } + + /***********************************************************************************/ + /// @brief Get Stack Frame of AP. + /***********************************************************************************/ + HAL::StackFramePtr HardwareThreadScheduler::Leak() noexcept + { + return fThreadList[fCurrentThread].fStack; + } + + /***********************************************************************************/ + /** + * Get Hardware thread at index. + * @param idx the index + * @return the reference to the hardware thread. + */ + /***********************************************************************************/ + Ref HardwareThreadScheduler::operator[](const SizeT& idx) + { + if (idx == 0) + { + if (fThreadList[idx].Kind() != kAPSystemReserved) + { + fThreadList[idx].fKind = kAPBoot; + } + } + else if (idx >= kMaxAPInsideSched) + { + static HardwareThread* kFakeThread = nullptr; + return {kFakeThread}; + } + + return &fThreadList[idx]; + } + + /***********************************************************************************/ + /** + * Check if thread pool isn't empty. + * @return + */ + /***********************************************************************************/ + HardwareThreadScheduler::operator bool() noexcept + { + return !fThreadList.Empty(); + } + + /***********************************************************************************/ + /** + * Reverse operator bool + * @return + */ + /***********************************************************************************/ + bool HardwareThreadScheduler::operator!() noexcept + { + return fThreadList.Empty(); + } + + /***********************************************************************************/ + /// @brief Returns the amount of core present. + /// @return the number of APs. + /***********************************************************************************/ + SizeT HardwareThreadScheduler::Capacity() noexcept + { + return fThreadList.Count(); + } +} // namespace NeOS diff --git a/dev/kernel/src/IDylibObject.cc b/dev/kernel/src/IDylibObject.cc new file mode 100644 index 00000000..30a76af9 --- /dev/null +++ b/dev/kernel/src/IDylibObject.cc @@ -0,0 +1,15 @@ +/* + * ======================================================== + * + * neoskrnl + * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + * + * ======================================================== + */ + +#include +#include + +#include + +using namespace NeOS; diff --git a/dev/kernel/src/IPEFDylibObject.cc b/dev/kernel/src/IPEFDylibObject.cc new file mode 100644 index 00000000..e994ad29 --- /dev/null +++ b/dev/kernel/src/IPEFDylibObject.cc @@ -0,0 +1,111 @@ +/* + * ======================================================== + * + * neoskrnl + * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + * + * ======================================================== + */ + +#include +#include +#include +#include +#include +#include + +/* ------------------------------------------- + + Revision History: + + 01/02/24: Reworked dll ABI, expect a rtl_init_dylib and + rtl_fini_dylib (amlel) + + 15/02/24: Breaking changes, changed the name of the + routines. (amlel) + + 07/28/24: Replace rt_library_free with rtl_fini_dylib + + 10/8/24: FIX: Fix log comment. + + ------------------------------------------- */ + +using namespace NeOS; + +/***********************************************************************************/ +/// @file IPEFDylibObject.cc +/// @brief PEF's Dylib runtime. +/***********************************************************************************/ + +/***********************************************************************************/ +/** @brief Library initializer. */ +/***********************************************************************************/ + +EXTERN_C IDylibRef rtl_init_dylib(UserProcess& process) +{ + IDylibRef dll_obj = tls_new_class(); + + if (!dll_obj) + { + process.Crash(); + return nullptr; + } + + dll_obj->Mount(new IPEFDylibObject::DLL_TRAITS()); + + if (!dll_obj->Get()) + { + tls_delete_class(dll_obj); + dll_obj = nullptr; + + process.Crash(); + + return nullptr; + } + + dll_obj->Get()->ImageObject = + process.Image.fBlob; + + if (!dll_obj->Get()->ImageObject) + { + delete dll_obj->Get(); + + tls_delete_class(dll_obj); + dll_obj = nullptr; + + process.Crash(); + + return nullptr; + } + + dll_obj->Get()->ImageEntrypointOffset = + dll_obj->Load(kPefStart, rt_string_len(kPefStart, 0), kPefCode); + + return dll_obj; +} + +/***********************************************************************************/ +/** @brief Frees the dll_obj. */ +/** @note Please check if the dll_obj got freed! */ +/** @param dll_obj The dll_obj to free. */ +/** @param successful Reports if successful or not. */ +/***********************************************************************************/ + +EXTERN_C Void rtl_fini_dylib(UserProcess& process, IDylibRef dll_obj, BOOL* successful) +{ + MUST_PASS(successful); + + // sanity check (will also trigger a bug check if this fails) + if (dll_obj == nullptr) + { + *successful = false; + process.Crash(); + } + + delete dll_obj->Get(); + delete dll_obj; + + dll_obj = nullptr; + + *successful = true; +} diff --git a/dev/kernel/src/IndexableProperty.cc b/dev/kernel/src/IndexableProperty.cc new file mode 100644 index 00000000..404cddc3 --- /dev/null +++ b/dev/kernel/src/IndexableProperty.cc @@ -0,0 +1,57 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include + +/// @brief File indexer API for fast path access. +/// BUGS: 0 + +#define kMaxLenIndexer (256U) + +namespace NeOS +{ + namespace Indexer + { + IndexProperty& IndexableProperty::Leak() noexcept + { + return fIndex; + } + + Void IndexableProperty::AddFlag(Int16 flag) + { + fFlags |= flag; + } + + Void IndexableProperty::RemoveFlag(Int16 flag) + { + fFlags &= flag; + } + + Int16 IndexableProperty::HasFlag(Int16 flag) + { + return fFlags & flag; + } + + /// @brief Index a file into the indexer instance. + /// @param filename filesystem path to access. + /// @param filenameLen used bytes in path. + /// @param indexer the filesystem indexer. + /// @return none, check before if indexer can be claimed (using indexer.HasFlag(kIndexerClaimed)). + Void fs_index_file(const Char* filename, SizeT filenameLen, IndexableProperty& indexer) + { + if (!indexer.HasFlag(kIndexerClaimed)) + { + indexer.AddFlag(kIndexerClaimed); + rt_copy_memory((VoidPtr)indexer.Leak().Path, (VoidPtr)filename, filenameLen); + + kout << "FSKit: Indexed new file: " << filename << kendl; + } + } + } // namespace Indexer +} // namespace NeOS diff --git a/dev/kernel/src/Json.cc b/dev/kernel/src/Json.cc new file mode 100644 index 00000000..48567b5f --- /dev/null +++ b/dev/kernel/src/Json.cc @@ -0,0 +1,10 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +/// @brief Undefined object, is null in length. +RTL_INIT_OBJECT(NeOS::Json::kNull, NeOS::Json); diff --git a/dev/kernel/src/KString.cc b/dev/kernel/src/KString.cc new file mode 100644 index 00000000..d96ef38c --- /dev/null +++ b/dev/kernel/src/KString.cc @@ -0,0 +1,218 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +/// @file KString.cc +/// @brief Kernel String manipulation file. + +namespace NeOS +{ + Char* KString::Data() + { + return this->fData; + } + + const Char* KString::CData() const + { + return const_cast(this->fData); + } + + Size KString::Length() const + { + return this->fDataSz; + } + + bool KString::operator==(const KString& rhs) const + { + if (rhs.Length() != this->Length()) + return false; + + for (Size index = 0; index < this->Length(); ++index) + { + if (rhs.fData[index] != this->fData[index]) + return false; + } + + return true; + } + + bool KString::operator==(const Char* rhs) const + { + if (rt_string_len(rhs) != this->Length()) + return false; + + for (Size index = 0; index < rt_string_len(rhs); ++index) + { + if (rhs[index] != this->fData[index]) + return false; + } + + return true; + } + + bool KString::operator!=(const KString& rhs) const + { + if (rhs.Length() != this->Length()) + return false; + + for (Size index = 0; index < rhs.Length(); ++index) + { + if (rhs.fData[index] == this->fData[index]) + return false; + } + + return true; + } + + bool KString::operator!=(const Char* rhs) const + { + if (rt_string_len(rhs) != this->Length()) + return false; + + for (Size index = 0; index < rt_string_len(rhs); ++index) + { + if (rhs[index] == this->fData[index]) + return false; + } + + return true; + } + + ErrorOr KStringBuilder::Construct(const Char* data) + { + if (!data || *data == 0) + return {}; + + KString* view = new KString(rt_string_len(data)); + (*view) += data; + + return ErrorOr(*view); + } + + const Char* KStringBuilder::FromBool(const Char* fmt, bool i) + { + if (!fmt) + return ("?"); + + const Char* boolean_expr = i ? "YES" : "NO"; + Char* ret = (Char*)RTL_ALLOCA((sizeof(char) * i) ? 4 : 5 + rt_string_len(fmt)); + + if (!ret) + return ("?"); + + const auto fmt_len = rt_string_len(fmt); + const auto res_len = rt_string_len(boolean_expr); + + for (Size idx = 0; idx < fmt_len; ++idx) + { + if (fmt[idx] == '%') + { + SizeT result_cnt = idx; + + for (auto y_idx = idx; y_idx < res_len; ++y_idx) + { + ret[result_cnt] = boolean_expr[y_idx]; + ++result_cnt; + } + + break; + } + + ret[idx] = fmt[idx]; + } + + return ret; + } + + bool KStringBuilder::Equals(const Char* lhs, const Char* rhs) + { + if (rt_string_len(rhs) != rt_string_len(lhs)) + return false; + + for (Size index = 0; index < rt_string_len(rhs); ++index) + { + if (rhs[index] != lhs[index]) + return false; + } + + return true; + } + + bool KStringBuilder::Equals(const WideChar* lhs, const WideChar* rhs) + { + for (Size index = 0; rhs[index] != 0; ++index) + { + if (rhs[index] != lhs[index]) + return false; + } + + return true; + } + + const Char* KStringBuilder::Format(const Char* fmt, const Char* fmt2) + { + if (!fmt || !fmt2) + return ("?"); + + Char* ret = + (Char*)RTL_ALLOCA(sizeof(char) * (rt_string_len(fmt2) + rt_string_len(fmt))); + + if (!ret) + return ("?"); + + const auto len = rt_string_len(fmt); + + for (Size idx = 0; idx < len; ++idx) + { + if (fmt[idx] == '%' && idx < rt_string_len(fmt) && fmt[idx] == 's') + { + Size result_cnt = idx; + + for (Size y_idx = 0; y_idx < rt_string_len(fmt2); ++y_idx) + { + ret[result_cnt] = fmt2[y_idx]; + ++result_cnt; + } + } + + ret[idx] = fmt[idx]; + } + + return ret; + } + + STATIC void rt_string_append(Char* lhs, const Char* rhs, Int32 cur) + { + SizeT sz_rhs = rt_string_len(rhs); + SizeT rhs_i = 0; + + for (; rhs_i < sz_rhs; ++rhs_i) + { + lhs[rhs_i + cur] = rhs[rhs_i]; + } + } + + KString& KString::operator+=(const Char* rhs) + { + rt_string_append(this->fData, rhs, this->fCur); + this->fCur += rt_string_len(rhs); + + return *this; + } + + KString& KString::operator+=(const KString& rhs) + { + if (rt_string_len(rhs.fData) > this->Length()) + return *this; + + rt_string_append(this->fData, const_cast(rhs.fData), this->fCur); + this->fCur += rt_string_len(const_cast(rhs.fData)); + + return *this; + } +} // namespace NeOS diff --git a/dev/kernel/src/LPC.cc b/dev/kernel/src/LPC.cc new file mode 100644 index 00000000..b6b2e11b --- /dev/null +++ b/dev/kernel/src/LPC.cc @@ -0,0 +1,34 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +namespace NeOS +{ + STATIC Bool kRaiseOnBugCheck = false; + + /// @brief Does a system wide bug check. + /// @param void no params. + /// @return if error-free: false, otherwise true. + Boolean err_bug_check(void) noexcept + { + if (kRaiseOnBugCheck) + { + ke_panic(RUNTIME_CHECK_BAD_BEHAVIOR); + } + + return No; + } + + /// @brief Tells if we should raise a bug check not. + /// @param void + /// @return void + Void err_bug_check_raise(Void) noexcept + { + kRaiseOnBugCheck = true; + } +} // namespace NeOS diff --git a/dev/kernel/src/LockDelegate.cc b/dev/kernel/src/LockDelegate.cc new file mode 100644 index 00000000..df62c6f3 --- /dev/null +++ b/dev/kernel/src/LockDelegate.cc @@ -0,0 +1,12 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +namespace NeOS +{ + /// @note Leave it empty for now. +} // namespace NeOS diff --git a/dev/kernel/src/MemoryMgr.cc b/dev/kernel/src/MemoryMgr.cc new file mode 100644 index 00000000..4e13ea15 --- /dev/null +++ b/dev/kernel/src/MemoryMgr.cc @@ -0,0 +1,289 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include + +/* ------------------------------------------- + + Revision History: + 10/8/24: FIX: Fix useless long name, alongside a new WR (WriteRead) field. + 20/10/24: Fix mm_new_ and mm_delete_ APIs inside MemoryMgr.h header. (amlal) + 27/01/25: Reworked code as the memory manager. + + ------------------------------------------- */ + +//! @file MemoryMgr.cc +//! @brief Heap algorithm that serves as the main memory manager. + +#define kKernelHeapMagic (0xD4D75) +#define kKernelHeapAlignSz (__BIGGEST_ALIGNMENT__) + +namespace NeOS +{ + /// @brief Contains data structures and algorithms for the heap. + namespace Detail + { + struct PACKED HEAP_INFORMATION_BLOCK; + + /// @brief Kernel heap information block. + /// Located before the address bytes. + /// | HIB | CLASS/STRUCT/DATA TYPES... | + struct PACKED HEAP_INFORMATION_BLOCK final + { + ///! @brief 32-bit value which contains the magic number of the heap. + UInt32 fMagic : 24; + + ///! @brief Is the heap present? + UInt8 fPresent : 1; + + /// @brief Is this value writable? + UInt8 fWriteRead : 1; + + /// @brief Is this value owned by the user? + UInt8 fUser : 1; + + /// @brief Is this a page pointer? + UInt8 fPage : 1; + + /// @brief 32-bit CRC checksum. + UInt32 fCRC32; + + /// @brief 64-bit Allocation flags. + UInt16 fFlags; + + /// @brief 64-bit pointer size. + SizeT fSize; + + /// @brief 64-bit target offset pointer. + UIntPtr fOffset; + + /// @brief Padding bytes for header. + UInt8 fPadding[kKernelHeapAlignSz]; + }; + + /// @brief Check for heap address validity. + /// @param heap_ptr The address_ptr to check. + /// @return Bool if the pointer is valid or not. + _Output auto mm_check_heap_address(VoidPtr heap_ptr) -> Bool + { + if (!heap_ptr) + return false; + + auto base_heap = ((IntPtr)heap_ptr) - sizeof(Detail::HEAP_INFORMATION_BLOCK); + + /// Add that check in case we're having an integer underflow. /// + + if (base_heap < 0) + { + return false; + } + + return true; + } + + typedef HEAP_INFORMATION_BLOCK* HEAP_INFORMATION_BLOCK_PTR; + } // namespace Detail + + /// @brief Declare a new size for ptr_heap. + /// @param ptr_heap the pointer. + /// @return Newly allocated heap header. + _Output auto mm_realloc_heap(VoidPtr ptr_heap, SizeT new_sz) -> VoidPtr + { + if (Detail::mm_check_heap_address(ptr_heap) == No) + return nullptr; + + if (!ptr_heap || new_sz < 1) + return nullptr; + + kout << "This function is not implemented by NeOSKrnl, please use the BSD's realloc instead.\r"; + ke_panic(RUNTIME_CHECK_INVALID); + + return nullptr; + } + + /// @brief Allocate chunk of memory. + /// @param sz Size of pointer + /// @param wr Read Write bit. + /// @param user User enable bit. + /// @return The newly allocated pointer. + _Output VoidPtr mm_new_heap(const SizeT sz, const bool wr, const bool user) + { + auto sz_fix = sz; + + if (sz_fix == 0) + return nullptr; + + sz_fix += sizeof(Detail::HEAP_INFORMATION_BLOCK); + + PageMgr heap_mgr; + auto wrapper = heap_mgr.Request(wr, user, No, sz_fix); + + Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr = + reinterpret_cast( + wrapper.VirtualAddress() + sizeof(Detail::HEAP_INFORMATION_BLOCK)); + + heap_info_ptr->fSize = sz_fix; + heap_info_ptr->fMagic = kKernelHeapMagic; + heap_info_ptr->fCRC32 = 0; // dont fill it for now. + heap_info_ptr->fOffset = reinterpret_cast(heap_info_ptr) + sizeof(Detail::HEAP_INFORMATION_BLOCK); + heap_info_ptr->fPage = No; + heap_info_ptr->fWriteRead = wr; + heap_info_ptr->fUser = user; + heap_info_ptr->fPresent = Yes; + + rt_set_memory(heap_info_ptr->fPadding, 0, kKernelHeapAlignSz); + + auto result = reinterpret_cast(heap_info_ptr->fOffset); + + kout << "Registered heap address: " << hex_number(reinterpret_cast(heap_info_ptr)) << kendl; + + return result; + } + + /// @brief Makes a page heap. + /// @param heap_ptr the pointer to make a page heap. + /// @return kErrorSuccess if successful, otherwise an error code. + _Output Int32 mm_make_page(VoidPtr heap_ptr) + { + if (Detail::mm_check_heap_address(heap_ptr) == No) + return kErrorHeapNotPresent; + + Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr = + reinterpret_cast( + (UIntPtr)heap_ptr - sizeof(Detail::HEAP_INFORMATION_BLOCK)); + + if (!heap_info_ptr) + return kErrorHeapNotPresent; + + heap_info_ptr->fPage = true; + + kout << "Registered page address: " << hex_number(reinterpret_cast(heap_info_ptr)) << kendl; + + return kErrorSuccess; + } + + /// @brief Overwrites and set the flags of a heap header. + /// @param heap_ptr the pointer to update. + /// @param flags the flags to set. + _Output Int32 mm_make_flags(VoidPtr heap_ptr, UInt64 flags) + { + if (Detail::mm_check_heap_address(heap_ptr) == No) + return kErrorHeapNotPresent; + + Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr = + reinterpret_cast( + (UIntPtr)heap_ptr - sizeof(Detail::HEAP_INFORMATION_BLOCK)); + + if (!heap_info_ptr) + return kErrorHeapNotPresent; + + heap_info_ptr->fFlags = flags; + + return kErrorSuccess; + } + + /// @brief Gets the flags of a heap header. + /// @param heap_ptr the pointer to get. + _Output UInt64 mm_get_flags(VoidPtr heap_ptr) + { + Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr = + reinterpret_cast( + (UIntPtr)heap_ptr - sizeof(Detail::HEAP_INFORMATION_BLOCK)); + + if (!heap_info_ptr) + return kErrorHeapNotPresent; + + return heap_info_ptr->fFlags; + } + + /// @brief Declare pointer as free. + /// @param heap_ptr the pointer. + /// @return + _Output Int32 mm_delete_heap(VoidPtr heap_ptr) + { + if (Detail::mm_check_heap_address(heap_ptr) == No) + return kErrorHeapNotPresent; + + Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr = + reinterpret_cast( + (UIntPtr)(heap_ptr) - sizeof(Detail::HEAP_INFORMATION_BLOCK)); + + if (heap_info_ptr && heap_info_ptr->fMagic == kKernelHeapMagic) + { + if (!heap_info_ptr->fPresent) + { + return kErrorHeapNotPresent; + } + + heap_info_ptr->fSize = 0UL; + heap_info_ptr->fPresent = No; + heap_info_ptr->fOffset = 0; + heap_info_ptr->fCRC32 = 0; + heap_info_ptr->fWriteRead = No; + heap_info_ptr->fUser = No; + heap_info_ptr->fMagic = 0; + + PTEWrapper page_wrapper(No, No, No, reinterpret_cast(heap_info_ptr) - sizeof(Detail::HEAP_INFORMATION_BLOCK)); + Ref pte_address{page_wrapper}; + + PageMgr heap_mgr; + heap_mgr.Free(pte_address); + + kout << "Address has been successfully freed." << kendl; + + return kErrorSuccess; + } + + return kErrorInternal; + } + + /// @brief Check if pointer is a valid Kernel pointer. + /// @param heap_ptr the pointer + /// @return if it exists. + _Output Boolean mm_is_valid_heap(VoidPtr heap_ptr) + { + if (heap_ptr && HAL::mm_is_bitmap(heap_ptr)) + { + Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr = + reinterpret_cast( + (UIntPtr)(heap_ptr) - sizeof(Detail::HEAP_INFORMATION_BLOCK)); + + return (heap_info_ptr && heap_info_ptr->fPresent && heap_info_ptr->fMagic == kKernelHeapMagic); + } + + return No; + } + + /// @brief Protect the heap with a CRC value. + /// @param heap_ptr HIB pointer. + /// @return if it valid: point has crc now., otherwise fail. + _Output Boolean mm_protect_heap(VoidPtr heap_ptr) + { + if (heap_ptr) + { + Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr = + reinterpret_cast( + (UIntPtr)heap_ptr - sizeof(Detail::HEAP_INFORMATION_BLOCK)); + + /// if valid, present and is heap header, then compute crc32 + if (heap_info_ptr && heap_info_ptr->fPresent && kKernelHeapMagic == heap_info_ptr->fMagic) + { + heap_info_ptr->fCRC32 = + ke_calculate_crc32((Char*)heap_info_ptr->fOffset, heap_info_ptr->fSize); + + return Yes; + } + } + + return No; + } +} // namespace NeOS diff --git a/dev/kernel/src/MutableArray.cc b/dev/kernel/src/MutableArray.cc new file mode 100644 index 00000000..8464a283 --- /dev/null +++ b/dev/kernel/src/MutableArray.cc @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include diff --git a/dev/kernel/src/Network/IPAddr.cc b/dev/kernel/src/Network/IPAddr.cc new file mode 100644 index 00000000..6f523086 --- /dev/null +++ b/dev/kernel/src/Network/IPAddr.cc @@ -0,0 +1,129 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +namespace NeOS +{ + Char* RawIPAddress::Address() + { + return fAddr; + } + + RawIPAddress::RawIPAddress(char bytes[4]) + { + rt_copy_memory(bytes, fAddr, 4); + } + + BOOL RawIPAddress::operator==(const RawIPAddress& ipv4) + { + for (Size index = 0; index < 4; ++index) + { + if (ipv4.fAddr[index] != fAddr[index]) + return false; + } + + return true; + } + + BOOL RawIPAddress::operator!=(const RawIPAddress& ipv4) + { + for (Size index = 0; index < 4; ++index) + { + if (ipv4.fAddr[index] == fAddr[index]) + return false; + } + + return true; + } + + Char& RawIPAddress::operator[](const Size& index) + { + kout << "[RawIPAddress::operator[]] Fetching Index...\r"; + + static char IP_PLACEHOLDER = '0'; + if (index > 4) + return IP_PLACEHOLDER; + + return fAddr[index]; + } + + RawIPAddress6::RawIPAddress6(char bytes[8]) + { + rt_copy_memory(bytes, fAddr, 8); + } + + char& RawIPAddress6::operator[](const Size& index) + { + kout << "[RawIPAddress6::operator[]] Fetching Index...\r"; + + static char IP_PLACEHOLDER = '0'; + if (index > 8) + return IP_PLACEHOLDER; + + return fAddr[index]; + } + + bool RawIPAddress6::operator==(const RawIPAddress6& ipv6) + { + for (SizeT index = 0; index < 8; ++index) + { + if (ipv6.fAddr[index] != fAddr[index]) + return false; + } + + return true; + } + + bool RawIPAddress6::operator!=(const RawIPAddress6& ipv6) + { + for (SizeT index = 0; index < 8; ++index) + { + if (ipv6.fAddr[index] == fAddr[index]) + return false; + } + + return true; + } + + ErrorOr IPFactory::ToKString(Ref& ipv6) + { + auto str = KStringBuilder::Construct(ipv6.Leak().Address()); + return str; + } + + ErrorOr IPFactory::ToKString(Ref& ipv4) + { + auto str = KStringBuilder::Construct(ipv4.Leak().Address()); + return str; + } + + bool IPFactory::IpCheckVersion4(const Char* ip) + { + if (!ip) + return NO; + + Int32 cnter = 0; + + for (SizeT base = 0; base < rt_string_len(ip); ++base) + { + if (ip[base] == '.') + { + cnter = 0; + } + else + { + if (cnter == 3) + return false; + + ++cnter; + } + } + + return true; + } +} // namespace NeOS diff --git a/dev/kernel/src/Network/IPCAddr.cc b/dev/kernel/src/Network/IPCAddr.cc new file mode 100644 index 00000000..75a54a36 --- /dev/null +++ b/dev/kernel/src/Network/IPCAddr.cc @@ -0,0 +1,32 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + ------------------------------------------- */ + +#include +#include +#include + +namespace NeOS +{ + bool IPC_ADDR::operator==(const IPC_ADDR& addr) noexcept + { + return addr.UserProcessID == this->UserProcessID && addr.UserProcessTeam == this->UserProcessTeam; + } + + bool IPC_ADDR::operator==(IPC_ADDR& addr) noexcept + { + return addr.UserProcessID == this->UserProcessID && addr.UserProcessTeam == this->UserProcessTeam; + } + + bool IPC_ADDR::operator!=(const IPC_ADDR& addr) noexcept + { + return addr.UserProcessID != this->UserProcessID || addr.UserProcessTeam != this->UserProcessTeam; + } + + bool IPC_ADDR::operator!=(IPC_ADDR& addr) noexcept + { + return addr.UserProcessID != this->UserProcessID || addr.UserProcessTeam != this->UserProcessTeam; + } +} // namespace NeOS diff --git a/dev/kernel/src/Network/IPCMsg.cc b/dev/kernel/src/Network/IPCMsg.cc new file mode 100644 index 00000000..f5bec6f7 --- /dev/null +++ b/dev/kernel/src/Network/IPCMsg.cc @@ -0,0 +1,125 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include + +namespace NeOS +{ + /// @internal internal use for IPC system only. + /// @brief The internal sanitize function. + Bool ipc_int_sanitize_packet(IPC_MSG* pckt) + { + auto endian = RTL_ENDIAN(pckt, ((Char*)pckt)[0]); + + switch (endian) + { + case Endian::kEndianBig: { + if (pckt->IpcEndianess == kIPCLittleEndian) + goto ipc_check_failed; + + break; + } + case Endian::kEndianLittle: { + if (pckt->IpcEndianess == kIPCBigEndian) + goto ipc_check_failed; + + break; + } + case Endian::kEndianMixed: { + if (pckt->IpcEndianess == kIPCMixedEndian) + goto ipc_check_failed; + + break; + } + default: + goto ipc_check_failed; + } + + if (pckt->IpcFrom == pckt->IpcTo || + pckt->IpcPacketSize > kIPCMsgSize) + { + goto ipc_check_failed; + } + + return pckt->IpcPacketSize > 1 && pckt->IpcHeaderMagic == kIPCHeaderMagic; + + ipc_check_failed: + err_local_get() = kErrorIPC; + return false; + } + + /// @brief Sanitize packet function + /// @retval true packet is correct. + /// @retval false packet is incorrect and process has crashed. + Bool ipc_sanitize_packet(IPC_MSG* pckt) + { + if (!pckt || + !ipc_int_sanitize_packet(pckt)) + { + return false; + } + + return true; + } + + /// @brief Construct packet function + /// @retval true packet is correct. + /// @retval false packet is incorrect and process has crashed. + Bool ipc_construct_packet(_Output IPC_MSG** pckt_in) + { + // don't act if it's not even valid. + if (!pckt_in) + return false; + + if (!*pckt_in) + *pckt_in = new IPC_MSG(); + + MUST_PASS(*pckt_in); + + if (*pckt_in) + { + const auto endianess = RTL_ENDIAN((*pckt_in), ((Char*)(*pckt_in))[0]); + + (*pckt_in)->IpcHeaderMagic = kIPCHeaderMagic; + + (*pckt_in)->IpcEndianess = static_cast(endianess); + (*pckt_in)->IpcPacketSize = sizeof(IPC_MSG); + + (*pckt_in)->IpcTo.UserProcessID = 0; + (*pckt_in)->IpcTo.UserProcessTeam = 0; + + (*pckt_in)->IpcFrom.UserProcessID = 0; + (*pckt_in)->IpcFrom.UserProcessTeam = 0; + + return Yes; + } + + return No; + } + + /// @brief Pass message from **src** to **target** + /// @param src Source message. + /// @param target Target message. + Bool IPC_MSG::Pass(IPC_MSG* src, IPC_MSG* target) noexcept + { + if (src && target && (target != src)) + { + if (src->IpcMsgSz > target->IpcMsgSz) + return No; + + if (target->IpcMsgSz > src->IpcMsgSz) + return No; + + rt_copy_memory(src->IpcData, target->IpcData, src->IpcMsgSz); + + return Yes; + } + + return No; + } +} // namespace NeOS diff --git a/dev/kernel/src/Network/MACAddressGetter.cc b/dev/kernel/src/Network/MACAddressGetter.cc new file mode 100644 index 00000000..627bcd34 --- /dev/null +++ b/dev/kernel/src/Network/MACAddressGetter.cc @@ -0,0 +1,15 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +namespace NeOS +{ + Array& MacAddressGetter::AsBytes() + { + return this->fMacAddress; + } +} // namespace NeOS diff --git a/dev/kernel/src/Network/NetworkDevice.cc b/dev/kernel/src/Network/NetworkDevice.cc new file mode 100644 index 00000000..f2971265 --- /dev/null +++ b/dev/kernel/src/Network/NetworkDevice.cc @@ -0,0 +1,35 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +namespace NeOS +{ + /// \brief Getter for fNetworkName. + const Char* NetworkDevice::Name() const + { + return this->fNetworkName; + } + + /// \brief Setter for fNetworkName. + Boolean NetworkDevice::Name(const Char* devnam) + { + if (devnam == nullptr) + return NO; + + if (*devnam == 0) + return NO; + + if (rt_string_len(devnam) > cNetworkNameLen) + return NO; + + rt_copy_memory((VoidPtr)devnam, + (VoidPtr)this->fNetworkName, rt_string_len(devnam)); + + return YES; + } +} // namespace NeOS diff --git a/dev/kernel/src/New+Delete.cc b/dev/kernel/src/New+Delete.cc new file mode 100644 index 00000000..1e0a3421 --- /dev/null +++ b/dev/kernel/src/New+Delete.cc @@ -0,0 +1,50 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +void* operator new[](size_t sz) +{ + if (sz == 0) + ++sz; + + return NeOS::mm_new_heap(sz, true, false); +} + +void* operator new(size_t sz) +{ + if (sz == 0) + ++sz; + + return NeOS::mm_new_heap(sz, true, false); +} + +void operator delete[](void* ptr) +{ + if (ptr == nullptr) + return; + + NeOS::mm_delete_heap(ptr); +} + +void operator delete(void* ptr) +{ + if (ptr == nullptr) + return; + + NeOS::mm_delete_heap(ptr); +} + +void operator delete(void* ptr, size_t sz) +{ + if (ptr == nullptr) + return; + + NE_UNUSED(sz); + + NeOS::mm_delete_heap(ptr); +} diff --git a/dev/kernel/src/OwnPtr.cc b/dev/kernel/src/OwnPtr.cc new file mode 100644 index 00000000..e4d529aa --- /dev/null +++ b/dev/kernel/src/OwnPtr.cc @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include diff --git a/dev/kernel/src/PEFCodeMgr.cc b/dev/kernel/src/PEFCodeMgr.cc new file mode 100644 index 00000000..426a1e26 --- /dev/null +++ b/dev/kernel/src/PEFCodeMgr.cc @@ -0,0 +1,268 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/// @brief PEF stack size symbol. +#define kPefStackSizeSymbol "__PEFSizeOfReserveStack" +#define kPefHeapSizeSymbol "__PEFSizeOfReserveHeap" +#define kPefNameSymbol "__PEFProgramName" + +namespace NeOS +{ + namespace Detail + { + /***********************************************************************************/ + /// @brief Get the PEF platform signature according to the compiled architecture. + /***********************************************************************************/ + UInt32 ldr_get_platform(void) noexcept + { +#if defined(__NE_32X0__) + return kPefArch32x0; +#elif defined(__NE_64X0__) + return kPefArch64x0; +#elif defined(__NE_AMD64__) + return kPefArchAMD64; +#elif defined(__NE_PPC64__) + return kPefArchPowerPC; +#elif defined(__NE_ARM64__) + return kPefArchARM64; +#else + return kPefArchInvalid; +#endif // __32x0__ || __64x0__ || __x86_64__ + } + } // namespace Detail + + /***********************************************************************************/ + /// @brief PEF loader constructor w/ blob. + /// @param blob file blob. + /***********************************************************************************/ + PEFLoader::PEFLoader(const VoidPtr blob) + : fCachedBlob(blob) + { + MUST_PASS(fCachedBlob); + fBad = false; + } + + /***********************************************************************************/ + /// @brief PEF loader constructor. + /// @param path the filesystem path. + /***********************************************************************************/ + PEFLoader::PEFLoader(const Char* path) + : fCachedBlob(nullptr), fBad(false), fFatBinary(false) + { + fFile.New(const_cast(path), kRestrictRB); + fPath = KStringBuilder::Construct(path).Leak(); + + auto kPefHeader = "PEF_CONTAINER"; + + fCachedBlob = fFile->Read(kPefHeader, mib_cast(16)); + + PEFContainer* container = reinterpret_cast(fCachedBlob); + + if (container->Cpu == Detail::ldr_get_platform() && + container->Magic[0] == kPefMagic[0] && + container->Magic[1] == kPefMagic[1] && + container->Magic[2] == kPefMagic[2] && + container->Magic[3] == kPefMagic[3] && + container->Magic[4] == kPefMagic[4] && container->Abi == kPefAbi) + { + return; + } + else if (container->Magic[4] == kPefMagic[0] && + container->Magic[3] == kPefMagic[1] && + container->Magic[2] == kPefMagic[2] && + container->Magic[1] == kPefMagic[3] && + container->Magic[0] == kPefMagic[4] && container->Abi == kPefAbi) + { + /// This is a fat binary. + this->fFatBinary = true; + return; + } + + fBad = true; + + if (fCachedBlob) + mm_delete_heap(fCachedBlob); + + kout << "PEFLoader: warn: Executable format error!\r"; + + fCachedBlob = nullptr; + } + + /***********************************************************************************/ + /// @brief PEF destructor. + /***********************************************************************************/ + PEFLoader::~PEFLoader() + { + if (fCachedBlob) + mm_delete_heap(fCachedBlob); + + fFile.Delete(); + } + + /***********************************************************************************/ + /// @brief Finds the symbol according to it's name. + /// @param name name of symbol. + /// @param kind kind of symbol we want. + /***********************************************************************************/ + VoidPtr PEFLoader::FindSymbol(const Char* name, Int32 kind) + { + if (!fCachedBlob || fBad || !name) + return nullptr; + + PEFContainer* container = reinterpret_cast(fCachedBlob); + + auto blob = fFile->Read(name, mib_cast(16)); + + PEFCommandHeader* container_header = reinterpret_cast(blob); + + constexpr auto cMangleCharacter = '$'; + const Char* cContainerKinds[] = {".code64", ".data64", ".zero64", nullptr}; + + ErrorOr error_or_symbol; + + switch (kind) + { + case kPefCode: { + error_or_symbol = KStringBuilder::Construct(cContainerKinds[0]); // code symbol. + break; + } + case kPefData: { + error_or_symbol = KStringBuilder::Construct(cContainerKinds[1]); // data symbol. + break; + } + case kPefZero: { + error_or_symbol = KStringBuilder::Construct(cContainerKinds[2]); // block starting symbol. + break; + } + default: + return nullptr; // prevent that from the kernel's mode perspective, let that happen if it were + // a user process. + } + + Char* unconst_symbol = const_cast(name); + + for (SizeT i = 0UL; i < rt_string_len(unconst_symbol, kPefNameLen); ++i) + { + if (unconst_symbol[i] == ' ') + { + unconst_symbol[i] = cMangleCharacter; + } + } + + error_or_symbol.Leak().Leak() += name; + + for (SizeT index = 0; index < container->Count; ++index) + { + if (KStringBuilder::Equals(container_header->Name, + error_or_symbol.Leak().Leak().CData())) + { + if (container_header->Kind == kind) + { + if (container_header->Cpu != Detail::ldr_get_platform()) + { + if (!this->fFatBinary) + { + mm_delete_heap(blob); + return nullptr; + } + } + + Char* container_blob_value = new Char[container_header->Size]; + + rt_copy_memory((VoidPtr)((Char*)blob + sizeof(PEFCommandHeader)), container_blob_value, container_header->Size); + mm_delete_heap(blob); + + kout << "PEFLoader: INFO: Load stub: " << container_header->Name << "!\r"; + + return container_blob_value; + } + } + } + + mm_delete_heap(blob); + return nullptr; + } + + /// @brief Finds the executable entrypoint. + /// @return + ErrorOr PEFLoader::FindStart() + { + if (auto sym = this->FindSymbol(kPefStart, kPefCode); sym) + return ErrorOr(sym); + + return ErrorOr(kErrorExecutable); + } + + /// @brief Tells if the executable is loaded or not. + /// @return + bool PEFLoader::IsLoaded() noexcept + { + return !fBad && fCachedBlob; + } + + const Char* PEFLoader::Path() + { + return fPath.Leak().CData(); + } + + const Char* PEFLoader::AsString() + { +#ifdef __32x0__ + return "32x0 PEF executable."; +#elif defined(__64x0__) + return "64x0 PEF executable."; +#elif defined(__x86_64__) + return "x86_64 PEF executable."; +#elif defined(__aarch64__) + return "AARCH64 PEF executable."; +#elif defined(__powerpc64__) + return "POWER64 PEF executable."; +#else + return "???? PEF executable."; +#endif // __32x0__ || __64x0__ || __x86_64__ || __powerpc64__ + } + + const Char* PEFLoader::MIME() + { + return kPefApplicationMime; + } + + ErrorOr PEFLoader::GetBlob() + { + return ErrorOr{this->fCachedBlob}; + } + + namespace Utils + { + ProcessID rtl_create_process(PEFLoader& exec, const Int32& process_kind) noexcept + { + auto errOrStart = exec.FindStart(); + + if (errOrStart.Error() != kErrorSuccess) + return kProcessInvalidID; + + auto id = UserProcessScheduler::The().Spawn(reinterpret_cast(exec.FindSymbol(kPefNameSymbol, kPefData)), errOrStart.Leak().Leak(), exec.GetBlob().Leak().Leak()); + + if (id != kProcessInvalidID) + { + UserProcessScheduler::The().CurrentTeam().AsArray()[id].Kind = process_kind; + UserProcessScheduler::The().CurrentTeam().AsArray()[id].StackSize = *(UIntPtr*)exec.FindSymbol(kPefStackSizeSymbol, kPefData); + UserProcessScheduler::The().CurrentTeam().AsArray()[id].MemoryLimit = *(UIntPtr*)exec.FindSymbol(kPefHeapSizeSymbol, kPefData); + } + + return id; + } + } // namespace Utils +} // namespace NeOS diff --git a/dev/kernel/src/PRDT.cc b/dev/kernel/src/PRDT.cc new file mode 100644 index 00000000..9ea3e70b --- /dev/null +++ b/dev/kernel/src/PRDT.cc @@ -0,0 +1,24 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include + +namespace NeOS +{ + /***********************************************************************************/ + /// @brief constructs a new PRD. + /// @param prd PRD reference. + /// @note This doesnt construct a valid, please fill it by yourself. + /***********************************************************************************/ + void construct_prdt(Ref& prd) + { + prd.Leak().fPhysAddress = 0x0; + prd.Leak().fSectorCount = 0x0; + prd.Leak().fEndBit = 0x0; + } +} // namespace NeOS diff --git a/dev/kernel/src/PageMgr.cc b/dev/kernel/src/PageMgr.cc new file mode 100644 index 00000000..eb7c7e03 --- /dev/null +++ b/dev/kernel/src/PageMgr.cc @@ -0,0 +1,110 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +#ifdef __NE_AMD64__ +#include +#elif defined(__NE_ARM64__) +#include +#endif // ifdef __NE_AMD64__ || defined(__NE_ARM64__) + +namespace NeOS +{ + PTEWrapper::PTEWrapper(Boolean Rw, Boolean User, Boolean ExecDisable, UIntPtr VirtAddr) + : fRw(Rw), + fUser(User), + fExecDisable(ExecDisable), + fVirtAddr(VirtAddr), + fCache(false), + fShareable(false), + fWt(false), + fPresent(true), + fAccessed(false) + { + } + + PTEWrapper::~PTEWrapper() = default; + + /// @brief Flush virtual address. + /// @param VirtAddr + Void PageMgr::FlushTLB() + { +#ifndef __NE_MINIMAL_OS__ + hal_flush_tlb(); +#endif // !__NE_MINIMAL_OS__ + } + + /// @brief Reclaim freed page. + /// @return + Bool PTEWrapper::Reclaim() + { + if (!this->fPresent) + { + this->fPresent = true; + return true; + } + + return false; + } + + /// @brief Request a PTE. + /// @param Rw r/w? + /// @param User user mode? + /// @param ExecDisable disable execution on page? + /// @return + PTEWrapper PageMgr::Request(Boolean Rw, Boolean User, Boolean ExecDisable, SizeT Sz) + { + // Store PTE wrapper right after PTE. + VoidPtr ptr = NeOS::HAL::mm_alloc_bitmap(Rw, User, Sz, false); + + return PTEWrapper{Rw, User, ExecDisable, reinterpret_cast(ptr)}; + } + + /// @brief Disable BitMap. + /// @param wrapper the wrapper. + /// @return If the page bitmap was cleared or not. + Bool PageMgr::Free(Ref& wrapper) + { + if (!NeOS::HAL::mm_free_bitmap((VoidPtr)wrapper.Leak().VirtualAddress())) + return false; + + return true; + } + + /// @brief Virtual PTE address. + /// @return The virtual address of the page. + const UIntPtr PTEWrapper::VirtualAddress() + { + return (fVirtAddr); + } + + Bool PTEWrapper::Shareable() + { + return fShareable; + } + + Bool PTEWrapper::Present() + { + return fPresent; + } + + Bool PTEWrapper::Access() + { + return fAccessed; + } + + Void PTEWrapper::NoExecute(const bool enable) + { + fExecDisable = enable; + } + + Bool PTEWrapper::NoExecute() + { + return fExecDisable; + } +} // namespace NeOS diff --git a/dev/kernel/src/Pmm.cc b/dev/kernel/src/Pmm.cc new file mode 100644 index 00000000..b3d5e79e --- /dev/null +++ b/dev/kernel/src/Pmm.cc @@ -0,0 +1,98 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include + +#if defined(__NE_ARM64__) +#include +#endif // defined(__NE_ARM64__) + +#if defined(__NE_AMD64__) +#include +#endif // defined(__NE_AMD64__) + +namespace NeOS +{ + /***********************************************************************************/ + /// @brief Pmm constructor. + /***********************************************************************************/ + Pmm::Pmm() + : fPageMgr() + { + kout << "[PMM] Allocate PageMemoryMgr"; + } + + Pmm::~Pmm() = default; + + /***********************************************************************************/ + /// @param If this returns Null pointer, enter emergency mode. + /// @param user is this a user page? + /// @param readWrite is it r/w? + /***********************************************************************************/ + Ref Pmm::RequestPage(Boolean user, Boolean readWrite) + { + PTEWrapper pt = fPageMgr.Leak().Request(user, readWrite, false, kPageSize); + + if (pt.fPresent) + { + kout << "[PMM]: Allocation failed.\r"; + return {}; + } + + return Ref(pt); + } + + Boolean Pmm::FreePage(Ref PageRef) + { + if (!PageRef) + return false; + + PageRef.Leak().fPresent = false; + + return true; + } + + Boolean Pmm::TogglePresent(Ref PageRef, Boolean Enable) + { + if (!PageRef) + return false; + + PageRef.Leak().fPresent = Enable; + + return true; + } + + Boolean Pmm::ToggleUser(Ref PageRef, Boolean Enable) + { + if (!PageRef) + return false; + + PageRef.Leak().fRw = Enable; + + return true; + } + + Boolean Pmm::ToggleRw(Ref PageRef, Boolean Enable) + { + if (!PageRef) + return false; + + PageRef.Leak().fRw = Enable; + + return true; + } + + Boolean Pmm::ToggleShare(Ref PageRef, Boolean Enable) + { + if (!PageRef) + return false; + + PageRef.Leak().fShareable = Enable; + + return true; + } +} // namespace NeOS diff --git a/dev/kernel/src/Property.cc b/dev/kernel/src/Property.cc new file mode 100644 index 00000000..8f3b5314 --- /dev/null +++ b/dev/kernel/src/Property.cc @@ -0,0 +1,45 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +namespace CFKit +{ + /***********************************************************************************/ + /// @brief Destructor. + /***********************************************************************************/ + Property::~Property() = default; + + /***********************************************************************************/ + /// @brief Constructor. + /***********************************************************************************/ + Property::Property() = default; + + /***********************************************************************************/ + /// @brief Check if property's name equals to name. + /// @param name string to check. + /***********************************************************************************/ + Bool Property::StringEquals(KString& name) + { + return this->fName && this->fName == name; + } + + /***********************************************************************************/ + /// @brief Gets the key (name) of property. + /***********************************************************************************/ + KString& Property::GetKey() + { + return this->fName; + } + + /***********************************************************************************/ + /// @brief Gets the value of the property. + /***********************************************************************************/ + PropertyId& Property::GetValue() + { + return fValue; + } +} // namespace CFKit diff --git a/dev/kernel/src/Ref.cc b/dev/kernel/src/Ref.cc new file mode 100644 index 00000000..6fadb033 --- /dev/null +++ b/dev/kernel/src/Ref.cc @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include diff --git a/dev/kernel/src/SoftwareTimer.cc b/dev/kernel/src/SoftwareTimer.cc new file mode 100644 index 00000000..5e4214e9 --- /dev/null +++ b/dev/kernel/src/SoftwareTimer.cc @@ -0,0 +1,39 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +/// @brief SoftwareTimer class, meant to be generic. + +using namespace NeOS; + +SoftwareTimer::SoftwareTimer(Int64 seconds) + : fWaitFor(seconds) +{ + fDigitalTimer = new IntPtr(); + MUST_PASS(fDigitalTimer); +} + +SoftwareTimer::~SoftwareTimer() +{ + delete fDigitalTimer; + fDigitalTimer = nullptr; + + fWaitFor = 0; +} + +BOOL SoftwareTimer::Wait() noexcept +{ + if (fWaitFor < 1) + return NO; + + while (*fDigitalTimer < (*fDigitalTimer + fWaitFor)) + { + ++(*fDigitalTimer); + } + + return YES; +} diff --git a/dev/kernel/src/Storage/AHCIDeviceInterface.cc b/dev/kernel/src/Storage/AHCIDeviceInterface.cc new file mode 100644 index 00000000..8d987ab5 --- /dev/null +++ b/dev/kernel/src/Storage/AHCIDeviceInterface.cc @@ -0,0 +1,36 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +using namespace NeOS; + +/// @brief Class constructor +/// @param Out Drive output +/// @param In Drive input +/// @param Cleanup Drive cleanup. +AHCIDeviceInterface::AHCIDeviceInterface(void (*out)(IDeviceObject* self, MountpointInterface* outpacket), + void (*in)(IDeviceObject* self, MountpointInterface* inpacket), + void (*cleanup)(void)) + : IDeviceObject(out, in), fCleanup(cleanup) +{ +} + +/// @brief Class desctructor +AHCIDeviceInterface::~AHCIDeviceInterface() +{ + MUST_PASS(fCleanup); + + if (fCleanup) + fCleanup(); +} + +/// @brief Returns the name of the device interface. +/// @return it's name as a string. +const Char* AHCIDeviceInterface::Name() const +{ + return "/dev/sda{}"; +} diff --git a/dev/kernel/src/Storage/ATADeviceInterface.cc b/dev/kernel/src/Storage/ATADeviceInterface.cc new file mode 100644 index 00000000..9f1a0068 --- /dev/null +++ b/dev/kernel/src/Storage/ATADeviceInterface.cc @@ -0,0 +1,88 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +using namespace NeOS; + +/// @brief Class constructor +/// @param Out Drive output +/// @param In Drive input +/// @param Cleanup Drive cleanup. +ATADeviceInterface::ATADeviceInterface( + void (*Out)(IDeviceObject*, MountpointInterface* outpacket), + void (*In)(IDeviceObject*, MountpointInterface* inpacket), + void (*Cleanup)(void)) + : IDeviceObject(Out, In), fCleanup(Cleanup) +{ +} + +/// @brief Class desctructor +ATADeviceInterface::~ATADeviceInterface() +{ + MUST_PASS(fCleanup); + if (fCleanup) + fCleanup(); +} + +/// @brief Returns the name of the device interface. +/// @return it's name as a string. +const Char* ATADeviceInterface::Name() const +{ + return "/dev/hda{}"; +} + +/// @brief Output operator. +/// @param Data +/// @return +ATADeviceInterface& ATADeviceInterface::operator<<(MountpointInterface* Data) +{ + if (!Data) + return *this; + + for (SizeT driveCount = 0; driveCount < kDriveMaxCount; ++driveCount) + { + auto interface = Data->GetAddressOf(driveCount); + if ((interface) && rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) == 0) + { + continue; + } + else if ((interface) && + rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) != 0) + { + return *this; + } + } + + return (ATADeviceInterface&)IDeviceObject::operator<<( + Data); +} + +/// @brief Input operator. +/// @param Data +/// @return +ATADeviceInterface& ATADeviceInterface::operator>>(MountpointInterface* Data) +{ + if (!Data) + return *this; + + for (SizeT driveCount = 0; driveCount < kDriveMaxCount; ++driveCount) + { + auto interface = Data->GetAddressOf(driveCount); + if ((interface) && rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) == 0) + { + continue; + } + else if ((interface) && + rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) != 0) + { + return *this; + } + } + + return (ATADeviceInterface&)IDeviceObject::operator>>( + Data); +} diff --git a/dev/kernel/src/Storage/NVMEDeviceInterface.cc b/dev/kernel/src/Storage/NVMEDeviceInterface.cc new file mode 100644 index 00000000..3e2c2c53 --- /dev/null +++ b/dev/kernel/src/Storage/NVMEDeviceInterface.cc @@ -0,0 +1,28 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +namespace NeOS +{ + NVMEDeviceInterface::NVMEDeviceInterface(void (*out)(IDeviceObject*, MountpointInterface* outpacket), + void (*in)(IDeviceObject*, MountpointInterface* inpacket), + void (*cleanup)(void)) + : IDeviceObject(out, in), fCleanup(cleanup) + { + } + + NVMEDeviceInterface::~NVMEDeviceInterface() + { + if (fCleanup) + fCleanup(); + } + + const Char* NVMEDeviceInterface::Name() const + { + return ("/dev/nvme{}"); + } +} // namespace NeOS diff --git a/dev/kernel/src/Storage/SCSIDeviceInterface.cc b/dev/kernel/src/Storage/SCSIDeviceInterface.cc new file mode 100644 index 00000000..cc625cdb --- /dev/null +++ b/dev/kernel/src/Storage/SCSIDeviceInterface.cc @@ -0,0 +1,11 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +///! @brief ATAPI SCSI packet. +const scsi_packet_type<12> kCDRomPacketTemplate = {0x43, 0, 1, 0, 0, 0, + 0, 12, 0x40, 0, 0}; diff --git a/dev/kernel/src/Stream.cc b/dev/kernel/src/Stream.cc new file mode 100644 index 00000000..8d060556 --- /dev/null +++ b/dev/kernel/src/Stream.cc @@ -0,0 +1,12 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: Stream.cc + Purpose: Stream object + + Revision History: + +------------------------------------------- */ + +#include diff --git a/dev/kernel/src/System/SwapDisk.cc b/dev/kernel/src/System/SwapDisk.cc new file mode 100644 index 00000000..921ea86d --- /dev/null +++ b/dev/kernel/src/System/SwapDisk.cc @@ -0,0 +1,47 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025 Amlal EL Mahrouss Labs, all rights reserved. + +------------------------------------------- */ + +#include +#include + +namespace NeOS +{ + BOOL SwapDisk::Write(const Char* fork_name, const SizeT fork_name_len, SWAP_DISK_HEADER* data, const SizeT data_len) + { + if (!fork_name || !fork_name_len) + return NO; + + if (data_len > kSwapBlockMaxSize) + return NO; + + if (!data) + return NO; + + FileStream file(kSwapPageFile, "wb"); + + auto ret = file.Write(fork_name, data, sizeof(SWAP_DISK_HEADER) + data_len); + + if (ret.Error()) + return NO; + + return YES; + } + + SWAP_DISK_HEADER* SwapDisk::Read(const Char* fork_name, const SizeT fork_name_len, const SizeT data_len) + { + if (!fork_name || !fork_name_len) + return nullptr; + + if (data_len > kSwapBlockMaxSize) + return nullptr; + + FileStream file(kSwapPageFile, "rb"); + + VoidPtr blob = file.Read(fork_name, sizeof(SWAP_DISK_HEADER) + data_len); + + return (SWAP_DISK_HEADER*)blob; + } +} // namespace NeOS diff --git a/dev/kernel/src/ThreadLocalStorage.cc b/dev/kernel/src/ThreadLocalStorage.cc new file mode 100644 index 00000000..b25b4288 --- /dev/null +++ b/dev/kernel/src/ThreadLocalStorage.cc @@ -0,0 +1,67 @@ +/* + * ======================================================== + * + * neoskrnl + * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + * + * ======================================================== + */ + +#include +#include +#include +#include + +/***********************************************************************************/ +/// @bugs: 0 +/// @file ThreadLocalStorage.cc +/// @brief Process Thread Local Storage. +/***********************************************************************************/ + +using namespace NeOS; + +/** + * @brief Checks for cookie inside the TIB. + * @param tib_ptr the TIB to check. + * @return if the cookie is enabled, true; false otherwise + */ + +Boolean tls_check_tib(THREAD_INFORMATION_BLOCK* tib_ptr) +{ + if (!tib_ptr || + !tib_ptr->Record) + return false; + + ICodec encoder; + const Char* tib_as_bytes = encoder.AsBytes(tib_ptr); + + kout << "TLS: Validating the TIB...\r"; + + return tib_as_bytes[kCookieMag0Idx] == kCookieMag0 && tib_as_bytes[kCookieMag1Idx] == kCookieMag1 && + tib_as_bytes[kCookieMag2Idx] == kCookieMag2; +} + +/** + * @brief System call implementation of the TLS check. + * @param tib_ptr The TIB record. + * @return if the TIB record is valid or not. + */ +EXTERN_C Bool tls_check_syscall_impl(NeOS::VoidPtr tib_ptr) noexcept +{ + if (!tib_ptr) + { + kout << "TLS: Failed because of an invalid TIB...\r"; + return No; + } + + THREAD_INFORMATION_BLOCK* tib = reinterpret_cast(tib_ptr); + + if (!tls_check_tib(tib)) + { + kout << "TLS: Failed because of an invalid TIB...\r"; + return No; + } + + kout << "TLS Pass.\r"; + return Yes; +} diff --git a/dev/kernel/src/Timer.cc b/dev/kernel/src/Timer.cc new file mode 100644 index 00000000..5df81134 --- /dev/null +++ b/dev/kernel/src/Timer.cc @@ -0,0 +1,19 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +///! BUGS: 0 +///! @file Timer.cc +///! @brief Software Timer implementation + +using namespace NeOS; + +/// @brief Unimplemented as it is an interface. +BOOL TimerInterface::Wait() noexcept +{ + return NO; +} diff --git a/dev/kernel/src/User.cc b/dev/kernel/src/User.cc new file mode 100644 index 00000000..3c23c59e --- /dev/null +++ b/dev/kernel/src/User.cc @@ -0,0 +1,195 @@ +/* + * ======================================================== + * + * NeKernel + * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + * + * File: User.cc + * Purpose: User class, used to provide authentication and security. + * + * ======================================================== + */ + +#include +#include +#include +#include +#include + +#define kStdUserType (0xEE) +#define kSuperUserType (0xEF) + +/// @file User.cc +/// @brief Multi-user support. + +namespace NeOS +{ + namespace Detail + { + //////////////////////////////////////////////////////////// + /// \brief Constructs a password by hashing the password. + /// \param password password to hash. + /// \return the hashed password + //////////////////////////////////////////////////////////// + const Int32 cred_construct_token(Char* password, const Char* in_password, User* user, SizeT length) + { + if (!password || !user) + return 1; + + kout << "cred_construct_token: Hashing user password...\r"; + + for (SizeT i_pass = 0UL; i_pass < length; ++i_pass) + { + const Char cur_chr = in_password[i_pass]; + + if (cur_chr == 0) + break; + + password[i_pass] = cur_chr | (user->IsStdUser() ? kStdUserType : kSuperUserType); + } + + kout << "cred_construct_token: Hashed user password.\r"; + + return 0; + } + } // namespace Detail + + //////////////////////////////////////////////////////////// + /// @brief User ring constructor. + //////////////////////////////////////////////////////////// + User::User(const Int32& sel, const Char* user_name) + : mUserRing((UserRingKind)sel) + { + MUST_PASS(sel >= 0); + rt_copy_memory((VoidPtr)user_name, this->mUserName, rt_string_len(user_name)); + } + + //////////////////////////////////////////////////////////// + /// @brief User ring constructor. + //////////////////////////////////////////////////////////// + User::User(const UserRingKind& ring_kind, const Char* user_name) + : mUserRing(ring_kind) + { + rt_copy_memory((VoidPtr)user_name, this->mUserName, rt_string_len(user_name)); + } + + //////////////////////////////////////////////////////////// + /// @brief User destructor class. + //////////////////////////////////////////////////////////// + User::~User() = default; + + Bool User::Save(const UserPublicKey password_to_fill) noexcept + { + if (!password_to_fill || + *password_to_fill == 0) + return No; + + SizeT len = rt_string_len(password_to_fill); + + UserPublicKey password = new UserPublicKeyType[len]; + + MUST_PASS(password); + + rt_set_memory(password, 0, len); + + // fill data first, generate hash. + // return false on error. + + rt_copy_memory((VoidPtr)password_to_fill, password, len); + + if (!Detail::cred_construct_token(password, password_to_fill, this, len)) + { + delete[] password; + password = nullptr; + + return No; + } + + // then store password. + + rt_copy_memory(password, this->mUserKey, rt_string_len(password_to_fill)); + + delete[] password; + password = nullptr; + + kout << "User::Save: Saved password successfully...\r"; + + return Yes; + } + + Bool User::Matches(const UserPublicKey password_to_fill) noexcept + { + if (!password_to_fill || + *password_to_fill) + return No; + + SizeT len = rt_string_len(password_to_fill); + + Char* password = new Char[len]; + MUST_PASS(password); + + // fill data first, generate hash. + // return false on error. + + rt_copy_memory((VoidPtr)password_to_fill, password, len); + + if (!Detail::cred_construct_token(password, password_to_fill, this, len)) + { + delete[] password; + password = nullptr; + + return No; + } + + kout << "User::Matches: Validating hashed passwords...\r"; + + // now check if the password matches. + if (rt_string_cmp(password, this->mUserKey, rt_string_len(this->mUserKey)) == 0) + { + kout << "User::Matches: Password matches.\r"; + return Yes; + } + + kout << "User::Matches: Password doesn't match.\r"; + return No; + } + + Bool User::operator==(const User& lhs) + { + return lhs.mUserRing == this->mUserRing; + } + + Bool User::operator!=(const User& lhs) + { + return lhs.mUserRing != this->mUserRing; + } + + //////////////////////////////////////////////////////////// + /// @brief Returns the user's name. + //////////////////////////////////////////////////////////// + + Char* User::Name() noexcept + { + return this->mUserName; + } + + //////////////////////////////////////////////////////////// + /// @brief Returns the user's ring. + /// @return The king of ring the user is attached to. + //////////////////////////////////////////////////////////// + + const UserRingKind& User::Ring() noexcept + { + return this->mUserRing; + } + + Bool User::IsStdUser() noexcept + { + return this->Ring() == UserRingKind::kRingStdUser; + } + + Bool User::IsSuperUser() noexcept + { + return this->Ring() == UserRingKind::kRingSuperUser; + } +} // namespace NeOS diff --git a/dev/kernel/src/UserProcessScheduler.cc b/dev/kernel/src/UserProcessScheduler.cc new file mode 100644 index 00000000..1087ac6b --- /dev/null +++ b/dev/kernel/src/UserProcessScheduler.cc @@ -0,0 +1,621 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + FILE: UserProcessScheduler.cc + PURPOSE: Low level/Ring-3 Process scheduler. + +------------------------------------------- */ + +/***********************************************************************************/ +/// @file UserProcessScheduler.cc +/// @brief Low level/Ring-3 process scheduler. +/***********************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +///! BUGS: 0 + +namespace NeOS +{ + /***********************************************************************************/ + /// @brief Exit Code global variable. + /***********************************************************************************/ + + STATIC UInt32 kLastExitCode = 0U; + + /***********************************************************************************/ + /// @brief External reference of the thread scheduler. + /***********************************************************************************/ + + STATIC UserProcessScheduler kProcessScheduler; + + UserProcess::UserProcess() = default; + UserProcess::~UserProcess() = default; + + /// @brief Gets the last exit code. + /// @note Not thread-safe. + /// @return Int32 the last exit code. + + const UInt32& sched_get_exit_code(void) noexcept + { + return kLastExitCode; + } + + /***********************************************************************************/ + /// @brief Crashes the current process. + /***********************************************************************************/ + + Void UserProcess::Crash() + { + if (this->Status != ProcessStatusKind::kRunning) + return; + + kout << this->Name << ": crashed, error id: " << number(kErrorProcessFault) << kendl; + this->Exit(kErrorProcessFault); + } + + /***********************************************************************************/ + /// @brief boolean operator, check status. + /***********************************************************************************/ + + UserProcess::operator bool() + { + return this->Status == ProcessStatusKind::kRunning; + } + + /***********************************************************************************/ + /// @brief Gets the local last exit code. + /// @note Not thread-safe. + /// @return Int32 the last exit code. + /***********************************************************************************/ + + const UInt32& UserProcess::GetExitCode() noexcept + { + return this->fLastExitCode; + } + + /***********************************************************************************/ + /// @brief Error code variable getter. + /***********************************************************************************/ + + Int32& UserProcess::GetLocalCode() noexcept + { + return this->fLocalCode; + } + + /***********************************************************************************/ + /// @brief Wakes process header. + /// @param should_wakeup if the program shall wakeup or not. + /***********************************************************************************/ + + Void UserProcess::Wake(const Bool should_wakeup) + { + this->Status = + should_wakeup ? ProcessStatusKind::kRunning : ProcessStatusKind::kFrozen; + } + + /***********************************************************************************/ + /** @brief Allocate pointer to track list. */ + /***********************************************************************************/ + + ErrorOr UserProcess::New(const SizeT& sz, const SizeT& pad_amount) + { +#ifdef __NE_VIRTUAL_MEMORY_SUPPORT__ + auto vm_register = hal_read_cr3(); + hal_write_cr3(this->VMRegister); + + auto ptr = mm_new_heap(sz + pad_amount, Yes, Yes); + + hal_write_cr3(vm_register); +#else + auto ptr = mm_new_heap(sz + pad_amount, Yes, Yes); +#endif + + if (!this->ProcessMemoryHeap) + { + this->ProcessMemoryHeap = new ProcessMemoryHeapList(); + + this->ProcessMemoryHeap->MemoryEntryPad = pad_amount; + this->ProcessMemoryHeap->MemoryEntrySize = sz; + + this->ProcessMemoryHeap->MemoryEntry = ptr; + + this->ProcessMemoryHeap->MemoryPrev = nullptr; + this->ProcessMemoryHeap->MemoryNext = nullptr; + } + else + { + ProcessMemoryHeapList* entry = this->ProcessMemoryHeap; + ProcessMemoryHeapList* prev_entry = nullptr; + + while (entry) + { + if (entry->MemoryEntry == nullptr) + break; // chose to break here, when we get an already allocated memory entry for our needs. + + prev_entry = entry; + entry = entry->MemoryNext; + } + + entry->MemoryNext = new ProcessMemoryHeapList(); + entry->MemoryNext->MemoryEntry = ptr; + + entry->MemoryNext->MemoryPrev = entry; + entry->MemoryNext->MemoryNext = nullptr; + } + + this->UsedMemory += sz; + + return ErrorOr(ptr); + } + + /***********************************************************************************/ + /// @brief Gets the name of the current process. + /***********************************************************************************/ + + const Char* UserProcess::GetName() noexcept + { + return this->Name; + } + + /***********************************************************************************/ + /// @brief Gets the owner of the process. + /***********************************************************************************/ + + const User* UserProcess::GetOwner() noexcept + { + return this->Owner; + } + + /// @brief UserProcess status getter. + const ProcessStatusKind& UserProcess::GetStatus() noexcept + { + return this->Status; + } + + /***********************************************************************************/ + /** + @brief Affinity is the time slot allowed for the process. + */ + /***********************************************************************************/ + + const AffinityKind& UserProcess::GetAffinity() noexcept + { + return this->Affinity; + } + + /***********************************************************************************/ + /** + @brief Exit process method. + @param exit_code The process's exit code. + */ + /***********************************************************************************/ + + Void UserProcess::Exit(const Int32& exit_code) + { + this->Status = exit_code > 0 ? ProcessStatusKind::kKilled : ProcessStatusKind::kFrozen; + this->fLastExitCode = exit_code; + + kLastExitCode = exit_code; + + auto memory_heap_list = this->ProcessMemoryHeap; + +#ifdef __NE_VIRTUAL_MEMORY_SUPPORT__ + auto pd = hal_read_cr3(); + hal_write_cr3(this->VMRegister); +#endif + + // Deleting memory lists. Make sure to free all of them. + while (memory_heap_list) + { + if (memory_heap_list->MemoryEntry) + { + MUST_PASS(mm_delete_heap(memory_heap_list->MemoryEntry)); + } + +#ifdef __NE_VIRTUAL_MEMORY_SUPPORT__ + hal_write_cr3(pd); +#endif + + auto next = memory_heap_list->MemoryNext; + + mm_delete_heap(memory_heap_list); + + memory_heap_list = next; + } + + //! Free the memory's page directory. + HAL::mm_free_bitmap(this->VMRegister); + + //! Delete image if not done already. + if (this->Image.fCode && mm_is_valid_heap(this->Image.fCode)) + mm_delete_heap(this->Image.fCode); + + if (this->Image.fBlob && mm_is_valid_heap(this->Image.fBlob)) + mm_delete_heap(this->Image.fBlob); + + if (this->StackFrame && mm_is_valid_heap(this->StackFrame)) + mm_delete_heap((VoidPtr)this->StackFrame); + + this->Image.fBlob = nullptr; + this->Image.fCode = nullptr; + this->StackFrame = nullptr; + + if (this->Kind == kExectuableDylibKind) + { + Bool success = false; + + rtl_fini_dylib(*this, reinterpret_cast(this->DylibDelegate), &success); + + if (!success) + { + ke_panic(RUNTIME_CHECK_PROCESS); + } + + this->DylibDelegate = nullptr; + } + + if (this->StackReserve) + mm_delete_heap(reinterpret_cast(this->StackReserve)); + + this->ProcessId = 0; + this->Status = ProcessStatusKind::kFinished; + + --this->ProcessParentTeam->mProcessCount; + + delete this; + } + + /***********************************************************************************/ + /// @brief Add process to team. + /// @param process the process *Ref* class. + /// @return the process index inside the team. + /***********************************************************************************/ + + ProcessID UserProcessScheduler::Spawn(const Char* name, VoidPtr code, VoidPtr image) + { + ProcessID pid = this->mTeam.mProcessCount; + + if (pid > kSchedProcessLimitPerTeam) + { + return kErrorProcessFault; + } + + ++this->mTeam.mProcessCount; + + UserProcess& process = this->mTeam.mProcessList[pid]; + + process.Image.fCode = code; + process.Image.fBlob = image; + + rt_copy_memory(reinterpret_cast(const_cast(name)), process.Name, rt_string_len(name)); + +#ifdef __NE_VIRTUAL_MEMORY_SUPPORT__ + process.VMRegister = new PDE(); + + if (!process.VMRegister) + { + process.Crash(); + return kErrorProcessFault; + } + + UInt32 flags = HAL::kMMFlagsPresent; + flags |= HAL::kMMFlagsWr; + flags |= HAL::kMMFlagsUser; + + HAL::mm_map_page((VoidPtr)process.VMRegister, process.VMRegister, flags); +#endif // __NE_VIRTUAL_MEMORY_SUPPORT__ + + process.StackFrame = new HAL::StackFrame(); + + if (!process.StackFrame) + { + process.Crash(); + return kErrorProcessFault; + } + +#ifdef __NE_VIRTUAL_MEMORY_SUPPORT__ + flags = HAL::kMMFlagsPresent; + flags |= HAL::kMMFlagsWr; + flags |= HAL::kMMFlagsUser; + + HAL::mm_map_page((VoidPtr)process.StackFrame, process.StackFrame, flags); +#endif // __NE_VIRTUAL_MEMORY_SUPPORT__ + + // React according to process kind. + switch (process.Kind) + { + case UserProcess::kExectuableDylibKind: { + process.DylibDelegate = rtl_init_dylib(process); + MUST_PASS(process.DylibDelegate); + } + default: { + kout << "Unknown process kind: " << hex_number(process.Kind) << kendl; + break; + } + } + + process.StackReserve = new UInt8[process.StackSize]; + rt_set_memory(process.StackReserve, 0, process.StackSize); + + if (!process.StackReserve) + { + process.Crash(); + return kErrorProcessFault; + } + +#ifdef __NE_VIRTUAL_MEMORY_SUPPORT__ + flags = HAL::kMMFlagsPresent; + flags |= HAL::kMMFlagsWr; + flags |= HAL::kMMFlagsUser; + + HAL::mm_map_page((VoidPtr)process.StackReserve, process.StackReserve, flags); +#endif // __NE_VIRTUAL_MEMORY_SUPPORT__ + + process.ProcessParentTeam = &mTeam; + + process.ProcessId = pid; + process.Status = ProcessStatusKind::kStarting; + process.PTime = (UIntPtr)AffinityKind::kStandard; + + kout << "PID: " << number(process.ProcessId) << kendl; + kout << "Name: " << process.Name << kendl; + + return pid; + } + + /***********************************************************************************/ + /// @brief Retrieves the singleton of the process scheduler. + /***********************************************************************************/ + + UserProcessScheduler& UserProcessScheduler::The() + { + return kProcessScheduler; + } + + /***********************************************************************************/ + + /// @brief Remove process from the team. + /// @param process_id process slot inside team. + /// @retval true process was removed. + /// @retval false process doesn't exist in team. + + /***********************************************************************************/ + + const Bool UserProcessScheduler::Remove(ProcessID process_id) + { + // check if process is within range. + if (process_id > mTeam.mProcessList.Count()) + return No; + + mTeam.mProcessList[process_id].Exit(0); + + return Yes; + } + + /// @brief Is it a user scheduler? + + const Bool UserProcessScheduler::IsUser() + { + return Yes; + } + + /// @brief Is it a kernel scheduler? + + const Bool UserProcessScheduler::IsKernel() + { + return No; + } + + /// @brief Is it a SMP scheduler? + + const Bool UserProcessScheduler::HasMP() + { + return Yes; + } + + /***********************************************************************************/ + /// @brief Run User scheduler object. + /// @return Process count executed within a team. + /***********************************************************************************/ + + const SizeT UserProcessScheduler::Run() noexcept + { + SizeT process_index = 0UL; //! we store this guy to tell the scheduler how many + //! things we have scheduled. + + if (mTeam.mProcessCount < 1) + { + kout << "UserProcessScheduler::Run(): This team doesn't have any process!\r"; + return 0UL; + } + for (; process_index < mTeam.AsArray().Capacity(); ++process_index) + { + auto& process = mTeam.AsArray()[process_index]; + + //! check if the process needs to be run. + if (UserProcessHelper::CanBeScheduled(process)) + { + // Set current process header. + this->CurrentProcess() = process; + + process.PTime = static_cast(process.Affinity); + + kout << "Switch to: '" << process.Name << "'.\r"; + + // tell helper to find a core to schedule on. + BOOL ret = UserProcessHelper::Switch(process.Image.fCode, &process.StackReserve[process.StackSize - 1], process.StackFrame, + process.ProcessId); + + if (!ret) + { + if (process.Affinity == AffinityKind::kRealTime) + continue; + + kout << "The process: " << process.Name << ", is not valid! Crashing it...\r"; + + process.Crash(); + } + } + else + { + --process.PTime; + } + } + + return process_index; + } + + /// @brief Gets the current scheduled team. + /// @return + UserProcessTeam& UserProcessScheduler::CurrentTeam() + { + return mTeam; + } + + /// @internal + + /// @brief Gets current running process. + /// @return + Ref& UserProcessScheduler::CurrentProcess() + { + return mTeam.AsRef(); + } + + /// @brief Current proccess id getter. + /// @return UserProcess ID integer. + ErrorOr UserProcessHelper::TheCurrentPID() + { + if (!kProcessScheduler.CurrentProcess()) + return ErrorOr{kErrorProcessFault}; + + kout << "UserProcessHelper::TheCurrentPID: Leaking ProcessId...\r"; + return ErrorOr{kProcessScheduler.CurrentProcess().Leak().ProcessId}; + } + + /// @brief Check if process can be schedulded. + /// @param process the process reference. + /// @retval true can be schedulded. + /// @retval false cannot be schedulded. + Bool UserProcessHelper::CanBeScheduled(const UserProcess& process) + { + if (process.Status == ProcessStatusKind::kKilled || + process.Status == ProcessStatusKind::kFinished || + process.Status == ProcessStatusKind::kStarting || + process.Status == ProcessStatusKind::kFrozen) + return No; + + if (process.Status == ProcessStatusKind::kInvalid) + return No; + + if (!process.Image.fCode) + return No; + + if (!process.Name[0]) + return No; + + // real time processes shouldn't wait that much. + if (process.Affinity == AffinityKind::kRealTime) + return Yes; + + return process.PTime < 1; + } + + /***********************************************************************************/ + /** + * @brief Start scheduling current AP. + */ + /***********************************************************************************/ + + SizeT UserProcessHelper::StartScheduling() + { + return kProcessScheduler.Run(); + } + + /***********************************************************************************/ + /** + * \brief Does a context switch in a CPU. + * \param the_stack the stackframe of the running app. + * \param new_pid the process's PID. + */ + /***********************************************************************************/ + + Bool UserProcessHelper::Switch(VoidPtr image, UInt8* stack, HAL::StackFramePtr frame_ptr, const PID& new_pid) + { + for (SizeT index = 0UL; index < HardwareThreadScheduler::The().Capacity(); ++index) + { + if (HardwareThreadScheduler::The()[index].Leak()->Kind() == kAPInvalid || + HardwareThreadScheduler::The()[index].Leak()->Kind() == kAPBoot) + continue; + + // A fallback is a special core for real-time tasks which needs immediate execution. + if (HardwareThreadScheduler::The()[index].Leak()->Kind() == kAPRealTime) + { + if (UserProcessScheduler::The().CurrentTeam().AsArray()[new_pid].Affinity != AffinityKind::kRealTime) + continue; + + if (HardwareThreadScheduler::The()[index].Leak()->Switch(image, stack, frame_ptr, new_pid)) + { + PTime prev_ptime = HardwareThreadScheduler::The()[index].Leak()->fPTime; + + HardwareThreadScheduler::The()[index].Leak()->fPTime = UserProcessScheduler::The().CurrentTeam().AsArray()[new_pid].PTime; + + PID prev_pid = UserProcessHelper::TheCurrentPID(); + UserProcessHelper::TheCurrentPID().Leak().Leak() = new_pid; + + return YES; + } + + continue; + } + + if (UserProcessScheduler::The().CurrentTeam().AsArray()[new_pid].Affinity == AffinityKind::kRealTime) + continue; + + //////////////////////////////////////////////////////////// + /// Prepare task switch. /// + //////////////////////////////////////////////////////////// + + Bool ret = HardwareThreadScheduler::The()[index].Leak()->Switch(image, stack, frame_ptr, new_pid); + + //////////////////////////////////////////////////////////// + /// Rollback on fail. /// + //////////////////////////////////////////////////////////// + + if (!ret) + continue; + + UserProcessHelper::TheCurrentPID().Leak().Leak() = new_pid; + + HardwareThreadScheduler::The()[index].Leak()->fPTime = UserProcessScheduler::The().CurrentTeam().AsArray()[new_pid].PTime; + HardwareThreadScheduler::The()[index].Leak()->Wake(YES); + + return Yes; + } + + return No; + } + + //////////////////////////////////////////////////////////// + /// @brief this checks if any process is on the team. + //////////////////////////////////////////////////////////// + UserProcessScheduler::operator bool() + { + return mTeam.AsArray().Count() > 0; + } + + //////////////////////////////////////////////////////////// + /// @brief this checks if no process is on the team. + //////////////////////////////////////////////////////////// + Bool UserProcessScheduler::operator!() + { + return mTeam.AsArray().Count() == 0; + } +} // namespace NeOS diff --git a/dev/kernel/src/UserProcessTeam.cc b/dev/kernel/src/UserProcessTeam.cc new file mode 100644 index 00000000..e0533ef1 --- /dev/null +++ b/dev/kernel/src/UserProcessTeam.cc @@ -0,0 +1,59 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +/***********************************************************************************/ +/// @file UserProcessTeam.cc +/// @brief Process teams implementation. +/***********************************************************************************/ + +#include + +namespace NeOS +{ + UserProcessTeam::UserProcessTeam() + { + for (SizeT i = 0U; i < this->mProcessList.Count(); ++i) + { + this->mProcessList[i] = UserProcess(); + this->mProcessList[i].PTime = 0; + this->mProcessList[i].Status = ProcessStatusKind::kKilled; + } + + this->mProcessCount = 0UL; + } + + /***********************************************************************************/ + /// @brief UserProcess list array getter. + /// @return The list of process to schedule. + /***********************************************************************************/ + + Array& UserProcessTeam::AsArray() + { + return this->mProcessList; + } + + /***********************************************************************************/ + /// @brief Get team ID. + /// @return The team's ID. + /***********************************************************************************/ + + ProcessID& UserProcessTeam::Id() noexcept + { + return this->mTeamId; + } + + /***********************************************************************************/ + /// @brief Get current process getter as Ref. + /// @return The current process header. + /***********************************************************************************/ + + Ref& UserProcessTeam::AsRef() + { + return this->mCurrentProcess; + } +} // namespace NeOS + +// last rev 05-03-24 diff --git a/dev/kernel/src/Utils.cc b/dev/kernel/src/Utils.cc new file mode 100644 index 00000000..a362099a --- /dev/null +++ b/dev/kernel/src/Utils.cc @@ -0,0 +1,224 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +namespace NeOS +{ + Int32 rt_string_cmp(const Char* src, const Char* cmp, Size size) + { + Int32 counter = 0; + + for (Size index = 0; index < size; ++index) + { + if (src[index] != cmp[index]) + ++counter; + } + + return counter; + } + + Void rt_zero_memory(voidPtr pointer, Size len) + { + rt_set_memory(pointer, 0, len); + } + + SizeT rt_string_len(const Char* str, SizeT _len) + { + SizeT len{0}; + + do + { + if (len > _len) + { + return _len; + } + + ++len; + } while (str[len] != '\0'); + + return len; + } + + Size rt_string_len(const Char* ptr) + { + SizeT cnt{0}; + + while (ptr[cnt] != 0) + ++cnt; + + return cnt; + } + + voidPtr rt_set_memory(voidPtr src, UInt32 value, Size len) + { + UInt32* start = reinterpret_cast(src); + + while (len) + { + *start = value; + ++start; + --len; + } + + return (voidPtr)start; + } + + Int rt_move_memory(const voidPtr src, voidPtr dst, Size len) + { + Char* srcChr = reinterpret_cast(src); + Char* dstChar = reinterpret_cast(dst); + SizeT index = 0; + + while (index < len) + { + dstChar[index] = srcChr[index]; + srcChr[index] = 0; + + ++index; + } + + return 0; + } + + Int rt_copy_memory(const voidPtr src, voidPtr dst, Size len) + { + char* srcChr = reinterpret_cast(src); + char* dstChar = reinterpret_cast(dst); + Size index = 0; + + while (index < len) + { + dstChar[index] = srcChr[index]; + ++index; + } + + dstChar[index] = 0; + + return index; + } + + const Char* rt_alloc_string(const Char* src) + { + const Char* string = new Char[rt_string_len(src) + 1]; + + if (!string) + return nullptr; + + voidPtr v_src = reinterpret_cast(const_cast(src)); + voidPtr v_dst = reinterpret_cast(const_cast(string)); + + rt_copy_memory(v_src, v_dst, rt_string_len(src) + 1); + + return string; + } + + Int32 rt_to_uppercase(Int32 character) + { + if (character >= 'a' && character <= 'z') + return character - 0x20; + + return character; + } + + Int32 rt_is_alnum(Int32 character) + { + return (character >= 'a' && character <= 'z') || (character >= 'A' && character <= 'Z') || (character >= '0' && character <= '9'); + } + + Int32 rt_to_lower(Int32 character) + { + if (character >= 'A' && character <= 'Z') + return character + 0x20; + + return character; + } + + Boolean rt_is_space(Char chr) + { + return chr == ' '; + } + + Boolean rt_is_newln(Char chr) + { + return chr == '\n'; + } + + VoidPtr rt_string_in_string(const Char* in, const Char* needle) + { + for (SizeT i = 0; i < rt_string_len(in); ++i) + { + if (rt_string_cmp(in + i, needle, rt_string_len(needle)) == 0) + return reinterpret_cast(const_cast(in + i)); + } + + return nullptr; + } + + Char rt_to_char(UInt64 base, Int32 limit) + { + const Char kNumbers[17] = "0123456789ABCDEF"; + return kNumbers[base % limit]; + } + + Bool rt_to_string(Char* str, UInt64 base, Int32 limit) + { +#ifdef __NE_AMD64__ + auto i = 0; + + auto final_number = base; + + auto mult = 1; + auto elems = 0L; + + base /= 10; + + while (base > 0) + { + elems++; + mult *= 10; + base /= 10; + } + + while (elems > -1) + { + final_number = (final_number % mult) * 10 + final_number / mult; + str[i] = rt_to_char(final_number, limit); + + --elems; + ++i; + } +#endif + + return YES; + } + + /// @brief Checks for a string start at the character. + + Char* rt_string_has_char(Char* str, const Char chr) + { + while (*str != chr) + { + ++str; + + if (*str == 0) + return nullptr; + } + + return str; + } +} // namespace NeOS + +EXTERN_C void* memset(void* dst, int c, long long unsigned int len) +{ + return NeOS::rt_set_memory(dst, c, len); +} + +EXTERN_C void* memcpy(void* dst, const void* src, long long unsigned int len) +{ + NeOS::rt_copy_memory(const_cast(src), dst, len); + return dst; +} diff --git a/dev/kernel/src/Variant.cc b/dev/kernel/src/Variant.cc new file mode 100644 index 00000000..cfa29d3a --- /dev/null +++ b/dev/kernel/src/Variant.cc @@ -0,0 +1,41 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include + +namespace NeOS +{ + const Char* Variant::ToString() + { + switch (fKind) + { + case VariantKind::kXML: + return ("Class:{XML}"); + case VariantKind::kJson: + return ("Class:{Json}"); + case VariantKind::kString: + return ("Class:{String}"); + case VariantKind::kBlob: + return ("Class:{Blob}"); + case VariantKind::kNull: + return ("Class:{Null}"); + default: + return ("Class:{Unknown}"); + } + } + + /// @brief Return variant's kind. + Variant::VariantKind& Variant::Kind() + { + return this->fKind; + } + + /// @brief Leak variant's instance. + VoidPtr Variant::Leak() + { + return this->fPtr; + } +} // namespace NeOS diff --git a/dev/modules/ACPI/ACPI.h b/dev/modules/ACPI/ACPI.h new file mode 100644 index 00000000..a4fe2b0e --- /dev/null +++ b/dev/modules/ACPI/ACPI.h @@ -0,0 +1,90 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef __ACPI__ +#define __ACPI__ + +/** + https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html +*/ + +#include + +#define SDT_OBJECT : public NeOS::SDT + +namespace NeOS +{ + 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 ACPI_ADDRESS_SPACE_KIND : UInt8 + { + eSystemMemory = 0, + eSystemIO = 1, + ePci = 2, + eController = 3, + eSmBus = 4, + eCount = 5, + eInvalid = 0xFF, + }; + + class PACKED ACPI_ADDRESS final + { + public: + UInt8 AddressSpaceId; + UInt8 RegisterBitWidth; + UInt8 RegisterBitOffset; + UInt8 Reserved; + UIntPtr Address; + }; + + class PACKED RSDT final + { + 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 NeOS + +#endif // !__ACPI__ diff --git a/dev/modules/ACPI/ACPIFactoryInterface.h b/dev/modules/ACPI/ACPIFactoryInterface.h new file mode 100644 index 00000000..06a5c6e9 --- /dev/null +++ b/dev/modules/ACPI/ACPIFactoryInterface.h @@ -0,0 +1,59 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef __MOD_ACPI_H__ +#define __MOD_ACPI_H__ + +#include +#include +#include +#include +#include +#include + +namespace NeOS +{ + class PowerFactory; + class ACPIFactoryInterface; + + typedef ACPIFactoryInterface PowerFactoryInterface; + + class ACPIFactoryInterface final NE_POWER_FACTORY + { + public: + explicit ACPIFactoryInterface(voidPtr rsp_ptr); + ~ACPIFactoryInterface() = default; + + ACPIFactoryInterface& operator=(const ACPIFactoryInterface&) = default; + ACPIFactoryInterface(const ACPIFactoryInterface&) = default; + + public: + Bool 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); + + private: + VoidPtr fRsdp{nullptr}; // pointer to root descriptor. + SSizeT fEntries{0UL}; // number of entries, -1 tells that no invalid entries were + // found. + }; +} // namespace NeOS + +#endif // !__MOD_ACPI_H__ diff --git a/dev/modules/AHCI/.gitkeep b/dev/modules/AHCI/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/modules/AHCI/AHCI.h b/dev/modules/AHCI/AHCI.h new file mode 100644 index 00000000..2ff54be9 --- /dev/null +++ b/dev/modules/AHCI/AHCI.h @@ -0,0 +1,370 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: AHCI.h + Purpose: AHCI protocol defines. + + Revision History: + + 03/02/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +#include +#include + +/// @file AHCI.h +/// @brief AHCI support. + +#define kAHCISectorSize (512) + +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 + NeOS::UInt8 FisType; // FIS_TYPE_REG_H2D + + NeOS::UInt8 PortMul : 4; // Port multiplier + NeOS::UInt8 Reserved0 : 3; // Reserved + NeOS::UInt8 CmdOrCtrl : 1; // 1: Command, 0: Control + + NeOS::UInt8 Command; // Command register + NeOS::UInt8 FeatureLow; // Feature register, 7:0 + + // DWORD 1 + NeOS::UInt8 Lba0; // LBA low register, 7:0 + NeOS::UInt8 Lba1; // LBA mid register, 15:8 + NeOS::UInt8 Lba2; // LBA high register, 23:16 + NeOS::UInt8 Device; // Device register + + // DWORD 2 + NeOS::UInt8 Lba3; // LBA register, 31:24 + NeOS::UInt8 Lba4; // LBA register, 39:32 + NeOS::UInt8 Lba5; // LBA register, 47:40 + NeOS::UInt8 FeatureHigh; // Feature register, 15:8 + + // DWORD 3 + NeOS::UInt8 CountLow; // Count register, 7:0 + NeOS::UInt8 CountHigh; // Count register, 15:8 + NeOS::UInt8 Icc; // Isochronous command completion + NeOS::UInt8 Control; // Control register + + // DWORD 4 + NeOS::UInt8 Reserved1[4]; // Reserved +} FisRegH2D; + +typedef struct FisRegD2H final +{ + // DWORD 0 + NeOS::UInt8 FisType; // FIS_TYPE_REG_D2H + + NeOS::UInt8 PortMul : 4; // Port multiplier + NeOS::UInt8 Reserved0 : 2; // Reserved + NeOS::UInt8 IE : 1; // Interrupt bit + NeOS::UInt8 Reserved1 : 1; // Reserved + + NeOS::UInt8 Status; // Status register + NeOS::UInt8 Error; // Error register + + // DWORD 1 + NeOS::UInt8 Lba0; // LBA low register, 7:0 + NeOS::UInt8 Lba1; // LBA mid register, 15:8 + NeOS::UInt8 Lba2; // LBA high register, 23:16 + NeOS::UInt8 Device; // Device register + + // DWORD 2 + NeOS::UInt8 Lba3; // LBA register, 31:24 + NeOS::UInt8 Lba4; // LBA register, 39:32 + NeOS::UInt8 Lba5; // LBA register, 47:40 + NeOS::UInt8 Rsv2; // Reserved + + // DWORD 3 + NeOS::UInt8 CountLow; // Count register, 7:0 + NeOS::UInt8 CountHigh; // Count register, 15:8 + NeOS::UInt8 Rsv3[2]; // Reserved + + // DWORD 4 + NeOS::UInt8 Rsv4[4]; // Reserved +} FisRegD2H; + +typedef struct FisData final +{ + // DWORD 0 + NeOS::UInt8 FisType; // FIS_TYPE_DATA + + NeOS::UInt8 PortMul : 4; // Port multiplier + NeOS::UInt8 Reserved0 : 4; // Reserved + + NeOS::UInt8 Reserved1[2]; // Reserved + + // DWORD 1 ~ N + NeOS::UInt32 Data[1]; // Payload +} FisData; + +typedef struct FisPioSetup final +{ + // DWORD 0 + NeOS::UInt8 FisType; // FIS_TYPE_PIO_SETUP + + NeOS::UInt8 PortMul : 4; // Port multiplier + NeOS::UInt8 Reserved0 : 1; // Reserved + NeOS::UInt8 DTD : 1; // Data transfer direction, 1 - device to host + NeOS::UInt8 IE : 1; // Interrupt bit + NeOS::UInt8 Reserved1 : 1; + + NeOS::UInt8 Status; // Status register + NeOS::UInt8 Error; // Error register + + // DWORD 1 + NeOS::UInt8 Lba0; // LBA low register, 7:0 + NeOS::UInt8 Lba1; // LBA mid register, 15:8 + NeOS::UInt8 Lba2; // LBA high register, 23:16 + NeOS::UInt8 Device; // Device register + + // DWORD 2 + NeOS::UInt8 Lba3; // LBA register, 31:24 + NeOS::UInt8 Lba4; // LBA register, 39:32 + NeOS::UInt8 Lba5; // LBA register, 47:40 + NeOS::UInt8 Rsv2; // Reserved + + // DWORD 3 + NeOS::UInt8 CountLow; // Count register, 7:0 + NeOS::UInt8 CountHigh; // Count register, 15:8 + NeOS::UInt8 Rsv3; // Reserved + NeOS::UInt8 EStatus; // New value of status register + + // DWORD 4 + NeOS::UInt16 TranferCount; // Transfer count + NeOS::UInt8 Rsv4[2]; // Reserved +} FisPioSetup; + +typedef struct FisDmaSetup final +{ + // DWORD 0 + NeOS::UInt8 FisType; // FIS_TYPE_DMA_SETUP + + NeOS::UInt8 PortMul : 4; // Port multiplier + NeOS::UInt8 Reserved0 : 1; // Reserved + NeOS::UInt8 DTD : 1; // Data transfer direction, 1 - device to host + NeOS::UInt8 IE : 1; // Interrupt bit + NeOS::UInt8 AutoEnable : 1; // Auto-activate. Specifies if DMA Activate FIS is needed + + NeOS::UInt8 Reserved1[2]; // Reserved + + // DWORD 1&2 + volatile NeOS::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 + NeOS::UInt32 Rsvd; // More reserved + + // DWORD 4 + NeOS::UInt32 DmabufOffset; // Byte offset into buffer. First 2 bits must be 0 + + // DWORD 5 + NeOS::UInt32 TransferCount; // Number of bytes to transfer. Bit 0 must be 0 + + // DWORD 6 + NeOS::UInt32 Reserved3; // Reserved +} FisDmaSetup; + +typedef struct FisDevBits final +{ + // DWORD 0 + NeOS::UInt8 FisType; // FIS_TYPE_DMA_SETUP (A1h) + + NeOS::UInt8 Reserved0 : 5; // Reserved + NeOS::UInt8 R0 : 1; + NeOS::UInt8 IE : 1; + NeOS::UInt8 N : 1; + + NeOS::UInt8 StatusLow : 3; + NeOS::UInt8 R1 : 1; + NeOS::UInt8 StatusHigh : 3; + + NeOS::UInt8 R2 : 1; + NeOS::UInt8 Error; + + // DWORD 1 + NeOS::UInt32 Act; +} FisDevBits; + +/// \brief Enable AHCI device bit in GHC register. +#ifndef kSATAGHC_AE +#define kSATAGHC_AE (31) +#endif //! ifndef kSATAGHC_AE + +typedef struct HbaPort final +{ + NeOS::UInt32 Clb; // 0x00, command list base address, 1K-byte aligned + NeOS::UInt32 Clbu; // 0x04, command list base address upper 32 bits + NeOS::UInt32 Fb; // 0x08, FIS base address, 256-byte aligned + NeOS::UInt32 Fbu; // 0x0C, FIS base address upper 32 bits + NeOS::UInt32 Is; // 0x10, interrupt status + NeOS::UInt32 Ie; // 0x14, interrupt enable + NeOS::UInt32 Cmd; // 0x18, command and status + NeOS::UInt32 Reserved0; // 0x1C, Reserved + NeOS::UInt32 Tfd; // 0x20, task file data + NeOS::UInt32 Sig; // 0x24, signature + NeOS::UInt32 Ssts; // 0x28, SATA status (SCR0:SStatus) + NeOS::UInt32 Sctl; // 0x2C, SATA control (SCR2:SControl) + NeOS::UInt32 Serr; // 0x30, SATA error (SCR1:SError) + NeOS::UInt32 Sact; // 0x34, SATA active (SCR3:SActive) + NeOS::UInt32 Ci; // 0x38, command issue + NeOS::UInt32 Sntf; // 0x3C, SATA notification (SCR4:SNotification) + NeOS::UInt32 Fbs; // 0x40, FIS-based switch control + NeOS::UInt32 Reserved1[11]; // 0x44 ~ 0x6F, Reserved + NeOS::UInt32 Vendor[4]; // 0x70 ~ 0x7F, vendor specific +} HbaPort; + +typedef struct HbaMem final +{ + // 0x00 - 0x2B, Generic Host Control + NeOS::UInt32 Cap; // 0x00, Host capability + NeOS::UInt32 Ghc; // 0x04, Global host control + NeOS::UInt32 Is; // 0x08, Interrupt status + NeOS::UInt32 Pi; // 0x0C, Port implemented + NeOS::UInt32 Vs; // 0x10, Version + NeOS::UInt32 Ccc_ctl; // 0x14, Command completion coalescing control + NeOS::UInt32 Ccc_pts; // 0x18, Command completion coalescing ports + NeOS::UInt32 Em_loc; // 0x1C, Enclosure management location + NeOS::UInt32 Em_ctl; // 0x20, Enclosure management control + NeOS::UInt32 Cap2; // 0x24, Host capabilities extended + NeOS::UInt32 Bohc; // 0x28, BIOS/OS handoff control and status + + NeOS::UInt8 Resv0[0xA0 - 0x2C]; + NeOS::UInt8 Vendor[0x100 - 0xA0]; + + HbaPort Ports[1]; // 1 ~ 32, 32 is the max ahci devices per controller. +} HbaMem; + +typedef struct HbaCmdHeader final +{ + // DW0 + union { + struct + { + NeOS::UInt8 Cfl : 5; // Command FIS length in DWORDS, 2 ~ 16 + NeOS::UInt8 Atapi : 1; // ATAPI + NeOS::UInt8 Write : 1; // Write, 1: H2D, 0: D2H + NeOS::UInt8 Prefetchable : 1; // Prefetchable + + NeOS::UInt8 Reset : 1; // Reset + NeOS::UInt8 BIST : 1; // BIST + NeOS::UInt8 Clear : 1; // Clear busy upon R_OK + NeOS::UInt8 Reserved0 : 1; // Reserved + NeOS::UInt8 Pmp : 4; // Port multiplier port + }; + NeOS::UInt16 Flags; + }; + + NeOS::UInt16 Prdtl; // Physical region descriptor table length in entries + NeOS::UInt32 Prdbc; // Physical region descriptor byte count transferred + + NeOS::UInt32 Ctba; // Command table descriptor base address + NeOS::UInt32 Ctbau; // Command table descriptor base address upper 32 bits + + NeOS::UInt32 Rsv[4]; +} ATTRIBUTE(packed, aligned(32)) HbaCmdHeader; + +typedef struct HbaFis final +{ + // 0x00 + FisDmaSetup Dsfis; // DMA Setup FIS + NeOS::UInt8 Pad0[4]; + // 0x20 + FisPioSetup Psfis; // PIO Setup FIS + NeOS::UInt8 Pad1[12]; + // 0x40 + FisRegD2H Rfis; // Register – Device to Host FIS + NeOS::UInt8 Pad2[4]; + // 0x58 + FisDevBits Sdbfis; // Set Device Bit FIS + // 0x60 + NeOS::UInt8 Ufis[64]; + // 0xA0 + NeOS::UInt8 Rsv[0x100 - 0xA0]; +} HbaFis; + +typedef struct HbaPrdtEntry final +{ + NeOS::UInt32 Dba; // Data base address + NeOS::UInt32 Dbau; // Data base address upper 32 bits + NeOS::UInt32 Reserved0; // Reserved + // DW3 + NeOS::UInt32 Dbc : 22; // Byte count, 4M max + NeOS::UInt32 Reserved1 : 9; // Reserved + NeOS::UInt32 Ie : 1; // Interrupt on completion +} HbaPrdtEntry; + +typedef struct HbaCmdTbl final +{ + NeOS::UInt8 Cfis[64]; // Command FIS + NeOS::UInt8 Acmd[16]; // ATAPI command, 12 or 16 bytes + NeOS::UInt8 Rsv[48]; // Reserved + struct HbaPrdtEntry Prdt[]; // Physical region descriptor table entries, 0 ~ 65535 +} HbaCmdTbl; + +/// @brief Initializes an AHCI disk. +/// @param PortsImplemented the amount of port that have been detected. +/// @return +NeOS::Boolean drv_std_init(NeOS::UInt16& PortsImplemented); + +NeOS::Boolean drv_std_detected(NeOS::Void); + +/// @brief Read from AHCI disk. +/// @param lba +/// @param buf +/// @param sector_sz +/// @param buf_sz +/// @return +NeOS::Void drv_std_read(NeOS::UInt64 lba, NeOS::Char* buf, NeOS::SizeT sector_sz, NeOS::SizeT buf_sz); + +/// @brief Write to AHCI disk. +/// @param lba +/// @param buf +/// @param sector_sz +/// @param buf_sz +/// @return +NeOS::Void drv_std_write(NeOS::UInt64 lba, NeOS::Char* buf, NeOS::SizeT sector_sz, NeOS::SizeT buf_sz); + +/// @brief Gets the sector count from AHCI disk. +NeOS::SizeT drv_get_sector_count(); + +/// @brief Gets the AHCI disk size. +NeOS::SizeT drv_get_size(); + +/// @brief Checks if the drive has completed the command. +BOOL drv_is_ready(void); + +/* EOF */ diff --git a/dev/modules/APM/APM.h b/dev/modules/APM/APM.h new file mode 100644 index 00000000..1cb55fdc --- /dev/null +++ b/dev/modules/APM/APM.h @@ -0,0 +1,37 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +namespace NeOS +{ + typedef Int32 APMPowerCmd; + + enum + { + kAPMPowerCommandInvalid = 0x00, + kAPMPowerCommandStop = 0x01, + kAPMPowerCommandStart = 0x02, + kAPMPowerCommandSleep = 0x04, + kAPMPowerCommandWakeup = 0x06, + kAPMPowerCommandShutdown = 0x07, + kAPMPowerCommandReboot = 0x08, + }; + + /// @brief Send a APM command into it's own DMA space. + /// @param base_dma the DMA base address. + /// @param cmd the command. + /// @return status code. + EXTERN_C Int32 apm_send_dma_command(Ptr64 register_addr, APMPowerCmd value); + + /// @brief Send a APM command into it's own IO space. + /// @param base_dma the IO base port. + /// @param cmd the command. + /// @return status code. + EXTERN_C Int32 apm_send_io_command(UInt16 cmd, APMPowerCmd value); +} // namespace NeOS diff --git a/dev/modules/ATA/ATA.h b/dev/modules/ATA/ATA.h new file mode 100644 index 00000000..374b8b5d --- /dev/null +++ b/dev/modules/ATA/ATA.h @@ -0,0 +1,155 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: Defines.h + Purpose: ATA header. + + Revision History: + + 03/02/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +#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_REG_SET_FEATURES 0xEF + +#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__) + +NeOS::Boolean drv_std_init(NeOS::UInt16 in_bus, NeOS::UInt8 drive, NeOS::UInt16& out_bus, NeOS::UInt8& out_master); + +NeOS::Boolean drv_std_detected(NeOS::Void); + +NeOS::Void drv_std_select(NeOS::UInt16 bus); + +NeOS::Boolean drv_std_wait_io(NeOS::UInt16 io); + +NeOS::Void drv_std_read(NeOS::UInt64 lba, NeOS::UInt16 io, NeOS::UInt8 is_master, NeOS::Char* buf, NeOS::SizeT sec_sz, NeOS::SizeT buf_sz); + +NeOS::Void drv_std_write(NeOS::UInt64 lba, NeOS::UInt16 io, NeOS::UInt8 is_master, NeOS::Char* buf, NeOS::SizeT sec_sz, NeOS::SizeT buf_sz); + +/// @brief get sector count. +NeOS::SizeT drv_get_sector_count(); + +/// @brief get device size. +NeOS::SizeT drv_get_size(); + +#endif // ifdef __NEOSKRNL__ \ No newline at end of file diff --git a/dev/modules/CoreGfx/AccessibilityMgr.h b/dev/modules/CoreGfx/AccessibilityMgr.h new file mode 100644 index 00000000..a45470eb --- /dev/null +++ b/dev/modules/CoreGfx/AccessibilityMgr.h @@ -0,0 +1,41 @@ +/* ------------------------------------------- + + Copyright Amlal EL Mahrouss. + +------------------------------------------- */ + +#ifndef GFX_MGR_ACCESSIBILITY_H +#define GFX_MGR_ACCESSIBILITY_H + +#include +#include +#include +#include +#include + +namespace FB +{ + using namespace NeOS; + + /// @brief common User interface class. + class UIAccessibilty final + { + explicit UIAccessibilty() = default; + ~UIAccessibilty() = default; + + public: + NE_COPY_DELETE(UIAccessibilty); + + static Int64 Width() noexcept + { + return kHandoverHeader->f_GOP.f_Width; + } + + static Int64 Height() noexcept + { + return kHandoverHeader->f_GOP.f_Height; + } + }; +} // namespace FB + +#endif // !GFX_MGR_ACCESSIBILITY_H_ diff --git a/dev/modules/CoreGfx/FBMgr.h b/dev/modules/CoreGfx/FBMgr.h new file mode 100644 index 00000000..5600e4c7 --- /dev/null +++ b/dev/modules/CoreGfx/FBMgr.h @@ -0,0 +1,150 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +#define fb_init() NeOS::SizeT kCGCursor = 0 + +#define fb_color(R, G, B) RGB(R, G, B) + +#define fb_get_clear_clr() fb_color(0x20, 0x20, 0x20) + +#define fb_clear() kCGCursor = 0 + +#ifdef __NE_AMD64__ +/// @brief Performs Alpha drawing on the framebuffer. +#define FBDrawBitMapInRegionA(reg_ptr, height, width, base_x, base_y) \ + for (NeOS::SizeT i = base_x; i < (width + base_x); ++i) \ + { \ + for (NeOS::SizeT u = base_y; u < (height + base_y); ++u) \ + { \ + *(((NeOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ + 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ + i + \ + 4 * u))) |= (reg_ptr)[kCGCursor]; \ + \ + ++kCGCursor; \ + } \ + } + +/// @brief Performs drawing on the framebuffer. +#define FBDrawBitMapInRegion(reg_ptr, height, width, base_x, base_y) \ + for (NeOS::SizeT i = base_x; i < (width + base_x); ++i) \ + { \ + for (NeOS::SizeT u = base_y; u < (height + base_y); ++u) \ + { \ + *(((NeOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ + 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ + i + \ + 4 * u))) = (reg_ptr)[kCGCursor]; \ + \ + ++kCGCursor; \ + } \ + } + +#define FBDrawBitMapInRegionToRgn(_Rgn, reg_ptr, height, width, base_x, base_y) \ + for (NeOS::SizeT i = base_x; i < (width + base_x); ++i) \ + { \ + for (NeOS::SizeT u = base_y; u < (height + base_y); ++u) \ + { \ + *(((NeOS::UInt32*)(_Rgn + \ + 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ + i + \ + 4 * u))) = (reg_ptr)[kCGCursor]; \ + \ + ++kCGCursor; \ + } \ + } + +/// @brief Cleans a resource. +#define CGClearRegion(height, width, base_x, base_y) \ + for (NeOS::SizeT i = base_x; i < (width + base_x); ++i) \ + { \ + for (NeOS::SizeT u = base_y; u < (height + base_y); ++u) \ + { \ + *(((volatile NeOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ + 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ + i + \ + 4 * u))) = fb_get_clear_clr(); \ + } \ + } + +/// @brief Draws inside a zone. +#define FBDrawInRegion(_Clr, height, width, base_x, base_y) \ + for (NeOS::SizeT x_base = base_x; x_base < (width + base_x); ++x_base) \ + { \ + for (NeOS::SizeT y_base = base_y; y_base < (height + base_y); ++y_base) \ + { \ + *(((volatile NeOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ + 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ + x_base + \ + 4 * y_base))) = _Clr; \ + } \ + } + +/// @brief Draws inside a zone. +#define FBDrawInRegionToRgn(_Rgn, _Clr, height, width, base_x, base_y) \ + for (NeOS::SizeT x_base = base_x; x_base < (width + base_x); ++x_base) \ + { \ + for (NeOS::SizeT y_base = base_y; y_base < (height + base_y); ++y_base) \ + { \ + *(((volatile NeOS::UInt32*)(_Rgn + \ + 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ + x_base + \ + 4 * y_base))) = _Clr[kCGCursor]; \ + ++kCGCursor; \ + } \ + } + +#define FBDrawInRegionA(_Clr, height, width, base_x, base_y) \ + for (NeOS::SizeT x_base = base_x; x_base < (width + base_x); ++x_base) \ + { \ + for (NeOS::SizeT y_base = base_y; y_base < (height + base_y); ++y_base) \ + { \ + *(((volatile NeOS::UInt32*)(kHandoverHeader->f_GOP.f_The + \ + 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ + x_base + \ + 4 * y_base))) |= _Clr; \ + } \ + } +#else +#define FBDrawBitMapInRegionA(reg_ptr, height, width, base_x, base_y) +#define FBDrawBitMapInRegion(reg_ptr, height, width, base_x, base_y) +#define FBDrawBitMapInRegionToRgn(_Rgn, reg_ptr, height, width, base_x, base_y) +#define CGClearRegion(height, width, base_x, base_y) +#define FBDrawInRegion(_Clr, height, width, base_x, base_y) +#define FBDrawInRegionToRgn(_Rgn, _Clr, height, width, base_x, base_y) +#define FBDrawInRegionA(_Clr, height, width, base_x, base_y) +#define FBDrawBitMapInRegionA(reg_ptr, height, width, base_x, base_y) +#define FBDrawBitMapInRegion(reg_ptr, height, width, base_x, base_y) +#define FBDrawBitMapInRegionToRgn(_Rgn, reg_ptr, height, width, base_x, base_y) +#define CGClearRegion(height, width, base_x, base_y) +#define FBDrawInRegion(_Clr, height, width, base_x, base_y) +#define FBDrawInRegionToRgn(_Rgn, _Clr, height, width, base_x, base_y) +#define FBDrawInRegionA(_Clr, height, width, base_x, base_y) +#endif // __NE_AMD64__ + +#ifndef GFX_MGR_ACCESSIBILITY_H +#include +#endif // ifndef GFX_MGR_ACCESSIBILITY_H + +namespace FB +{ + struct FB_CONTROL_BLOCK; + + inline void fb_clear_video() noexcept + { + fb_init(); + + FBDrawInRegion(fb_get_clear_clr(), FB::UIAccessibilty::Height(), FB::UIAccessibilty::Width(), + 0, 0); + + fb_clear(); + } + +} // namespace FB \ No newline at end of file diff --git a/dev/modules/CoreGfx/MathMgr.h b/dev/modules/CoreGfx/MathMgr.h new file mode 100644 index 00000000..7e85c0dc --- /dev/null +++ b/dev/modules/CoreGfx/MathMgr.h @@ -0,0 +1,29 @@ +/* ------------------------------------------- + + Copyright Amlal EL Mahrouss. + +------------------------------------------- */ + +#pragma once + +/// @file MathMgr.h +/// @brief Linear interpolation implementation. + +namespace UI +{ +#ifdef NE_GFX_MGR_USE_DOUBLE + typedef double fb_real_t; +#else + typedef float fb_real_t; +#endif + + /// @brief Linear interpolation equation solver. + /// @param from where to start + /// @param to to which value. + /// @param stat + /// @return Linear interop value. + inline fb_real_t fb_math_lerp(fb_real_t to, fb_real_t from, fb_real_t stat) + { + return (from) + (to - from) * stat; + } +} // namespace UI \ No newline at end of file diff --git a/dev/modules/CoreGfx/TextMgr.h b/dev/modules/CoreGfx/TextMgr.h new file mode 100644 index 00000000..843e8274 --- /dev/null +++ b/dev/modules/CoreGfx/TextMgr.h @@ -0,0 +1,178 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include + +#define kFontSizeX 8 +#define kFontSizeY 8 +#define kFontNOFChars 128 + +inline const NeOS::UInt8 kFontBitmap[kFontNOFChars][kFontSizeX] = { + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0000 (nul) + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0001 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0002 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0003 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0004 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0005 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0006 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0007 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0008 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0009 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000A + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000B + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000C + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000D + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000E + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+000F + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0010 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0011 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0012 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0013 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0014 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0015 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0016 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0017 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0018 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0019 + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001A + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001B + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001C + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001D + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001E + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+001F + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0020 (space) + {0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00}, // U+0021 (!) + {0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0022 (") + {0x36, 0x36, 0x7F, 0x36, 0x7F, 0x36, 0x36, 0x00}, // U+0023 (#) + {0x0C, 0x3E, 0x03, 0x1E, 0x30, 0x1F, 0x0C, 0x00}, // U+0024 ($) + {0x00, 0x63, 0x33, 0x18, 0x0C, 0x66, 0x63, 0x00}, // U+0025 (%) + {0x1C, 0x36, 0x1C, 0x6E, 0x3B, 0x33, 0x6E, 0x00}, // U+0026 (&) + {0x06, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0027 (') + {0x18, 0x0C, 0x06, 0x06, 0x06, 0x0C, 0x18, 0x00}, // U+0028 (() + {0x06, 0x0C, 0x18, 0x18, 0x18, 0x0C, 0x06, 0x00}, // U+0029 ()) + {0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00}, // U+002A (*) + {0x00, 0x0C, 0x0C, 0x3F, 0x0C, 0x0C, 0x00, 0x00}, // U+002B (+) + {0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x06}, // U+002C (,) + {0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00}, // U+002D (-) + {0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x00}, // U+002E (.) + {0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x00}, // U+002F (/) + {0x3E, 0x63, 0x73, 0x7B, 0x6F, 0x67, 0x3E, 0x00}, // U+0030 (0) + {0x0C, 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x3F, 0x00}, // U+0031 (1) + {0x1E, 0x33, 0x30, 0x1C, 0x06, 0x33, 0x3F, 0x00}, // U+0032 (2) + {0x1E, 0x33, 0x30, 0x1C, 0x30, 0x33, 0x1E, 0x00}, // U+0033 (3) + {0x38, 0x3C, 0x36, 0x33, 0x7F, 0x30, 0x78, 0x00}, // U+0034 (4) + {0x3F, 0x03, 0x1F, 0x30, 0x30, 0x33, 0x1E, 0x00}, // U+0035 (5) + {0x1C, 0x06, 0x03, 0x1F, 0x33, 0x33, 0x1E, 0x00}, // U+0036 (6) + {0x3F, 0x33, 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x00}, // U+0037 (7) + {0x1E, 0x33, 0x33, 0x1E, 0x33, 0x33, 0x1E, 0x00}, // U+0038 (8) + {0x1E, 0x33, 0x33, 0x3E, 0x30, 0x18, 0x0E, 0x00}, // U+0039 (9) + {0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x00}, // U+003A (:) + {0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x06}, // U+003B (;) + {0x18, 0x0C, 0x06, 0x03, 0x06, 0x0C, 0x18, 0x00}, // U+003C (<) + {0x00, 0x00, 0x3F, 0x00, 0x00, 0x3F, 0x00, 0x00}, // U+003D (=) + {0x06, 0x0C, 0x18, 0x30, 0x18, 0x0C, 0x06, 0x00}, // U+003E (>) + {0x1E, 0x33, 0x30, 0x18, 0x0C, 0x00, 0x0C, 0x00}, // U+003F (?) + {0x3E, 0x63, 0x7B, 0x7B, 0x7B, 0x03, 0x1E, 0x00}, // U+0040 (@) + {0x0C, 0x1E, 0x33, 0x33, 0x3F, 0x33, 0x33, 0x00}, // U+0041 (A) + {0x3F, 0x66, 0x66, 0x3E, 0x66, 0x66, 0x3F, 0x00}, // U+0042 (B) + {0x3C, 0x66, 0x03, 0x03, 0x03, 0x66, 0x3C, 0x00}, // U+0043 (C) + {0x1F, 0x36, 0x66, 0x66, 0x66, 0x36, 0x1F, 0x00}, // U+0044 (D) + {0x7F, 0x46, 0x16, 0x1E, 0x16, 0x46, 0x7F, 0x00}, // U+0045 (E) + {0x7F, 0x46, 0x16, 0x1E, 0x16, 0x06, 0x0F, 0x00}, // U+0046 (F) + {0x3C, 0x66, 0x03, 0x03, 0x73, 0x66, 0x7C, 0x00}, // U+0047 (G) + {0x33, 0x33, 0x33, 0x3F, 0x33, 0x33, 0x33, 0x00}, // U+0048 (H) + {0x1E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+0049 (I) + {0x78, 0x30, 0x30, 0x30, 0x33, 0x33, 0x1E, 0x00}, // U+004A (J) + {0x67, 0x66, 0x36, 0x1E, 0x36, 0x66, 0x67, 0x00}, // U+004B (K) + {0x0F, 0x06, 0x06, 0x06, 0x46, 0x66, 0x7F, 0x00}, // U+004C (L) + {0x63, 0x77, 0x7F, 0x7F, 0x6B, 0x63, 0x63, 0x00}, // U+004D (M) + {0x63, 0x67, 0x6F, 0x7B, 0x73, 0x63, 0x63, 0x00}, // U+004E (N) + {0x1C, 0x36, 0x63, 0x63, 0x63, 0x36, 0x1C, 0x00}, // U+004F (O) + {0x3F, 0x66, 0x66, 0x3E, 0x06, 0x06, 0x0F, 0x00}, // U+0050 (P) + {0x1E, 0x33, 0x33, 0x33, 0x3B, 0x1E, 0x38, 0x00}, // U+0051 (Q) + {0x3F, 0x66, 0x66, 0x3E, 0x36, 0x66, 0x67, 0x00}, // U+0052 (R) + {0x1E, 0x33, 0x07, 0x0E, 0x38, 0x33, 0x1E, 0x00}, // U+0053 (S) + {0x3F, 0x2D, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+0054 (T) + {0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x3F, 0x00}, // U+0055 (U) + {0x33, 0x33, 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x00}, // U+0056 (V) + {0x63, 0x63, 0x63, 0x6B, 0x7F, 0x77, 0x63, 0x00}, // U+0057 (W) + {0x63, 0x63, 0x36, 0x1C, 0x1C, 0x36, 0x63, 0x00}, // U+0058 (X) + {0x33, 0x33, 0x33, 0x1E, 0x0C, 0x0C, 0x1E, 0x00}, // U+0059 (Y) + {0x7F, 0x63, 0x31, 0x18, 0x4C, 0x66, 0x7F, 0x00}, // U+005A (Z) + {0x1E, 0x06, 0x06, 0x06, 0x06, 0x06, 0x1E, 0x00}, // U+005B ([) + {0x03, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x40, 0x00}, // U+005C (\) + {0x1E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1E, 0x00}, // U+005D (]) + {0x08, 0x1C, 0x36, 0x63, 0x00, 0x00, 0x00, 0x00}, // U+005E (^) + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF}, // U+005F (_) + {0x0C, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0060 (`) + {0x00, 0x00, 0x1E, 0x30, 0x3E, 0x33, 0x6E, 0x00}, // U+0061 (a) + {0x07, 0x06, 0x06, 0x3E, 0x66, 0x66, 0x3B, 0x00}, // U+0062 (b) + {0x00, 0x00, 0x1E, 0x33, 0x03, 0x33, 0x1E, 0x00}, // U+0063 (c) + {0x38, 0x30, 0x30, 0x3e, 0x33, 0x33, 0x6E, 0x00}, // U+0064 (d) + {0x00, 0x00, 0x1E, 0x33, 0x3f, 0x03, 0x1E, 0x00}, // U+0065 (e) + {0x1C, 0x36, 0x06, 0x0f, 0x06, 0x06, 0x0F, 0x00}, // U+0066 (f) + {0x00, 0x00, 0x6E, 0x33, 0x33, 0x3E, 0x30, 0x1F}, // U+0067 (g) + {0x07, 0x06, 0x36, 0x6E, 0x66, 0x66, 0x67, 0x00}, // U+0068 (h) + {0x0C, 0x00, 0x0E, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+0069 (i) + {0x30, 0x00, 0x30, 0x30, 0x30, 0x33, 0x33, 0x1E}, // U+006A (j) + {0x07, 0x06, 0x66, 0x36, 0x1E, 0x36, 0x67, 0x00}, // U+006B (k) + {0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+006C (l) + {0x00, 0x00, 0x33, 0x7F, 0x7F, 0x6B, 0x63, 0x00}, // U+006D (m) + {0x00, 0x00, 0x1F, 0x33, 0x33, 0x33, 0x33, 0x00}, // U+006E (n) + {0x00, 0x00, 0x1E, 0x33, 0x33, 0x33, 0x1E, 0x00}, // U+006F (o) + {0x00, 0x00, 0x3B, 0x66, 0x66, 0x3E, 0x06, 0x0F}, // U+0070 (p) + {0x00, 0x00, 0x6E, 0x33, 0x33, 0x3E, 0x30, 0x78}, // U+0071 (q) + {0x00, 0x00, 0x3B, 0x6E, 0x66, 0x06, 0x0F, 0x00}, // U+0072 (r) + {0x00, 0x00, 0x3E, 0x03, 0x1E, 0x30, 0x1F, 0x00}, // U+0073 (s) + {0x08, 0x0C, 0x3E, 0x0C, 0x0C, 0x2C, 0x18, 0x00}, // U+0074 (t) + {0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x6E, 0x00}, // U+0075 (u) + {0x00, 0x00, 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x00}, // U+0076 (v) + {0x00, 0x00, 0x63, 0x6B, 0x7F, 0x7F, 0x36, 0x00}, // U+0077 (w) + {0x00, 0x00, 0x63, 0x36, 0x1C, 0x36, 0x63, 0x00}, // U+0078 (x) + {0x00, 0x00, 0x33, 0x33, 0x33, 0x3E, 0x30, 0x1F}, // U+0079 (y) + {0x00, 0x00, 0x3F, 0x19, 0x0C, 0x26, 0x3F, 0x00}, // U+007A (z) + {0x38, 0x0C, 0x0C, 0x07, 0x0C, 0x0C, 0x38, 0x00}, // U+007B ({) + {0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00}, // U+007C (|) + {0x07, 0x0C, 0x0C, 0x38, 0x0C, 0x0C, 0x07, 0x00}, // U+007D (}) + {0x6E, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+007E (~) + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // U+007F + +}; + +inline NeOS::Void fb_render_string_for_bitmap(const NeOS::UInt8* bitmap, const NeOS::SizeT& x_sz, const NeOS::SizeT& y_sz, NeOS::Int32& x_dst, NeOS::Int32& y_dst, NeOS::Int32& color) +{ + NeOS::Int32 x, y; + NeOS::Int32 set; + + x = 0; + y = 0; + set = 0; + + for (; y < y_sz; ++y) + { + for (x = 0; x < x_sz; ++x) + { + set = bitmap[x] & (1 << y); + + if (set) + { + FBDrawInRegion(color, 1, 1, ((x_dst) + x), ((y_dst) + y)); + } + } + } +} + +inline NeOS::Void fb_render_string(const NeOS::Char* text, NeOS::Int32 x_dst, NeOS::Int32 y_dst, NeOS::Int32 color) +{ + for (NeOS::SizeT i = 0; text[i] != 0; ++i) + { + fb_render_string_for_bitmap(&kFontBitmap[text[i]][0], kFontSizeX, kFontSizeY, x_dst, y_dst, color); + y_dst += kFontSizeY; + } +} diff --git a/dev/modules/GPRS/.keepme b/dev/modules/GPRS/.keepme new file mode 100644 index 00000000..e69de29b diff --git a/dev/modules/HPET/.gitkeep b/dev/modules/HPET/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/modules/HPET/Defines.h b/dev/modules/HPET/Defines.h new file mode 100644 index 00000000..36df3ebd --- /dev/null +++ b/dev/modules/HPET/Defines.h @@ -0,0 +1,42 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: HPET.h + Purpose: HPET builtin. + + Revision History: + +------------------------------------------- */ + +#pragma once + +#include +#include + +namespace NeOS +{ + struct PACKED HPETAddressStructure final + { + NeOS::UInt8 AddressSpaceId; // 0 - system memory, 1 - system I/O + NeOS::UInt8 RegisterBitWidth; + NeOS::UInt8 RegisterBitOffset; + NeOS::UInt8 Reserved; + NeOS::UInt64 Address; + }; + + struct PACKED HPETHeader final : public SDT + { + NeOS::UInt8 HardwareRevId; + NeOS::UInt8 ComparatorCount : 5; + NeOS::UInt8 CounterSize : 1; + NeOS::UInt8 Reserved : 1; + NeOS::UInt8 LegacyReplacement : 1; + NeOS::UInt16 PciVendorId; + HPETAddressStructure Address; + NeOS::UInt8 HpetNumber; + NeOS::UInt16 MinimumTick; + NeOS::UInt8 PageProtection; + }; + +} // namespace NeOS diff --git a/dev/modules/IEEE802/.gitkeep b/dev/modules/IEEE802/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/modules/LTE/LTE.h b/dev/modules/LTE/LTE.h new file mode 100644 index 00000000..ef7d49f3 --- /dev/null +++ b/dev/modules/LTE/LTE.h @@ -0,0 +1,40 @@ +/* ------------------------------------------- + +Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.. + +File: LTE\LTE.h. +Purpose: LTE Standard Library. + +------------------------------------------- */ + +#ifndef _INC_NETWORK_LTE_H_ +#define _INC_NETWORK_LTE_H_ + +#include +#include + +/// @brief Long Term Evolution I/O routines. + +/// @brief Turn on SIM slot. +NeOS::Boolean lte_turn_on_sim(NeOS::Int32 simSlot); + +/// @brief Turn off SIM slot. +NeOS::Boolean lte_turn_off_sim(NeOS::Int32 simSlot); + +/// @brief Send AT command. +NeOS::Boolean lte_send_at_command(NeOS::Char* buf, + NeOS::Size bufReadSz, + NeOS::Int32 simSlot); + +NeOS::Boolean lte_write_sim_file(NeOS::Char* file, + NeOS::VoidPtr buf, + NeOS::Size bufSz, + NeOS::Size offset, + NeOS::Int32 simSlot); + +NeOS::VoidPtr lte_read_sim_file(NeOS::Char* file, + NeOS::Size bufSz, + NeOS::Size offset, + NeOS::Int32 simSlot); + +#endif // ifndef _INC_NETWORK_LTE_H_ diff --git a/dev/modules/MBCI/MBCI.h b/dev/modules/MBCI/MBCI.h new file mode 100644 index 00000000..c774df30 --- /dev/null +++ b/dev/modules/MBCI/MBCI.h @@ -0,0 +1,100 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef _INC_MODULE_MBCI_H_ +#define _INC_MODULE_MBCI_H_ + +#include +#include + +/** +- VCC (IN) (OUT for MCU) +- CLK (IN) (OUT for MCU) +- ACK (BI) (Contains an Acknowledge Packet Frame) +- D0- (IN) (Starts with the Host Interface Packet Frame) +- D1- (IN) (Starts with the Host Interface Packet Frame) +- D0+ (OUT) (Starts with the Host Interface Packet Frame) +- D1+ (OUT) (Starts with the Host Interface Packet Frame) +- GND (IN) (OUT for MCU) + */ + +#define kMBCIZeroSz (8) + +namespace NeOS +{ + struct IMBCIHost; + + enum + { + kMBCISpeedDeviceInvalid, + kMBCILowSpeedDevice, + kMBCIHighSpeedDevice, + kMBCISpeedDeviceCount, + }; + + /// @brief MBCI Host header. + struct PACKED IMBCIHost final + { + UInt32 Magic; + UInt32 HostId; + UInt16 VendorId; + UInt16 DeviceId; + UInt8 MemoryType; + UInt16 HostType; + UInt16 HostFlags; + UInt8 Error; + UInt32 MMIOTest; + UInt16 State; + UInt8 Status; + UInt8 InterruptEnable; + UInt64 BaseAddressRegister; + UInt64 BaseAddressRegisterSize; + UInt32 CommandIssue; + Char Zero[kMBCIZeroSz]; + }; + + /// @brief MBCI host flags. + enum MBCIHostFlags + { + kMBCIHostFlagsSupportsNothing, // Invalid MBCI device. + kMBCIHostFlagsSupportsAPM, // Advanced Power Management. + kMBCIHostFlagsSupportsDaisyChain, // Is daisy chained. + kMBCIHostFlagsSupportsHWInterrupts, // Has HW interrupts. + kMBCIHostFlagsSupportsDMA, // Has DMA. + kMBCIHostFlagsExtended, // Extended flags table. + }; + + /// @brief MBCI host kind. + enum MBCIHostKind + { + kMBCIHostKindHardDisk, + kMBCIHostKindOpticalDisk, + kMBCIHostKindKeyboardLow, + kMBCIHostKindMouseLow, + kMBCIHostKindMouseHigh, + kMBCIHostKindKeyboardHigh, + kMBCIHostKindNetworkInterface, + kMBCIHostKindDaisyChain, + kMBCIHostKindStartExtended, // Extended vendor table limit. + }; + + enum MBCIHostState + { + kMBCIHostStateInvalid, + kMBCIHostStateReset, + kMBCIHostStateSuccess, + kMBCIHostStateReady, + kMBCIHostStateDmaStart, + kMBCIHostStateDmaEnd, + kMBCIHostStateFail, + kMBCIHostStateCount, + }; + + /// @brief An AuthKey is a context used to decrpy data from an MBCI packet. + typedef UInt64 MBCIAuthKeyType; +} // namespace NeOS + +#endif // ifndef _INC_MODULE_MBCI_H_ diff --git a/dev/modules/MFlash/MFlash.h b/dev/modules/MFlash/MFlash.h new file mode 100644 index 00000000..a1846610 --- /dev/null +++ b/dev/modules/MFlash/MFlash.h @@ -0,0 +1,25 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#ifdef NE_USE_MBCI_FLASH + +#include + +NeOS::SizeT drv_get_sector_count(NeOS::Int32 slot); + +NeOS::SizeT drv_get_size(NeOS::Int32 slot); + +NeOS::Void drv_enable_at(NeOS::Int32 slot); + +NeOS::Void drv_disable_at(NeOS::Int32 slot); + +NeOS::Void drv_std_write(NeOS::Int32 slot, NeOS::UInt64 lba, NeOS::Char* buf, NeOS::SizeT sector_sz, NeOS::SizeT buf_sz); + +NeOS::Void drv_std_read(NeOS::Int32 slot, NeOS::UInt64 lba, NeOS::Char* buf, NeOS::SizeT sector_sz, NeOS::SizeT buf_sz); + +#endif // ifdef NE_USE_MBCI_FLASH diff --git a/dev/modules/NVME/NVME.h b/dev/modules/NVME/NVME.h new file mode 100644 index 00000000..5f8608f7 --- /dev/null +++ b/dev/modules/NVME/NVME.h @@ -0,0 +1,113 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + Revision History: + + ??/??/24: Added file (amlel) + 23 Jul 24: Update filename to Defines.h and using NE_ALIGN_NVME for NVME structs. (amlel) + +------------------------------------------- */ + +#ifndef __MODULE_NVME_H__ +#define __MODULE_NVME_H__ + +#include + +/// @file NVME.h +/// @brief NVME driver. + +#define NE_ALIGN_NVME ATTRIBUTE(aligned(sizeof(NeOS::UInt32))) + +namespace NeOS +{ + struct NE_ALIGN_NVME HAL_NVME_BAR_0 final + { + UInt32 fCapabilities; + UInt32 fVersion; + UInt32 fIntMaskSet; + UInt32 fIntMaskClr; + UInt32 fContrlConf; + UInt32 fContrlStat; + UInt32 fAdminQueueAttr; + UInt32 fAdminSubmissionQueue; + UInt32 fAdminCompletionQueue; + }; + + struct NE_ALIGN_NVME HAL_NVME_QUEUE final + { + UInt32 fOpcode; + UInt32 fNSID; + UInt32 fReserved[3]; + UInt32 fMetadataPtr[5]; + UInt32 fDataPtr[9]; + UInt32 CommandSpecific[15]; + }; + + enum + { + kInvalidNVME, + kCreateCompletionQueueNVME = 0x05, + kCreateSubmissionQueueNVME = 0x01, + kIdentifyNVME = 0x06, + kReadNVME = 0x02, + kWriteNVME = 0x01, + kCountNVME = 5, + }; + + /// @brief Creates an admin command for a DMA operation. + template + inline Bool nvme_create_admin_command(HAL_NVME_QUEUE* entry, UInt32 nsid, UInt32 prpTransfer[3], UInt32 startingLba[2], UInt32 lowTransferBlocks) + { + if (entry == nullptr) + return false; + + entry->CommandSpecific[9] = startingLba[0]; + entry->CommandSpecific[10] = startingLba[1]; + + entry->CommandSpecific[11] = lowTransferBlocks; + + entry->CommandSpecific[5] = prpTransfer[0]; + entry->CommandSpecific[6] = prpTransfer[1]; + entry->CommandSpecific[7] = prpTransfer[2]; + + entry->CommandSpecific[0] = nsid; + + return true; + } + + /// @brief Creates an I/O command for a DMA operation. + template + inline Bool nvme_create_io_command(HAL_NVME_QUEUE* entry, UInt64 baseAddress, UInt32 identLoAndQueueSizeHi, UInt32 flagsLoAndQueueComplIdHi, UInt32 identify, Bool provideIdentify = false, Bool namespaceIdentify = false) + { + if (entry == nullptr) + return false; + + if (baseAddress == 0) + return false; + + entry->fOpcode = Opcode; + + entry->CommandSpecific[5] = (baseAddress & 0xFF); + entry->CommandSpecific[6] = static_cast(baseAddress); + + if (!provideIdentify) + { + entry->CommandSpecific[9] = identLoAndQueueSizeHi; + entry->CommandSpecific[10] = flagsLoAndQueueComplIdHi; + } + else + { + entry->CommandSpecific[9] = identify; + + if (namespaceIdentify) + { + entry->CommandSpecific[0] = 1; + } + } + + return true; + } +} // namespace NeOS + +#endif // ifndef __MODULE_NVME_H__ diff --git a/dev/modules/OHCI/.gitkeep b/dev/modules/OHCI/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/modules/Pwr/PowerFactory.h b/dev/modules/Pwr/PowerFactory.h new file mode 100644 index 00000000..02d2e092 --- /dev/null +++ b/dev/modules/Pwr/PowerFactory.h @@ -0,0 +1,37 @@ +/* ------------------------------------------- + + Copyright (C) 2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include +#include +#include +#include + +#define NE_POWER_FACTORY : public PowerFactory + +namespace NeOS +{ + class PowerFactory; + + class PowerFactory + { + public: + explicit PowerFactory() = default; + virtual ~PowerFactory() = default; + + PowerFactory& operator=(const PowerFactory&) = default; + PowerFactory(const PowerFactory&) = default; + + public: + Bool Shutdown() + { + return NO; + }; // shutdown + Void Reboot(){}; // soft-reboot + }; +} // namespace NeOS \ No newline at end of file diff --git a/dev/modules/ReadMe.md b/dev/modules/ReadMe.md new file mode 100644 index 00000000..1261e247 --- /dev/null +++ b/dev/modules/ReadMe.md @@ -0,0 +1,12 @@ +# Kernel Modules + +## Brief + +They are pluggable modules for specific hardware support. + +## To-Do + +- [X] AHCI kernel module. +- [X] MBCI kernel module. + +###### Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. All rights reserved. diff --git a/dev/modules/SCSI/.gitkeep b/dev/modules/SCSI/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/modules/SCSI/SCSI.h b/dev/modules/SCSI/SCSI.h new file mode 100644 index 00000000..156bec90 --- /dev/null +++ b/dev/modules/SCSI/SCSI.h @@ -0,0 +1,15 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include + +/// @file SCSI.h +/// @brief Serial SCSI driver. + +template +using scsi_packet_type = NeOS::UInt16[PacketBitLen]; diff --git a/dev/modules/WiFi/.gitkeep b/dev/modules/WiFi/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/modules/XHCI/.gitkeep b/dev/modules/XHCI/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/dev/modules/XHCI/Defines.h b/dev/modules/XHCI/Defines.h new file mode 100644 index 00000000..e3fcce11 --- /dev/null +++ b/dev/modules/XHCI/Defines.h @@ -0,0 +1,70 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: Defines.h + Purpose: XHCI (and backwards) header. + + Revision History: + + 01/02/24: Added file (amlel) + 03/02/24: Update filename to Defines.h (amlel) + +------------------------------------------- */ + +#pragma once + +#include + +using namespace NeOS; + +#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. +*/ -- cgit v1.2.3