<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=US-ASCII"> <meta name="generator" content="ZealOS V1.00"> <style type="text/css"> body {background-color:#fef1f0;} .cF0{color:#000000;background-color:#fef1f0;} .cF1{color:#0148a4;background-color:#fef1f0;} .cF2{color:#3b7901;background-color:#fef1f0;} .cF3{color:#057c7e;background-color:#fef1f0;} .cF4{color:#bb2020;background-color:#fef1f0;} .cF5{color:#9e42ae;background-color:#fef1f0;} .cF6{color:#b57901;background-color:#fef1f0;} .cF7{color:#b2b6af;background-color:#fef1f0;} .cF8{color:#555753;background-color:#fef1f0;} .cF9{color:#678fbb;background-color:#fef1f0;} .cFA{color:#82bc49;background-color:#fef1f0;} .cFB{color:#0097a2;background-color:#fef1f0;} .cFC{color:#e26a6a;background-color:#fef1f0;} .cFD{color:#c671bc;background-color:#fef1f0;} .cFE{color:#c7ab00;background-color:#fef1f0;} .cFF{color:#fef1f0;background-color:#fef1f0;} </style> </head> <body> <pre style="font-family:monospace;font-size:12pt"> <a name="l1"></a><span class=cF5> Block Chain</span><span class=cF0> <a name="l2"></a> <a name="l3"></a>There was a technique on the Commodore 64 where disk blocks were chained together with a block pointer at the end of each <a name="l4"></a>block. This is far inferior to having a file allocation table, as in FAT32. <a name="l5"></a> <a name="l6"></a>The </span><a href="https://zeal-operating-system.github.io/ZealOS/Doc/RedSea.DD.html#l1"><span class=cF4>RedSea</span></a><span class=cF0> file system does not allow files to grow because it only has an allocation bitmap and not a FAT table. This <a name="l7"></a>"flaw" is by design. Terry intentionally crippled the operating system, making it a toy with the wisdom that this will <a name="l8"></a>prevent commercialization and corruption. The toy spirit of the operating system will be preserved going into the future. Th <a name="l9"></a>e vision for this operating system was a modern Commodore 64, which was a fun toy. <a name="l10"></a> <a name="l11"></a>Doing whole file operations is the ZealOS way of doing things. It is the simplest and, ironically, the fastest. It is <a name="l12"></a>obnoxious in the characteristic way that ZealOS is obnoxious, flaunting massive modern resources in a way that makes old <a name="l13"></a>programmers protest. <a name="l14"></a> <a name="l15"></a>When doing large, whole-file operations, immediately memory fragmentation is a serious problem, but not so for allocations in <a name="l16"></a>the range under a Meg (with occasional larger ones). <a name="l17"></a> <a name="l18"></a>The </span><a href="https://zeal-operating-system.github.io/ZealOS/Doc/DolDoc.DD.html#l1"><span class=cF4>DolDoc</span></a><span class=cF0> format cannot have text tacked onto the end, since binary data is at the end. <a name="l19"></a> <a name="l20"></a>Terry didn't want to spoil fun, so of course offered a way to get awesome performance that is, ironically, superior. </span><span class=cF4> <a name="l21"></a></span><a href="https://zeal-operating-system.github.io/ZealOS/Kernel/BlkDev/DiskCFile.CC.html#l151"><span class=cF4>FBlkRead</span></a><span class=cF0>() and </span><a href="https://zeal-operating-system.github.io/ZealOS/Kernel/BlkDev/DiskCFile.CC.html#l214"><span class=cF4>FBlkWrite</span></a><span class=cF0>() allow you to read a block offset from the start of a file. Since files are all contiguous, this is <a name="l22"></a>incredibly efficient. You just have to declare the desired file size when you create it with </span><a href="https://zeal-operating-system.github.io/ZealOS/Kernel/BlkDev/DiskCFile.CC.html#l9"><span class=cF4>FOpen</span></a><span class=cF0>() and cannot change it. <a name="l23"></a>See </span><a href="https://zeal-operating-system.github.io/ZealOS/Demo/Disk/DataBase.CC.html#l1"><span class=cF4>::/Demo/Disk/DataBase.CC</span></a><span class=cF0>. <a name="l24"></a> <a name="l25"></a>If you like, you are encouraged to to do raw </span><a href="https://zeal-operating-system.github.io/ZealOS/Kernel/BlkDev/DiskBlk.CC.html#l37"><span class=cF4>BlkRead</span></a><span class=cF0>() and </span><a href="https://zeal-operating-system.github.io/ZealOS/Kernel/BlkDev/DiskBlk.CC.html#l87"><span class=cF4>BlkWrite</span></a><span class=cF0>() directly on a drive. Just get a pointer to a </span><a href="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelA.HH.html#l3376"><span class=cF4>CDrive</span></a><span class=cF0> <a name="l26"></a>with </span><a href="https://zeal-operating-system.github.io/ZealOS/Kernel/BlkDev/DiskDrive.CC.html#l211"><span class=cF4>Letter2Drive</span></a><span class=cF0>() and you are on your way! Your computer is supposed to be a fun toy! You can make an entire partition <a name="l27"></a>used for a database, or invent a file system. <a name="l28"></a> <a name="l29"></a>On the whole, the </span><a href="https://zeal-operating-system.github.io/ZealOS/Doc/RedSea.DD.html#l1"><span class=cF4>RedSea</span></a><span class=cF0> file system with its whole-file-only limitation bring beautiful harmony. It beautifully captures <a name="l30"></a>the spirit of ZealOS with simplicity and, ironic speed, since contiguous is fastest. <a name="l31"></a> <a name="l32"></a></span><span class=cF8> <a name="l33"></a>* "Commodore 64" is a trademark owned by Polabe Holding NV. </span></pre></body> </html>