I want to send customized CDB (SCSI commands) to my USB mass storage device. And read back.
Currently I am using the sg_raw from sg3_utils-1.46mgw32 to send. Like
[login to view URL]
sg_raw -r 512 pd1 25 00 00 00 00 00 00 00 00 00 -n
sg_raw -s 512 -i [login to view URL] pd1 2a 00 00 00 01 00 00 00 01 00 -n
sg_raw -r 512 pd1 28 00 00 00 01 00 00 00 01 00 -n
below is what I need:
1. I have a lot of data to input. Let's say, more than 100k lines. The speed of sending 100k lines commands from windows cli with sg_raw is too slow. I need to improve this. So you need to fimplify the operation from 100k lines to 1 line. like
sg_raw_customized [login to view URL] so the tool will send all the data one by one.
2. I need you to create a tool to generate the [login to view URL] in above. I will let you know how to do that. Basically you just need to convert some strings(CDB content) to the all.dat.
3. I also need you add the feature for sg_raw to read data and output to screen (windows cli) and save to bin file or text file.
4. the test file or bin file generated from item 3 in above will be able to used by sg_raw to write data into the device.
The sg_raw is the option I am using. If you have better solution, like using python framework, that will be acceptable. You can let me know.
But the most important thing is the performance. If the performance is good, I am ok.