First, regarding write endurance I think this comes down to whether your CF cards have wear leveling or not. CF is commonly used as a HD replacement in embedded applications, and I think there are ones out there which do have wear leveling circuits. ....
Yes, I know that CF cards are used in embedded applications because I have seen it. I work for the local Chuck E. Cheese and they have two machines made by Trio-Tech (A Canadian company that makes motion simulator rides/games). These machines use Windows Embedded with a compact flash as the hard drive.
Now, what is meant by wear leveling?
I use USB flash drives extensively at my work, and I've run full Linux installs off them for years at a time with no issue.
I do run Linux as well and usually it is my first choice, but Linux still isn't 100% with certain applications, particularly for the work that want to do. Thusfar, Windows XP runs the applications just about flawlessly. BUT the problem is that that darn OS constantly wants to parse the hard drive.
As far as I know, Linux doesn't do this, but I am not 100% sure. As it is, I am running Linux on my main machine right now, and the hdd light flashes readily 1 time each second. Another thing that I am not sure if it 'just doing it' or if it is a read operation or a write operation.
I think most controllers these days do dynamic leveling, but I did have one drive which did static leveling (it was unbearably slow). Currently I have an Arch linux image I run off a USB flash drive (it is a virtualbox image inside a truecrypt container), no problems yet. My concerns with flash, esp MLC cells, are always much more with regard to bit rot than wear leveling though. I don't know if there are any studies of MLC flash reliability with regard to environmental factors (ie. heat), but having designed flash cells in the distant past I know leakages are a major concern (and manufacturers are reluctant to disclose mitigating circuitry, such as ECC implementations, probably due to a lack thereof - it makes it very difficult to gauge reliability).
That is interesting to know, but this is a problem that would be beyond the user control and thus backups and fail safes should be implemented. The good thing is that the CF card is easily replaced and that is what I like about the format.
Regardless of all this, I think the goal of having a never fail CF card is the wrong way to go about it.
That isn't what I am going for, but if there is a way I can assist in the LONGEVITY of the card and I have control over that, then I am certainly going to go that route. But as I mentioned above, if it is something that I cannot control, then it is time to revert to a backup.
For a game machine the install is essentially static (aside from maybe high scores). Small capacity flash is cheap these days, just get a couple cards and make one an offline backup. If you are constantly tweaking the machine just refresh the backup every 2-3 months or so. This is actually the way I go about it myself - I put all my files inside a truecrypt container on the flash device, and every day/week/month/whatever I drag and drop the whole container to a backup HD. Since the HD is much larger than any flash you can keep multiple timestamped images.
Sounds like a good plan, and yeah, that is what I would probably do. I can keep everything stored on my main machine which has two 500gig drives on it. I have a CF card reader on my printer and I can do dumps to a card from there.
Your other idea is intriguing though - running it off a ramdisk. I've never gotten around to it myself, but there is something you could try here:
http://memory.dataram.com/products-and-services/software/ramdisk
I will check that out later, but after I made my post last night, I did do some research and it seems that running Windows XP totally from ram alone is a difficult proposition to say the least. So the jury is still out on this one. Linux however CAN be run totally from a ram drive. Most Linux distributions can run a Live CD and does so by running the OS in ram (at least partially). There is at least one distribution called "Puppy Linux" that is extremely fast once loaded on (via a Live CD) because it is so small it runs ENTIRELY from within ram.
The caveat is that Puppy Linux is Slackware based and as such the repositories are not very endowed. I have had trouble with getting Mame to work correctly, but it does support Wine and I have managed to get some Windows based programs to run, but not the ones I need for my embedded projects. Still the door is open with this OS as I have not completed my testing on it. But for Ubuntu...nope. I don't think it will work.
I think if you can get your image small enough to fit inside a ram disk, plus allow enough working ram for the thing to function, then that is a great idea. I remember running a Puppy Linux live CD a long time back, and it would load itself entirely into ram, and it was blazing fast - programs would open instantly. I've had that sort of thing on my to-do list for a long time, so if you do that I would be interested in knowing your results.
LOL! This is what I get when I read and respond.
Actually this gives me another idea - if you use a ramdisk to load the OS and emulator and then add in a wireless card and a NAS, you could source the ROMs wirelessly from the NAS so you would have no capacity issue.
For MAME, naw...I only have about 400 roms and most of them are classic games. However, that idea does have merit for the jukebox program since I can keep all the songs in one place and the jukebox can parse a NAS unit that has many music titles on it. Since music takes up quite a bit more space than a MAME rom, it would be best to have all my music on a NAS with a standard hard drive. So yeah, then that is a good idea.
Why not use a proper ssd with a sata-to-ide adaptor?
Because that is expensive and an ssd cannot be easily removed and attached to my main computer as a compact flash card can.
With proper wear leveling, "wearing out" a large flash devices is not really a concern. I wouldn't recommend using them as swap,
Point noted. My computer is recognizing the Syba adapter as a removable drive and as such the feature of having a swap file is grayed out anyway. So the swap file is 'off'. Even with as low a ram as I have on my test machine, I didn't notice any problems (thusfar).
If you must run WindowsXP, there are some tricks, but I think MS only officially supports them on the "embedded" version.
Yeah, last night I was reading up on something called an Enhanced Write Filter. This is something that is included with the embedded version of XP. However, it is also something that can be added to Windows XP Professional too.
I do not have any details yet as I found this info late last night.
You can have it do copy-on-write to a ramdisk. This effectively "freezes" the system partition as any changes you make exist in RAM only and go away when you reboot and everything loads back off the mass storage. This avoids the overhead of a full ramdisk while still removing all write activity to the system partition. There's a "thaw" command if you want to make changes and commit them. I don't know anything about how to do this, only that it exists. A similar trick can be done on Linux via a variety of methods, or it's possible to just run Linux with everything mounted readonly, if you're careful.
Wow, you did mention a mouthful here and this does look like the direction that I would like to head in. Yes, I know that some distributions of Linux can be made Read Only. I have Ubuntu 10.04 and with this version you must supply a password to mount drives. Thus read/writing is automatically blocked. You can set permissions to read only if you like. The only thing is that I am not sure if the main OS partition could be set up this way. With Puppy Linux, I am sure it can be done since that OS is already set up to be able to run in RAM. A boot partition could be set up on the Compact Flash in which you can load up the OS straight into RAM. However, I don't know how to do it. But if it can be done with a CD-ROM, I am sure it can be done with a Compact Flash.
Now I know the rest of you have been talking about TRIM, but at this point in time my goals are to have the OS write to the compact flash as little as possible, or better yet, not at all.
So what it looks like I have to do is either find a way to get Windows XP to stop haphazardly writing to the compact flash, or I am looking at going with a different OS. The latter would be difficult as just about all my applications use sound and finding drivers for a non-parsing OS such as Windows 98 or DOS would be difficult. I am mostly dealing with newer style motherboards and just about all have built in sound.
I know that both MAME and DWJukebox can be set up on a DOS machine, but then I would probably have to look into a full sized motherboard that has an ISA slot on it. An ISA slot would allow the use of a Soundblaster 16 and I would be set there. Surprisingly this would solve the bulk of my problems, but not all. There are just some programs that I have that need to run on Windows. OR I could use Wine if I could get the darn com ports to work!
Thanx for the info guys and keep the suggestions coming.
Geo