#62780 - GPFerror - Mon Dec 05, 2005 6:43 pm
--------------------------------------------------------------------------------
This DS library implementation the Linux ROMFS file system for reading a pre-made boot romdisk.
To create a romdisk image, you will need the program "genromfs". This program was designed for Linux but can compile under Cygwin.", included is a prebuilt mingw windows binary.
This was derived/ported from KOS 1.3.x from the Dreamcast KallistiOS .
included is a simple FS test which demonstrates reading a couple of files from the romdisk, and then it displays the directory structure.
for more information about using the filesystem checkout the fs.h file for the proper api calls, which are all very similiar to standard stdio calls.
Also include is some stdio newlib files(stdio.c and stdio.h) that call the kosFS for better stdio support but so far I havent figure out how to make them work successfully yet.
Enjoy :)
Troy Davis(GPF)
http://gpf.dcemu.co.uk/ndsromdisk.shtml
Last edited by GPFerror on Wed Dec 07, 2005 3:45 pm; edited 1 time in total
This DS library implementation the Linux ROMFS file system for reading a pre-made boot romdisk.
To create a romdisk image, you will need the program "genromfs". This program was designed for Linux but can compile under Cygwin.", included is a prebuilt mingw windows binary.
This was derived/ported from KOS 1.3.x from the Dreamcast KallistiOS .
included is a simple FS test which demonstrates reading a couple of files from the romdisk, and then it displays the directory structure.
for more information about using the filesystem checkout the fs.h file for the proper api calls, which are all very similiar to standard stdio calls.
Code: |
file_t fs_open(const char *fn, int mode);
void fs_close(file_t hnd); ssize_t fs_read(file_t hnd, void *buffer, size_t cnt); ssize_t fs_write(file_t hnd, const void *buffer, size_t cnt); off_t fs_seek(file_t hnd, off_t offset, int whence); off_t fs_tell(file_t hnd); size_t fs_total(file_t hnd); dirent_t* fs_readdir(file_t hnd); int fs_ioctl(file_t hnd, void *data, size_t size); int fs_rename(const char *fn1, const char *fn2); int fs_unlink(const char *fn); int fs_chdir(const char *fn); void* fs_mmap(file_t hnd); int fs_complete(file_t fd, ssize_t * rv); int fs_stat(const char * fn, stat_t * rv); int fs_mkdir(const char * fn); int fs_rmdir(const char * fn); file_t fs_dup(file_t oldfd); file_t fs_dup2(file_t oldfd, file_t newfd); |
Also include is some stdio newlib files(stdio.c and stdio.h) that call the kosFS for better stdio support but so far I havent figure out how to make them work successfully yet.
Enjoy :)
Troy Davis(GPF)
http://gpf.dcemu.co.uk/ndsromdisk.shtml
Last edited by GPFerror on Wed Dec 07, 2005 3:45 pm; edited 1 time in total