Tuesday, March 01, 2011

Reading raw disks with python - Windows/Linux/Mac

We have been working for a while on an embedded solution that geo-tags jerks using an accelerometer (I know it sounds funny :)). Not wanting to increase the overhead on our tiny < 16MHz 8 bit AVR and maintain our precise sampling requirements, we came up with a simple filesystem that does the job and this fancy format meant that we needed some code on the computer end to read the sdcard. Took us a while to search out the raw disk file for Windows. The following snippet shows how to search the disk at a particular address - [Our disk structure had the word MOMS at that address.]

tl;dr Snippet to read the raw disk using python on Windows/Linux/MacOSX