CoolFace
Datasetpublic

hschumann2/TempleOS-Source-Code

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes838downloads
BlkChain.txt46 linesDownload Raw Back to Doc
1 2                                  Block Chain3 4There was a technique on the Commodore 64 where disk blocks were chained5together with a block pointer at the end of each block.  This is far inferior to6having a file allocation table, as in FAT32.7 8The RedSea file system does not allow files to grow because it only has an9allocation bitmap and not a FAT table.  This "flaw" is by design.  I am10intentionally crippling this operating system, making it a toy with the wisdom11that this will prevent commercialization and corruption.  The toy spirit of the12operating system will be preserved going into the future.  The vision for this13operating system was a modern Commodore 64, which was a fun toy.14 15Doing whole file operations is the TempleOS way of doing thinks.  It is the16simplest and, ironically, the fastest.  It is obnoxious in the characteristic17way that TempleOS is obnoxious, flaunting massive modern resources in a way that18makes old programmers protest.19 20Doing whole file operations will sabotage efforts to change the 640x48021resolution and violate the ban on multimedia.  When doing large, whole-file22operations, immediately memory fragmentation is a serious problem, but not so23for allocations in the range under a Meg (with occasional larger ones).24 25The file compression scheme in TempleOS only works on whole file operations and26the DolDoc format cannot have text tacked onto the end, since binary data is at27the end.28 29I don't want to spoil fun, so of course I offer a way to get awesome performance30that is, ironically, superior.  FBlkRead() and FBlkWrite() allow you to read a31block offset from the start of a file.  Since files are all contiguous, this is32incredibly efficient.  You just have to declare the desired file size when you33create it with FOpen() and cannot change it.  See ::/Demo/Dsk/DataBase.HC.34 35If you like, you are encouraged to to do raw BlkRead() and BlkWrite() directly36on a drive.  Just get a pointer to a CDrv with Let2Drv() and you are on your37way!  Your computer is supposed to be a fun toy!  You can make an entire38partition used for a database, or invent a file system.39 40On the whole, the RedSea file system with its whole-file-only limitation bring41beautiful harmony.  It beautifully captures the spirit of TempleOS with42simplicity and, ironic speed, since contiguous is fastest.43 44 45* "Commodore 64" is a trademark owned by Polabe Holding NV.46