summaryrefslogtreecommitdiffhomepage
path: root/dev
diff options
context:
space:
mode:
Diffstat (limited to 'dev')
-rw-r--r--dev/Boot/src/HEL/AMD64/EFIBootStartup.cc6
-rw-r--r--dev/Kernel/FirmwareKit/EFI/EFI.h16
-rw-r--r--dev/Kernel/HALKit/AMD64/Storage/SATA.cc14
3 files changed, 27 insertions, 9 deletions
diff --git a/dev/Boot/src/HEL/AMD64/EFIBootStartup.cc b/dev/Boot/src/HEL/AMD64/EFIBootStartup.cc
index 462e59e4..a1861178 100644
--- a/dev/Boot/src/HEL/AMD64/EFIBootStartup.cc
+++ b/dev/Boot/src/HEL/AMD64/EFIBootStartup.cc
@@ -158,6 +158,7 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr image_handle,
{
handover_hdr->f_HardwareTables.f_MultiProcessingEnabled = NO;
}
+
// Fill handover header now.
// ---------------------------------------------------- //
@@ -269,7 +270,10 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr image_handle,
// Assign to global 'kHandoverHeader'.
- Boot::BFileReader reader_kernel(L"neoskrnl.exe", image_handle);
+ const auto kernel_path = L"neoskrnl.exe";
+ const auto kernel_path_sz = 15;
+
+ Boot::BFileReader reader_kernel(kernel_path, image_handle);
reader_kernel.ReadAll(0);
diff --git a/dev/Kernel/FirmwareKit/EFI/EFI.h b/dev/Kernel/FirmwareKit/EFI/EFI.h
index c96777d6..bbf990ce 100644
--- a/dev/Kernel/FirmwareKit/EFI/EFI.h
+++ b/dev/Kernel/FirmwareKit/EFI/EFI.h
@@ -610,6 +610,20 @@ struct EfiSimpleFilesystemProtocol
EfiOpenVolume OpenVolume;
};
+typedef struct EfiRuntimeServices
+{
+ EfiTableHeader SystemTable;
+ VoidPtr GetTime, SetTime, GetWakeupTime, SetWakeupTime, SetVirtualAddressMap, ConvertPointer;
+ UInt64(EFI_API* GetVariable)(const Char* Name, EfiGUID VendorGUID, UInt32* Attributes, UInt32* DataSize, VoidPtr Data);
+ VoidPtr GetNextVariable;
+ UInt64(EFI_API* SetVariable)(const Char* Name, EfiGUID VendorGUID, UInt32* Attributes, UInt32* DataSize, VoidPtr Data);
+ VoidPtr GetNextHighMonotonicCount;
+ VoidPtr ResetSystem;
+ VoidPtr UpdateCapsule;
+ VoidPtr QueryCapsuleCapabilites;
+ VoidPtr QueryVariableInfo;
+} EfiRuntimeServices;
+
/**
@brief The Structure that they give you when booting.
*/
@@ -624,7 +638,7 @@ typedef struct EfiSystemTable
EfiSimpleTextOutputProtocol* ConOut;
EfiHandlePtr StandardErrorHandle;
VoidPtr StdErr;
- VoidPtr RuntimeServices;
+ EfiRuntimeServices* RuntimeServices;
EfiBootServices* BootServices;
UInt64 NumberOfTableEntries;
/// The configuration table (contains the RSD PTR entry.)
diff --git a/dev/Kernel/HALKit/AMD64/Storage/SATA.cc b/dev/Kernel/HALKit/AMD64/Storage/SATA.cc
index d2c0ee5b..74e1e8c1 100644
--- a/dev/Kernel/HALKit/AMD64/Storage/SATA.cc
+++ b/dev/Kernel/HALKit/AMD64/Storage/SATA.cc
@@ -68,14 +68,14 @@ static Kernel::Void drv_calculate_disk_geometry() noexcept
drv_std_input_output<NO, YES, YES>(0, identify_data, 0, kib_cast(4));
- uint32_t lba28_sectors = (identify_data[61] << 16) | identify_data[60];
+ uint32_t lba28_sectors = (identify_data[61] << 16) | identify_data[60];
- uint64_t lba48_sectors = ((uint64_t)identify_data[103] << 48) |
- ((uint64_t)identify_data[102] << 32) |
- ((uint64_t)identify_data[101] << 16) |
- ((uint64_t)identify_data[100]);
+ uint64_t lba48_sectors = ((uint64_t)identify_data[103] << 48) |
+ ((uint64_t)identify_data[102] << 32) |
+ ((uint64_t)identify_data[101] << 16) |
+ ((uint64_t)identify_data[100]);
- kCurrentDiskSectorCount = (lba48_sectors) ? lba48_sectors : lba28_sectors;
+ kCurrentDiskSectorCount = (lba48_sectors) ? lba48_sectors : lba28_sectors;
for (Kernel::Int32 i = 0; i < 40; i += 2)
{
@@ -229,7 +229,7 @@ static Kernel::Void drv_std_input_output(Kernel::UInt64 lba, Kernel::UInt8* buff
command_header->Cfl = sizeof(FisRegH2D) / sizeof(Kernel::UInt32);
command_header->Write = Write;
command_header->Prdtl = mib_cast(32) / mib_cast(4);
- command_header->Prdbc = (1 << slot);
+ command_header->Prdbc = (1 << slot);
volatile HbaCmdTbl* command_table = (volatile HbaCmdTbl*)((Kernel::UInt64)command_header->Ctba);