1
0
mirror of https://github.com/elua/elua.git synced 2025-01-25 01:02:54 +08:00

Changed the ROMFS terminator char

The ROMFS termination char is now 0xFF instead of 0x00 (in preparation
of WOFS).
This commit is contained in:
Bogdan Marinescu 2012-06-19 16:21:14 +03:00
parent ed54aec47a
commit 01a8dcd9a5
3 changed files with 8 additions and 11 deletions

View File

@ -133,8 +133,8 @@ def mkfs( dirname, outname, flist, mode, compcmd ):
# Report
print "Encoded file %s (%d bytes real size, %d bytes after rounding, %d bytes total)" % ( fname, len( filedata ), actual, _fcnt )
# All done, write the final "0" (terminator)
_add_data( 0, outfile, False )
# All done, write the final "0xFF" (terminator)
_add_data( 0xFF, outfile, False )
outfile.write( "};\n\n#endif\n" );
outfile.close()
print "Done, total size is %d bytes" % _bytecnt

View File

@ -48,17 +48,14 @@ static u8 romfs_open_file( const char* fname, u8 *pbase, FD* pfd )
i = 0;
while( 1 )
{
if( pbase[ i ] == 0xFF )
return FS_FILE_NOT_FOUND;
// Read file name
for( j = 0; j < DM_MAX_FNAME_LENGTH; j ++ )
{
fsname[ j ] = pbase[ i + j ];
if( fsname[ j ] == 0 )
{
if( j == 0 )
return FS_FILE_NOT_FOUND;
else
break;
}
break;
}
// ' i + j' now points at the '0' byte
j = i + j + 1;
@ -182,7 +179,7 @@ static struct dm_dirent* romfs_readdir_r( struct _reent *r, void *d, void *pdata
FSDATA *pfsdata = ( FSDATA* )pdata;
u8 *pbase = pfsdata->pbase;
if( pbase[ off ] == 0 )
if( pbase[ off ] == 0xFF )
return NULL;
while( ( dm_shared_fname[ j ++ ] = pbase[ off ++ ] ) != '\0' );
pent->fname = dm_shared_fname;

View File

@ -143,8 +143,8 @@ function mkfs( dirname, outname, flist, mode, compcmd )
end
end
-- All done, write the final "0" (terminator)
_add_data( 0, outfile, false )
-- All done, write the final "0xFF" (terminator)
_add_data( 0xFF, outfile, false )
outfile:write( "};\n\n#endif\n" );
outfile:close()
print( sf( "Done, total size is %d bytes", _bytecnt ) )