From 4475e3e184ef13324bc4bfbc7aa31327ff627a08 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Wed, 19 Apr 2023 17:29:36 +0300 Subject: [PATCH] Kernel: ATAController will fail to initialize in native mode --- kernel/include/kernel/Errors.h | 1 + kernel/kernel/Errors.cpp | 1 + kernel/kernel/Storage/ATAController.cpp | 2 ++ 3 files changed, 4 insertions(+) diff --git a/kernel/include/kernel/Errors.h b/kernel/include/kernel/Errors.h index b815f0e8..ca934662 100644 --- a/kernel/include/kernel/Errors.h +++ b/kernel/include/kernel/Errors.h @@ -29,6 +29,7 @@ namespace Kernel ATA_MC, ATA_UNC, ATA_BBK, + ATA_UnsupportedDevice, Font_FileTooSmall, Font_Unsupported, Count diff --git a/kernel/kernel/Errors.cpp b/kernel/kernel/Errors.cpp index 38c1d9e9..acc21ed3 100644 --- a/kernel/kernel/Errors.cpp +++ b/kernel/kernel/Errors.cpp @@ -26,6 +26,7 @@ namespace Kernel "Media changed"sv, "Uncorrectable data error"sv, "Bad Block detected"sv, + "Unsupported ata device"sv, "Font file too small"sv, "Unsupported font format"sv, }; diff --git a/kernel/kernel/Storage/ATAController.cpp b/kernel/kernel/Storage/ATAController.cpp index 70fae90f..e7f1fbdc 100644 --- a/kernel/kernel/Storage/ATAController.cpp +++ b/kernel/kernel/Storage/ATAController.cpp @@ -39,11 +39,13 @@ namespace Kernel { buses[0].base = pci_device.read_dword(0x10) & 0xFFFFFFFC; buses[0].ctrl = pci_device.read_dword(0x14) & 0xFFFFFFFC; + return BAN::Error::from_error_code(ErrorCode::ATA_UnsupportedDevice); } if (prog_if & 0x04) { buses[1].base = pci_device.read_dword(0x18) & 0xFFFFFFFC; buses[1].ctrl = pci_device.read_dword(0x1C) & 0xFFFFFFFC; + return BAN::Error::from_error_code(ErrorCode::ATA_UnsupportedDevice); } m_buses[0] = ATABus::create(this, buses[0].base, buses[0].ctrl, 14);