summaryrefslogtreecommitdiffhomepage
path: root/Private
diff options
context:
space:
mode:
authorAmlal <amlalelmahrouss@icloud.com>2024-04-28 15:13:03 +0000
committerAmlal <amlalelmahrouss@icloud.com>2024-04-28 15:13:03 +0000
commit14f10cc0b35155ddb19ec9069ebb884246e61dcf (patch)
treea988617d1c511cf04eb2c2392829a37d82a59e2e /Private
parentdb0681412191dcceb5aa99cf31fb8339d6bc4adb (diff)
parent346558208d39a036effe3a4ec232fa5df5a3c8e7 (diff)
Merged in MHR-18 (pull request #8)
MHR-18: A lot of fixes and improvements, mostly related to disk I/O and kernel stability.
Diffstat (limited to 'Private')
-rw-r--r--Private/ArchKit/ArchKit.hpp5
-rw-r--r--Private/ArchKit/compile_flags.txt1
-rw-r--r--Private/Builtins/ATA/ATA.hxx4
-rw-r--r--Private/Builtins/MBCI/MBCI.hxx22
-rw-r--r--Private/Builtins/Toolbox/Rsrc/Cursor.rsrc105
-rw-r--r--Private/FSKit/NewFS.hxx38
-rw-r--r--Private/FirmwareKit/Handover.hxx3
-rw-r--r--Private/HALKit/64x0/HalVirtualMemory.cxx2
-rw-r--r--Private/HALKit/64x0/MBCI/.gitkeep (renamed from Private/Applications/.gitkeep)0
-rw-r--r--Private/HALKit/AMD64/HalACPIFactoryInterface.cxx11
-rw-r--r--Private/HALKit/AMD64/HalControlRegister.s8
-rw-r--r--Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp2
-rw-r--r--Private/HALKit/AMD64/HalKernelMouse.cxx7
-rw-r--r--Private/HALKit/AMD64/HalPageAlloc.cpp36
-rw-r--r--Private/HALKit/AMD64/HalPageAlloc.hpp4
-rw-r--r--Private/HALKit/AMD64/Processor.hpp8
-rw-r--r--Private/HALKit/AMD64/Storage/AHCI.cxx2
-rw-r--r--Private/HALKit/AMD64/Storage/ATA-PIO.cxx138
-rw-r--r--Private/HALKit/compile_flags.txt1
-rw-r--r--Private/KernelKit/DebugOutput.hpp11
-rw-r--r--Private/KernelKit/DriveManager.hxx12
-rw-r--r--Private/KernelKit/PEFCodeManager.hxx2
-rw-r--r--Private/NewBoot/BootKit/BootKit.hxx81
-rw-r--r--Private/NewBoot/BootKit/Vendor/Support.hxx6
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootATA.cxx22
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootMain.cxx28
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootPlatform.cxx2
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/New+Delete.cxx2
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/Support.cxx16
-rw-r--r--Private/NewBoot/Source/compile_flags.txt1
-rw-r--r--Private/NewBoot/Source/makefile4
-rw-r--r--Private/NewKit/PageAllocator.hpp2
-rw-r--r--Private/NewKit/PageManager.hpp2
-rw-r--r--Private/Source/AppMain.cxx10
-rw-r--r--Private/Source/DriveManager.cxx55
-rw-r--r--Private/Source/FS/NewFS.cxx213
-rw-r--r--Private/Source/KernelCheck.cxx4
-rw-r--r--Private/Source/KernelHeap.cxx9
-rw-r--r--Private/Source/NewFS+FileManager.cxx14
-rw-r--r--Private/Source/NewFS+IO.cxx22
-rw-r--r--Private/Source/PEFCodeManager.cxx29
-rw-r--r--Private/Source/PageAllocator.cxx9
-rw-r--r--Private/Source/PageManager.cxx18
-rw-r--r--Private/Source/Pmm.cxx2
-rw-r--r--Private/Source/Storage/ATADeviceInterface.cxx22
-rw-r--r--Private/Source/Utils.cxx3
-rw-r--r--Private/Source/compile_flags.txt1
-rw-r--r--Private/compile_flags.txt1
48 files changed, 600 insertions, 400 deletions
diff --git a/Private/ArchKit/ArchKit.hpp b/Private/ArchKit/ArchKit.hpp
index d7c52108..f4654012 100644
--- a/Private/ArchKit/ArchKit.hpp
+++ b/Private/ArchKit/ArchKit.hpp
@@ -44,9 +44,4 @@ extern NewOS::Array<rt_syscall_proc,
EXTERN_C NewOS::HAL::StackFramePtr rt_get_current_context();
EXTERN_C NewOS::Void rt_do_context_switch(NewOS::HAL::StackFramePtr stackFrame);
-inline NewOS::VoidPtr kKernelVirtualStart;
-inline NewOS::UIntPtr kKernelVirtualSize;
-
-inline NewOS::VoidPtr kKernelPhysicalStart;
-
#include <FirmwareKit/Handover.hxx>
diff --git a/Private/ArchKit/compile_flags.txt b/Private/ArchKit/compile_flags.txt
index 03f62eac..a3cab89d 100644
--- a/Private/ArchKit/compile_flags.txt
+++ b/Private/ArchKit/compile_flags.txt
@@ -4,3 +4,4 @@
-I./
-I../
-I$(HOME)/
+-D__NEWOS_AMD64__
diff --git a/Private/Builtins/ATA/ATA.hxx b/Private/Builtins/ATA/ATA.hxx
index a2ce79ba..ed9d275a 100644
--- a/Private/Builtins/ATA/ATA.hxx
+++ b/Private/Builtins/ATA/ATA.hxx
@@ -148,5 +148,9 @@ NewOS::Void drv_std_read(NewOS::UInt64 Lba, NewOS::UInt16 IO, NewOS::UInt8 Maste
NewOS::Void drv_std_write(NewOS::UInt64 Lba, NewOS::UInt16 IO, NewOS::UInt8 Master, NewOS::Char* Buf,
NewOS::SizeT SectorSz, NewOS::SizeT Size);
+NewOS::SizeT drv_std_get_sector_count();
+
+NewOS::SizeT drv_std_get_drv_size();
+
#endif // ifdef __KERNEL__
#endif // ifndef __AHCI__
diff --git a/Private/Builtins/MBCI/MBCI.hxx b/Private/Builtins/MBCI/MBCI.hxx
index a41b0569..fa03e149 100644
--- a/Private/Builtins/MBCI/MBCI.hxx
+++ b/Private/Builtins/MBCI/MBCI.hxx
@@ -11,17 +11,15 @@
namespace NewOS {
struct MBCIHostInterface;
-struct MBCIDeviceInterface;
-struct MBCIPacketInterface;
/// @brief MBCI Host Interface header.
-struct MBCIHostInterface final {
+struct PACKED MBCIHostInterface final {
UInt32 HostId;
UInt16 VendorId;
UInt16 DeviceId;
UInt8 MemoryType;
- UInt8 HostType;
- UInt8 HostFlags;
+ UInt16 HostType;
+ UInt16 HostFlags;
UInt8 Error;
UInt8 Status;
UInt8 InterruptEnable;
@@ -36,6 +34,18 @@ enum MBCIHostFlags {
kMBCIHostFlagsSupportsDaisyChain, /// Is daisy chained.
kMBCIHostFlagsSupportsHWInterrupts, /// Has HW interrupts.
kMBCIHostFlagsSupportsDMA, /// Has DMA.
- kMBCIHostFlagsCount,
+ kMBCIHostFlagsExtended = __UINT16_MAX__, // Extended flags table.
+};
+
+enum MBCIHostKind {
+ kMBCIHostKindHardDisk,
+ kMBCIHostKindOpticalDisk,
+ kMBCIHostKindKeyboardLow,
+ kMBCIHostKindMouseLow,
+ kMBCIHostKindMouseHigh,
+ kMBCIHostKindKeyboardHigh,
+ kMBCIHostKindNetworkInterface,
+ kMBCIHostKindDaisyChain,
+ kMBCIHostKindStartExtended = __UINT16_MAX__, /// Extended vendor table.
};
} // namespace NewOS
diff --git a/Private/Builtins/Toolbox/Rsrc/Cursor.rsrc b/Private/Builtins/Toolbox/Rsrc/Cursor.rsrc
index cd011ab9..7943b805 100644
--- a/Private/Builtins/Toolbox/Rsrc/Cursor.rsrc
+++ b/Private/Builtins/Toolbox/Rsrc/Cursor.rsrc
@@ -1,46 +1,63 @@
-#define CURSOR_ICON_HEIGHT 40
-#define CURSOR_ICON_WIDTH 40
+#define CURSOR_HEIGHT 57
+#define CURSOR_WIDTH 53
-// array size is 4800
-static const unsigned int cursor_icon[] = {
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0x8b8b8b, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0x000000, 0x7b7b7b, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0x000000, 0x000000, 0x232323, 0xe3e3e3, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0x000000, 0x000000, 0x000000, 0x232323, 0xe3e3e3, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x9b9b9b, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x8b8b8b, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x5a5a5a, 0xf1f1f1, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 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, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x232323, 0xe3e3e3, 0xffffff, 0xffffff, 0xffffff, 0x000000, 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, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x232323, 0xd5d5d5, 0xffffff, 0xffffff, 0xffffff, 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, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x8b8b8b, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x8b8b8b, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x373737, 0xe3e3e3, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x232323, 0xe3e3e3, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0xb8b8b8, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x8b8b8b, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x7b7b7b, 0xf1f1f1, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x232323, 0xe3e3e3, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x232323, 0xd5d5d5, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x494949, 0x9a9a9a, 0xc6c6c6, 0xc6c6c6, 0xc6c6c6, 0xc6c6c6, 0xc6c6c6, 0xc6c6c6, 0xc6c6c6, 0xc6c6c6, 0xc6c6c6, 0xc6c6c6, 0xc6c6c6, 0xc6c6c6, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x8a8a8a, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x8a8a8a, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x5a5a5a, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x232323, 0xf1f1f1, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0x000000, 0x000000, 0x000000, 0x232323, 0xe3e3e3, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0x000000, 0x000000, 0x0e0e0e, 0xe3e3e3, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0x000000, 0x000000, 0xb8b8b8, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0x000000, 0x9a9a9a, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0x8a8a8a, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0xffffff, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 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, 0xffffff, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
- 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+// array size is 9063
+static const unsigned int Cursor[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0x474747, 0x474747, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x363636, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x363636, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xa5a5a5, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x686868, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x585858, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0x585858, 0x222222, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x363636, 0x000000, 0x000000, 0x000000, 0x686868, 0xebebeb, 0xf9f9f9, 0x969696, 0x000000, 0x000000, 0x000000, 0x222222, 0xdedede, 0xf9f9f9, 0xdedede, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x575757, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xdedede, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x000000, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0x575757, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x000000, 0x585858, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x000000, 0x777777, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0x474747, 0x474747, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x777777, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xcfcfcf, 0x000000, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x363636, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0xb3b3b3, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x686868, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x363636, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x222222, 0x222222, 0x363636, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x222222, 0x000000, 0x000000, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x686868, 0x686868, 0xcfcfcf, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xcfcfcf, 0xd0d0d0, 0xdedede, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x222222, 0x000000, 0x000000, 0xa5a5a5, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x000000, 0x686868, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xcfcfcf, 0x000000, 0x000000, 0x585858, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x363636, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x686868, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xd0d0d0, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x585858, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xb3b3b3, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xa5a5a5, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x0e0e0e, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x686868, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x969696, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xcfcfcf, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xb3b3b3, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x0e0e0e, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x787878, 0x000000, 0x777777, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x0e0e0e, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0xb4b4b4, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0e0e0e, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x686868, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0xb4b4b4, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x000000, 0x000000, 0xebebeb, 0xf9f9f9, 0xdedede, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xcfcfcf, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x979797, 0x000000, 0x474747, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x474747, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0x363636, 0x000000, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xececec, 0x0e0e0e, 0x000000, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0x878787, 0x000000, 0x777777, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xa5a5a5, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x343434, 0xebebeb, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x575757, 0x000000, 0x878787, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xb3b3b3, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x343434, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x0e0e0e, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x222222, 0x222222, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xc2c2c2, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x686868, 0xdedede, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x686868, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x777777, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xdedede, 0x222222, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xcfcfcf, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0x585858, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x222222, 0xc2c2c2, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xf9f9f9, 0xebebeb, 0x585858, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x474747, 0x878787, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0xa5a5a5, 0x979797, 0x686868, 0x0e0e0e, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
};
diff --git a/Private/FSKit/NewFS.hxx b/Private/FSKit/NewFS.hxx
index d3b72803..2a783b11 100644
--- a/Private/FSKit/NewFS.hxx
+++ b/Private/FSKit/NewFS.hxx
@@ -82,8 +82,8 @@ default.
#define kNewFSLbaType (NewOS::Lba)
/// Start After the PM headers, pad 1024 bytes.
-#define kNewFSAddressAsLba (1024)
-#define kNewFSCatalogStartAddress (kNewFSAddressAsLba + sizeof(NewPartitionBlock))
+#define kNewFSAddressAsLba (512)
+#define kNewFSCatalogStartAddress (1024 + sizeof(NewPartitionBlock))
#define kResourceTypeDialog 10
#define kResourceTypeString 11
@@ -117,8 +117,8 @@ struct PACKED NewCatalog final {
NewOS::Int32 Flags;
NewOS::Int32 Kind;
- NewOS::Lba FirstFork;
- NewOS::Lba LastFork;
+ NewOS::Lba DataFork;
+ NewOS::Lba ResourceFork;
NewOS::Lba NextSibling;
NewOS::Lba PrevSibling;
@@ -187,7 +187,7 @@ enum { kNewFSRsrcForkKind = 0, kNewFSDataForkKind = 1 };
/// forks...) Designed like the DOM, detects the filesystem automatically.
///
-class NewFSParser {
+class NewFSParser final {
public:
explicit NewFSParser() = default;
~NewFSParser() = default;
@@ -208,34 +208,34 @@ class NewFSParser {
/// @param name the fork name.
/// @return the fork.
_Output NewFork* FindFork(_Input NewCatalog* catalog,
- _Input const Char* name);
+ _Input const Char* name, Boolean dataOrRsrc);
- virtual _Output Void RemoveFork(_Input NewFork* fork) = 0;
+ _Output Void RemoveFork(_Input NewFork* fork);
- virtual _Output Void CloseFork(_Input NewFork* fork) = 0;
+ _Output Void CloseFork(_Input NewFork* fork);
- virtual _Output NewCatalog* FindCatalog(_Input const char* catalogName) = 0;
+ _Output NewCatalog* FindCatalog(_Input const char* catalogName);
- virtual _Output NewCatalog* GetCatalog(_Input const char* name) = 0;
+ _Output NewCatalog* GetCatalog(_Input const char* name);
- virtual _Output NewCatalog* CreateCatalog(_Input const char* name,
+ _Output NewCatalog* CreateCatalog(_Input const char* name,
_Input const Int32& flags,
_Input const Int32& kind);
- virtual _Output NewCatalog* CreateCatalog(_Input const char* name);
+ _Output NewCatalog* CreateCatalog(_Input const char* name);
- virtual bool WriteCatalog(_Input _Output NewCatalog* catalog, voidPtr data);
+ bool WriteCatalog(_Input _Output NewCatalog* catalog, voidPtr data);
- virtual VoidPtr ReadCatalog(_Input _Output NewCatalog* catalog,
- SizeT dataSz) = 0;
+ VoidPtr ReadCatalog(_Input _Output NewCatalog* catalog,
+ SizeT dataSz);
- virtual bool Seek(_Input _Output NewCatalog* catalog, SizeT off) = 0;
+ bool Seek(_Input _Output NewCatalog* catalog, SizeT off);
- virtual SizeT Tell(_Input _Output NewCatalog* catalog) = 0;
+ SizeT Tell(_Input _Output NewCatalog* catalog);
- virtual bool RemoveCatalog(_Input _Output NewCatalog* catalog) = 0;
+ bool RemoveCatalog(_Input _Output NewCatalog* catalog);
- virtual bool CloseCatalog(_InOut NewCatalog* catalog) = 0;
+ bool CloseCatalog(_InOut NewCatalog* catalog);
/// @brief Make a EPM+NewFS drive out of the disk.
/// @param drive The drive to write on.
diff --git a/Private/FirmwareKit/Handover.hxx b/Private/FirmwareKit/Handover.hxx
index afec440d..da9a3bbf 100644
--- a/Private/FirmwareKit/Handover.hxx
+++ b/Private/FirmwareKit/Handover.hxx
@@ -25,6 +25,7 @@
#define kHandoverVersion 0x1011
#define kHandoverStructSz sizeof(HEL::HandoverHeader)
+#define kHandoverHeapStart (0xfffffff80000000)
namespace NewOS::HEL {
/**
@@ -81,6 +82,8 @@ struct HandoverInformationHeader {
UInt64 f_FirmwareSpecific[8];
};
+enum { kHandoverSpecificKind, kHandoverSpecificAttrib, };
+
/// @brief Bootloader main type.
typedef void (*BootMainKind)(NewOS::HEL::HandoverInformationHeader* handoverInfo);
diff --git a/Private/HALKit/64x0/HalVirtualMemory.cxx b/Private/HALKit/64x0/HalVirtualMemory.cxx
index 2ae0f7ac..96202c00 100644
--- a/Private/HALKit/64x0/HalVirtualMemory.cxx
+++ b/Private/HALKit/64x0/HalVirtualMemory.cxx
@@ -10,5 +10,5 @@
using namespace NewOS;
/// @brief Flush system TLB, looks like the POWER version, as it acts the same, no specific instruction for that.
-/// @note The 88K MMU should be present in the die.
+/// @note The 88K MMU should be present as well.
EXTERN_C void hal_flush_tlb() { asm volatile("invltlb"); }
diff --git a/Private/Applications/.gitkeep b/Private/HALKit/64x0/MBCI/.gitkeep
index e69de29b..e69de29b 100644
--- a/Private/Applications/.gitkeep
+++ b/Private/HALKit/64x0/MBCI/.gitkeep
diff --git a/Private/HALKit/AMD64/HalACPIFactoryInterface.cxx b/Private/HALKit/AMD64/HalACPIFactoryInterface.cxx
index d18d49cf..91e0eeb6 100644
--- a/Private/HALKit/AMD64/HalACPIFactoryInterface.cxx
+++ b/Private/HALKit/AMD64/HalACPIFactoryInterface.cxx
@@ -22,10 +22,6 @@ void rt_shutdown_acpi_virtualbox(void) { HAL::Out16(0x4004, 0x3400); }
ACPIFactoryInterface::ACPIFactoryInterface(voidPtr rsdPtr)
: fRsdp(rsdPtr), fEntries(0) {
- volatile RSDP *_rsdPtr = reinterpret_cast<volatile RSDP *>(this->fRsdp);
-
- MUST_PASS(_rsdPtr);
- MUST_PASS(_rsdPtr->Revision >= 2);
}
Void ACPIFactoryInterface::Shutdown() {
@@ -60,11 +56,14 @@ ErrorOr<voidPtr> ACPIFactoryInterface::Find(const char *signature) {
return ErrorOr<voidPtr>{-4};
}
- SDT* xsdt = (SDT*)(rsdPtr->RsdtAddress + rsdPtr->XsdtAddress);
+ SDT* xsdt = (SDT*)(rsdPtr->XsdtAddress >> (rsdPtr->XsdtAddress & 0xFFF));
+
SizeT num = xsdt->Length + sizeof(SDT) / 8;
+ this->fEntries = num;
+
kcout << "ACPI: Number of entries: " << number(num) << endl;
- kcout << "ACPI: Address of XSDT: " << number((UIntPtr)xsdt) << endl;
+ kcout << "ACPI: Address of XSDT: " << hex_number((UIntPtr)xsdt) << endl;
constexpr short ACPI_SIGNATURE_LENGTH = 4;
diff --git a/Private/HALKit/AMD64/HalControlRegister.s b/Private/HALKit/AMD64/HalControlRegister.s
index 74dda36c..2a649f04 100644
--- a/Private/HALKit/AMD64/HalControlRegister.s
+++ b/Private/HALKit/AMD64/HalControlRegister.s
@@ -11,10 +11,12 @@
.globl hal_read_cr0
.globl hal_flush_tlb
-.section .text
+.text
hal_flush_tlb:
- invlpg (%rcx)
+ call hal_read_cr3
+ mov %rcx, %rax
+ call hal_write_cr3
ret
hal_read_cr3:
@@ -36,5 +38,3 @@ hal_write_cr3:
hal_write_cr0:
movq %cr0, %rdi
ret
-
-
diff --git a/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp b/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp
index 37e8f0cc..5c845812 100644
--- a/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp
+++ b/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp
@@ -6,7 +6,7 @@
#include <Builtins/ACPI/ACPIFactoryInterface.hxx>
#include <HALKit/AMD64/Processor.hpp>
-#include "NewKit/KernelCheck.hpp"
+#include <NewKit/KernelCheck.hpp>
///////////////////////////////////////////////////////////////////////////////////////
diff --git a/Private/HALKit/AMD64/HalKernelMouse.cxx b/Private/HALKit/AMD64/HalKernelMouse.cxx
index 468a595f..6321265a 100644
--- a/Private/HALKit/AMD64/HalKernelMouse.cxx
+++ b/Private/HALKit/AMD64/HalKernelMouse.cxx
@@ -6,6 +6,7 @@
#include <Builtins/PS2/PS2MouseInterface.hxx>
#include <Builtins/Toolbox/Toolbox.hxx>
+#include <Builtins/Toolbox/Rsrc/Cursor.rsrc>
#include <KernelKit/Framebuffer.hpp>
#include <NewKit/Defines.hpp>
@@ -22,6 +23,8 @@ STATIC NewOS::PS2MouseInterface kMousePS2;
STATIC NewOS::Char kMousePacket[4] = {};
STATIC NewOS::Boolean kMousePacketReady = false;
+STATIC ToolboxInitRsrc();
+
#define kPS2Leftbutton 0b00000001
#define kPS2Middlebutton 0b00000010
#define kPS2Rightbutton 0b00000100
@@ -38,7 +41,7 @@ Void hal_handle_mouse() {
switch (kMouseCycle) {
case 0:
if (kMousePacketReady) break;
- if (data & 0b00001000 == 0) break;
+ if ((data & 0b00001000) == 0) break;
kMousePacket[0] = data;
kMouseCycle++;
break;
@@ -149,4 +152,4 @@ EXTERN_C Void _hal_init_mouse() {
HAL::Out8(0x21, 0b11111001);
HAL::Out8(0xA1, 0b11101111);
-} \ No newline at end of file
+}
diff --git a/Private/HALKit/AMD64/HalPageAlloc.cpp b/Private/HALKit/AMD64/HalPageAlloc.cpp
index 3a8d3047..9ba0ea4d 100644
--- a/Private/HALKit/AMD64/HalPageAlloc.cpp
+++ b/Private/HALKit/AMD64/HalPageAlloc.cpp
@@ -10,28 +10,31 @@
#include <NewKit/KernelCheck.hpp>
STATIC NewOS::Boolean kAllocationInProgress = false;
+
namespace NewOS {
namespace HAL {
namespace Detail {
struct VirtualMemoryHeader {
- Boolean Present : 1;
- Boolean ReadWrite : 1;
- Boolean User : 1;
+ UInt32 Magic;
+ Boolean Present;
+ Boolean ReadWrite;
+ Boolean User;
+ SizeT PageSize;
};
struct VirtualMemoryHeaderTraits {
/// @brief Get next header.
- /// @param current
- /// @return
+ /// @param current
+ /// @return
VirtualMemoryHeader* Next(VirtualMemoryHeader* current) {
- return current + sizeof(PTE);
+ return current + sizeof(PTE) + current->PageSize;
}
/// @brief Get previous header.
- /// @param current
- /// @return
+ /// @param current
+ /// @return
VirtualMemoryHeader* Prev(VirtualMemoryHeader* current) {
- return current - sizeof(PTE);
+ return current - sizeof(PTE) - current->PageSize;
}
};
}
@@ -41,22 +44,27 @@ struct VirtualMemoryHeaderTraits {
/// @param rw read/write flag.
/// @param user user flag.
/// @return the page table of it.
-STATIC auto hal_try_alloc_new_page(Boolean rw, Boolean user) -> VoidPtr {
+STATIC auto hal_try_alloc_new_page(Boolean rw, Boolean user, SizeT size) -> VoidPtr {
if (kAllocationInProgress) return nullptr;
kAllocationInProgress = true;
+ constexpr auto cVMTMagic = 0xDEEFD00D;
+
///! fetch from the start.
Detail::VirtualMemoryHeader* vmHeader = reinterpret_cast<Detail::VirtualMemoryHeader*>(kKernelVirtualStart);
Detail::VirtualMemoryHeaderTraits traits;
- while (vmHeader->Present) {
+ while (vmHeader->Present &&
+ vmHeader->Magic != cVMTMagic) {
vmHeader = traits.Next(vmHeader);
}
+ vmHeader->Magic = cVMTMagic;
vmHeader->Present = true;
vmHeader->ReadWrite = rw;
vmHeader->User = user;
+ vmHeader->PageSize = size;
kAllocationInProgress = false;
@@ -67,14 +75,16 @@ STATIC auto hal_try_alloc_new_page(Boolean rw, Boolean user) -> VoidPtr {
/// @param rw read/write bit.
/// @param user user bit.
/// @return
-auto hal_alloc_page(Boolean rw, Boolean user) -> VoidPtr {
+auto hal_alloc_page(Boolean rw, Boolean user, SizeT size) -> VoidPtr {
/// Wait for a ongoing allocation to complete.
while (kAllocationInProgress) {
;
}
+ if (size == 0) ++size;
+
/// allocate new page.
- return hal_try_alloc_new_page(rw, user);
+ return hal_try_alloc_new_page(rw, user, size);
}
} // namespace HAL
} // namespace NewOS
diff --git a/Private/HALKit/AMD64/HalPageAlloc.hpp b/Private/HALKit/AMD64/HalPageAlloc.hpp
index d23c6e96..94956329 100644
--- a/Private/HALKit/AMD64/HalPageAlloc.hpp
+++ b/Private/HALKit/AMD64/HalPageAlloc.hpp
@@ -26,7 +26,7 @@
#define kPTESize (0x1000)
#endif // !kPTESize
-EXTERN_C void hal_flush_tlb(NewOS::UIntPtr pde);
+EXTERN_C void hal_flush_tlb();
EXTERN_C void hal_write_cr3(NewOS::UIntPtr pde);
EXTERN_C void hal_write_cr0(NewOS::UIntPtr bit);
@@ -72,7 +72,7 @@ struct PageDirectory64 final {
PageTable64 ALIGN(kPTEAlign) Pte[kPTEMax];
};
-VoidPtr hal_alloc_page(Boolean rw, Boolean user);
+VoidPtr hal_alloc_page(Boolean rw, Boolean user, SizeT size);
} // namespace NewOS::HAL
namespace NewOS {
diff --git a/Private/HALKit/AMD64/Processor.hpp b/Private/HALKit/AMD64/Processor.hpp
index 70452d1d..efe773da 100644
--- a/Private/HALKit/AMD64/Processor.hpp
+++ b/Private/HALKit/AMD64/Processor.hpp
@@ -16,6 +16,7 @@
#include <NewKit/Array.hpp>
#include <NewKit/Defines.hpp>
#include <NewKit/Utils.hpp>
+#include <FirmwareKit/Handover.hxx>
#ifdef kCPUBackendName
#undef kCPUBackendName
@@ -30,7 +31,7 @@
#define kTrapGate (0xEF)
#define kTaskGate (0b10001100)
#define kGdtCodeSelector (0x08)
-#define kVirtualAddressStartOffset (0x100)
+#define kVirtualAddressStartOffset (0x10000000)
namespace NewOS {
namespace Detail::AMD64 {
@@ -183,3 +184,8 @@ EXTERN_C void hal_load_gdt(NewOS::HAL::RegisterGDT ptr);
/// @brief Maximum size of the IDT.
#define kKernelIdtSize 0x100
#define kKernelInterruptId 0x32
+
+inline NewOS::VoidPtr kKernelVirtualStart = (NewOS::VoidPtr)kVirtualAddressStartOffset;
+inline NewOS::UIntPtr kKernelVirtualSize = 0UL;
+
+inline NewOS::VoidPtr kKernelPhysicalStart = nullptr;
diff --git a/Private/HALKit/AMD64/Storage/AHCI.cxx b/Private/HALKit/AMD64/Storage/AHCI.cxx
index c9db540a..80224d89 100644
--- a/Private/HALKit/AMD64/Storage/AHCI.cxx
+++ b/Private/HALKit/AMD64/Storage/AHCI.cxx
@@ -36,7 +36,7 @@ NewOS::Boolean drv_std_init(NewOS::UInt16& PortsImplemented) {
iterator[devIndex].Leak().EnableMmio(); /// enable the memory i/o for this ahci device.
kAhciDevice = iterator[devIndex].Leak(); /// and then leak the reference.
- kcout << "NewKernel: [PCI] Found AHCI controller.\r\n";
+ kcout << "New Kernel: [PCI] Found AHCI controller.\r\n";
return true;
}
diff --git a/Private/HALKit/AMD64/Storage/ATA-PIO.cxx b/Private/HALKit/AMD64/Storage/ATA-PIO.cxx
index beb113d3..6fe1e29a 100644
--- a/Private/HALKit/AMD64/Storage/ATA-PIO.cxx
+++ b/Private/HALKit/AMD64/Storage/ATA-PIO.cxx
@@ -32,21 +32,21 @@ static Int32 kATADeviceType = kATADeviceCount;
static Char kATAData[kATADataLen] = {0};
Boolean drv_std_wait_io(UInt16 IO) {
- for (int i = 0; i < 4; i++) In8(IO + ATA_REG_STATUS);
+ for (int i = 0; i < 4; i++) In8(IO + ATA_REG_STATUS);
-ATAWaitForIO_Retry:
- auto statRdy = In8(IO + ATA_REG_STATUS);
+ ATAWaitForIO_Retry:
+ auto statRdy = In8(IO + ATA_REG_STATUS);
- if ((statRdy & ATA_SR_BSY)) goto ATAWaitForIO_Retry;
+ if ((statRdy & ATA_SR_BSY)) goto ATAWaitForIO_Retry;
-ATAWaitForIO_Retry2:
- statRdy = In8(IO + ATA_REG_STATUS);
+ ATAWaitForIO_Retry2:
+ statRdy = In8(IO + ATA_REG_STATUS);
- if (statRdy & ATA_SR_ERR) return false;
+ if (statRdy & ATA_SR_ERR) return false;
- if (!(statRdy & ATA_SR_DRDY)) goto ATAWaitForIO_Retry2;
+ if (!(statRdy & ATA_SR_DRDY)) goto ATAWaitForIO_Retry2;
- return true;
+ return true;
}
Void drv_std_select(UInt16 Bus) {
@@ -58,98 +58,69 @@ Void drv_std_select(UInt16 Bus) {
Boolean drv_std_init(UInt16 Bus, UInt8 Drive, UInt16& OutBus,
UInt8& OutMaster) {
- if (drv_std_detected()) return true;
+ if (drv_std_detected()) return true;
- UInt16 IO = Bus;
+ UInt16 IO = Bus;
- drv_std_select(IO);
+ drv_std_select(IO);
- // Bus init, NEIN bit.
- Out8(IO + ATA_REG_NEIN, 1);
+ // Bus init, NEIN bit.
+ Out8(IO + ATA_REG_NEIN, 1);
- // identify until it's good.
+ // identify until it's good.
ATAInit_Retry:
- auto statRdy = In8(IO + ATA_REG_STATUS);
-
- if (statRdy & ATA_SR_ERR) {
- kcout << "New OS: ATA: Select error, not an IDE based hard-drive.\r\n";
-
- return false;
- }
-
- if ((statRdy & ATA_SR_BSY)) goto ATAInit_Retry;
-
- Out8(IO + ATA_REG_COMMAND, ATA_CMD_IDENTIFY);
-
- rt_set_memory(kATAData, 0, kATADataLen);
-
- /// fetch serial info
- /// model, speed, number of sectors...
+ auto statRdy = In8(IO + ATA_REG_STATUS);
- drv_std_wait_io(IO);
-
- for (SizeT indexData = 0ul; indexData < kATADataLen; ++indexData) {
- kATAData[indexData] = In16(IO + ATA_REG_DATA);
- }
-
- OutBus = Bus;
- OutMaster = (OutBus == ATA_PRIMARY_IO) ? ATA_MASTER : ATA_SLAVE;
+ if (statRdy & ATA_SR_ERR) {
+ return false;
+ }
- Out8(Bus + ATA_REG_HDDEVSEL, 0xA0 | ATA_MASTER << 4);
+ if ((statRdy & ATA_SR_BSY)) goto ATAInit_Retry;
- In8(Bus + ATA_REG_CONTROL);
- In8(Bus + ATA_REG_CONTROL);
- In8(Bus + ATA_REG_CONTROL);
- In8(Bus + ATA_REG_CONTROL);
+ Out8(IO + ATA_REG_COMMAND, ATA_CMD_IDENTIFY);
- unsigned cl = In8(Bus + ATA_CYL_LOW); /* get the "signature bytes" */
- unsigned ch = In8(Bus + ATA_CYL_HIGH);
+ /// fetch serial info
+ /// model, speed, number of sectors...
- /* differentiate ATA, ATAPI, SATA and SATAPI */
- if (cl == 0x14 && ch == 0xEB) {
- kcout << "New OS: PATAPI drive detected.\r\n";
- kATADeviceType = kATADevicePATA_PI;
- }
- if (cl == 0x69 && ch == 0x96) {
- kcout << "New OS: SATAPI drive detected.\r\n";
- kATADeviceType = kATADeviceSATA_PI;
- }
+ drv_std_wait_io(IO);
- if (cl == 0x0 && ch == 0x0) {
- kcout << "New OS: PATA drive detected.\r\n";
- kATADeviceType = kATADevicePATA;
- }
+ for (SizeT indexData = 0ul; indexData < kATADataLen; ++indexData) {
+ kATAData[indexData] = In16(IO + ATA_REG_DATA);
+ }
- if (cl == 0x3c && ch == 0xc3) {
- kcout << "New OS: SATA drive detected.\r\n";
- kATADeviceType = kATADeviceSATA;
- }
+ OutBus = (Bus == ATA_PRIMARY_IO) ? ATA_PRIMARY_IO : ATA_SECONDARY_IO;
- Out8(IO + ATA_REG_CONTROL, 0x02);
+ OutMaster = (Bus == ATA_PRIMARY_IO) ? ATA_MASTER : ATA_SLAVE;
- return true;
+ return true;
}
Void drv_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf,
SizeT SectorSz, SizeT Size) {
UInt8 Command = ((!Master )? 0xE0 : 0xF0);
+ Lba /= SectorSz;
+
+ drv_std_wait_io(IO);
+ drv_std_select(IO);
+
Out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F));
- Out8(IO + ATA_REG_SEC_COUNT0, 1);
+
+ Out8(IO + ATA_REG_SEC_COUNT0, 2);
Out8(IO + ATA_REG_LBA0, (Lba));
Out8(IO + ATA_REG_LBA1, (Lba) >> 8);
Out8(IO + ATA_REG_LBA2, (Lba) >> 16);
- Out8(IO + ATA_REG_LBA4, (Lba) >> 24);
+ Out8(IO + ATA_REG_LBA3, (Lba) >> 24);
Out8(IO + ATA_REG_COMMAND, ATA_CMD_READ_PIO);
drv_std_wait_io(IO);
for (SizeT IndexOff = 0; IndexOff < Size; ++IndexOff) {
- WideChar chr = In16(IO + ATA_REG_DATA);
-
- Buf[IndexOff] = chr;
+ drv_std_wait_io(IO);
+ Buf[IndexOff] = In16(IO + ATA_REG_DATA);
+ drv_std_wait_io(IO);
}
}
@@ -157,25 +128,44 @@ Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf,
SizeT SectorSz, SizeT Size) {
UInt8 Command = ((!Master) ? 0xE0 : 0xF0);
+ Lba /= SectorSz;
+
+ drv_std_wait_io(IO);
+ drv_std_select(IO);
+
Out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F));
- Out8(IO + ATA_REG_SEC_COUNT0, 1);
+
+ Out8(IO + ATA_REG_SEC_COUNT0, 2);
Out8(IO + ATA_REG_LBA0, (Lba));
Out8(IO + ATA_REG_LBA1, (Lba) >> 8);
Out8(IO + ATA_REG_LBA2, (Lba) >> 16);
- Out8(IO + ATA_REG_LBA4, (Lba) >> 24);
+ Out8(IO + ATA_REG_LBA3, (Lba) >> 24);
Out8(IO + ATA_REG_COMMAND, ATA_CMD_WRITE_PIO);
drv_std_wait_io(IO);
for (SizeT IndexOff = 0; IndexOff < Size; ++IndexOff) {
+ drv_std_wait_io(IO);
Out16(IO + ATA_REG_DATA, Buf[IndexOff]);
-
+ drv_std_wait_io(IO);
}
}
-/// @check is ATA detected?
+/// @brief is ATA detected?
Boolean drv_std_detected(Void) { return kATADetected; }
+/***
+ @brief Getter, gets the number of sectors inside the drive.
+*/
+NewOS::SizeT drv_std_get_sector_count() {
+ return (kATAData[61] << 16)| kATAData[60];
+}
+
+/// @brief Get the drive size.
+NewOS::SizeT drv_std_get_drv_size() {
+ return drv_std_get_sector_count() * kATASectorSize;
+}
+
#endif /* ifdef __ATA_PIO__ */
diff --git a/Private/HALKit/compile_flags.txt b/Private/HALKit/compile_flags.txt
index a37ae6bf..26779833 100644
--- a/Private/HALKit/compile_flags.txt
+++ b/Private/HALKit/compile_flags.txt
@@ -3,3 +3,4 @@
-std=c++20
-I./
-I../
+-D__NEWOS_AMD64__
diff --git a/Private/KernelKit/DebugOutput.hpp b/Private/KernelKit/DebugOutput.hpp
index f24933cc..6c4da58e 100644
--- a/Private/KernelKit/DebugOutput.hpp
+++ b/Private/KernelKit/DebugOutput.hpp
@@ -57,8 +57,8 @@ inline TerminalDevice carriage_return() {
namespace Detail {
inline TerminalDevice _write_number(const Long &x, TerminalDevice& term) {
- int y = x / 10;
- int h = x % 10;
+ UInt64 y = (x > 0 ? x : -x) / 10;
+ UInt64 h = (x > 0 ? x : -x) % 10;
if (y) _write_number(y, term);
@@ -81,8 +81,8 @@ inline TerminalDevice _write_number(const Long &x, TerminalDevice& term) {
}
inline TerminalDevice _write_number_hex(const Long &x, TerminalDevice& term) {
- int y = x / 16;
- int h = x % 16;
+ UInt64 y = (x > 0 ? x : -x) / 16;
+ UInt64 h = (x > 0 ? x : -x) % 16;
if (y) _write_number_hex(y, term);
@@ -94,7 +94,7 @@ inline TerminalDevice _write_number_hex(const Long &x, TerminalDevice& term) {
if (y < 0) y = -y;
- const char NUMBERS[17] = "0123456789";
+ const char NUMBERS[17] = "0123456789ABCDEF";
Char buf[2];
buf[0] = NUMBERS[h];
@@ -143,4 +143,3 @@ class DebuggerPortHeader final {
#define kcout TerminalDevice::Shared()
#define endl end_line()
-
diff --git a/Private/KernelKit/DriveManager.hxx b/Private/KernelKit/DriveManager.hxx
index c3d7c484..0fd8a0d4 100644
--- a/Private/KernelKit/DriveManager.hxx
+++ b/Private/KernelKit/DriveManager.hxx
@@ -73,12 +73,12 @@ class MountpointInterface final {
NEWOS_COPY_DEFAULT(MountpointInterface);
public:
- DriveTraitPtr A() { return mA; }
- DriveTraitPtr B() { return mB; }
- DriveTraitPtr C() { return mC; }
- DriveTraitPtr D() { return mD; }
+ DriveTrait& A() { return mA; }
+ DriveTrait& B() { return mB; }
+ DriveTrait& C() { return mC; }
+ DriveTrait& D() { return mD; }
- DriveTraitPtr* GetAddressOf(Int32 index) {
+ DriveTraitPtr GetAddressOf(Int32 index) {
DbgLastError() = kErrorSuccess;
switch (index) {
@@ -102,7 +102,7 @@ class MountpointInterface final {
}
private:
- DriveTraitPtr mA, mB, mC, mD = nullptr;
+ DriveTrait mA, mB, mC, mD;
};
/// @brief Unimplemented drive.
diff --git a/Private/KernelKit/PEFCodeManager.hxx b/Private/KernelKit/PEFCodeManager.hxx
index 80ac6e90..a928e89e 100644
--- a/Private/KernelKit/PEFCodeManager.hxx
+++ b/Private/KernelKit/PEFCodeManager.hxx
@@ -50,7 +50,7 @@ class PEFLoader : public LoaderInterface {
};
namespace Utils {
-bool execute_from_image(PEFLoader &exec) noexcept;
+bool execute_from_image(PEFLoader &exec, const Int32& procKind) noexcept;
} // namespace Utils
} // namespace NewOS
diff --git a/Private/NewBoot/BootKit/BootKit.hxx b/Private/NewBoot/BootKit/BootKit.hxx
index e2e371dd..c3e438ae 100644
--- a/Private/NewBoot/BootKit/BootKit.hxx
+++ b/Private/NewBoot/BootKit/BootKit.hxx
@@ -38,9 +38,6 @@ class BFileReader;
class BFileRunner;
class BVersionString;
-///! @note This address is reserved to NewKernel.
-#define kBootVirtualAddress (0xfffffff80000000)
-
using namespace NewOS;
typedef Char *PEFImagePtr;
@@ -188,11 +185,15 @@ public:
Char fFileName[kNewFSNodeNameLen];
Char fForkName[kNewFSNodeNameLen];
- UInt32 fKind;
+ Int32 fKind;
+ Int64 fLba;
VoidPtr fBlob;
SizeT fBlobSz;
+ bool IsCatalogValid() { return fLba != 0 && fLba >= kNewFSCatalogStartAddress; }
+
+ struct BFileDescriptor* fParent;
struct BFileDescriptor* fPrev;
struct BFileDescriptor* fNext;
};
@@ -214,7 +215,7 @@ public:
Boolean Format(const char* partName, BFileDescriptor* fileBlobs, SizeT blobCount);
/// @brief check if partition is good.
- operator bool() noexcept {
+ Bool IsPartitionValid() noexcept {
fDiskDev.Leak().mBase = (kNewFSAddressAsLba);
fDiskDev.Leak().mSize = BootDev::kSectorSize;
@@ -224,12 +225,13 @@ public:
NewPartitionBlock* blockPart = reinterpret_cast<NewPartitionBlock*>(buf);
+ BTextWriter writer;
+
for (SizeT indexMag = 0UL; indexMag < kNewFSIdentLen; ++indexMag) {
if (blockPart->Ident[indexMag] != kNewFSIdent[indexMag])
return false;
}
- BTextWriter writer;
writer.Write(L"Device Size: ").Write(this->fDiskDev.GetDiskSize()).Write(L"\r\n");
if (blockPart->DiskSize != this->fDiskDev.GetDiskSize() ||
@@ -247,32 +249,46 @@ public:
private:
/// @brief Write all of the requested catalogs into the filesystem.
- Boolean WriteContent(BFileDescriptor* fileBlobs, SizeT blobCount,
- SizeT sectorSz, NewPartitionBlock& partBlock) {
- if (sectorSz != BootDev::kSectorSize) return false;
+ /// @param fileBlobs the blobs.
+ /// @param blobCount the number of blobs to write.
+ /// @param partBlock the NewFS partition block.
+ Boolean FormatCatalog(BFileDescriptor* fileBlobs, SizeT blobCount,
+ NewPartitionBlock& partBlock) {
+ if (partBlock.SectorSize != BootDev::kSectorSize) return false;
BFileDescriptor* blob = fileBlobs;
Lba startLba = partBlock.StartCatalog;
BTextWriter writer;
- SizeT blobCounter = 0UL;
+ Char bufCatalog[sizeof(NewCatalog)] = { 0 };
+ Char bufFork[sizeof(NewFork)] = { 0 };
while (blob) {
- if (blobCounter > blobCount) break;
- ++blobCounter;
-
- NewCatalog* catalogKind = new NewCatalog();
- memset(catalogKind, 0, sizeof(NewCatalog));
+ NewCatalog* catalogKind = (NewCatalog*)bufCatalog;
+
+ blob->fLba = startLba;
+
+ if (!blob->fParent)
+ catalogKind->PrevSibling = startLba;
+ else {
+ if (blob->IsCatalogValid()) {
+ catalogKind->PrevSibling = blob->fParent->fLba;
+ } else {
+ EFI::ThrowError(L"Invalid-Catalog-Location", L"Invalid catalog location.");
+ }
+ }
/// Fill catalog kind.
catalogKind->Kind = blob->fKind;
/// Allocate fork for blob.
- catalogKind->FirstFork = (startLba + sizeof(NewCatalog));
- catalogKind->LastFork = catalogKind->FirstFork;
+ if (catalogKind->Kind == kNewFSDataForkKind) {
+ catalogKind->DataFork = (startLba + sizeof(NewCatalog));
+ } else {
+ catalogKind->ResourceFork = (startLba + sizeof(NewCatalog));
+ }
- NewFork* forkKind = new NewFork();
- memset(forkKind, 0, sizeof(NewFork));
+ NewFork* forkKind = (NewFork*)bufFork;
memcpy(forkKind->Name, blob->fForkName, strlen(blob->fForkName));
forkKind->Kind = (forkKind->Name[0] == kNewFSDataFork[0]) ? kNewFSDataForkKind : kNewFSRsrcForkKind;
@@ -284,8 +300,8 @@ private:
forkKind->ResourceKind = 0;
/// We're the only fork here.
- forkKind->NextSibling = catalogKind->FirstFork;
- forkKind->PreviousSibling = catalogKind->FirstFork;
+ forkKind->NextSibling = forkKind->Kind == kNewFSDataForkKind ? catalogKind->DataFork : catalogKind->ResourceFork;
+ forkKind->PreviousSibling = kNewFSDataForkKind ? catalogKind->DataFork : catalogKind->ResourceFork;
forkKind->DataOffset = (startLba + sizeof(NewCatalog) + sizeof(NewFork));
forkKind->DataSize = blob->fBlobSz;
@@ -300,7 +316,7 @@ private:
fDiskDev.Leak().mBase = startLba + sizeof(NewCatalog);
fDiskDev.Leak().mSize = sizeof(NewFork);
- fDiskDev.Write((Char*)forkKind, sizeof(NewFork));
+ fDiskDev.Write((Char*)bufFork, sizeof(NewFork));
do {
this->fDiskDev.Leak().mSize = BootDev::kSectorSize;
@@ -316,13 +332,8 @@ private:
catalogKind->Kind = blob->fKind;
catalogKind->Flags |= kNewFSFlagCreated;
- Lba catalogLba = (sizeof(NewCatalog) - startLba);
-
//// Now write catalog as well..
- catalogKind->PrevSibling = startLba;
- catalogKind->NextSibling = (sizeof(NewCatalog) + blob->fBlobSz);
-
/// this mime only applies to file.
if (catalogKind->Kind == kNewFSCatalogKindFile) {
memcpy(catalogKind->Mime, kBKBootFileMime, strlen(kBKBootFileMime));
@@ -332,18 +343,20 @@ private:
memcpy(catalogKind->Name, blob->fFileName, strlen(blob->fFileName));
+ catalogKind->NextSibling = startLba + (sizeof(NewCatalog) + sizeof(NewFork) + blob->fBlobSz);
+
fDiskDev.Leak().mBase = startLba;
fDiskDev.Leak().mSize = sizeof(NewCatalog);
- fDiskDev.Write((Char*)catalogKind, sizeof(NewCatalog));
+ fDiskDev.Write((Char*)bufCatalog, sizeof(NewCatalog));
startLba += (sizeof(NewCatalog) + sizeof(NewFork) + blob->fBlobSz);
--partBlock.FreeCatalog;
--partBlock.FreeSectors;
- delete forkKind;
- delete catalogKind;
+ memset(bufFork, 0, sizeof(NewFork));
+ memset(bufCatalog, 0, sizeof(NewCatalog));
blob = blob->fNext;
}
@@ -381,14 +394,14 @@ inline Boolean BDiskFormatFactory<BootDev>::Format(const char* partName,
partBlock->CatalogCount = blobCount;
partBlock->Kind = kNewFSHardDrive;
partBlock->SectorSize = sectorSz;
- partBlock->FreeCatalog = fDiskDev.GetSectorsCount() - partBlock->CatalogCount;
+ partBlock->FreeCatalog = fDiskDev.GetSectorsCount();
partBlock->SectorCount = fDiskDev.GetSectorsCount();
- partBlock->FreeSectors = fDiskDev.GetSectorsCount() - partBlock->CatalogCount;
+ partBlock->FreeSectors = fDiskDev.GetSectorsCount();
partBlock->StartCatalog = kNewFSCatalogStartAddress;
partBlock->DiskSize = fDiskDev.GetDiskSize();
- if (this->WriteContent(fileBlobs, blobCount, sectorSz, *partBlock)) {
- fDiskDev.Leak().mBase = (kNewFSAddressAsLba);
+ if (this->FormatCatalog(fileBlobs, blobCount, *partBlock)) {
+ fDiskDev.Leak().mBase = kNewFSAddressAsLba;
fDiskDev.Leak().mSize = sectorSz;
fDiskDev.Write(buf, sectorSz);
diff --git a/Private/NewBoot/BootKit/Vendor/Support.hxx b/Private/NewBoot/BootKit/Vendor/Support.hxx
index 4d35b4cb..b4ba4f68 100644
--- a/Private/NewBoot/BootKit/Vendor/Support.hxx
+++ b/Private/NewBoot/BootKit/Vendor/Support.hxx
@@ -13,9 +13,9 @@
#define LONG_MAX ((long)(~0UL>>1))
#define LONG_MIN (~LONG_MAX)
-#define SetMem(dst, c, sz) BSetMem((CharacterTypeUTF16 *)dst, c, sz)
-#define MoveMem(dst, src, sz) BCopyMem((CharacterTypeUTF16 *)dst, (CharacterTypeUTF16 *)src, sz)
-#define CopyMem(dst, src, sz) BCopyMem((CharacterTypeUTF16 *)dst, (CharacterTypeUTF16 *)src, sz)
+#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)
inline int isspace(int c) { return c == ' '; }
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx b/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
index 8ab7dc20..d6b5542c 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx
@@ -88,7 +88,7 @@ ATAInit_Retry:
boot_ata_wait_io(IO);
for (SizeT indexData = 0ul; indexData < kATADataLen; ++indexData) {
- kATAData[indexData] = In8(IO + ATA_REG_DATA);
+ kATAData[indexData] = In16(IO + ATA_REG_DATA);
}
OutBus =
@@ -107,18 +107,22 @@ Void boot_ata_read(UInt64 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf,
boot_ata_select(IO);
Out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F));
- Out8(IO + ATA_REG_SEC_COUNT0, 1);
+
+ Out8(IO + ATA_REG_SEC_COUNT0, 2);
Out8(IO + ATA_REG_LBA0, (Lba));
Out8(IO + ATA_REG_LBA1, (Lba) >> 8);
Out8(IO + ATA_REG_LBA2, (Lba) >> 16);
- Out8(IO + ATA_REG_LBA4, (Lba) >> 24);
+ Out8(IO + ATA_REG_LBA3, (Lba) >> 24);
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] = In16(IO + ATA_REG_DATA);
+ boot_ata_wait_io(IO);
}
}
@@ -130,18 +134,22 @@ Void boot_ata_write(UInt64 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf,
boot_ata_select(IO);
Out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F));
- Out8(IO + ATA_REG_SEC_COUNT0, 1);
+
+ Out8(IO + ATA_REG_SEC_COUNT0, 2);
Out8(IO + ATA_REG_LBA0, (Lba));
Out8(IO + ATA_REG_LBA1, (Lba) >> 8);
Out8(IO + ATA_REG_LBA2, (Lba) >> 16);
- Out8(IO + ATA_REG_LBA4, (Lba) >> 24);
+ Out8(IO + ATA_REG_LBA3, (Lba) >> 24);
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);
Out16(IO + ATA_REG_DATA, Buf[IndexOff]);
+ boot_ata_wait_io(IO);
}
}
@@ -188,7 +196,7 @@ BootDeviceATA& BootDeviceATA::Read(CharacterTypeUTF8* Buf, const SizeT& SectorSz
if (!Buf || SectorSz < 1) return *this;
- auto lba = this->Leak().mBase / BootDeviceATA::kSectorSize;
+ auto lba = this->Leak().mBase / SectorSz;
boot_ata_read(lba, this->Leak().mBus, this->Leak().mMaster,
Buf, SectorSz, this->Leak().mSize);
@@ -211,7 +219,7 @@ BootDeviceATA& BootDeviceATA::Write(CharacterTypeUTF8* Buf, const SizeT& SectorS
if (!Buf || SectorSz < 1) return *this;
- auto lba = this->Leak().mBase / BootDeviceATA::kSectorSize;
+ auto lba = this->Leak().mBase / SectorSz;
boot_ata_write(lba, this->Leak().mBus, this->Leak().mMaster,
Buf, SectorSz, this->Leak().mSize);
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
index 558bf001..2939c182 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
@@ -12,6 +12,7 @@
#include <NewKit/Macros.hpp>
#include <BootKit/BootKit.hxx>
#include <NewKit/Ref.hpp>
+#include <FirmwareKit/Handover.hxx>
#include <cstring>
/// make the compiler shut up.
@@ -21,13 +22,11 @@
/** Graphics related. */
-EXTERN_C Void hal_init_platform(HEL::HandoverInformationHeader* HIH);
-
STATIC EfiGraphicsOutputProtocol* kGop = nullptr;
STATIC UInt16 kStride = 0U;
STATIC EfiGUID kGopGuid;
-EXTERN_C Void rt_jump_to_address(VoidPtr blob);
+EXTERN_C Void hal_init_platform(HEL::HandoverInformationHeader* HIH);
/**
@brief Finds and stores the GOP.
@@ -66,7 +65,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
writer.Write(L"Mahrouss-Logic (R) New Boot: ")
.Write(BVersionString::Shared());
- writer.Write(L"\r\nNewBoot: Firmware Vendor: ")
+ writer.Write(L"\r\nNew Boot: Firmware Vendor: ")
.Write(SystemTable->FirmwareVendor)
.Write(L"\r\n");
@@ -76,6 +75,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
UInt32* SzDesc = new UInt32();
UInt32* RevDesc = new UInt32();
+ *MapKey = 0;
*SizePtr = sizeof(EfiMemoryDescriptor);
HEL::HandoverInformationHeader* handoverHdrPtr = new HEL::HandoverInformationHeader();
@@ -125,19 +125,12 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
ToolboxClearRsrc();
- EfiPhysicalAddress* whereAddress =
- reinterpret_cast<EfiPhysicalAddress*>(kBootVirtualAddress);
-
BS->GetMemoryMap(SizePtr, Descriptor, MapKey, SzDesc, RevDesc);
handoverHdrPtr->f_PhysicalStart = (VoidPtr)Descriptor->PhysicalStart;
- handoverHdrPtr->f_FirmwareSpecific[0] = Descriptor->Attribute;
- handoverHdrPtr->f_FirmwareSpecific[1] = Descriptor->Kind;
-
-
- BS->AllocatePages(EfiAllocateType::AllocateAnyPages,
- EfiMemoryType::EfiConventionalMemory, 1, whereAddress);
+ handoverHdrPtr->f_FirmwareSpecific[HEL::kHandoverSpecificAttrib] = Descriptor->Attribute;
+ handoverHdrPtr->f_FirmwareSpecific[HEL::kHandoverSpecificKind] = Descriptor->Kind;
handoverHdrPtr->f_VirtualStart = (VoidPtr)Descriptor->VirtualStart;
handoverHdrPtr->f_VirtualSize = Descriptor->NumberOfPages; /* # of pages */
@@ -170,7 +163,9 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
BDiskFormatFactory<BootDeviceATA> diskFormatter;
- if (!diskFormatter) {
+ /// if not formated yet, then format it with the following folders:
+ /// /, /Boot, /Applications.
+ if (!diskFormatter.IsPartitionValid()) {
BDiskFormatFactory<BootDeviceATA>::BFileDescriptor rootDesc{0};
memcpy(rootDesc.fFileName, "/", strlen("/"));
@@ -178,6 +173,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
rootDesc.fBlobSz = BootDeviceATA::kSectorSize;
rootDesc.fBlob = new Char[rootDesc.fBlobSz];
+ rootDesc.fParent = &rootDesc;
memset(rootDesc.fBlob, 0, rootDesc.fBlobSz);
@@ -195,6 +191,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
bootDesc.fBlobSz = BootDeviceATA::kSectorSize;
bootDesc.fBlob = new Char[bootDesc.fBlobSz];
+ bootDesc.fParent = &rootDesc;
memset(bootDesc.fBlob, 0, bootDesc.fBlobSz);
@@ -213,6 +210,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
appDesc.fBlobSz = BootDeviceATA::kSectorSize;
appDesc.fBlob = new Char[appDesc.fBlobSz];
+ appDesc.fParent = &rootDesc;
memset(appDesc.fBlob, 0, appDesc.fBlobSz);
@@ -229,7 +227,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
EFI::ExitBootServices(*MapKey, ImageHandle);
- hal_init_platform(kHandoverHeader);
+ hal_init_platform(handoverHdrPtr);
EFI::Stop();
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootPlatform.cxx b/Private/NewBoot/Source/HEL/AMD64/BootPlatform.cxx
index 2ac90dd8..fa735142 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootPlatform.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootPlatform.cxx
@@ -9,7 +9,7 @@
#include <BootKit/BootKit.hxx>
#include "HALKit/AMD64/Processor.hpp"
-#if 0
+#ifdef __STANDALONE__
EXTERN_C void rt_hlt() { asm volatile("hlt"); }
diff --git a/Private/NewBoot/Source/HEL/AMD64/New+Delete.cxx b/Private/NewBoot/Source/HEL/AMD64/New+Delete.cxx
index 909ccca6..8d811bd9 100644
--- a/Private/NewBoot/Source/HEL/AMD64/New+Delete.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/New+Delete.cxx
@@ -9,7 +9,7 @@
#include <BootKit/BootKit.hxx>
#include <cstddef> /* Since we're using GCC for this EFI program. */
-#if 0
+#ifdef __STANDALONE__
/// @brief Allocates a new object.
/// @param sz the size.
diff --git a/Private/NewBoot/Source/HEL/AMD64/Support.cxx b/Private/NewBoot/Source/HEL/AMD64/Support.cxx
index a8e2c275..3a6974bb 100644
--- a/Private/NewBoot/Source/HEL/AMD64/Support.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/Support.cxx
@@ -8,7 +8,7 @@
#include <FirmwareKit/Handover.hxx>
#include <BootKit/Vendor/Support.hxx>
-#if 0
+#ifdef __STANDALONE__
/// @brief memset definition in C++.
/// @param dst destination pointer.
@@ -16,8 +16,11 @@
/// @param len length of of src.
EXTERN_C VoidPtr memset(void *dst, int byte,
long long unsigned int len) {
- SetMem(dst, byte, len);
- return dst;
+ for (size_t i = 0UL; i < len; ++i) {
+ ((int*)dst)[i] = byte;
+ }
+
+ return dst;
}
/// @brief memcpy definition in C++.
@@ -26,8 +29,11 @@ EXTERN_C VoidPtr memset(void *dst, int byte,
/// @param len length of of src.
EXTERN_C VoidPtr memcpy(void *dst, const void *src,
long long unsigned int len) {
- CopyMem(dst, src, len);
- return dst;
+ for (size_t i = 0UL; i < len; ++i){
+ ((int*)dst)[i] = ((int*)src)[i];
+ }
+
+ return dst;
}
/// @brief strlen definition in C++.
diff --git a/Private/NewBoot/Source/compile_flags.txt b/Private/NewBoot/Source/compile_flags.txt
index e58d7ab9..c74d22b2 100644
--- a/Private/NewBoot/Source/compile_flags.txt
+++ b/Private/NewBoot/Source/compile_flags.txt
@@ -1,3 +1,4 @@
-std=c++20
-I../
-I../../
+-D__NEWOS_AMD64__
diff --git a/Private/NewBoot/Source/makefile b/Private/NewBoot/Source/makefile
index f3a292c5..9f70d903 100644
--- a/Private/NewBoot/Source/makefile
+++ b/Private/NewBoot/Source/makefile
@@ -75,8 +75,8 @@ run-efi-amd64:
.PHONY: epm-img
epm-img:
- qemu-img create -f qcow2 $(IMG) 512M
- qemu-img create -f qcow2 $(IMG_2) 512M
+ qemu-img create -f raw $(IMG) 512M
+ qemu-img create -f raw $(IMG_2) 512M
.PHONY: download-edk
download-edk:
diff --git a/Private/NewKit/PageAllocator.hpp b/Private/NewKit/PageAllocator.hpp
index 6d9478cb..0d8377b0 100644
--- a/Private/NewKit/PageAllocator.hpp
+++ b/Private/NewKit/PageAllocator.hpp
@@ -12,7 +12,7 @@
namespace NewOS {
namespace Detail {
-VoidPtr create_page_wrapper(Boolean rw, Boolean user);
+VoidPtr create_page_wrapper(Boolean rw, Boolean user, SizeT pageSz);
void exec_disable(UIntPtr addr);
bool page_disable(UIntPtr addr);
} // namespace Detail
diff --git a/Private/NewKit/PageManager.hpp b/Private/NewKit/PageManager.hpp
index c8806c90..05965306 100644
--- a/Private/NewKit/PageManager.hpp
+++ b/Private/NewKit/PageManager.hpp
@@ -66,7 +66,7 @@ struct PageManager final {
PageManager(const PageManager &) = default;
public:
- PTEWrapper Request(Boolean Rw, Boolean User, Boolean ExecDisable);
+ PTEWrapper Request(Boolean Rw, Boolean User, Boolean ExecDisable, SizeT Sz);
bool Free(Ref<PTEWrapper *> &wrapper);
private:
diff --git a/Private/Source/AppMain.cxx b/Private/Source/AppMain.cxx
index 87705393..8fa74459 100644
--- a/Private/Source/AppMain.cxx
+++ b/Private/Source/AppMain.cxx
@@ -20,12 +20,18 @@
EXTERN_C NewOS::Void AppMain(NewOS::Void) {
///! Mounts a NewFS block.
NewOS::NewFilesystemManager* newFS = new NewOS::NewFilesystemManager();
- NewOS::ke_protect_ke_heap(newFS);
NewOS::FilesystemManagerInterface::Mount(newFS);
+ if (newFS->GetImpl()) {
+ auto catalog = newFS->GetImpl()->GetCatalog("/Boot");
+ if (catalog) {
+ NewOS::kcout << "Catalog-Path-Name: " << catalog->Name << NewOS::endl;
+ delete catalog;
+ }
+ }
+
while (NewOS::ProcessScheduler::Shared().Leak().Run() > 0);
- ///! we're done, unmount.
delete newFS;
}
diff --git a/Private/Source/DriveManager.cxx b/Private/Source/DriveManager.cxx
index 86478831..41f4f4ab 100644
--- a/Private/Source/DriveManager.cxx
+++ b/Private/Source/DriveManager.cxx
@@ -18,73 +18,82 @@ static UInt16 kATAIO = 0U;
static UInt8 kATAMaster = 0U;
/// @brief reads from an ATA drive.
-/// @param pckt
-/// @return
+/// @param pckt
+/// @return
Void ke_drv_input(DriveTrait::DrivePacket* pckt) {
if (!pckt) {
return;
}
-
+
pckt->fPacketGood = false;
#ifdef __AHCI__
- drv_std_read(pckt->fLba, (Char*)pckt->fPacketContent, 1, pckt->fPacketSize);
+ drv_std_read(pckt->fLba, (Char*)pckt->fPacketContent, kAHCISectorSize, pckt->fPacketSize);
#elif defined(__ATA_PIO__) || defined(__ATA_DMA__)
- drv_std_read(pckt->fLba, kATAIO, kATAMaster, (Char*)pckt->fPacketContent, 1, pckt->fPacketSize);
+ drv_std_read(pckt->fLba, kATAIO, kATAMaster, (Char*)pckt->fPacketContent, kATASectorSize, pckt->fPacketSize);
#endif
-
pckt->fPacketGood = true;
}
/// @brief Writes to an ATA drive.
-/// @param pckt
-/// @return
+/// @param pckt
+/// @return
Void ke_drv_output(DriveTrait::DrivePacket* pckt) {
if (!pckt) {
return;
}
-
+
pckt->fPacketGood = false;
#ifdef __AHCI__
- drv_std_write(pckt->fLba,(Char*)pckt->fPacketContent, 1, pckt->fPacketSize);
+ drv_std_write(pckt->fLba,(Char*)pckt->fPacketContent, kATASectorSize, pckt->fPacketSize);
#elif defined(__ATA_PIO__) || defined(__ATA_DMA__)
- drv_std_write(pckt->fLba, kATAIO, kATAMaster, (Char*)pckt->fPacketContent, 1, pckt->fPacketSize);
+ drv_std_write(pckt->fLba, kATAIO, kATAMaster, (Char*)pckt->fPacketContent, kATASectorSize, pckt->fPacketSize);
#endif
pckt->fPacketGood = true;
}
/// @brief Executes a disk check on the ATA drive.
-/// @param pckt
-/// @return
+/// @param pckt
+/// @return
Void ke_drv_check_disk(DriveTrait::DrivePacket* pckt) {
if (!pckt) {
return;
}
-
+
pckt->fPacketGood = false;
+
+
+#if defined(__ATA_PIO__) || defined (__ATA_DMA__)
+ kATAMaster = true;
+ kATAIO = ATA_PRIMARY_IO;
+
+ MUST_PASS(drv_std_init(kATAIO, kATAMaster, kATAIO, kATAMaster));
+#endif // if defined(__ATA_PIO__) || defined (__ATA_DMA__)
+
+ pckt->fPacketGood = true;
}
/// @brief Gets the drive kind (ATA, SCSI, AHCI...)
-/// @param
-/// @return
-#ifdef __ATA_PIO__
+/// @param
+/// @return
+#ifdef __ATA_PIO__
const Char* ke_drive_kind(Void) { return "ATA-PIO"; }
#endif
-#ifdef __ATA_DMA__
+#ifdef __ATA_DMA__
const Char* ke_drive_kind(Void) { return "ATA-DMA"; }
#endif
-#ifdef __AHCI__
+#ifdef __AHCI__
const Char* ke_drive_kind(Void) { return "AHCI"; }
#endif
/// @brief Unimplemented drive.
-/// @param pckt
-/// @return
+/// @param pckt
+/// @return
Void ke_drv_unimplemented(DriveTrait::DrivePacket* pckt) {}
/// @brief Makes a new drive.
@@ -98,6 +107,7 @@ DriveTrait construct_drive() noexcept {
trait.fInput = ke_drv_unimplemented;
trait.fOutput = ke_drv_unimplemented;
trait.fVerify = ke_drv_unimplemented;
+ trait.fDriveKind = ke_drive_kind;
return trait;
}
@@ -107,12 +117,13 @@ DriveTrait construct_drive() noexcept {
DriveTrait construct_main_drive() noexcept {
DriveTrait trait;
- rt_copy_memory((VoidPtr)"/Mount/Disk/0", trait.fName, rt_string_len("/Mount/Disk/0"));
+ rt_copy_memory((VoidPtr)"/Mount/MainDisk/", trait.fName, rt_string_len("/Mount/MainDisk/"));
trait.fKind = kMassStorage | kEPMDrive;
trait.fInput = ke_drv_input;
trait.fOutput = ke_drv_output;
trait.fVerify = ke_drv_check_disk;
+ trait.fDriveKind = ke_drive_kind;
return trait;
}
diff --git a/Private/Source/FS/NewFS.cxx b/Private/Source/FS/NewFS.cxx
index 7eb79d10..a5dfe45b 100644
--- a/Private/Source/FS/NewFS.cxx
+++ b/Private/Source/FS/NewFS.cxx
@@ -10,12 +10,15 @@
#include <KernelKit/HError.hpp>
#include <NewKit/Crc32.hpp>
#include <NewKit/Utils.hpp>
+#include <NewKit/String.hpp>
+#include <Builtins/ATA/ATA.hxx>
+#include <Builtins/AHCI/AHCI.hxx>
using namespace NewOS;
/// forward decl.
-STATIC Lba ke_find_free_fork(SizeT sz, Int32 drv, NewCatalog* catalog);
+STATIC Lba ke_find_free_fork(SizeT sz, Int32 drv, NewCatalog* catalog, Boolean isDataFork);
STATIC Lba ke_find_free_catalog(SizeT kind, Int32 drv);
STATIC MountpointInterface sMountpointInterface;
@@ -30,28 +33,36 @@ _Output NewFork* NewFSParser::CreateFork(_Input NewCatalog* catalog,
Lba whereFork = 0;
theFork.DataOffset =
- ke_find_free_fork(theFork.DataSize, this->fDriveIndex, catalog);
+ ke_find_free_fork(theFork.DataSize, this->fDriveIndex, catalog, theFork.Kind == kNewFSDataForkKind);
theFork.Flags |= kNewFSFlagCreated;
+ Lba lba = theFork.Kind == kNewFSDataForkKind ? catalog->DataFork : catalog->ResourceFork;
- if (catalog->FirstFork == 0) {
- catalog->FirstFork = whereFork;
+ if (lba == 0) {
+ lba = whereFork;
} else {
- if (catalog->LastFork == 0) {
- theFork.PreviousSibling = catalog->FirstFork;
+ if (lba == 0) {
+ theFork.PreviousSibling = lba;
}
}
- if (catalog->LastFork == 0) {
- catalog->LastFork = whereFork;
+ if (theFork.Kind == kNewFSDataForkKind) {
+ if (catalog->DataFork == 0) {
+ catalog->DataFork = whereFork;
+ } else {
+ theFork.PreviousSibling = catalog->DataFork;
+ }
} else {
- theFork.PreviousSibling = catalog->LastFork;
+ if (catalog->ResourceFork == 0) {
+ catalog->ResourceFork = whereFork;
+ } else {
+ theFork.PreviousSibling = catalog->ResourceFork;
+ }
}
- if (!sMountpointInterface.GetAddressOf(this->fDriveIndex) ||
- !*sMountpointInterface.GetAddressOf(this->fDriveIndex))
+ if (!sMountpointInterface.GetAddressOf(this->fDriveIndex))
return nullptr;
- auto drv = *sMountpointInterface.GetAddressOf(this->fDriveIndex);
+ auto drv = sMountpointInterface.GetAddressOf(this->fDriveIndex);
drv->fPacket.fLba = whereFork;
drv->fPacket.fPacketSize = theFork.DataSize;
@@ -92,10 +103,10 @@ _Output NewFork* NewFSParser::CreateFork(_Input NewCatalog* catalog,
/// @param name the fork name.
/// @return the fork.
_Output NewFork* NewFSParser::FindFork(_Input NewCatalog* catalog,
- _Input const Char* name) {
- auto drv = *sMountpointInterface.GetAddressOf(this->fDriveIndex);
+ _Input const Char* name, Boolean isDataFork) {
+ auto drv = sMountpointInterface.GetAddressOf(this->fDriveIndex);
NewFork* theFork = nullptr;
- Lba lba = catalog->FirstFork;
+ Lba lba = isDataFork ? catalog->DataFork : catalog->ResourceFork;
while (lba != 0) {
drv->fPacket.fLba = lba;
@@ -165,7 +176,7 @@ bool NewFSParser::Format(_Input _Output DriveTrait* drive) {
return false;
}
- Char sectorBuf[kNewFSMinimumSectorSz] = {0};
+ UInt16 sectorBuf[kNewFSMinimumSectorSz] = {0};
drive->fPacket.fPacketContent = sectorBuf;
drive->fPacket.fPacketSize = kNewFSMinimumSectorSz;
@@ -184,15 +195,15 @@ bool NewFSParser::Format(_Input _Output DriveTrait* drive) {
rt_copy_memory((VoidPtr)kNewFSIdent, (VoidPtr)partBlock->Ident,
kNewFSIdentLen);
- rt_copy_memory((VoidPtr) "New OS\0", (VoidPtr)partBlock->PartitionName,
- rt_string_len("New OS\0"));
+ rt_copy_memory((VoidPtr) "Untitled HD\0", (VoidPtr)partBlock->PartitionName,
+ rt_string_len("Untitled HD\0"));
SizeT catalogCount = 0;
- SizeT sectorCount = 0;
- SizeT diskSize = 0;
+ SizeT sectorCount = drv_std_get_sector_count();
+ SizeT diskSize = drv_std_get_drv_size();
partBlock->Kind = kNewFSPartitionTypeStandard;
- partBlock->StartCatalog = sizeof(NewPartitionBlock) + kNewFSAddressAsLba;
+ partBlock->StartCatalog = kNewFSCatalogStartAddress;;
partBlock->CatalogCount = catalogCount;
partBlock->SectorCount = sectorCount;
partBlock->DiskSize = diskSize;
@@ -229,27 +240,90 @@ bool NewFSParser::WriteCatalog(_Input _Output NewCatalog* catalog,
/// @param catalogName
/// @return
_Output NewCatalog* NewFSParser::FindCatalog(_Input const char* catalogName) {
- return nullptr;
+ if (!sMountpointInterface.GetAddressOf(this->fDriveIndex)) return nullptr;
+
+ Char* sectorBuf = new Char[sizeof(NewPartitionBlock)];
+ auto drive = sMountpointInterface.GetAddressOf(this->fDriveIndex);
+
+ drive->fPacket.fPacketContent = sectorBuf;
+ drive->fPacket.fPacketSize = sizeof(NewPartitionBlock);
+ drive->fPacket.fLba = kNewFSAddressAsLba;
+
+ drive->fInput(&drive->fPacket);
+
+ NewPartitionBlock* part = (NewPartitionBlock*)sectorBuf;
+
+ kcout << "Drive-Kind: " << drive->fDriveKind() << endl;
+
+ kcout << "Partition-Name: " << part->PartitionName << endl;
+ kcout << "Start-Catalog: " << number(part->StartCatalog) << endl;
+ kcout << "Catalog-Count: " << number(part->CatalogCount) << endl;
+ kcout << "Free-Catalog: " << number(part->FreeCatalog) << endl;
+ kcout << "Free-Sectors: " << number(part->FreeSectors) << endl;
+ kcout << "Sector-Size: " << number(part->SectorSize) << endl;
+
+ auto start = part->StartCatalog;
+
+ drive->fPacket.fLba = start;
+ drive->fPacket.fPacketContent = sectorBuf;
+ drive->fPacket.fPacketSize = sizeof(NewCatalog);
+
+ drive->fInput(&drive->fPacket);
+
+ while (drive->fPacket.fPacketGood) {
+ NewCatalog* catalog = (NewCatalog*)sectorBuf;
+
+ if (StringBuilder::Equals(catalogName, catalog->Name)) {
+ NewCatalog* catalogPtr = new NewCatalog();
+ rt_copy_memory(catalog, catalogPtr, sizeof(NewCatalog));
+
+ delete[] sectorBuf;
+ return catalogPtr;
+ }
+
+ if (catalog->NextSibling == 0)
+ break;
+
+ drive->fPacket.fLba = catalog->NextSibling;
+ drive->fPacket.fPacketSize = kNewFSMinimumSectorSz;
+ drive->fInput(&drive->fPacket);
+ }
+
+ delete[] sectorBuf;
+
+ return nullptr;
}
/// @brief
/// @param name
/// @return
_Output NewCatalog* NewFSParser::GetCatalog(_Input const char* name) {
- return nullptr;
+ return this->FindCatalog(name);
}
/// @brief
/// @param catalog
/// @return
Boolean NewFSParser::CloseCatalog(_Input _Output NewCatalog* catalog) {
- return true;
+ if (this->WriteCatalog(catalog, nullptr)) {
+ delete catalog;
+ catalog = nullptr;
+
+ return true;
+ }
+
+ return false;
}
/// @brief Mark catalog as removed.
/// @param catalog The catalog structure.
/// @return
Boolean NewFSParser::RemoveCatalog(_Input _Output NewCatalog* catalog) {
+ if (!catalog) {
+ DbgLastError() = kErrorFileNotFound;
+ return false;
+ }
+
catalog->Flags |= kNewFSFlagDeleted;
this->WriteCatalog(catalog, nullptr);
@@ -260,54 +334,72 @@ Boolean NewFSParser::RemoveCatalog(_Input _Output NewCatalog* catalog) {
/// Reading,Seek,Tell are unimplemented on catalogs, refer to forks I/O instead.
/// ***************************************************************** ///
-/// @brief
+/// @brief Read the catalog data fork.
/// @param catalog
/// @param dataSz
/// @return
VoidPtr NewFSParser::ReadCatalog(_Input _Output NewCatalog* catalog,
SizeT dataSz) {
- return nullptr;
+ if (!catalog) {
+ DbgLastError() = kErrorFileNotFound;
+ return nullptr;
+ }
+
+ return nullptr;
}
-/// @brief
+/// @brief Seek in the data fork.
/// @param catalog
/// @param off
/// @return
bool NewFSParser::Seek(_Input _Output NewCatalog* catalog, SizeT off) {
- return false;
+ if (!catalog) {
+ DbgLastError() = kErrorFileNotFound;
+ return false;
+ }
+
+ return false;
}
-/// @brief
+/// @brief Tell where we are inside the data fork.
/// @param catalog
/// @return
-SizeT NewFSParser::Tell(_Input _Output NewCatalog* catalog) { return 0; }
+SizeT NewFSParser::Tell(_Input _Output NewCatalog* catalog) {
+ if (!catalog) {
+ DbgLastError() = kErrorFileNotFound;
+ return false;
+ }
+
+ return 0;
+}
/// @brief Find a free fork inside the filesystem.
/// @param sz the size of the fork to set.
/// @return the valid lba.
-STATIC Lba ke_find_free_fork(SizeT sz, Int32 drv, NewCatalog* catalog) {
- auto drive = *sMountpointInterface.GetAddressOf(drv);
+STATIC Lba ke_find_free_fork(SizeT sz, Int32 drv, NewCatalog* catalog, Boolean isDataFork) {
+
+ if (sMountpointInterface.GetAddressOf(drv)) {
+ auto drive = *sMountpointInterface.GetAddressOf(drv);
- if (drive) {
/// prepare packet.
bool done = false;
bool error = false;
- Lba lba = catalog->LastFork;
+ Lba lba = isDataFork ? catalog->DataFork : catalog->ResourceFork;
while (!done) {
- Char sectorBuf[kNewFSMinimumSectorSz] = {0};
+ UInt16 sectorBuf[kNewFSMinimumSectorSz] = {0};
- drive->fPacket.fPacketContent = sectorBuf;
- drive->fPacket.fPacketSize = kNewFSMinimumSectorSz;
- drive->fPacket.fLba = lba;
+ drive.fPacket.fPacketContent = sectorBuf;
+ drive.fPacket.fPacketSize = kNewFSMinimumSectorSz;
+ drive.fPacket.fLba = lba;
- drive->fInput(&drive->fPacket);
+ drive.fInput(&drive.fPacket);
- if (!drive->fPacket.fPacketGood) {
+ if (!drive.fPacket.fPacketGood) {
///! not a lot of choices, disk has become unreliable.
- if (ke_calculate_crc32(sectorBuf, kNewFSMinimumSectorSz) !=
- drive->fPacket.fPacketCRC32) {
+ if (ke_calculate_crc32((Char*)sectorBuf, kNewFSMinimumSectorSz) !=
+ drive.fPacket.fPacketCRC32) {
DbgLastError() = kErrorDiskIsCorrupted;
}
@@ -323,10 +415,10 @@ STATIC Lba ke_find_free_fork(SizeT sz, Int32 drv, NewCatalog* catalog) {
fork->DataSize = sz;
fork->Flags |= kNewFSFlagCreated;
- drive->fOutput(&drive->fPacket);
+ drive.fOutput(&drive.fPacket);
/// here it's either a read-only filesystem or something bad happened.'
- if (!drive->fPacket.fPacketGood) {
+ if (!drive.fPacket.fPacketGood) {
DbgLastError() = kErrorDiskReadOnly;
return 0;
@@ -351,18 +443,18 @@ STATIC Lba ke_find_free_fork(SizeT sz, Int32 drv, NewCatalog* catalog) {
/// @param kind the catalog kind.
/// @return the valid lba.
STATIC Lba ke_find_free_catalog(SizeT kind, Int32 drv) {
- auto drive = *sMountpointInterface.GetAddressOf(drv);
- if (drive) {
- Char sectorBuf[kNewFSMinimumSectorSz] = {0};
+ if (sMountpointInterface.GetAddressOf(drv)) {
+ auto drive = *sMountpointInterface.GetAddressOf(drv);
+ UInt16 sectorBuf[kNewFSMinimumSectorSz] = {0};
/// prepare packet.
- drive->fPacket.fPacketContent = sectorBuf;
- drive->fPacket.fPacketSize = kNewFSMinimumSectorSz;
- drive->fPacket.fLba = kNewFSAddressAsLba;
+ drive.fPacket.fPacketContent = sectorBuf;
+ drive.fPacket.fPacketSize = kNewFSMinimumSectorSz;
+ drive.fPacket.fLba = kNewFSAddressAsLba;
- drive->fInput(&drive->fPacket);
+ drive.fInput(&drive.fPacket);
NewPartitionBlock* partBlock = (NewPartitionBlock*)sectorBuf;
@@ -376,11 +468,11 @@ STATIC Lba ke_find_free_catalog(SizeT kind, Int32 drv) {
return 1;
} else {
while (startLba != 0) {
- drive->fPacket.fPacketContent = sectorBuf;
- drive->fPacket.fPacketSize = kNewFSMinimumSectorSz;
- drive->fPacket.fLba = startLba;
+ drive.fPacket.fPacketContent = sectorBuf;
+ drive.fPacket.fPacketSize = kNewFSMinimumSectorSz;
+ drive.fPacket.fLba = startLba;
- drive->fInput(&drive->fPacket);
+ drive.fInput(&drive.fPacket);
NewCatalog* catalog = (NewCatalog*)sectorBuf;
@@ -404,7 +496,16 @@ STATIC Lba ke_find_free_catalog(SizeT kind, Int32 drv) {
}
namespace NewOS::Detail {
-Boolean fs_init_newfs(Void) noexcept { return true; }
+Boolean fs_init_newfs(Void) noexcept {
+ sMountpointInterface.A() = construct_main_drive();
+ sMountpointInterface.B() = construct_drive();
+ sMountpointInterface.C() = construct_drive();
+ sMountpointInterface.D() = construct_drive();
+
+ sMountpointInterface.A().fVerify(&sMountpointInterface.A().fPacket);
+
+ return true;
+}
} // namespace NewOS::Detail
#endif // ifdef __FSKIT_NEWFS__
diff --git a/Private/Source/KernelCheck.cxx b/Private/Source/KernelCheck.cxx
index 5f617f06..d649ef35 100644
--- a/Private/Source/KernelCheck.cxx
+++ b/Private/Source/KernelCheck.cxx
@@ -91,8 +91,8 @@ void ke_stop(const NewOS::Int &id) {
void ke_runtime_check(bool expr, const char *file, const char *line) {
if (!expr) {
#ifdef __DEBUG__
- kcout << "NewKernel: File: " << file << "\r\n";
- kcout << "NewKernel: Line: " << line << "\r\n";
+ kcout << "New Kernel: File: " << file << "\r\n";
+ kcout << "New Kernel: Line: " << line << "\r\n";
#endif // __DEBUG__
diff --git a/Private/Source/KernelHeap.cxx b/Private/Source/KernelHeap.cxx
index 3b77ebb6..52b9bafb 100644
--- a/Private/Source/KernelHeap.cxx
+++ b/Private/Source/KernelHeap.cxx
@@ -49,7 +49,7 @@ typedef HeapInformationBlock *HeapInformationBlockPtr;
VoidPtr ke_new_ke_heap(SizeT sz, const bool rw, const bool user) {
if (sz == 0) ++sz;
- auto wrapper = kHeapPageManager.Request(rw, user, false);
+ auto wrapper = kHeapPageManager.Request(rw, user, false, sz);
Detail::HeapInformationBlockPtr heapInfo =
reinterpret_cast<Detail::HeapInformationBlockPtr>(
@@ -62,6 +62,9 @@ VoidPtr ke_new_ke_heap(SizeT sz, const bool rw, const bool user) {
++kHeapCount;
+ NewOS::kcout << "New OS: Allocate: " << hex_number((IntPtr)wrapper.VirtualAddress() +
+ sizeof(Detail::HeapInformationBlock)) << endl;
+
return reinterpret_cast<VoidPtr>(wrapper.VirtualAddress() +
sizeof(Detail::HeapInformationBlock));
}
@@ -71,11 +74,15 @@ VoidPtr ke_new_ke_heap(SizeT sz, const bool rw, const bool user) {
/// @return
Int32 ke_delete_ke_heap(VoidPtr heapPtr) {
if (kHeapCount < 1) return -kErrorInternal;
+ if (((IntPtr)heapPtr - sizeof(Detail::HeapInformationBlock)) <= 0) return -kErrorInternal;
+ if (((IntPtr)heapPtr - kBadPtr) < 0) return -kErrorInternal;
Detail::HeapInformationBlockPtr virtualAddress =
reinterpret_cast<Detail::HeapInformationBlockPtr>(
(UIntPtr)heapPtr - sizeof(Detail::HeapInformationBlock));
+ NewOS::kcout << "New OS: Freeing: " << hex_number((UIntPtr)virtualAddress) << endl;
+
if (virtualAddress && virtualAddress->fMagic == kKernelHeapMagic) {
if (!virtualAddress->fPresent) {
return -kErrorHeapNotPresent;
diff --git a/Private/Source/NewFS+FileManager.cxx b/Private/Source/NewFS+FileManager.cxx
index 7227c2e2..910ec841 100644
--- a/Private/Source/NewFS+FileManager.cxx
+++ b/Private/Source/NewFS+FileManager.cxx
@@ -5,6 +5,7 @@
------------------------------------------- */
#include <KernelKit/FileManager.hpp>
+#include <KernelKit/KernelHeap.hpp>
#ifdef __FSKIT_NEWFS__
@@ -15,9 +16,14 @@ namespace NewOS {
/// @brief C++ constructor
NewFilesystemManager::NewFilesystemManager() {
MUST_PASS(Detail::fs_init_newfs());
+ fImpl = new NewFSParser();
}
-NewFilesystemManager::~NewFilesystemManager() = default;
+NewFilesystemManager::~NewFilesystemManager() {
+ if (fImpl) {
+ delete fImpl;
+ }
+}
/// @brief Removes a node from the filesystem.
/// @param fileName The filename
@@ -53,15 +59,15 @@ NodePtr NewFilesystemManager::CreateAlias(const char* path) {
}
/// @brief Gets the root directory.
-/// @return
+/// @return
const char* NewFilesystemHelper::Root() { return kNewFSRoot; }
/// @brief Gets the up-dir directory.
-/// @return
+/// @return
const char* NewFilesystemHelper::UpDir() { return kNewFSUpDir; }
/// @brief Gets the separator character.
-/// @return
+/// @return
const char NewFilesystemHelper::Separator() { return kNewFSSeparator; }
} // namespace NewOS
diff --git a/Private/Source/NewFS+IO.cxx b/Private/Source/NewFS+IO.cxx
index a7acb63b..c78a0793 100644
--- a/Private/Source/NewFS+IO.cxx
+++ b/Private/Source/NewFS+IO.cxx
@@ -8,13 +8,13 @@
#include <KernelKit/FileManager.hpp>
/*************************************************************
- *
- * File: NewFS+IO.cxx
+ *
+ * File: NewFS+IO.cxx
* Purpose: Filesystem to mountpoint interface.
* Date: 3/26/24
- *
+ *
* Copyright Mahrouss Logic, all rights reserved.
- *
+ *
*************************************************************/
@@ -24,8 +24,8 @@
/// Useful macros.
-#define NEWFS_WRITE(DRV, TRAITS, MP) (*MP->DRV()).fOutput(&TRAITS)
-#define NEWFS_READ(DRV, TRAITS, MP) (*MP->DRV()).fInput(&TRAITS)
+#define NEWFS_WRITE(DRV, TRAITS, MP) (MP->DRV()).fOutput(&TRAITS)
+#define NEWFS_READ(DRV, TRAITS, MP) (MP->DRV()).fInput(&TRAITS)
using namespace NewOS;
@@ -33,12 +33,12 @@ using namespace NewOS;
/// @param Mnt mounted interface.
/// @param DrvTrait drive info
/// @param DrvIndex drive index.
-/// @return
+/// @return
Int32 fs_newfs_read(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex) {
if (!Mnt) return -1;
DrvTrait.fPacket.fPacketGood = false;
-
+
switch (DrvIndex) {
case kNewFSSubDriveA: {
NEWFS_READ(A, DrvTrait.fPacket, Mnt);
@@ -62,10 +62,10 @@ Int32 fs_newfs_read(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 DrvInd
}
/// @brief Write to newfs disk.
-/// @param Mnt mounted interface.
-/// @param DrvTrait drive info
+/// @param Mnt mounted interface.
+/// @param DrvTrait drive info
/// @param DrvIndex drive index.
-/// @return
+/// @return
Int32 fs_newfs_write(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 DrvIndex) {
if (!Mnt) return -1;
diff --git a/Private/Source/PEFCodeManager.cxx b/Private/Source/PEFCodeManager.cxx
index 6ff5730d..cd1b301f 100644
--- a/Private/Source/PEFCodeManager.cxx
+++ b/Private/Source/PEFCodeManager.cxx
@@ -35,11 +35,9 @@ UInt32 rt_get_pef_platform(void) noexcept {
/// @brief PEF loader constructor w/ blob.
/// @param blob
-PEFLoader::PEFLoader(const VoidPtr blob) : fCachedBlob(nullptr) {
- fCachedBlob = blob;
- fBad = false;
-
+PEFLoader::PEFLoader(const VoidPtr blob) : fCachedBlob(blob) {
MUST_PASS(fCachedBlob);
+ fBad = false;
}
/// @brief PEF loader constructor.
@@ -155,10 +153,8 @@ ErrorOr<VoidPtr> PEFLoader::FindStart() {
/// @return
bool PEFLoader::IsLoaded() noexcept { return !fBad && fCachedBlob; }
-#define kPefAppnameCommandHdr "PefAppName"
-
namespace Utils {
-bool execute_from_image(PEFLoader &exec) noexcept {
+bool execute_from_image(PEFLoader &exec, const Int32& procKind) noexcept {
auto errOrStart = exec.FindStart();
if (errOrStart.Error() != 0) return false;
@@ -166,10 +162,7 @@ bool execute_from_image(PEFLoader &exec) noexcept {
ProcessHeader proc(errOrStart.Leak().Leak());
Ref<ProcessHeader> refProc = proc;
- proc.Kind = ProcessHeader::kUserKind;
- rt_copy_memory(exec.FindSymbol(kPefAppnameCommandHdr, kPefData), proc.Name,
- rt_string_len((const Char *)exec.FindSymbol(
- kPefAppnameCommandHdr, kPefData)));
+ proc.Kind = procKind;
return ProcessScheduler::Shared().Leak().Add(refProc);
}
@@ -177,7 +170,19 @@ bool execute_from_image(PEFLoader &exec) noexcept {
const char *PEFLoader::Path() { return fPath.Leak().CData(); }
-const char *PEFLoader::Format() { return "PEF"; }
+const char *PEFLoader::Format() {
+ #ifdef __32x0__
+ return "32x0 PEF.";
+ #elif defined(__64x0__)
+ return "64x0 PEF.";
+ #elif defined(__x86_64__)
+ return "x86_64 PEF.";
+ #elif defined(__powerpc64__)
+ return "POWER PEF.";
+ #else
+ return "Unknonwn PEF.";
+ #endif // __32x0__ || __64x0__ || __x86_64__
+}
const char *PEFLoader::MIME() { return kPefApplicationMime; }
} // namespace NewOS
diff --git a/Private/Source/PageAllocator.cxx b/Private/Source/PageAllocator.cxx
index 9b1e05f0..510fa0ee 100644
--- a/Private/Source/PageAllocator.cxx
+++ b/Private/Source/PageAllocator.cxx
@@ -10,8 +10,8 @@
/// @brief Internal namespace, used internally by kernel.
namespace NewOS::Detail {
-VoidPtr create_page_wrapper(Boolean rw, Boolean user) {
- auto addr = HAL::hal_alloc_page(rw, user);
+VoidPtr create_page_wrapper(Boolean rw, Boolean user, SizeT pageSz) {
+ auto addr = HAL::hal_alloc_page(rw, user, pageSz);
if (addr == kBadAddress) {
kcout << "[create_page_wrapper] kBadAddress returned\n";
@@ -26,7 +26,7 @@ void exec_disable(UIntPtr VirtualAddr) {
MUST_PASS(!VirtualAddrTable->Accessed);
VirtualAddrTable->ExecDisable = true;
- hal_flush_tlb(VirtualAddr);
+ hal_flush_tlb();
}
bool page_disable(UIntPtr VirtualAddr) {
@@ -34,10 +34,9 @@ bool page_disable(UIntPtr VirtualAddr) {
auto VirtualAddrTable = (PTE *)(VirtualAddr);
MUST_PASS(!VirtualAddrTable->Accessed);
- if (VirtualAddrTable->Accessed) return false;
VirtualAddrTable->Present = false;
- hal_flush_tlb(VirtualAddr);
+ hal_flush_tlb();
return true;
}
diff --git a/Private/Source/PageManager.cxx b/Private/Source/PageManager.cxx
index 722df55e..0f7ae78a 100644
--- a/Private/Source/PageManager.cxx
+++ b/Private/Source/PageManager.cxx
@@ -30,15 +30,15 @@ PTEWrapper::PTEWrapper(Boolean Rw, Boolean User, Boolean ExecDisable,
PTEWrapper::~PTEWrapper() {}
/// @brief Flush virtual address.
-/// @param VirtAddr
+/// @param VirtAddr
void PageManager::FlushTLB(UIntPtr VirtAddr) {
if (VirtAddr == kBadAddress) return;
- hal_flush_tlb(VirtAddr);
+ hal_flush_tlb();
}
/// @brief Reclaim freed page.
-/// @return
+/// @return
bool PTEWrapper::Reclaim() {
if (!this->fPresent) {
this->fPresent = true;
@@ -52,17 +52,17 @@ bool PTEWrapper::Reclaim() {
/// @param Rw r/w?
/// @param User user mode?
/// @param ExecDisable disable execution on page?
-/// @return
-PTEWrapper PageManager::Request(Boolean Rw, Boolean User, Boolean ExecDisable) {
+/// @return
+PTEWrapper PageManager::Request(Boolean Rw, Boolean User, Boolean ExecDisable, SizeT Sz) {
// Store PTE wrapper right after PTE.
- VoidPtr ptr = NewOS::HAL::hal_alloc_page(Rw, User);
+ VoidPtr ptr = NewOS::HAL::hal_alloc_page(Rw, User, Sz);
return PTEWrapper{Rw, User, ExecDisable, reinterpret_cast<UIntPtr>(ptr)};
}
/// @brief Disable PTE.
-/// @param wrapper the wrapper.
-/// @return
+/// @param wrapper the wrapper.
+/// @return
bool PageManager::Free(Ref<PTEWrapper *> &wrapper) {
if (wrapper) {
if (!Detail::page_disable(wrapper->VirtualAddress())) return false;
@@ -73,7 +73,7 @@ bool PageManager::Free(Ref<PTEWrapper *> &wrapper) {
}
/// @brief Virtual PTE address.
-/// @return
+/// @return The virtual address of the page.
const UIntPtr PTEWrapper::VirtualAddress() {
return (fVirtAddr);
}
diff --git a/Private/Source/Pmm.cxx b/Private/Source/Pmm.cxx
index 7c331c65..bbd7e6f6 100644
--- a/Private/Source/Pmm.cxx
+++ b/Private/Source/Pmm.cxx
@@ -14,7 +14,7 @@ Pmm::~Pmm() = default;
/* If this returns Null pointer, enter emergency mode */
Ref<PTEWrapper> Pmm::RequestPage(Boolean user, Boolean readWrite) {
- PTEWrapper pt = fPageManager.Leak().Request(user, readWrite, false);
+ PTEWrapper pt = fPageManager.Leak().Request(user, readWrite, false, kPTESize);
if (pt.fPresent) {
kcout << "[PMM]: Allocation was successful.";
diff --git a/Private/Source/Storage/ATADeviceInterface.cxx b/Private/Source/Storage/ATADeviceInterface.cxx
index 89f11f5d..d70a03f0 100644
--- a/Private/Source/Storage/ATADeviceInterface.cxx
+++ b/Private/Source/Storage/ATADeviceInterface.cxx
@@ -28,17 +28,17 @@ ATADeviceInterface::~ATADeviceInterface() {
const char* ATADeviceInterface::Name() const { return "ATADeviceInterface"; }
/// @brief Output operator.
-/// @param Data
-/// @return
+/// @param Data
+/// @return
ATADeviceInterface& ATADeviceInterface::operator<<(MountpointInterface* Data) {
if (!Data) return *this;
for (SizeT driveCount = 0; driveCount < kDriveManagerCount; ++driveCount) {
auto interface = Data->GetAddressOf(driveCount);
- if ((*interface) && rt_string_cmp((*interface)->fDriveKind(), "ATA-", 5) == 0) {
+ if ((interface) && rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) == 0) {
continue;
- } else if ((*interface) &&
- rt_string_cmp((*interface)->fDriveKind(), "ATA-", 5) != 0) {
+ } else if ((interface) &&
+ rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) != 0) {
return *this;
}
}
@@ -48,21 +48,21 @@ ATADeviceInterface& ATADeviceInterface::operator<<(MountpointInterface* Data) {
}
/// @brief Input operator.
-/// @param Data
-/// @return
+/// @param Data
+/// @return
ATADeviceInterface& ATADeviceInterface::operator>>(MountpointInterface* Data) {
if (!Data) return *this;
for (SizeT driveCount = 0; driveCount < kDriveManagerCount; ++driveCount) {
auto interface = Data->GetAddressOf(driveCount);
- if ((*interface) && rt_string_cmp((*interface)->fDriveKind(), "ATA-", 5) == 0) {
+ if ((interface) && rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) == 0) {
continue;
- } else if ((*interface) &&
- rt_string_cmp((*interface)->fDriveKind(), "ATA-", 5) != 0) {
+ } else if ((interface) &&
+ rt_string_cmp((interface)->fDriveKind(), "ATA-", 5) != 0) {
return *this;
}
}
return (ATADeviceInterface&)DeviceInterface<MountpointInterface*>::operator>>(
Data);
-} \ No newline at end of file
+}
diff --git a/Private/Source/Utils.cxx b/Private/Source/Utils.cxx
index fcdddc4a..11b7129a 100644
--- a/Private/Source/Utils.cxx
+++ b/Private/Source/Utils.cxx
@@ -94,8 +94,6 @@ Int rt_copy_memory(const voidPtr src, voidPtr dst, Size len) {
++index;
}
- dstChar[index] = 0;
-
return index;
}
@@ -108,6 +106,7 @@ const Char *alloc_string(const Char *text) {
voidPtr vText = reinterpret_cast<voidPtr>(const_cast<char *>(text));
voidPtr vStr = reinterpret_cast<voidPtr>(const_cast<char *>(string));
rt_copy_memory(vText, vStr, rt_string_len(text));
+
return string;
}
diff --git a/Private/Source/compile_flags.txt b/Private/Source/compile_flags.txt
index b96cbe62..1f54e6fb 100644
--- a/Private/Source/compile_flags.txt
+++ b/Private/Source/compile_flags.txt
@@ -4,3 +4,4 @@
-I../
-I$(HOME)/
-D__FSKIT_NEWFS__
+-D__NEWOS_AMD64__
diff --git a/Private/compile_flags.txt b/Private/compile_flags.txt
index 12b56e37..de13f8f6 100644
--- a/Private/compile_flags.txt
+++ b/Private/compile_flags.txt
@@ -3,3 +3,4 @@
-std=c++20
-I./
-I$(HOME)/
+-D__NEWOS_AMD64__