3

I am working on an embedded project where data is stored on an SD card using no filesystem (I write data to specific blocks). My embedded device provides a mass-storage interface to the device, but there is no formatted filesystem on the device.

I was wondering how to access the device and read a specified sector at a time? I found a reference to pinvoke, but I wasn't able to figure out much by looking at pinvoke's website.

Any suggestions would be appreciated; thanks!

reza
  • 1,329
  • 2
  • 22
  • 37
  • 3
    The important bit is to find the API for said "embedded device" (this can then be p/invoked) - this is tagged C# - but what OS/run-time? –  Oct 12 '12 at 01:29
  • Here is a blog post detailing what you are looking for. http://www.codeproject.com/Articles/28314/Reading-and-Writing-to-Raw-Disk-Sectors – tsells Oct 12 '12 at 04:07
  • Assume it's just a mass storage device. I figured out the method was through P/Invoke's kernel32 ReadFile/WriteFile. Luckily, the drive shows up not doesn't try to get me to format it which is perfect. – reza Oct 21 '12 at 21:42
  • 2
    http://stackoverflow.com/questions/38190/how-do-i-read-a-disk-directly-with-net/38275#38275 got me pointed in the right direction. – reza Oct 21 '12 at 21:43

0 Answers0