0

So here's the background:

I've got this SCSI device with media that has raw data on it (for simplicity let's say it contains abc123). This device is on a Windows machine. I'd like to use C/C++ to initalize the device, open it, send the SCSI read command to the device, and ultimately "read" the bytes.

I've searched for similar topics, but I keep getting Linux/Unix guides, or Visual C++ (which I do not have access to).

Does anyone know a good way to start this? Maybe some sample code or maybe someone has a tutorial laying around ;-)

Thank you in advance!

EDIT: I am using Cygwin.

Harry Johnston
  • 35,639
  • 6
  • 68
  • 158
redhotspike
  • 1,056
  • 5
  • 17
  • 39
  • First, cygwin is not a compiler, it is an emulator for *nix environments at best. Second, you should start by reading the Windows API as you are clearly running on Windows. But if you want to use the Windows API, I would not do that under cygwin, it adds one more layer of complexity that you clearly don't need. Try using a free Windows compiler (e.g. Mingw) Alternatively, you can download/install Visual C++ (or Studio) Express, which is free – Attila Mar 30 '12 at 16:27
  • I realize that cygwin is not a compiler, but I am using the cygwin environment for compiling. I do not have access to the Mingw compiler either for the same reason I do not have access to Visual C++. Thank you. – redhotspike Mar 30 '12 at 16:30
  • Good luck to you, then. You are in it for the long haul... – Attila Mar 30 '12 at 16:31
  • Lol already been in the long haul. But if I figure it out - kudos! – redhotspike Mar 30 '12 at 16:35
  • @redhotspike: I suggest you ask another question: "How do I call the Win32 API from a Cygwin program?" – Harry Johnston Mar 31 '12 at 00:42

2 Answers2

0

UPDATE: After banging my head into a wall for quite some time, and some pleading and begging, I managed to get my superviser to allow me to get Visual Studio 2003 installed!

To anyone looking for more information on this topic, I highly agree with the comments provided above-it's near impossible to accomplish this on a Windows machine and not use Visual C++.

My only other suggestion is to make the wonderful switch to *nix world (if you can)!

redhotspike
  • 1,056
  • 5
  • 17
  • 39
  • You didn't need Visual C++ in particular, you just needed a Windows compiler. Mingw would have been perfectly adequate for the stated purpose. – Harry Johnston May 01 '12 at 23:27
  • 2
    (And I strongly suspect that trying to do a similar task in Linux, but insisting on using Wine rather than native code, would prove just as difficult!) – Harry Johnston May 01 '12 at 23:29
0

If you absolutely must go down to the hardware level and as far as linux is concerned you would have to use IOCTL commands, for example: http://sg.danny.cz/sg/sg_io.html

A_A
  • 2,326
  • 18
  • 27