Accessing a block device within kernel space..

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

 



Hi,

I would like to directly access a block device (e.g.
/dev/hda).  I would like to do very simple
reads/writes to this block device, without any type of
caching, and without going through any layers (e.g
filesystem).  

The steps I would like to do are the following:

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.

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/


[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