diff options
Diffstat (limited to 'Private')
| -rw-r--r-- | Private/KernelKit/Device.hpp | 18 | ||||
| -rw-r--r-- | Private/Source/Storage/ATA.cxx | 15 | ||||
| -rw-r--r-- | Private/Source/Storage/Storage.cxx | 1 |
3 files changed, 17 insertions, 17 deletions
diff --git a/Private/KernelKit/Device.hpp b/Private/KernelKit/Device.hpp index 097af85a..9a689b26 100644 --- a/Private/KernelKit/Device.hpp +++ b/Private/KernelKit/Device.hpp @@ -81,15 +81,13 @@ class IOBuf final { ///! @brief Device types enum. enum { - kDeviceIde, - kDeviceNetwork, - kDevicePrinter, - kDeviceGSDB, - kDeviceScsi, - kDeviceSata, - kDeviceUsb, - kDeviceCD, - kDeviceSwap, - kDeviceCnt, + kDeviceTypeIDE, + kDeviceTypeEthernet, + kDeviceTypeWiFi, + kDeviceTypeRS232, + kDeviceTypeSCSI, + kDeviceTypeSHCI, + kDeviceTypeUSB, + kDeviceTypeCount, }; } // namespace HCore diff --git a/Private/Source/Storage/ATA.cxx b/Private/Source/Storage/ATA.cxx index 47c05ac8..6027e6f9 100644 --- a/Private/Source/Storage/ATA.cxx +++ b/Private/Source/Storage/ATA.cxx @@ -10,8 +10,10 @@ #include <ArchKit/ArchKit.hpp> #include <StorageKit/ATA.hpp> +#define kBufferLen 512 + //! @brief ATA DMA Driver -//! @todo: Rework into a proper ATA DMA. +//! The idea is to let a driver do the transfer. /// bugs 0 @@ -42,25 +44,24 @@ enum { const char* ata_read_28(ULong lba) { if (!kPrdt) return nullptr; - static char buffer[512]; + char* buffer = reinterpret_cast<char*>(Alloca(sizeof(char) * kBufferLen)); + rt_set_memory(buffer, 0, kBufferLen); - UIntPtr* packet = (UIntPtr*)kPrdt.Leak()->PhysicalAddress(); + UIntPtr* packet = reinterpret_cast<UIntPtr*>(kPrdt.Leak()->PhysicalAddress()); packet[0] = k28BitRead; packet[1] = (UIntPtr)&buffer; - packet[2] = lba; + packet[4] = lba; rt_wait_for_io(); return buffer; } -#define kBufferLen 512 - const char* ata_read_48(ULong lba) { if (!kPrdt) return nullptr; - static char buffer[kBufferLen]; + char* buffer = reinterpret_cast<char*>(Alloca(sizeof(char) * kBufferLen)); rt_set_memory(buffer, 0, kBufferLen); UIntPtr* packet = reinterpret_cast<UIntPtr*>(kPrdt.Leak()->PhysicalAddress()); diff --git a/Private/Source/Storage/Storage.cxx b/Private/Source/Storage/Storage.cxx index 7d4ba70a..2fd5b29b 100644 --- a/Private/Source/Storage/Storage.cxx +++ b/Private/Source/Storage/Storage.cxx @@ -9,5 +9,6 @@ #include <StorageKit/Storage.hpp> +///! @brief ATAPI SCSI packet. const SKScsiPacket kCDRomPacketTemplate = {0x43, 0, 1, 0, 0, 0, 0, 12, 0x40, 0, 0}; |
