diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-04-03 09:20:28 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-04-03 09:20:28 +0200 |
| commit | 3facc32b746a44b0e3a91cbe1897127194396d1b (patch) | |
| tree | 0725ebbf35a18e6933596ea5c765ac81adf7834f /Private | |
| parent | efc6b5d169d2b6eaabe7384141cec6054ae622a0 (diff) | |
MHR-3: See main changes below.
Kernel: Improve Disk interfaces regarding the struct they're using (all of them are using MountpountInterface now)
SystemLib: Start adding PowerPC code to the SystemLib to be cross compiled
as a PEF FAT binary.
Kernel: Adding new builtins to support a wide range of hardware.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private')
| -rw-r--r-- | Private/Builtins/APM/.gitkeep | 0 | ||||
| -rw-r--r-- | Private/Builtins/ATA/Defines.hxx | 17 | ||||
| -rw-r--r-- | Private/Builtins/MBCI/Defines.hxx | 13 | ||||
| -rw-r--r-- | Private/Builtins/OHCI/.gitkeep | 0 | ||||
| -rw-r--r-- | Private/Builtins/README.TXT | 13 | ||||
| -rw-r--r-- | Private/Builtins/SAS/.gitkeep | 0 | ||||
| -rw-r--r-- | Private/Builtins/SAS/SCSI.hxx | 14 | ||||
| -rw-r--r-- | Private/KernelKit/DeviceManager.hpp | 8 | ||||
| -rw-r--r-- | Private/KernelKit/DriveManager.hxx | 28 | ||||
| -rw-r--r-- | Private/KernelRsrc.rc | 6 | ||||
| -rw-r--r-- | Private/Source/DriveManager.cxx | 15 | ||||
| -rw-r--r-- | Private/Source/NewFS+IO.cxx | 20 | ||||
| -rw-r--r-- | Private/Source/Storage/AHCIDeviceInterface.cxx | 4 | ||||
| -rw-r--r-- | Private/Source/Storage/ATADeviceInterface.cxx | 68 | ||||
| -rw-r--r-- | Private/Source/Storage/SCSIDeviceInterface.cxx (renamed from Private/Source/Storage/StorageBase.cxx) | 4 | ||||
| -rw-r--r-- | Private/StorageKit/AHCI.hpp | 20 | ||||
| -rw-r--r-- | Private/StorageKit/ATA.hpp | 26 | ||||
| -rw-r--r-- | Private/StorageKit/NVME.hpp | 19 | ||||
| -rw-r--r-- | Private/StorageKit/SCSI.hxx | 11 | ||||
| -rw-r--r-- | Private/StorageKit/Storage.hpp | 14 |
20 files changed, 200 insertions, 100 deletions
diff --git a/Private/Builtins/APM/.gitkeep b/Private/Builtins/APM/.gitkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/Private/Builtins/APM/.gitkeep diff --git a/Private/Builtins/ATA/Defines.hxx b/Private/Builtins/ATA/Defines.hxx index 0a07bc68..a8cabe77 100644 --- a/Private/Builtins/ATA/Defines.hxx +++ b/Private/Builtins/ATA/Defines.hxx @@ -16,7 +16,7 @@ #include <CompilerKit/CompilerKit.hxx> #include <NewKit/Defines.hpp> -// Status register +///! Status register #define ATA_SR_BSY 0x80 #define ATA_SR_DRDY 0x40 #define ATA_SR_DF 0x20 @@ -26,7 +26,7 @@ #define ATA_SR_IDX 0x02 #define ATA_SR_ERR 0x01 -// Error register +///! Error register #define ATA_ER_BBK 0x80 #define ATA_ER_UNC 0x40 #define ATA_ER_MC 0x20 @@ -50,6 +50,7 @@ #define ATA_CMD_IDENTIFY_PACKET 0xA1 #define ATA_CMD_IDENTIFY 0xEC +///! ident offsets, use with data that we got from ATA_CMD_IDENTIFY. #define ATA_IDENT_DEVICE_TYPE 0 #define ATA_IDENT_CYLINDERS 2 #define ATA_IDENT_HEADS 6 @@ -65,7 +66,7 @@ #define ATA_MASTER 0x00 #define ATA_SLAVE 0x01 -// Register +///! Register #define ATA_REG_DATA 0x00 #define ATA_REG_ERROR 0x01 #define ATA_REG_FEATURES 0x01 @@ -91,28 +92,30 @@ #define ATA_PRIMARY_DCR_AS 0x3F6 #define ATA_SECONDARY_DCR_AS 0x376 -// Irq +///! Irq #define ATA_PRIMARY_IRQ 14 #define ATA_SECONDARY_IRQ 15 -// Channels +///! Channels #define ATA_PRIMARY 0x00 #define ATA_SECONDARY 0x01 #define ATA_CYL_LOW 4 #define ATA_CYL_HIGH 5 -// IO Direction +///! IO Direction #define ATA_READ 0x00 #define ATA_WRITE 0x013 #define ATA_PRIMARY_SEL 0xA0 #define ATA_SECONDARY_SEL 0xB0 -// ATA Helpers +///! ATA address register. #define ATA_ADDRESS1(x) (x + 3) #define ATA_ADDRESS2(x) (x + 4) #define ATA_ADDRESS3(x) (x + 5) + +///! ATA command register. #define ATA_COMMAND(x) (x + 7) #define kATASectorSize 512 diff --git a/Private/Builtins/MBCI/Defines.hxx b/Private/Builtins/MBCI/Defines.hxx new file mode 100644 index 00000000..b347485c --- /dev/null +++ b/Private/Builtins/MBCI/Defines.hxx @@ -0,0 +1,13 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + +#include <NewKit/Defines.hpp> + +struct MBCIHostInterface; +struct MBCIDeviceInterface; +struct MBCIPacketInterface; diff --git a/Private/Builtins/OHCI/.gitkeep b/Private/Builtins/OHCI/.gitkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/Private/Builtins/OHCI/.gitkeep diff --git a/Private/Builtins/README.TXT b/Private/Builtins/README.TXT index 4cb791f7..b090b2e5 100644 --- a/Private/Builtins/README.TXT +++ b/Private/Builtins/README.TXT @@ -8,9 +8,12 @@ What are these? These are NewOS builtins device drivers. -=========== -Maintainers -=========== +=================== +Maintainers/Authors +=================== -ACPIFactoryInterface: Amlal EL Mahrouss -AHCI: Amlal EL Mahrouss
\ No newline at end of file +ACPIFactoryInterface: Amlal EL Mahrouss. +AHCI: Amlal EL Mahrouss. +Toolbox: Amlal EL Mahrouss. +PS2: Amlal EL Mahrouss +ATA: Amlal EL Mahrouss
\ No newline at end of file diff --git a/Private/Builtins/SAS/.gitkeep b/Private/Builtins/SAS/.gitkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/Private/Builtins/SAS/.gitkeep diff --git a/Private/Builtins/SAS/SCSI.hxx b/Private/Builtins/SAS/SCSI.hxx new file mode 100644 index 00000000..d7fb18d4 --- /dev/null +++ b/Private/Builtins/SAS/SCSI.hxx @@ -0,0 +1,14 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + +#include <NewKit/Defines.hpp> + +/// @file SCSI.hxx +/// @brief Serial SCSI driver. + +typedef NewOS::UInt16 scsi_packet_type[12]; diff --git a/Private/KernelKit/DeviceManager.hpp b/Private/KernelKit/DeviceManager.hpp index 10d23604..0935c5b3 100644 --- a/Private/KernelKit/DeviceManager.hpp +++ b/Private/KernelKit/DeviceManager.hpp @@ -21,8 +21,10 @@ #include <NewKit/ErrorOr.hpp> #include <NewKit/Ref.hpp> +#define kDriveManagerCount 4U + // Last Rev -// Sat Feb 24 CET 2024 +// Wed, Apr 3, 2024 9:09:41 AM namespace NewOS { template <typename T> @@ -41,12 +43,12 @@ class DeviceInterface { DeviceInterface(const DeviceInterface<T> &) = default; public: - DeviceInterface<T> &operator<<(T Data) { + virtual DeviceInterface<T> &operator<<(T Data) { m_Out(Data); return *this; } - DeviceInterface<T> &operator>>(T Data) { + virtual DeviceInterface<T> &operator>>(T Data) { m_In(Data); return *this; } diff --git a/Private/KernelKit/DriveManager.hxx b/Private/KernelKit/DriveManager.hxx index d82c302b..d3d14f9a 100644 --- a/Private/KernelKit/DriveManager.hxx +++ b/Private/KernelKit/DriveManager.hxx @@ -54,11 +54,11 @@ struct DriveTrait final { Void (*fInput)(DrivePacket* packetPtr); Void (*fOutput)(DrivePacket* packetPtr); Void (*fVerify)(DrivePacket* packetPtr); + const Char* (*fDriveKind)(Void); }; -//! drive as a device. -typedef DeviceInterface<DriveTrait> DriveDevice; -typedef DriveDevice* DriveDevicePtr; +///! drive as a device. +typedef DriveTrait* DriveTraitPtr; /** * @brief Mounted drives interface. @@ -73,12 +73,12 @@ class MountpointInterface final { HCORE_COPY_DEFAULT(MountpointInterface); public: - DriveDevicePtr A() { return mA; } - DriveDevicePtr B() { return mB; } - DriveDevicePtr C() { return mC; } - DriveDevicePtr D() { return mD; } + DriveTraitPtr A() { return mA; } + DriveTraitPtr B() { return mB; } + DriveTraitPtr C() { return mC; } + DriveTraitPtr D() { return mD; } - DriveDevicePtr* GetAddressOf(Int32 index) { + DriveTraitPtr* GetAddressOf(Int32 index) { DbgLastError() = kErrorSuccess; switch (index) { @@ -102,22 +102,26 @@ class MountpointInterface final { } private: - DriveDevicePtr mA, mB, mC, mD = nullptr; + DriveTraitPtr mA, mB, mC, mD = nullptr; }; - /// @brief Unimplemented drive. /// @param pckt /// @return Void ke_drv_unimplemented(DriveTrait::DrivePacket* pckt); +/// @brief Gets the drive kind (ATA, SCSI, AHCI...) +/// @param +/// @return +const Char* ke_drive_kind(Void); + /// @brief Makes a new drive. /// @return the new drive. -DriveTrait construct_drive() noexcept; +DriveTrait construct_drive(void) noexcept; /// @brief Fetches the main drive. /// @return the new drive. -DriveTrait main_drive() noexcept; +DriveTrait main_drive(void) noexcept; } // namespace NewOS #endif /* ifndef __DRIVE_MANAGER__ */ diff --git a/Private/KernelRsrc.rc b/Private/KernelRsrc.rc index 3f5fffd3..0470d572 100644 --- a/Private/KernelRsrc.rc +++ b/Private/KernelRsrc.rc @@ -8,11 +8,11 @@ BEGIN BEGIN BLOCK "080904E4" BEGIN - VALUE "CompanyName", "Mahrouss Logic" - VALUE "FileDescription", "NewOS Microkernel for AMD64" + VALUE "CompanyName", "MahroussLogic" + VALUE "FileDescription", "NewOS microkernel." VALUE "FileVersion", "1.0" VALUE "InternalName", "NewKernel" - VALUE "LegalCopyright", "Mahrouss Logic" + VALUE "LegalCopyright", "MahroussLogic" VALUE "OriginalFilename", "NewKernel.exe" VALUE "ProductName", "NewKernel" VALUE "ProductVersion", "1.0" diff --git a/Private/Source/DriveManager.cxx b/Private/Source/DriveManager.cxx index 41a623c9..f79fcdf5 100644 --- a/Private/Source/DriveManager.cxx +++ b/Private/Source/DriveManager.cxx @@ -53,6 +53,21 @@ Void ke_drv_check_disk(DriveTrait::DrivePacket* pckt) { pckt->fPacketGood = false; } +/// @brief Gets the drive kind (ATA, SCSI, AHCI...) +/// @param +/// @return +#ifdef __ATA_PIO__ +const Char* ke_drive_kind(Void) { return "ATA-PIO"; } +#endif + +#ifdef __ATA_DMA__ +const Char* ke_drive_kind(Void) { return "ATA-DMA"; } +#endif + +#ifdef __AHCI__ +const Char* ke_drive_kind(Void) { return "AHCO"; } +#endif + /// @brief Unimplemented drive. /// @param pckt /// @return diff --git a/Private/Source/NewFS+IO.cxx b/Private/Source/NewFS+IO.cxx index 8264f7fa..63db9b1a 100644 --- a/Private/Source/NewFS+IO.cxx +++ b/Private/Source/NewFS+IO.cxx @@ -24,8 +24,8 @@ /// Useful macros. -#define NEWFS_WRITE(DRV, TRAITS, MP) (*MP->DRV()) << TRAITS -#define NEWFS_READ(DRV, TRAITS, MP) (*MP->DRV()) >> TRAITS +#define NEWFS_WRITE(DRV, TRAITS, MP) (*MP->DRV()).fOutput(&TRAITS) +#define NEWFS_READ(DRV, TRAITS, MP) (*MP->DRV()).fInput(&TRAITS) using namespace NewOS; @@ -41,19 +41,19 @@ Int32 fs_newfs_read_raw(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 Dr switch (DrvIndex) { case kHCFSSubDriveA: { - NEWFS_READ(A, DrvTrait, Mnt); + NEWFS_READ(A, DrvTrait.fPacket, Mnt); break; } case kHCFSSubDriveB: { - NEWFS_READ(B, DrvTrait, Mnt); + NEWFS_READ(B, DrvTrait.fPacket, Mnt); break; } case kHCFSSubDriveC: { - NEWFS_READ(C, DrvTrait, Mnt); + NEWFS_READ(C, DrvTrait.fPacket, Mnt); break; } case kHCFSSubDriveD: { - NEWFS_READ(D, DrvTrait, Mnt); + NEWFS_READ(D, DrvTrait.fPacket, Mnt); break; } } @@ -73,19 +73,19 @@ Int32 fs_newfs_write_raw(MountpointInterface* Mnt, DriveTrait& DrvTrait, Int32 D switch (DrvIndex) { case kHCFSSubDriveA: { - NEWFS_WRITE(A, DrvTrait, Mnt); + NEWFS_WRITE(A, DrvTrait.fPacket, Mnt); break; } case kHCFSSubDriveB: { - NEWFS_WRITE(B, DrvTrait, Mnt); + NEWFS_WRITE(B, DrvTrait.fPacket, Mnt); break; } case kHCFSSubDriveC: { - NEWFS_WRITE(C, DrvTrait, Mnt); + NEWFS_WRITE(C, DrvTrait.fPacket, Mnt); break; } case kHCFSSubDriveD: { - NEWFS_WRITE(D, DrvTrait, Mnt); + NEWFS_WRITE(D, DrvTrait.fPacket, Mnt); break; } } diff --git a/Private/Source/Storage/AHCIDeviceInterface.cxx b/Private/Source/Storage/AHCIDeviceInterface.cxx index c6a4a4be..c7a99cb0 100644 --- a/Private/Source/Storage/AHCIDeviceInterface.cxx +++ b/Private/Source/Storage/AHCIDeviceInterface.cxx @@ -12,8 +12,8 @@ using namespace NewOS; /// @param Out Disk output /// @param In Disk input /// @param Cleanup Disk cleanup. -AHCIDeviceInterface::AHCIDeviceInterface(void (*Out)(AHCIPacket outpacket), - void (*In)(AHCIPacket inpacket), void (*Cleanup)(void)) +AHCIDeviceInterface::AHCIDeviceInterface(void (*Out)(MountpointInterface* outpacket), + void (*In)(MountpointInterface* inpacket), void (*Cleanup)(void)) : DeviceInterface(Out, In), fCleanup(Cleanup) {} /// @brief Class desctructor diff --git a/Private/Source/Storage/ATADeviceInterface.cxx b/Private/Source/Storage/ATADeviceInterface.cxx new file mode 100644 index 00000000..89f11f5d --- /dev/null +++ b/Private/Source/Storage/ATADeviceInterface.cxx @@ -0,0 +1,68 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#include <StorageKit/ATA.hpp> + +using namespace NewOS; + +/// @brief Class constructor +/// @param Out Disk output +/// @param In Disk input +/// @param Cleanup Disk cleanup. +ATADeviceInterface::ATADeviceInterface( + void (*Out)(MountpointInterface* outpacket), + void (*In)(MountpointInterface* inpacket), void (*Cleanup)(void)) + : DeviceInterface(Out, In), fCleanup(Cleanup) {} + +/// @brief Class desctructor +ATADeviceInterface::~ATADeviceInterface() { + MUST_PASS(fCleanup); + if (fCleanup) fCleanup(); +} + +/// @brief Returns the name of the device interface. +/// @return it's name as a string. +const char* ATADeviceInterface::Name() const { return "ATADeviceInterface"; } + +/// @brief Output operator. +/// @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) { + continue; + } else if ((*interface) && + rt_string_cmp((*interface)->fDriveKind(), "ATA-", 5) != 0) { + return *this; + } + } + + return (ATADeviceInterface&)DeviceInterface<MountpointInterface*>::operator<<( + Data); +} + +/// @brief Input operator. +/// @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) { + continue; + } 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/Storage/StorageBase.cxx b/Private/Source/Storage/SCSIDeviceInterface.cxx index bba4be1f..7625a279 100644 --- a/Private/Source/Storage/StorageBase.cxx +++ b/Private/Source/Storage/SCSIDeviceInterface.cxx @@ -4,8 +4,8 @@ ------------------------------------------- */ -#include <StorageKit/Storage.hpp> +#include <StorageKit/SCSI.hxx> ///! @brief ATAPI SCSI packet. -const SKScsiPacket kCDRomPacketTemplate = {0x43, 0, 1, 0, 0, 0, +const scsi_packet_type kCDRomPacketTemplate = {0x43, 0, 1, 0, 0, 0, 0, 12, 0x40, 0, 0}; diff --git a/Private/StorageKit/AHCI.hpp b/Private/StorageKit/AHCI.hpp index 6f5b5a90..08548a1c 100644 --- a/Private/StorageKit/AHCI.hpp +++ b/Private/StorageKit/AHCI.hpp @@ -7,15 +7,14 @@ #pragma once #include <KernelKit/DeviceManager.hpp> +#include <KernelKit/DriveManager.hxx> #include <NewKit/OwnPtr.hpp> namespace NewOS { -class AHCIPacket; - -class AHCIDeviceInterface : public DeviceInterface<AHCIPacket> { +class AHCIDeviceInterface : public DeviceInterface<MountpointInterface*> { public: - explicit AHCIDeviceInterface(void (*Out)(AHCIPacket outpacket), - void (*In)(AHCIPacket inpacket), + explicit AHCIDeviceInterface(void (*Out)(MountpointInterface* outpacket), + void (*In)(MountpointInterface* inpacket), void (*Cleanup)(void)); virtual ~AHCIDeviceInterface(); @@ -27,17 +26,6 @@ class AHCIDeviceInterface : public DeviceInterface<AHCIPacket> { const char *Name() const override; private: - void (*fOut)(AHCIPacket); - void (*fIn)(AHCIPacket); void (*fCleanup)(void); }; - -class AHCIPacket final { - UIntPtr DataPtr; - SizeT DataSz; - UInt8 PortId; - UInt8 PortRdy; - Lba BeginLba; - Lba SectorCnt; -}; } // namespace NewOS
\ No newline at end of file diff --git a/Private/StorageKit/ATA.hpp b/Private/StorageKit/ATA.hpp index 5ad5a2d4..da3c8d23 100644 --- a/Private/StorageKit/ATA.hpp +++ b/Private/StorageKit/ATA.hpp @@ -7,19 +7,24 @@ #pragma once #include <KernelKit/DeviceManager.hpp> +#include <KernelKit/DriveManager.hxx> #include <NewKit/OwnPtr.hpp> +#include <NewKit/Utils.hpp> namespace NewOS { -class ATAPacket; - -class ATADeviceInterface : public DeviceInterface<ATAPacket> { +/// @brief ATA device interface type. +class ATADeviceInterface : public DeviceInterface<MountpointInterface*> { public: - explicit ATADeviceInterface(void (*Out)(ATAPacket outpacket), - void (*In)(ATAPacket inpacket), + explicit ATADeviceInterface(void (*Out)(MountpointInterface* outpacket), + void (*In)(MountpointInterface* inpacket), void (*Cleanup)(void)); virtual ~ATADeviceInterface(); +public: + ATADeviceInterface &operator<<(MountpointInterface* Data) override; + ATADeviceInterface &operator>>(MountpointInterface* Data) override; + public: ATADeviceInterface &operator=(const ATADeviceInterface &) = default; ATADeviceInterface(const ATADeviceInterface &) = default; @@ -27,17 +32,6 @@ class ATADeviceInterface : public DeviceInterface<ATAPacket> { const char *Name() const override; private: - void (*fOut)(ATAPacket); - void (*fIn)(ATAPacket); void (*fCleanup)(void); }; - -class ATAPacket final { - UIntPtr DataPtr; - SizeT DataSz; - UInt8 PortId; - UInt8 PortRdy; - Lba BeginLba; - Lba SectorCnt; -}; } // namespace NewOS
\ No newline at end of file diff --git a/Private/StorageKit/NVME.hpp b/Private/StorageKit/NVME.hpp index d2ed585f..dc7b37d8 100644 --- a/Private/StorageKit/NVME.hpp +++ b/Private/StorageKit/NVME.hpp @@ -7,15 +7,14 @@ #pragma once #include <KernelKit/DeviceManager.hpp> +#include <KernelKit/DriveManager.hxx> #include <NewKit/OwnPtr.hpp> namespace NewOS { -class NVMEPacket; - -class NVMEDeviceInterface : public DeviceInterface<NVMEPacket> { +class NVMEDeviceInterface : public DeviceInterface<MountpointInterface*> { public: - explicit NVMEDeviceInterface(void (*Out)(NVMEPacket outpacket), - void (*In)(NVMEPacket inpacket), void (*Cleanup)(void)) + explicit NVMEDeviceInterface(void (*Out)(MountpointInterface* outpacket), + void (*In)(MountpointInterface* inpacket), void (*Cleanup)(void)) : DeviceInterface(Out, In), fCleanup(Cleanup) {} virtual ~NVMEDeviceInterface() { @@ -29,17 +28,9 @@ class NVMEDeviceInterface : public DeviceInterface<NVMEPacket> { const char *Name() const override; public: - OwnPtr<NVMEPacket> operator()(UInt32 dmaLow, UInt32 dmaHigh, SizeT sz); + OwnPtr<MountpointInterface*> operator()(UInt32 dmaLow, UInt32 dmaHigh, SizeT sz); private: void (*fCleanup)(void); }; - -class NVMEPacket final { - UIntPtr DataPtr; - SizeT DataSz; - UInt8 Namespace; - Lba Begin; - Lba End; -}; } // namespace NewOS diff --git a/Private/StorageKit/SCSI.hxx b/Private/StorageKit/SCSI.hxx new file mode 100644 index 00000000..eb207c9d --- /dev/null +++ b/Private/StorageKit/SCSI.hxx @@ -0,0 +1,11 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + +#include <Builtins/SAS/SCSI.hxx> + +extern const scsi_packet_type kCDRomPacketTemplate; diff --git a/Private/StorageKit/Storage.hpp b/Private/StorageKit/Storage.hpp index 8e7614e6..530e63bd 100644 --- a/Private/StorageKit/Storage.hpp +++ b/Private/StorageKit/Storage.hpp @@ -9,14 +9,8 @@ #include <NewKit/Defines.hpp> #include <StorageKit/NVME.hpp> #include <StorageKit/AHCI.hpp> +#include <StorageKit/SCSI.hxx> -typedef NewOS::UInt16 SKScsiPacket[12]; - -extern const SKScsiPacket kCDRomPacketTemplate; - -#define f_kDriveSectorSizeHDD (512) -#define f_kDriveSectorSizeSSD (4096) -#define f_kDriveSectorSizeCDROM (2048) - -#define f_kDriveSize(LAST_LBA) ((LAST_LBA + 1) * f_kDriveSectorSize) - +#define kDriveSectorSizeHDD (512) +#define kDriveSectorSizeSSD (4096) +#define kDriveSectorSizeCDROM (2048) |
