awefs/ocfs.txt
2025-02-02 05:30:04 -05:00

65 lines
2.3 KiB
Plaintext

Version 01
Disk Header:
Sector 1: Boot sector, 512 Bytes Offset 1
AWEFS Header Signature : 8 Bytes : Should be set to "AWEFS "
AWEFS Version Signature: 2 Bytes : Can be anything, version number
S/N : 8 Bytes : Anything, i.e "abcd1234" (displayed as abcd-1234)
Reserved : 46 Bytes : Reserved
Boot sector : 448 Bytes : Lua code, offset 65
Sector 2: Boot sector, 512 Bytes Offset 513
Boot sector : 512 Bytes : Lua code - extends Sector 1
Sector 3-5: Unmanaged data, 1.5 KiB Offset 1025
Data : 1.5 KiB : Data, unmanaged, don't use
Sector 6-10: File table, 2.5 KiB Offset 2502
File table signature : 8 Bytes : Should be set to "FILES "
Padding : 3 Bytes : Should be null
File Declaration: 32 Bytes
File name : 16 Bytes : i.e "FILENAME.txt "
File offset : 8 Bytes : Offset of file on disk
Size : 2 Bytes : How many sectors does the file take up
Reserved : 6 Bytes : Reserved
End of file table : 16 Bytes : "EOFTEOFTEOFTEOFT"
Sector 11-x: Data, files, etc Offset (in theory 5062 12c6)
File on disk :
Start file header : 9 Bytes : "STARTFILE"
Data : Defined : Defined in filetable
Default Bios Behaivors and Todo:
TODO:
scan disks for bootable, (add bootable flag?)
Behaivors:
Will pass along current drive's address, S/N, drive proxy, and
readBytes function (use local a,sn,dp,rB = ...)
local ts = os.time()
while 1 do
if os.time() - ts >= 0.5 then
coroutine.yield()
end
end
Notes:
In theory, you can put files anywhere on disk. Instead of doing that,
please store files directly after the end of a file with the file with the largest
offset + (size * sectorSize) (i.e last file is at offset 4000 and size 1 sector, store next file at 4512)
The 16 bytes for file name is very limiting. I will probably raise it, but it's fine right now
Writing to disk will probably be okay, (loop thru filetable, find lowest offset using a
candidate system or something, then do the math to find the next offset. Issue with that
would be any deleted files before the file with the highest offset will never be reclaimed)
003FFFF0