1

I am implementing USB as a host using OHCI to read the files stored in the Flashdrive. To read I implement the read(10) command in SCSI. The Logical Block address being the sector number. The following is an image of the command I send for read(10) to read LBA 0x0000- https://i.stack.imgur.com/2pCYJ.png

I read 512bytes(size of one sector or 1 LBA)and the following is the output that i get for LBA 0x0000- https://i.stack.imgur.com/a4Rpr.jpg

The bytes in the above image are not present any where on the pendrive, I checked that using HXD. Now, for testing I filled the pendrive to full capacity. If I read any other LBA, other than 0x0000, then I always get 512 bytes of 0x00.

Could anyone please tell me what the problem could be? Am I supposed to execute some other command before I do a read(10) so that the USB sends me the right data maybe?

From my understanding I have put DPO, FUA and FUA_NV=0 and also RDPROTECT=2

Anurag
  • 651
  • 4
  • 18
  • @duskwuff would u know anything about this? – Anurag Dec 12 '15 at 08:04
  • If you are prepared to tackle this task, you are certainly capable of getting your output in a textual form and including it within the body of your question. As for your question, there are many open-source implementations of what you are trying to do, and reading one might be informative. Those for smaller systems may be simpler to understand. – Chris Stratton Dec 12 '15 at 15:32
  • Possible duplicate of [Can't properly read the boot sector from a FAT32 USB drive on Android device](http://stackoverflow.com/questions/29323088/cant-properly-read-the-boot-sector-from-a-fat32-usb-drive-on-android-device) – Turbo J Dec 12 '15 at 22:38
  • 1
    Question has the [same answer](http://stackoverflow.com/a/29330720/410847) as [29323088](http://stackoverflow.com/q/29323088/410847). Vote to close. – Turbo J Dec 12 '15 at 22:40

0 Answers0