Re: Accessing a block device within kernel space..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Vinod,

Thank you for your response. I have read Chap 13 of
ldd a few times.  What I am looking for is pointers to
send read/write commands to a block device, not how to
write a block device driver.

Regards,
Ahmed.

--- Vinod Sreedharan <vinod.sreedharan@xxxxxxxxxxxxxx>
wrote:

>   
> >reads/writes to this block device, without any type
> of
> >caching, and without going through any layers (e.g
> >filesystem).
> 
> I guess what you want to do is "raw I/O"
> 
> >1) Allocate buffer_head structure
> >2) Allocate memory for data (read or write).
> >    (This is where I need some pointers as to which
> >funstions to use, and where to allocate memory
> from).
> >3) Minimal initialization of buffer_head structure,
> so
> >make_generic_request can carry out the operation.
> >    (Need some pointers here, as there are too many
> >fields in buffer_head structure).
> >4) Call generic_make_request().
> >5) Upon completion of command, free memory.
> 
> Not sure if you should work with buffer heads to do
> raw-IO. If you are talking of 2.4 kernel, kiobuf
> interfaces should be used. 
> 
> You may want to read Chapter 13 of the ldd book by
> Rubini for information. Its online in case you
> didn't know!
> 
> Hope this helps.
> 
> Thanks,
> Vinod
> 
> >Steps 2 and 3 are where I am a bit lost at this
> point.
> >  Can someone please point me to examples in the
> linux
> >kernel source where this is done, or examples of
> >applications that might do this.
> >
> >Thank you,
> >Ahmed.
> >
> >
> >
> >
> >_______________________________
> >Do you Yahoo!?
> >Declare Yourself - Register online to vote today!
> >http://vote.yahoo.com
> >
> >--
> >Kernelnewbies: Help each other learn about the
> Linux kernel.
> >Archive:      
> http://mail.nl.linux.org/kernelnewbies/
> >FAQ:           http://kernelnewbies.org/faq/
> >
> 



		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux