|
From: Tim R. <ti...@pr...> - 2011-10-24 18:45:41
|
Eric Sepich wrote:
> I would like to develop a
> very simple program to read and write data (files) to and from a USB
> based SD Card reader. For the time being I want to do this with the most
> simple code possible...
Here is approximately the simplest code possible for that task.
#!/bin/sh
echo Hello. > /media/sdcard/file1
cat /media/sdcard/file1
You REALLY do not want to undertake the task of accessing a USB mass
storage device at a raw level. Think about it this way. Would you
consider writing a "simple" program to read and write files on your
primary hard disk, without using any drivers of any kind? How many
things would you have to learn? You'd have to learn ATA controller
register programming, interrupts, DMA, ATA commands, sector mapping,
partition table layouts, and complete file system specifications. It is
not a "very simple program". Accessing a USB mass storage device is
exactly the same.
--
Tim Roberts, ti...@pr...
Providenza & Boekelheide, Inc.
|