Self-contained ramdisk as GRUB module
Posted: Tue May 16, 2006 12:02 pm
I'm sure there's some really obvious solution, but I haven't seen the light yet, so maybe someone else has. Problem is as follows:
Link a module, that contains a ramdisk driver (that's not a problem) and a set of files, in such a way that the driver can access the files.
Best I've come up with is something like: make an archive out of the required files, pipe it into a script that turns it into (say) assembler source with the bytes converted into one long hexadecimal array and pipes that to gas. Then it's just an array in an object file, and can be linked easily.
The archive part is fine, but is there easier way to get it linked as raw data with a label before and after it (or length, either will do), without the ugly binary->hexdecimal conversion? I could write an object file manually, I know, but is there a tool that already does that?
Or have I just missed something?
I want to run the tool in Linux, and I preferably want the object be ELF.
On Windows there's the whole resource mess for this thing, but nobody seems to use anything like that in ELF land. And there's that XPM format that seems like a warning sign to me...
Link a module, that contains a ramdisk driver (that's not a problem) and a set of files, in such a way that the driver can access the files.
Best I've come up with is something like: make an archive out of the required files, pipe it into a script that turns it into (say) assembler source with the bytes converted into one long hexadecimal array and pipes that to gas. Then it's just an array in an object file, and can be linked easily.
The archive part is fine, but is there easier way to get it linked as raw data with a label before and after it (or length, either will do), without the ugly binary->hexdecimal conversion? I could write an object file manually, I know, but is there a tool that already does that?
Or have I just missed something?
I want to run the tool in Linux, and I preferably want the object be ELF.
On Windows there's the whole resource mess for this thing, but nobody seems to use anything like that in ELF land. And there's that XPM format that seems like a warning sign to me...