Reputation: 51
I have a music playlist folder in my Flash drive (pen drive), music names are sorted in a fixed manner, I want to shuffle my music playlist by renaming the files. Generally I use Flash drive to play music in my car.
Is it practically possible to write a program for a flash drive? On inserting a flash drive into PC/car firmware; music files in the playlist folder must be shuffled every time.
Thank you.
I searched on web, I didn't find useful resources to accomplish the task.
Upvotes: 0
Views: 1323
Reputation: 364458
It's only possible if either of the following are true:
The "computer" you're inserting it into supports running code. (Like an autoexec.bat on Windows). Obviously this depends entirely on what CPU/"OS" your car's audio player runs. Unlikely that there's any intentional support for executing code, but you might find an exploit that would let you run code on your car's audio-player microcontroller. The audio player probably doesn't really have an OS, it's probably just a lightweight custom system.
Your flash drive can run custom firmware that has a driver for FAT32 and modifies its own contents on powerup, before making itself visible to the host.
Flash drives do have a microcontroller internally to run the flash remapping / wear-leveling firmware. But usually there's no documented interface for uploading programs to it. And normally it doesn't know anything about filesystems, only block-level stuff, so anything you wanted to stuff into it would have to include a driver for FAT32.
I assume some people have reverse-engineered the programming / firmware-update interface on some flash drives.
You can probably also get USB devices that are designed to run custom programs like this as well as act as USB storage. If you really really want this (and your car doesn't have a "randomize" mode you can use instead), buying a USB-storage device that was designed to be programmable would probably be the easiest way to go. I assume such things exist but IDK.
Upvotes: 1