User:Superleaf1995/AFPFS

From OSDev Wiki
Jump to navigation Jump to search

AFPFS abritary file positioning file system is a theoric and proven (in my own personal DOS-alike OS) file system.

Bootloader size record

I was able to manage to make a 62 byte long bootloader with AFPFS. It was very stripped out of functions, but it got to load the kernel properly

Bootsector

The bootsector has information like bytes per sectors, heads, and label. Then the boot thingy.


Files

The FS views the disk as a array, a big one.

There are no directories, there are only 'groups' in files. Every file arbitraryly uses 0FF8h as SOF (Start of file), when 0FF8h, means that there is a new file. 0FF9h means that this is the last file in partition and works as an EOF for the entire partition, leaving the empty part untouched until written on, and allowing for multiple partitions.

There are no FATs or whatsoever.

File entry

After the SOF there is file metadata Wich is:

1-byte wide of filename filename wide as (above byte + 1)

3-bytes wide extension

2-byte indicating group

2-byte indicating member ID in group (same IDs in multiple files means that they are the same file but split up)

And then the file data.

Conclusion

The good of this filesystem is that since there is no file table, the files will always be indexed in disk. Regardless of a corrupt file or sector.

This Filesystem can be simpler than FAT if we remove the groups and tune it a bit.

Still, leave the floppy signature at the end of the boot sector.

Note: Only tested on floppy disk, requires bytecopiers to copy to a floppy image. And have to manually put the file metadata on all files. (ASM simplifies this).

Notes

Obviously, put a jump before boot info. Put the jump after or before file metadata, depending on implementation.

Implementation.

A implementation version, truly arbitraryly because there are no IDs or whatsoever, just filenames (see DISK.img in releases)

https://github.com/SuperLeaf1995/LeafDOS/tree/master/SOURCE/KERNEL