Files
libfreemkv/src/lib.rs
T
MattJackson b9ea1d29dd libfreemkv v0.1.0 — Open source 4K UHD / Blu-ray / DVD drive library
Features:
- Open drive identification via SPC-4 INQUIRY + MMC-6 GET CONFIGURATION
- 141 supported drives with bundled profiles
- MT1959 platform: unlock, calibrate, raw sector reads
- DriveSpeed enum: BD1x-BD12x, DVD1x-DVD16x
- Field names follow SPC-4 §6.4.2 and MMC-6 §5.3.10 standards
- No proprietary fingerprints — open matching by SCSI fields
- Zero config: profiles compiled into binary

Tested on real hardware: HL-DT-ST BD-RE BU40N 1.03
2026-04-06 10:00:00 -07:00

53 lines
1.4 KiB
Rust

//! libfreemkv — Open source raw disc access for optical drives.
//!
//! Provides SCSI/MMC commands to enable raw reading mode on compatible
//! Blu-ray drives, allowing direct sector access for disc archival
//! and backup purposes.
//!
//! # Architecture
//!
//! The library is data-driven. Drive-specific SCSI command sequences
//! are stored in profile files, not in code. Adding support for a new
//! drive requires only a profile contribution — no rebuild needed.
//!
//! ```text
//! DriveSession (high-level API)
//! ├── Platform trait (per-chipset unlock logic)
//! ├── DriveProfile (per-drive data from JSON profiles)
//! └── ScsiTransport (SG_IO on Linux, IOKit on macOS)
//! ```
//!
//! # Quick Start
//!
//! ```no_run
//! use libfreemkv::DriveSession;
//! use std::path::Path;
//!
//! let mut session = DriveSession::open(
//! Path::new("/dev/sr0"),
//! Path::new("profiles/"),
//! ).unwrap();
//!
//! session.enable().unwrap();
//! session.calibrate().unwrap();
//!
//! let mut buf = vec![0u8; 2048];
//! let n = session.read_sectors(0, 1, &mut buf).unwrap();
//! ```
pub mod error;
pub mod scsi;
pub mod profile;
pub mod platform;
pub mod drive;
pub mod identity;
pub mod speed;
pub use error::{Error, Result};
pub use drive::DriveSession;
pub use identity::DriveId;
pub use profile::{DriveProfile, PlatformType};
pub use platform::{Platform, DriveStatus};
pub use scsi::ScsiTransport;
pub use speed::DriveSpeed;