kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: maildanrl@googlemail.com (Dan Luedtke)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Getting a block from a block device?
Date: Tue, 8 Nov 2011 12:56:07 +0100	[thread overview]
Message-ID: <CAAfuxnKP5aZ5vnro_zEGMW76JS3-QRCZmjseda7wgpX0ymQxmw@mail.gmail.com> (raw)
In-Reply-To: <CACzurzsCpKN_9Ew+g-HLvH=GuPQU=Tzf8yrimf-zDOjPtFsF2w@mail.gmail.com>

Hallo,

On Tue, Nov 8, 2011 at 12:27 PM, Stephen Gream <poisonthemon@gmail.com> wrote:
> Once you have the device registered (on /sys or /dev), register a read
> callback on the file and use copy_to_user to output the data

I read that article you referred to, but I don't think it addresses my
problem, as I may have been more clear on what I want to achieve
before. Sorry for that!
I want to eventually implement a file system, and therefore I am
studying the kernel sources to get an idea about all that.

Here is my general understanding on how thinks may work :)

virtual file system (VFS) <-[1]-> my file system implementation
<-[2]-> a block device

As I understood, all these subsystems are running in kernel mode.

For [1] I read vfs.txt and learned about the VFS-API
For [2] I have no idea where I can find the API documentation, however
there were some hints on the book "Linux Driver Development" from
O'Reilly in chapter "block devices". Nothing really helpful, as they
were talking about registering new block devices. I want to use
already present devices where I expect my filesystem to be present on.
To check that, I have to read the first 512 bytes.

The userspace implementation I was talking about previously is
something like a mkfs.myfilesystem, that's why i referred to fopen()
there.

Thank you!

Greetings,

Dan
-- 
Dan Luedtke
http://www.danrl.de

  parent reply	other threads:[~2011-11-08 11:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-08 11:06 Getting a block from a block device? Dan Luedtke
     [not found] ` <CACzurzsCpKN_9Ew+g-HLvH=GuPQU=Tzf8yrimf-zDOjPtFsF2w@mail.gmail.com>
2011-11-08 11:56   ` Dan Luedtke [this message]
2011-11-08 11:59     ` rohan puri
2011-11-08 12:28       ` mani
2011-11-08 14:02         ` Dan Luedtke
2011-11-08 15:18           ` Manish Katiyar
2011-11-09  4:54             ` rohan puri
2011-11-09  7:32               ` Dan Luedtke
2011-11-08 12:12     ` Alexandru Juncu
2011-11-08 12:21       ` Stephen Gream
2011-11-08 12:08 ` Javier Martinez Canillas

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=CAAfuxnKP5aZ5vnro_zEGMW76JS3-QRCZmjseda7wgpX0ymQxmw@mail.gmail.com \
    --to=maildanrl@googlemail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).