KallistiOS
##version##
|
ROMFS virtual file system. More...
Go to the source code of this file.
Macros | |
#define | MAX_RD_FILES 16 |
The maximum number of files that can be open at a time. More... | |
Functions | |
int | fs_romdisk_mount (const char *mountpoint, const uint8 *img, int own_buffer) |
Mount a ROMFS image as a new filesystem. More... | |
int | fs_romdisk_unmount (const char *mountpoint) |
Unmount a ROMFS image. More... | |
ROMFS virtual file system.
This file contains support for the romdisk VFS. This VFS allows you to make Linux-style ROMFS images and either embed them into your binary or load them at runtime from some other source (such as a CD-ROM). These images are made with the genromfs program that is included in the utils portion of the tree.
You can choose to automount one ROMFS image by embedding it into your binary and using the appropriate KOS_INIT_FLAGS() setting. The embedded ROMFS will mount itself on /rom. You can also mount additional images that you load from some other source on whatever mountpoint you want.
#define MAX_RD_FILES 16 |
The maximum number of files that can be open at a time.
int fs_romdisk_mount | ( | const char * | mountpoint, |
const uint8 * | img, | ||
int | own_buffer | ||
) |
Mount a ROMFS image as a new filesystem.
This function will mount a ROMFS image that has been loaded into memory to the specified mountpoint.
mountpoint | The directory to mount this romdisk on |
img | The ROMFS image |
own_buffer | If 0, you are still responsible for img, and must free it if appropriate. If non-zero, img will be freed when it is unmounted |
0 | On success |
-1 | On error |
int fs_romdisk_unmount | ( | const char * | mountpoint | ) |
Unmount a ROMFS image.
This function unmounts a ROMFS image that has been previously mounted with fs_romdisk_mount(). This function does not check for open files on the fs, so make sure that all files have been closed before calling it. If the VFS owns the buffer (own_buffer was non-zero when you called the mount function) then this function will also free the buffer.
mountpoint | The ROMFS to unmount |
0 | On success |
-1 | On error |