Page 2 of 3
Re: RSFS - Really Simple File System
Posted: Thu Sep 25, 2014 2:57 pm
by b.zaar
iansjack wrote:
I still don't think it's a filesystem and not even useful as a template for one. It fails to address some of the most basic points of filesystems such as allocation of storage space. It's not so much a
printf("Hello World")
filesystem as a
puts(’H')
one.
Agreed...
@Antti It's just a file with an internal structure without much to gain over a regular flat file. The same thing as your
mkdir/cd/type example could be done using existing file types like tar or zip. Working with a stored zip file (compression method = 0) would handle all the same tests you want to do without having to write the tool to create the file. The format really isn't complicated, check out 4.3.7 for the file meta data. If you really want a system simpler than this you can just ignore everything but the uncompressed size and the filename.
http://www.pkware.com/documents/casestudies/APPNOTE.TXT
Re: RSFS - Really Simple File System
Posted: Thu Sep 25, 2014 11:39 pm
by Antti
Combuster wrote:It forces you to cover all the cases needed in a device driver without actually designing a filesystem
Yes and it is easy to have a device driver that is really perfect, e.g. no missing features. It is simple but it works. Perhaps in the future all hobby OSes have an "rsfs.c" in their "fsdrivers".
b.zaar wrote:Working with a stored zip file...
An interesting side note, I studied that format few months ago. I thought I could use it as a boot RAM disk but I discarded that idea for now. But yes, the zip format could work.
Please note that an RSFS partition must be bootable. Perhaps the structure could be something like this:
Code: Select all
Offset Length Description
0x0000000000000000 124 reserved area
0x000000000000007C 4 signature 'RSFS'
0x0000000000000080 8 volume size
0x0000000000000088 8 file start offset
0x0000000000000090 8 file size
0x0000000000000098 8 modification time
0x00000000000000A0 4 file checksum (optional)
0x00000000000000A4 2 file flags (implicit folders are "default")
0x00000000000000A6 2 header checksum (from 0x7C to 0xFF)
0x00000000000000A8 1-88 file name (zero terminated UTF-8, zero-byte padded)
0x0000000000000100 256 reserved area
0x0000000000000200 ? optional system area (if "file start offset" is not 0x200)
0x???????????????? ? file data
I removed the backup block. Comments?
Re: RSFS - Really Simple File System
Posted: Fri Sep 26, 2014 12:34 am
by Antti
"Hidden sectors" information is important. A new draft version:
Code: Select all
Offset Length Description
0x0000000000000000 120 reserved area
0x0000000000000078 4 signature 'RSFS'
0x000000000000007C 2 header checksum
0x000000000000007E 2 file flags
0x0000000000000080 8 volume offset
0x0000000000000088 8 volume size
0x0000000000000090 8 file offset
0x0000000000000098 8 file size
0x00000000000000A0 8 creation time
0x00000000000000A8 8 modification time
0x00000000000000B0 0-80 file name (zero terminated UTF-8, zero-byte padded)
0x0000000000000100 256 reserved area
0x0000000000000200 ? optional system area (if "file offset" is not 0x200)
0x???????????????? ? file data
Re: RSFS - Really Simple File System
Posted: Fri Sep 26, 2014 12:53 am
by b.zaar
Antti wrote:Please note that an RSFS partition must be bootable.
How big is a partition for a single file?
What kind of data do you plan to store in this one file?
Re: RSFS - Really Simple File System
Posted: Fri Sep 26, 2014 1:39 am
by Antti
b.zaar wrote:How big is a partition for a single file?
You can decide the partition size. It must be at least
(max file size + 512) bytes. Also, I would recommend using a well-aligned partition size.
b.zaar wrote:What kind of data do you plan to store in this one file?
Any data, e.g. it could be an image file of another file system. The file data is always continuous, i.e. not fragmented.
Re: RSFS - Really Simple File System
Posted: Fri Sep 26, 2014 3:52 am
by b.zaar
So it's just a wrapper around real files?
Re: RSFS - Really Simple File System
Posted: Fri Sep 26, 2014 4:34 am
by Antti
b.zaar wrote:So it's just a wrapper around real files?
I would not want think it that way. It is a full file system on its own. How the file data is handled, e.g. if it is a file system image, is not RSFS's policy.
Re: RSFS - Really Simple File System
Posted: Sat Sep 27, 2014 1:53 am
by Antti
Code: Select all
Offset Length Description
0x0000000000000000 120 reserved area
0x0000000000000078 4 signature 'RSFS'
0x000000000000007C 2 header checksum
0x000000000000007E 2 file flags
0x0000000000000080 8 volume offset
0x0000000000000088 8 volume size
0x0000000000000090 8 file offset
0x0000000000000098 8 file size
0x00000000000000A0 8 creation time
0x00000000000000A8 8 modification time
0x00000000000000B0 0-80 file name (zero terminated UTF-8, zero-byte padded)
0x0000000000000100 256 reserved area
0x0000000000000200 ? optional system area (if "file offset" is not 0x200)
0x???????????????? ? file data
Units
A byte is an 8-bit unit. Multibyte values are little-endian.
File flags
Code: Select all
Flag Description
0x0001 reading allowed
0x0002 writing allowed
0x0004 executing allowed
0x0008 deleting allowed
0x0010 archive flag
Other flags are not used and they shall be zero.
Volume offset and size
Volume offset defines how many bytes there are before this volume in a storage device. The size defines the RSFS file system size in bytes.
File offset and size
File offset defines how many bytes there are before the file data (starting from the beginning of RSFS). Must be at least 512 bytes. File size defines the file data length in bytes.
Creation and modification time
The number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970, not counting leap seconds.
File name
E.g. "FILE.TXT", "FOLDER/FILE.TXT".
Name rules defined later.
Re: RSFS - Really Simple File System
Posted: Sat Sep 27, 2014 2:16 am
by Antti
This is an informal description but you got the idea. I need to write an extremely official specification. Otherwise this is pointless and no one is going to use it.
Re: RSFS - Really Simple File System
Posted: Sat Sep 27, 2014 2:52 am
by Combuster
And instead of bothering with the notion of leap seconds, you may want to consider using TAI or GPS seconds instead, and add a conversion to UTC/POSIX time as an implementation note.
Re: RSFS - Really Simple File System
Posted: Wed Oct 01, 2014 10:34 am
by AndrewAPrice
Antti wrote:I plan to create a file system specification. The idea is to have a file system that supports only one file.
I do see some use for this. A database engine that takes full control of a partition or device.
Re: RSFS - Really Simple File System
Posted: Wed Oct 01, 2014 10:50 am
by iansjack
MessiahAndrw wrote:Antti wrote:I plan to create a file system specification. The idea is to have a file system that supports only one file.
I do see some use for this. A database engine that takes full control of a partition or device.
Well, yes. I believe that's how early databases were implemented. But it's hardly a file system, is it?
Re: RSFS - Really Simple File System
Posted: Wed Oct 01, 2014 12:42 pm
by AndrewAPrice
iansjack wrote:MessiahAndrw wrote:Antti wrote:I plan to create a file system specification. The idea is to have a file system that supports only one file.
I do see some use for this. A database engine that takes full control of a partition or device.
Well, yes. I believe that's how early databases were implemented. But it's hardly a file system, is it?
It is a system for storing a file, no?
I could see the advantage in writing a gzip file directly onto to a block device.
Re: RSFS - Really Simple File System
Posted: Wed Oct 01, 2014 1:41 pm
by iansjack
But a filesystem is more than a means of storing a single file. The essence of a filesystem is that it divides the data stored on a device into named chunks, which conventionally are known as files. Most useful filesystems also organize those files into a hierarchy of containers known as directories.
A "filesystem" consisting of a single file is similar to a Periodic Table containing only one element - and just as useful.
Re: RSFS - Really Simple File System
Posted: Wed Oct 01, 2014 1:43 pm
by Kevin
It is a system for storing a file, no?
I could see the advantage in writing a gzip file directly onto to a block device.
But then why don't you just write it directly to the device, without a pseudo-filesystem in between? Do you really need any filesystem metadata? (Well, for gzip it actually looks like you need to have the file length, but for a database I'd expect this information to be contained in the file data.)