diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-04 10:59:24 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-04 10:59:24 +0100 |
| commit | e2bbec91d70847cc5a2ff67eb84ca4a3c2d03e85 (patch) | |
| tree | 1e7fec7c232b0c750157007113ce8f86d43b7e76 /Private/Source/Storage | |
| parent | aff54fd3dc6855b62c047f126c6fe20ca717ee0f (diff) | |
Kernel: Depend less on NewFS, add support for FileSystem protocol in
NewBoot.
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/Source/Storage')
| -rw-r--r-- | Private/Source/Storage/ATA.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Private/Source/Storage/ATA.cxx b/Private/Source/Storage/ATA.cxx index 7d8ce32f..47c05ac8 100644 --- a/Private/Source/Storage/ATA.cxx +++ b/Private/Source/Storage/ATA.cxx @@ -40,6 +40,8 @@ enum { }; const char* ata_read_28(ULong lba) { + if (!kPrdt) return nullptr; + static char buffer[512]; UIntPtr* packet = (UIntPtr*)kPrdt.Leak()->PhysicalAddress(); @@ -56,6 +58,8 @@ const char* ata_read_28(ULong lba) { #define kBufferLen 512 const char* ata_read_48(ULong lba) { + if (!kPrdt) return nullptr; + static char buffer[kBufferLen]; rt_set_memory(buffer, 0, kBufferLen); @@ -71,6 +75,8 @@ const char* ata_read_48(ULong lba) { } Int32 ata_write_48(ULong lba, const char* buffer) { + if (!kPrdt) return kATAError; + UIntPtr* packet = reinterpret_cast<UIntPtr*>(kPrdt.Leak()->PhysicalAddress()); packet[0] = k48BitWrite; @@ -83,6 +89,8 @@ Int32 ata_write_48(ULong lba, const char* buffer) { } Int32 ata_write_28(ULong lba, const char* text) { + if (!kPrdt) return kATAError; + UIntPtr* packet = (UIntPtr*)kPrdt.Leak()->PhysicalAddress(); packet[0] = k28BitWrite; |
