* 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:
2015-10-14 01:07:45 +01:00
parent 9f0d09b789
commit d7546d4e88
6 changed files with 29 additions and 47 deletions

View File

@@ -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>
* Device/Constructor.cs:

View File

@@ -148,15 +148,8 @@ namespace DiscImageChef.Devices.Linux
enum LinuxIoctl : ulong
{
// SCSI IOCtls
SG_EMULATED_HOST = 0x2203,
SG_GET_VERSION_NUM = 0x2282,
SG_IO = 0x2285,
SG_GET_SCSI_ID = 0x2276,
// ATA IOCtls
HDIO_DRIVE_CMD = 0x031F,
HDIO_DRIVE_TASK = 0x031E,
HDIO_DRIVE_TASKFILE = 0x031D
}
[Flags]

View File

@@ -56,12 +56,6 @@ namespace DiscImageChef.Devices.Linux
[DllImport("libc", EntryPoint="ioctl", SetLastError = true)]
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);
}
}

View File

@@ -70,39 +70,5 @@ namespace DiscImageChef.Devices.Linux
public uint duration; /* [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;
}
}

View File

@@ -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>
* DiscImageChef.Interop.csproj:

View File

@@ -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;
}
}
}