Documented dcb-drv slightly.

This commit is contained in:
Filipe Rodrigues 2021-05-27 23:30:09 +01:00
parent 252330391b
commit f8d9d6f6ce
6 changed files with 17 additions and 20 deletions

1
dcb-drv/src/dir.rs Normal file
View File

@ -0,0 +1 @@
#![doc(include = "dir.md")]

View File

@ -1,5 +1,9 @@
# Directory entry
Every directory entry must be aligned to a `2048` (`0x800`) byte sector, including
both files and directories, but may span however many sectors it needs (excluding files
which have a max size of ~`4 GiB` and thus a max sector size of `2097152` sectors).
# Layout
Each directory entry has the following layout:
@ -15,5 +19,5 @@ Each directory entry has the following layout:
# Limitations
The max size for a file is `u32::MAX` bytes, but the filesystem itself can hold `2^43` bytes in total, as each
The max size for a file is `u32::MAX` bytes, but the filesystem itself can hold `8 TiB` (`2^43` bytes) in total, as each
directory and file position is identified by sector.

View File

@ -1,4 +1,4 @@
//! Directory entry
#![doc(include = "entry.md")]
// Modules
pub mod error;

View File

@ -1,22 +1,9 @@
# `Drv` filesystem
# `drv` filesystem
The `Drv` filesystem is the second-stage filesystem used by `dcb` after the standard
`ISO 9660` found in the cd-rom itself.
The `drv` filesystem is a worm (write-one-read-many) filesystem, with support for files
and directories.
It's a multi-level read-only filesystem with support for files and directories.
Each directory entry may be either a file or directory and is described by
a `16` byte name and a `UNIX` timestamp (32-bit).
Files are further described by a `3` byte file extension and a `32` bit file
size, thus limiting them to about the `4 GiB` mark.
Directories may have any number of entries, limited just by the total number of sectors
within the drive, around the `8 TiB` mark.
Every directory entry must be aligned to a `2048` (`0x800`) byte sector, including
both files and directories, but may span however many sectors it needs (excluding files
which have a max size of ~`4 GiB` and thus a max sector size of `2097152` sectors).
Each directory is a list of entries, see [`entry`] for more details.
# Layout

View File

@ -59,6 +59,7 @@
// Modules
pub mod cursor;
pub mod dir;
pub mod entry;
pub mod path;
pub mod ptr;

View File

@ -1,10 +1,14 @@
//! Paths
//!
//! See the [`Path`] type for more details.
// Imports
use ascii::{AsciiChar, AsciiStr};
use ref_cast::RefCast;
/// A path
///
/// Paths are separated by a backslash, `\`.
#[derive(Debug)]
#[derive(ref_cast::RefCast)]
#[repr(transparent)]
@ -43,7 +47,7 @@ impl Path {
/// Returns an iterator over all components of this path
#[must_use]
pub const fn components(&self) -> Components<'_> {
pub const fn components(&self) -> Components {
Components { path: self, idx: 0 }
}