Re: USB Mass Storage Driver Question

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

 



On Fri, Jun 18, 2010 at 04:00:28PM -0700, S I wrote:
> 
> 
> > > I have done copying memory using a driver to SATA hard drive.
> > > Basically by programming SATA Controller registers, doing DMA to write
> > > to the sectors of SATA hard drive. Doing this from a User application
> > > is completely out of question for my purpose. 
> > 
> > But you said you "had" to do this without using any kernel interfaces,
> > how do you do that for a SATA device unless you are in the kernel?
> 
> It needs to be done from Kernel directly accessing the PCI device
> corresponding to the SATA or USB controller. What I meant is -
> "Windows has its own framework for writing USB drivers, Mac OS X has
> its own way of writing USB driver and I guess same for Linux too" - I
> don't want to use these frameworks or API. I will definitely use
> kernel functions - for allocating memory, convert virtual address to
> physical address etc. 

But you need to use the PCI functions to do this, so why not just use
the USB ones, and then, hey, use the SCSI ones, and look, why not just
use userspace :)

> > And why do you have to do this?  What problem are you
> > really trying to
> > solve here?  Why go around the operating system
> > entirely?  One might
> > suspect you were trying to write a root-kit :)
> 
> It is only for an internal purpose and will never go into any product
> or source code base.  

Again, why?  What are you trying to solve here?  You are asking for help
for a very strange thing, basically how to go around all of our code,
yet, you don't explain _why_ you don't like using our code.

> > You would have to emulate the whole ehci driver, as well as implement
> > the scsi stack to write scsi commands to the device.
> 
> Not sure whether the following makes sense...
> "Read from EHCI spec that Asynchronous List is used for Bulk & control
> Transfers. I assume SCSI commands can be wrapped in those transfers".
> If it is feasible, I think I don't need to write entire ehci/scsi
> stack (for my purpose). 

I think in the end, you will have done just that.

What about the filesystem on the device?  How are you going to handle
that?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux