mirror of
https://github.com/Zenithsiz/dcb.git
synced 2026-02-04 00:21:57 +00:00
Documented dcb-drv slightly.
This commit is contained in:
parent
252330391b
commit
f8d9d6f6ce
1
dcb-drv/src/dir.rs
Normal file
1
dcb-drv/src/dir.rs
Normal file
@ -0,0 +1 @@
|
||||
#![doc(include = "dir.md")]
|
||||
@ -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.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
//! Directory entry
|
||||
#![doc(include = "entry.md")]
|
||||
|
||||
// Modules
|
||||
pub mod error;
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -59,6 +59,7 @@
|
||||
|
||||
// Modules
|
||||
pub mod cursor;
|
||||
pub mod dir;
|
||||
pub mod entry;
|
||||
pub mod path;
|
||||
pub mod ptr;
|
||||
|
||||
@ -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 }
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user