storage-book: A 39-Chapter Technical Book on Storage and File Systems with a Working Embedded FS in C
An open-source book on storage technology and file systems. From knot records to Flash physics, from FAT to LittleFS — complete with KnotFS, a teaching-grade log-structured embedded file system (~1770 lines C).
At a glance
- What is it?
- storage-book is an open Chinese-language book on storage technology that covers Flash physics, file system theory, LittleFS source analysis and the from-scratch construction of KnotFS, a teaching-grade log-structured embedded file system in approximately 1,770 lines of C. It targets embedded engineers and systems programmers who want a grounded understanding of why Flash storage fails and how production file systems defend against it.
- Who is it for?
- Embedded engineers working with Flash storage who want to understand what happens below the LittleFS API, and students who want a guided path from knotted-record history to a working log-structured file system, are the intended readers. Developers looking for a production-ready library should look at LittleFS directly: KnotFS is explicitly a teaching implementation, not a production-optimized one.
- Can I use it commercially?
- Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
- Is it still maintained?
- Yes. The repository last received commits 28 days ago.
- What is it written in?
- Mainly C, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What the Book Covers and How It Is Organized
storage-book is structured as 39 chapters across five parts, available to read online at a hosted mdBook site or to clone and run locally. The first part (five chapters) opens with the fundamental problems of storage: physical wear, power interruptions and noise in the recording medium. The second part (five chapters) covers Flash physics at the transistor level, explaining floating-gate behavior, NOR versus NAND architecture, and how SLC, MLC and TLC cell types trade density for endurance and reliability. The third part (eight chapters) moves into file system theory using thought experiments before introducing FAT, log-structured designs, wear leveling algorithms and the design choices that make a file system safe across unexpected power loss. The fourth part (six chapters) dissects the LittleFS source code, covering the Metadata Pair mechanism for atomic updates, the CTZ Skip-List for indirect block addressing and the block allocator. The fifth part (fifteen chapters) builds KnotFS from scratch: a teaching-grade asynchronous log-structured embedded file system written in pure C.
KnotFS: The Hands-On Embedded File System
KnotFS is a log-structured embedded file system implemented in approximately 1,770 lines of C. The implementation is intended to expose the mechanisms that make a production embedded file system reliable: log structuring for wear distribution, atomic write semantics and recovery from mid-write power loss. Because it is a teaching implementation, the design prioritizes clarity over performance optimization. The repository includes a Makefile and a test suite. Running both is a single step:
cd knotfs
make && make testThe README does not specify the exact hardware targets or Flash abstraction layer KnotFS expects, so readers who want to understand the integration path should read the fifth part of the book alongside the source. The fifteen chapters on KnotFS include what the README describes as production integration considerations, which suggests the final chapters discuss real constraints even though the implementation itself is a teaching tool.
How to Read and Navigate the Repository
The online reader, hosted at the URL listed in the README, renders all 39 chapters through an mdBook interface maintained by a contributor credited as @web-l. The repository itself is organized into two top-level directories: chapters/ for the book content and knotfs/ for the implementation. Readers who prefer working with the source can clone the repository and read the Markdown files directly in any editor. The book is written in Chinese. Engineers who work with English documentation first should note that the subject matter (Flash physics, file system theory and embedded C) is language-independent, but the explanatory prose and the chapter navigation are in Chinese.
The repository is part of a series the author calls the automotive electronics heptology, which comprises seven books covering related embedded and systems topics. The sibling volumes address PTP time synchronization, HSM (hardware security modules), UDS diagnostic protocols, ISO 26262 functional safety, general embedded software engineering and a broader survey from semiconductors to CAN bus.
The Technical Depth of the Flash Coverage
The second part of the book addresses why Flash storage is fundamentally different from DRAM or spinning disk in ways that matter for software design. It covers the physical structure of floating-gate transistors that store charge to represent binary values, and explains why each program-erase cycle degrades the oxide layer that traps the charge. NOR Flash, which supports random read access at byte granularity, is contrasted with NAND Flash, which requires page-level reads and block-level erases. The trade-off between SLC (single-level cell, highest endurance), MLC (multi-level cell, more bits per cell, faster wear) and TLC (three-level cell, highest density, shortest lifespan) is presented in terms of the physical mechanism rather than product marketing. This grounding in physics is the stated foundation for why wear leveling and log-structured file systems are necessary rather than optional.
LittleFS Source Analysis and What It Teaches
The fourth part examines LittleFS, the production embedded file system widely used in microcontroller firmware. The analysis focuses on three mechanisms. The Metadata Pair keeps two copies of directory metadata in a fixed pair of blocks and atomically flips which copy is current, so a power failure during a metadata write never leaves the directory in an inconsistent state. The CTZ Skip-List (Chickadee Tree Zap) is the data structure LittleFS uses to index file contents across non-contiguous Flash blocks: it uses a logarithmic skip structure that allows the file to grow without a contiguous allocation requirement. The block allocator uses a wear-aware scanning approach that distributes writes across the available blocks. Understanding these three mechanisms prepares readers to modify or debug LittleFS in a production project, and they serve as the design reference for the KnotFS construction in part five.
Limitations and Licensing
KnotFS is a teaching implementation. The README does not document performance benchmarks, maximum file sizes, directory depth limits or the Flash driver interface required to port it to a specific microcontroller. Developers who need a production-tested embedded file system for safety-critical or high-wear hardware should use LittleFS directly rather than treating KnotFS as a drop-in replacement. The book content is published under CC BY-NC-ND 4.0: it can be read and shared for non-commercial purposes, but derivative works (translated editions, adapted courses, modified versions) are not permitted under the license without separate authorization. KnotFS source code is MIT licensed, permitting use in commercial products and modification. The online reader is maintained separately from the repository, and an outage there does not affect the local Markdown files.
Editorial conclusion
Embedded engineers working with Flash storage who want to understand what happens below the LittleFS API, and students who want a guided path from knotted-record history to a working log-structured file system, are the intended readers. Developers looking for a production-ready library should look at LittleFS directly: KnotFS is explicitly a teaching implementation, not a production-optimized one. The book and its online reader are actively maintained, with the last push to the repository on 2026-09-03. Book content is under CC BY-NC-ND 4.0 (non-commercial, no derivatives), and KnotFS source code is MIT licensed.
Frequently asked questions
What programming language is KnotFS written in?
KnotFS is written in pure C and is approximately 1,770 lines. The repository includes a Makefile and test suite that can be run with cd knotfs && make && make test.
Is storage-book written in Chinese or English?
The book is written in Chinese. The subject matter covers storage hardware and file system implementation, which is language-independent, but all explanatory prose and navigation are in Chinese.
What license covers the book content and the KnotFS source code?
Book content is under CC BY-NC-ND 4.0, which allows non-commercial sharing without modification. KnotFS source code is MIT licensed, permitting use in commercial projects and modification.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/lularible-storage-book)