Mass storage drivers
Posted: Sat May 14, 2011 5:55 pm
So far I've been loading files as GRUB "modules" into memory and using a fake ramdisk driver to read them as filesystems. This has become a problem for larger filesystems like FAT32 where older computers don't necessarily appreciate loading modules that are a few hundred megabytes in size... I'm wondering if I could get suggestions on where to start in terms of writing mass storage drivers. I'd like to be able to read whatever media I'm booting from, and at the moment that seems to be CD-ROMs, but of course I'd like to move to hard disk.
What I'd really like to know is how difficult is it to implement CD-ROM support. Are there other mass storage devices that are easier?
And more on the theoretical side, where is the best place to cache results from the disk? And how much is a good idea to cache? Is it done by the driver that does the reading, or perhaps at some other point in the filesystem (or both)? I guess this could be a matter of taste but I would like to hear other perspectives on the issue.
One last question: how do your storage drivers interface with your filesystem? My ramdisk driver is pretty dumb: it just has a read and write function that pass a length, position and pointer to a buffer. Is this generally sufficient for minimal storage implementations or is life not so simple with real hardware?
What I'd really like to know is how difficult is it to implement CD-ROM support. Are there other mass storage devices that are easier?
And more on the theoretical side, where is the best place to cache results from the disk? And how much is a good idea to cache? Is it done by the driver that does the reading, or perhaps at some other point in the filesystem (or both)? I guess this could be a matter of taste but I would like to hear other perspectives on the issue.
One last question: how do your storage drivers interface with your filesystem? My ramdisk driver is pretty dumb: it just has a read and write function that pass a length, position and pointer to a buffer. Is this generally sufficient for minimal storage implementations or is life not so simple with real hardware?