All of lore.kernel.org
 help / color / mirror / Atom feed
From: greg@kroah.com (Greg Kroah-Hartman)
To: kernelnewbies@lists.kernelnewbies.org
Subject: USB file mmap
Date: Mon, 7 Jul 2014 13:29:29 -0700	[thread overview]
Message-ID: <20140707202929.GA27543@kroah.com> (raw)
In-Reply-To: <CAC-LjFvYkJWXc-RPQGJky+OxOE70XSm1H-uMfcTvFuzUHP-J7A@mail.gmail.com>

On Tue, Jul 08, 2014 at 01:26:26AM +0530, Jeshwanth Kumar N K wrote:
> Hi Greg,
> 
> Thanks for the reply.
> 
> I recently purchased an mbed board
> https://mbed.org/platforms/mbed-LPC1768/?(friend recommended) to learn
> USB Mass storage class. And used OpenLPC usb stack with fatfs example
> to check how it works (used protocol analyser and stuff, to know whats
> happening). In that they are reading each buffer, i mean copying
> buffer (8k) of data to RAM and process it. And other idea I found is
> using diskio function in openLPC stack to read the data in USB flash
> (but this is without file system).

The USB storage protocol does not define a specific filesystem, so you
can send "raw" block commands to the device, but that's usually not very
interesting.

> As a Linux user I knew in Linux we can do mmap easily for a file (with
> filesystem). So thought of asking from where to start understanding
> these concepts :).

mmap on a file on disk is the same as USB flash, a USB storage device is
just a SCSI device (a quite complex little device, not a trivial one at
all.)  As I said, you have a filesystem, block layer, SCSI layer, USB
layer, and then the VFS and other stuff going on here.  So I'd recommend
focusing on one layer at a time, otherwise you will be overwhelmed.

good luck,

greg k-h

  reply	other threads:[~2014-07-07 20:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-07 14:00 USB file mmap Jeshwanth Kumar N K
2014-07-07 16:34 ` Greg KH
2014-07-07 19:56   ` Jeshwanth Kumar N K
2014-07-07 20:29     ` Greg Kroah-Hartman [this message]
2014-07-07 20:32       ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140707202929.GA27543@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.