hschumann2/TempleOS-Source-Code
0838
1 2 RedSea File System3 4The RedSea file system is a simple, 64-bit, file system which is similar to5FAT32, but with absolute block addresses instead of clus, fixed-sized 64-byte6directory entries and no FAT table, just an allocation bitmap. A clus is just7one 512 byte sector. Files are stored in contiguous blocks and cannot grow in8size.9 10#define CDIR_FILENAME_LEN 38 //Must include terminator zero11 12The following bit field shows valid 8-Bit ASCII filename characters.13 14U32 char_bmp_filename[8]=15{0x0000000, 0x03FF73FB, 0xEFFFFFFF, 0x2FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,160xFFFFFFFF, 0xFFFFFFFF};17 18public class CDirEntry //64-byte fixed-size19{20 U16 attr; //See RS_ATTR_DIR. I would like to change these.21 U8 name[CDIR_FILENAME_LEN]; //See char_bmp_filename, FileNameChk22 I64 clus; (blk) //One sector per clus.23 I64 size; //In bytes24 CDate datetime; //See DateTime, Implementation of DateTime25};26 27public class CRedSeaBoot //RedSea is type FAT32 in partition table to fool BIOS.28{29 U8 jump_and_nop[3];30 U8 signature,reserved[4]; //MBR_PT_REDSEA=0x88. Distinguish from real FAT32.31 I64 drv_offset; //For CD/DVD image copy.32 I64 sects;33 I64 root_clus; (root_blk)34 I64 bitmap_sects;35 I64 unique_id;36 U8 code[462];37 U16 signature2; //0xAA5538};39 40See ::/Kernel/BlkDev/FileSysRedSea.HC and ::/Adam/Opt/Boot/DskISORedSea.HC.41 42Files with names ending in .Z are compressed. See ::/Kernel/Compress.HC.43 44To replace ISO9660, make hard-drive partition image of a measured size and copy45onto a CD/DVD starting at about sector 20, with EL TORITO booting. 512-byte46sectors will be placed on top of 2048-byte CD/DCD sectors, so there will be four47blocks per CD/DVD sector.48 49RedSea file system has no bad block table and no redundant allocation table.50 51Read Block Chain for a philosophical explaination of RedSea reasoning.52 