ROMFS - ROM File System
Posted: Thu Apr 20, 2006 11:59 pm
Hi,
I wanted to share our work on Romfs,. Gawd has actually initiated the stuff, but I finally releasing it, since he gave me the permission and since I took it over (if I can say) and enhanced it with (what I thought to be) complete I/O routines (providing fio and libc style functions).
So what is it ? Basically, ROMFS allow to emulate a directory, that directory being an binary image in memory. It allows to embed files and external resources directly in the ELF, while keeping the original i/o routines to access them..
The initial project has been started by Jakub Jelinek on linux, then gawd reused it for flashback, and this is how I discovered it. Drakonite also participated in adding functionality, and since the stuff is starting to be relatively mature (IMHO), it's time to share it !
Sources are here : http://psxdev.info/evilo/download/romfs_0100.zip
I tried to respect the ps2sdk structures, as maybe we could add it into the official SDK :
/ps2sdk/ee/fs/romfs/include
/ps2sdk/ee/fs/romfs/src
-> contains romfs routines
/ps2sdk/ee/fs/romfs/regress
-> regression campaign for i/o routines (based on the libc one)
/ps2sdk/ee/fs/samples
-> makefile.romfs sample (to be reused for any new project)
/ps2sdk/ee/fs/tools/genromfs
-> PC (W32/Linux) side tool to generate the binary (.o) from the directory.
You'll find in the regress directory a good example on how to use it, but it just consist on globally respecting the following steps :
- include makefile.romfs into your makefile (and adapt path,... Of course)
- include <romfs_io.h> in your project
- call rioInit() from your main
And you're done !
All calls to fopen, fread, etc.. Are replaced by calls to ropen, rread, ... Thanks to the defines in the makefile (...)
Feel free to comment on how to do this in a cleaner way (I don't think making an IRX would the best solution, even if it would give the access all the "driver" stuff presents on the IOP).
That's it... Hoping that I have been clear, and that it will be usefull to somebody else ;)
Credit : gawd, drakonite, and myself.. !
[EDIT] Updated the licence in the source code (now LGPL 2.0)
I wanted to share our work on Romfs,. Gawd has actually initiated the stuff, but I finally releasing it, since he gave me the permission and since I took it over (if I can say) and enhanced it with (what I thought to be) complete I/O routines (providing fio and libc style functions).
So what is it ? Basically, ROMFS allow to emulate a directory, that directory being an binary image in memory. It allows to embed files and external resources directly in the ELF, while keeping the original i/o routines to access them..
The initial project has been started by Jakub Jelinek on linux, then gawd reused it for flashback, and this is how I discovered it. Drakonite also participated in adding functionality, and since the stuff is starting to be relatively mature (IMHO), it's time to share it !
Sources are here : http://psxdev.info/evilo/download/romfs_0100.zip
I tried to respect the ps2sdk structures, as maybe we could add it into the official SDK :
/ps2sdk/ee/fs/romfs/include
/ps2sdk/ee/fs/romfs/src
-> contains romfs routines
/ps2sdk/ee/fs/romfs/regress
-> regression campaign for i/o routines (based on the libc one)
/ps2sdk/ee/fs/samples
-> makefile.romfs sample (to be reused for any new project)
/ps2sdk/ee/fs/tools/genromfs
-> PC (W32/Linux) side tool to generate the binary (.o) from the directory.
You'll find in the regress directory a good example on how to use it, but it just consist on globally respecting the following steps :
- include makefile.romfs into your makefile (and adapt path,... Of course)
- include <romfs_io.h> in your project
- call rioInit() from your main
And you're done !
All calls to fopen, fread, etc.. Are replaced by calls to ropen, rread, ... Thanks to the defines in the makefile (...)
Feel free to comment on how to do this in a cleaner way (I don't think making an IRX would the best solution, even if it would give the access all the "driver" stuff presents on the IOP).
That's it... Hoping that I have been clear, and that it will be usefull to somebody else ;)
Credit : gawd, drakonite, and myself.. !
[EDIT] Updated the licence in the source code (now LGPL 2.0)