kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* mmap on a block device
@ 2011-06-07  4:27 Kaustubh Ashtekar
  2011-06-07  6:17 ` Rajat Sharma
  0 siblings, 1 reply; 4+ messages in thread
From: Kaustubh Ashtekar @ 2011-06-07  4:27 UTC (permalink / raw)
  To: kernelnewbies

Hello All,

Is it possible to mmap on a block device? I am writing my own kernel space
filesystem on Linux (academic project). I am writing a user space tool to
format the block device (again my own ramdisk driver). It would be much
simpler if I could just mmap the block device into my address space.

-Kaustubh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110607/14d3b2a0/attachment.html 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* mmap on a block device
  2011-06-07  4:27 mmap on a block device Kaustubh Ashtekar
@ 2011-06-07  6:17 ` Rajat Sharma
  2011-06-07  6:44   ` Kaustubh Ashtekar
  0 siblings, 1 reply; 4+ messages in thread
From: Rajat Sharma @ 2011-06-07  6:17 UTC (permalink / raw)
  To: kernelnewbies

yes its fairly possible, go ahead and try it.

On Tue, Jun 7, 2011 at 9:57 AM, Kaustubh Ashtekar <ksashtekar@gmail.com> wrote:
> Hello All,
> Is it possible to mmap on a block device? I am writing my own kernel space
> filesystem on Linux (academic project). I am writing a user space tool to
> format the block device (again my own ramdisk driver). It would be much
> simpler if I could just mmap the block device into my address space.
> -Kaustubh
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* mmap on a block device
  2011-06-07  6:17 ` Rajat Sharma
@ 2011-06-07  6:44   ` Kaustubh Ashtekar
  2011-06-07 14:53     ` Dave Hylands
  0 siblings, 1 reply; 4+ messages in thread
From: Kaustubh Ashtekar @ 2011-06-07  6:44 UTC (permalink / raw)
  To: kernelnewbies

Done. mmap was successful.

Is it a good idea to mmap a block device. A block device being much bigger
than the available virtual address space, I will have to map it multiple
times while working on various parts of the block device.

BR,
Kaustubh

On Tue, Jun 7, 2011 at 11:47 AM, Rajat Sharma <fs.rajat@gmail.com> wrote:

> yes its fairly possible, go ahead and try it.
>
> On Tue, Jun 7, 2011 at 9:57 AM, Kaustubh Ashtekar <ksashtekar@gmail.com>
> wrote:
> > Hello All,
> > Is it possible to mmap on a block device? I am writing my own kernel
> space
> > filesystem on Linux (academic project). I am writing a user space tool to
> > format the block device (again my own ramdisk driver). It would be much
> > simpler if I could just mmap the block device into my address space.
> > -Kaustubh
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies at kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110607/0567cf86/attachment.html 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* mmap on a block device
  2011-06-07  6:44   ` Kaustubh Ashtekar
@ 2011-06-07 14:53     ` Dave Hylands
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Hylands @ 2011-06-07 14:53 UTC (permalink / raw)
  To: kernelnewbies

Hi Kaustubh,

Replying to all this time...

On Mon, Jun 6, 2011 at 11:44 PM, Kaustubh Ashtekar <ksashtekar@gmail.com> wrote:
> Done. mmap was successful.
> Is it a good idea to mmap a block device. A block device being much bigger
> than the available virtual address space, I will have to map it multiple
> times while working on various parts of the block device.

What it means to mmap any device is quite arbitrary and entirely up to
the driver writer.

All that mmaping means is to take some memory that the driver
allocated in kernel space and make that memory available into user
space. The contents of the memory is entirely up to the driver. Maybe
you put statistics in there? Maybe you make it map in the data storage
your block device is front-ending? It's up to the driver writer to
decide what goes there and whether it makes sense or not.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-07 14:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-07  4:27 mmap on a block device Kaustubh Ashtekar
2011-06-07  6:17 ` Rajat Sharma
2011-06-07  6:44   ` Kaustubh Ashtekar
2011-06-07 14:53     ` Dave Hylands

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).