Embedded Linux as Attached USB Storage Device?
dont_drink_the_water asks: "I am currently working on a few projects which will (hopefully) use Embedded Linux to deliver content (mp3 players, web servers, other possibilities). The question is, can Linux act as a USB attached hard drive, so that other machines can simply read/write data on the hard drive by using the USB port? Is anyone currently working on projects like this, and has any software been developed for this purpose?"
Oh yeah. In fact, you won't believe it, but I've actually got Linux acting as a power supply right now. I couldn't get Linux to act as a SoundBlaster Audigy, however, but I'm still working on it.
-Bodero
Note: While they say they are based on linux, they do not appear to of have released the sources anywhere that I can find. They do claim to be making a developers kit, but that is alos hard to find at the moment....
Me fail english? That's unpossible!
This question doesn't really make sense as written, does it? No....didn't think so.
Why? It would be much cheaper and simpler to simply design an I/O interface to do that (or use any of the generic designs published by most of the big chip houses. E.g. NEC, Motorola, Maxim, etc.)
Unless you're talking a RAID chassis or something (which be insanely stupid to hang off USB), it isn't much more than serial/parallel conversion/buffering with some voltage matching and a little driver code.
Using embedded Linux for this would be like converting a laptop into a trip-computer for your bicycle. Major overkill.
I couldn't imagine a better idea than to run linux on my devices on a computer running linux. Infact, I have linux running on my sound processing unit which talks to my sound card, which also runs linux, which talks to my computer, which also runs linux. Infact, I dont have a single device that ISN'T based on some form of linux. Wow, the world is such a better place now that I run a seperate OS on everything.
Basically my understanding of this question is:
"Can Linux act as a USB slave, and provide a slave or 'target' implementation of the USB Mass Storage Class?"
In other words, can I build a fancy MP3 box with lots of storage that appears to be a USB hard drive to the host PC, but is really a Linux machine pretending to be "just" a USB hard disk?
USB slave drivers and an Open Source implementation of the slave side of the USB Mass Storage Class would be cool.
The question is connectivity between different machines and devices...the terapin-mine was a great example. Thanks to those who even attempted to post something useful. The machine does more than just acting as a hard drive, of course, so yes, it will be necessary to have an operating system on it. The question still stands - how can a linux based machine act as a usb master and slave? Are there any existing projects?
I can't believe all the short sighted hecklers posting sarcastic relpies to this! Are you morons?
Whether you're talking about a portable mp3 player, a wearable computer, or whatever the embedded application, can't you see the usefullness of being able to plug it into any computer usb port and have instant access to the file system? Here's one scenario: You have this linux-based mp3 player. You take it to work in the morning and plug it into your office pc where winamp accesses your mp3's to play through your pc sound system while you work. At the end of the day you copy the project you have been working on to the mp3 player hard disk. On the way home you stop at a friend's house and let him hear one of the new mp3's you've got. He want's a copy so you plug the player into his pc and copy the file over to his hard drive. He doesn't have broadband so you also leave him the latest 'what's cool' ISO so he can burn a copy (Hey you've got a 5gig drive on this thing, why not cary some cool stuff around) Then you go home and plug the player into your own pc and download the project you brought home from work.
If you are talking about some other embedded application it could still be very usefull. The nice thing about it would be that you can plug the thing into any pc and have instant access to the files.
-=-=-=-=- osjedi uses Debian GNU/Linux. -=-=-=-=-
This would also be very usefull on a laptop. I would love to be able to plug a USB cable between my laptop and ANY desktop pr laptop pc for instant file access between the two. I can network all my own computers, but what if I want to share something with a friend or classmate? The "my laptop looks to your pc like a USB hard-drive" trick would be slick.
My Hipzip MP3 player from Iomega pretty much fits the bill. It runs on a proprietary os (dadio OS) which is based on eCos, [redhat.com] an embedded OS based on linux. It has updatable firmware and runs the OS on a maverick chip. It also has 40 MB removable media disks.
While this is a far cry from the 5GB disk proposed somewhere above, the idea however is solid. A handheld device that runs a linux based embedded OS and can plug in as a drive under windows, macOS and probably linux (if I get USB support working).
If you replaced the Iomega zip drive with a small hard drive, then it would be the device you are talking about.
As is, the Hipzip allows me to store any file that fits into the 40MB limit.
"A witty saying proves nothing." -Voltaire
The CerfCube is a ARM-based development board that can be used for designing USB devices. It runs Linux and has a number I/O capabilities.
http://www.softconnex.com/
not free, hardware specific
Some time ago, when I saw an ad about the SanCube I thought "That would be nice to have." and then "That should be possible to make!" especially since Firewire supports multiple masters and it's fast enough to make sense for a (albeit cheap) SAN.
Having one SAN storage which can me expanded and then you can assign partitions to a certain host just is much more flexible than anything else a standard computer uses. LVM and netblock devices help though.
Anyway, the point is, while USB has masters and slaves, Firewire does not distinguish between those, so every Firewire card can be host and slave, which makes it much easier from a hardware point of view to do, what the original poster wants to do.
Now the software is a different thing. While USB is cheap and simple (the master controls and polls the slaves, the slaves just respond), Firewire is much more like SCSI: everyone can start to talk suddenly. Since I am not a device driver programmer, this is too much for me. But then, I am not the one who has to program the device drivers...