mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
* DiscImageChef.Devices/Linux/Enums.cs:
* DiscImageChef.Devices/Linux/Extern.cs: * DiscImageChef.Devices/Linux/Structs.cs: Since libata, ATA/ATAPI commands should be sent using libata's SCSI/ATA Translation Layer, so remove HDIO ioctls. * DiscImageChef.Interop/DetectOS.cs: Add code to detect if running under 32 or 64 bits.
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2015-10-14 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
|
* Linux/Enums.cs:
|
||||||
|
* Linux/Extern.cs:
|
||||||
|
* Linux/Structs.cs:
|
||||||
|
Since libata, ATA/ATAPI commands should be sent using
|
||||||
|
libata's SCSI/ATA Translation Layer, so remove HDIO ioctls.
|
||||||
|
|
||||||
2015-10-13 Natalia Portillo <claunia@claunia.com>
|
2015-10-13 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
* Device/Constructor.cs:
|
* Device/Constructor.cs:
|
||||||
|
|||||||
@@ -148,15 +148,8 @@ namespace DiscImageChef.Devices.Linux
|
|||||||
enum LinuxIoctl : ulong
|
enum LinuxIoctl : ulong
|
||||||
{
|
{
|
||||||
// SCSI IOCtls
|
// SCSI IOCtls
|
||||||
SG_EMULATED_HOST = 0x2203,
|
|
||||||
SG_GET_VERSION_NUM = 0x2282,
|
SG_GET_VERSION_NUM = 0x2282,
|
||||||
SG_IO = 0x2285,
|
SG_IO = 0x2285,
|
||||||
SG_GET_SCSI_ID = 0x2276,
|
|
||||||
|
|
||||||
// ATA IOCtls
|
|
||||||
HDIO_DRIVE_CMD = 0x031F,
|
|
||||||
HDIO_DRIVE_TASK = 0x031E,
|
|
||||||
HDIO_DRIVE_TASKFILE = 0x031D
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
|
|||||||
@@ -56,12 +56,6 @@ namespace DiscImageChef.Devices.Linux
|
|||||||
|
|
||||||
[DllImport("libc", EntryPoint="ioctl", SetLastError = true)]
|
[DllImport("libc", EntryPoint="ioctl", SetLastError = true)]
|
||||||
internal static extern int ioctlSg(int fd, LinuxIoctl request, ref sg_io_hdr_t value);
|
internal static extern int ioctlSg(int fd, LinuxIoctl request, ref sg_io_hdr_t value);
|
||||||
|
|
||||||
[DllImport("libc", EntryPoint="ioctl", SetLastError = true)]
|
|
||||||
internal static extern int ioctlHdTaskfile(int fd, LinuxIoctl request, ref hd_drive_task_hdr value);
|
|
||||||
|
|
||||||
[DllImport("libc", EntryPoint="ioctl", SetLastError = true)]
|
|
||||||
internal static extern int ioctlHdTask(int fd, LinuxIoctl request, ref byte[] value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,39 +70,5 @@ namespace DiscImageChef.Devices.Linux
|
|||||||
public uint duration; /* [o] */
|
public uint duration; /* [o] */
|
||||||
public SgInfo info; /* [o] */
|
public SgInfo info; /* [o] */
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
struct hd_drive_task_hdr
|
|
||||||
{
|
|
||||||
public byte data;
|
|
||||||
public byte feature;
|
|
||||||
public byte sector_count;
|
|
||||||
public byte sector_number;
|
|
||||||
public byte low_cylinder;
|
|
||||||
public byte high_cylinder;
|
|
||||||
public byte device_head;
|
|
||||||
public byte command;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
struct hd_drive_task_array
|
|
||||||
{
|
|
||||||
public byte command;
|
|
||||||
public byte features;
|
|
||||||
public byte sector_count;
|
|
||||||
public byte sector_number;
|
|
||||||
public byte low_cylinder;
|
|
||||||
public byte high_cylinder;
|
|
||||||
public byte device_head;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
struct hd_drive_cmd
|
|
||||||
{
|
|
||||||
public byte command;
|
|
||||||
public byte sector;
|
|
||||||
public byte feature;
|
|
||||||
public byte nsector;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
2015-10-14 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
|
* DetectOS.cs:
|
||||||
|
Add code to detect if running under 32 or 64 bits.
|
||||||
|
|
||||||
2015-10-13 Natalia Portillo <claunia@claunia.com>
|
2015-10-13 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
* DiscImageChef.Interop.csproj:
|
* DiscImageChef.Interop.csproj:
|
||||||
|
|||||||
@@ -184,5 +184,21 @@ namespace DiscImageChef.Interop
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks if the underlying runtime runs in 64-bit mode
|
||||||
|
/// </summary>
|
||||||
|
public static bool Is64Bit()
|
||||||
|
{
|
||||||
|
return IntPtr.Size == 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks if the underlying runtime runs in 32-bit mode
|
||||||
|
/// </summary>
|
||||||
|
public static bool Is32Bit()
|
||||||
|
{
|
||||||
|
return IntPtr.Size == 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user