From: Greg KH <[EMAIL PROTECTED]>
Reply-To: linux-usb-devel@lists.sourceforge.net
To: [EMAIL PROTECTED]
CC: linux-usb-devel@lists.sourceforge.net
Subject: Re: [linux-usb-devel] Query over mouting mass-storage driver
Date: Sat, 29 Apr 2006 00:44:52 -0700
On Sat, Apr 29, 2006 at 06:32:17AM +0000, [EMAIL PROTECTED] wrote:
> >On Fri, Apr 28, 2006 at 05:01:32AM +0000, [EMAIL PROTECTED]
wrote:
> >> Hi,
> >>
> >> I have question.
> >>
> >> I have written a Skelton driver for Mass-Storage device (init,exit,
> >probe,
> >> disconnect,release,and open). When I tried to test (by open
> >("/dev/sda5",
> >> read-only)) my Skelton driver by writing an application, i failed to
> >open.
> >> I noticed that I have to mount the memory stick after doing insmod
> >> my_driver.ko.
> >
> >Yes, that's the way that block devices work.
> >
> >> my questions are...
> >
> >Our first one is, why write another mass-storage driver when the kernel
> >already has 2?
>
> Greg I agree with you. There is no need to write a driver. But What I am
> trying to do is, I am learning, I am trying to learn how to write a USB
> driver in linux on my own, with the help of this group. So I just wrote
a
> skelton driver and want to test.
A mass-storage driver is NOT the thing to start out with to "just test".
I suggest something much simpler that doesn't involve the SCSI spec :)
I have written skelton drivers for scanner, webcam and printer. Now I am
doing the same for mass-storage stick. Thats the reason why I am putting my
queries :). So in the case of mass-storage, can you tell me how to test with
a sample application?
Like a USB thermometer. That's what I use in a "how to write a real
working driver" class that I give, and it can be done in 2 hours.
> >> 1) Do I have to mount the stick like "mount -t vfat /dev/sda5
> >/mnt/storage"
> >> before doing open in the application?
> >
> >You don't ever call "open" on a block device when dealing with a file
> >system.
>
> Without calling "open( "/dev/usb/<node>", R_ONLY )" how can I access
node
> for read/write in future when I will write them in my driver?
>
> If you don't mind could be more clear?
Please read up on how block devices work, they are not like char
devices. If you need more information, the book, "Linux Device Drivers,
third edition" is a good place to start. It's free online if you don't
want to purchase it.
I just downloaded the chapters, I will surely go through those chapters.
Thanks for your valuble reference.
> >> 2) If I mount with the above mentioned command, from my test
application
> >> can I able to access the device with the open call?
> >
> >No.
>
> What should I do inorder to acess the device from my application by
using
> by skelton driver?
It all depends on what type of device you have. Try reading the USB
chapter in the above mentioned book for more details.
Ya I will do it.
> >> 3) Otherwise do I have to write any piece of code in the driver
itself
> >for
> >> mounting?
> >
> >You just have to use the standard block driver or scsi interface. You
> >are doing that, right?
>
> :(......do you mean to say that the scsi commands like Inquiry,
> Test_unit_ready, Request_sense?
You did read the USB storage spec, right?
I have read "usbmassbulk_10.pdf" also scsi command set. Any futher more
information do I need to have rather than these two?
good luck,
Thank you,
Regards,
Jeeva
greg k-h
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
_________________________________________________________________
Shah Rukh fan? Know all about the Baadshah of Bollywood. On MSN Search
http://server1.msn.co.in/profile/shahrukh.asp
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel