README: consistent layout, remove prebuilt binary section (library only)

This commit is contained in:
MattJackson
2026-04-06 12:33:20 -07:00
parent 509cdf6ea7
commit 1e90497760
+15 -38
View File
@@ -10,23 +10,12 @@ Part of the [freemkv](https://github.com/freemkv) project.
## Install ## Install
### As a library
```toml ```toml
[dependencies] [dependencies]
libfreemkv = "0.2" libfreemkv = "0.2"
``` ```
### Prebuilt binaries ## Quick Start
Download from [GitHub Releases](https://github.com/freemkv/libfreemkv/releases):
| Platform | Architecture | Download |
|----------|-------------|----------|
| Linux | x86_64 | [freemkv-info](https://github.com/freemkv/libfreemkv/releases/latest) |
| Linux | aarch64 | [freemkv-info](https://github.com/freemkv/libfreemkv/releases/latest) |
## Usage
```rust ```rust
use libfreemkv::DriveSession; use libfreemkv::DriveSession;
@@ -54,12 +43,11 @@ No fingerprints. No encrypted lookups. All identification uses standard SCSI fie
## API ## API
```rust ```rust
// Open and auto-identify
let mut session = DriveSession::open(device_path)?; let mut session = DriveSession::open(device_path)?;
// Drive identity // Drive identity
session.drive_id.vendor_id // "HL-DT-ST" session.drive_id.vendor_id // "HL-DT-ST"
session.drive_id.product_id // "BD-RE BU40N" session.drive_id.product_id // "BD-RE BU40N"
session.drive_id.product_revision // "1.03" session.drive_id.product_revision // "1.03"
session.drive_id.vendor_specific // "NM00000" session.drive_id.vendor_specific // "NM00000"
session.drive_id.firmware_date // "211810241934" session.drive_id.firmware_date // "211810241934"
@@ -71,12 +59,12 @@ session.profile.unlock_buf_id // 0x44
session.profile.signature // [0x99, 0x9e, 0xc3, 0x75] session.profile.signature // [0x99, 0x9e, 0xc3, 0x75]
// Operations // Operations
session.unlock()?; // activate raw mode session.unlock()?;
session.calibrate()?; // speed optimization session.calibrate()?;
session.read_sectors(lba, count, &mut buf)?; session.read_sectors(lba, count, &mut buf)?;
session.status()?; // feature flags session.status()?;
session.read_config()?; // drive configuration session.read_config()?;
session.read_register(index)?; // hardware registers session.read_register(index)?;
``` ```
## Chipset Support ## Chipset Support
@@ -86,8 +74,6 @@ session.read_register(index)?; // hardware registers
| MediaTek MT1959 | Supported | 206 | LG, ASUS, HP | | MediaTek MT1959 | Supported | 206 | LG, ASUS, HP |
| Renesas | Planned | -- | Pioneer | | Renesas | Planned | -- | Pioneer |
Each profile stores per-drive `unlock_mode` and `unlock_buf_id` — the exact CDB bytes for that drive's unlock command. A single `Mt1959` implementation handles all MediaTek variants.
## Drive Profile ## Drive Profile
Each bundled profile (compiled into the binary): Each bundled profile (compiled into the binary):
@@ -109,35 +95,26 @@ Each bundled profile (compiled into the binary):
## Error Codes ## Error Codes
Structured errors for programmatic handling — no user-facing English text in the library.
| Code | Error | Meaning | | Code | Error | Meaning |
|------|-------|---------| |------|-------|---------|
| E1000 | DeviceNotFound | Device path doesn't exist | | E1000 | DeviceNotFound | Device path doesn't exist |
| E1001 | DevicePermission | No access (try sudo or cdrom group) | | E1001 | DevicePermission | No access (try sudo or cdrom group) |
| E2000 | UnsupportedDrive | No matching profile | | E2000 | UnsupportedDrive | No matching profile |
| E2001 | ProfileNotFound | Profile lookup failed |
| E3000 | UnlockFailed | Unlock command rejected | | E3000 | UnlockFailed | Unlock command rejected |
| E3001 | SignatureMismatch | Response signature wrong | | E3001 | SignatureMismatch | Response signature wrong |
| E3002 | NotUnlocked | Operation requires unlock first | | E3002 | NotUnlocked | Operation requires unlock first |
| E4000 | ScsiError | SCSI command failed | | E4000 | ScsiError | SCSI command failed |
| E5000 | IoError | System I/O error | | E5000 | IoError | System I/O error |
## Architecture
```
DriveSession
├── ScsiTransport SG_IO (Linux) / IOKit (macOS, planned)
├── DriveProfile per-drive parameters (bundled JSON, compiled in)
├── DriveId INQUIRY + GET_CONFIG 010C fields
└── Platform
├── Mt1959 MediaTek MT1959 (206 drives)
└── (Renesas) Pioneer (planned)
```
## Platform ## Platform
Linux only today (SG_IO ioctl). The `ScsiTransport` trait abstracts the platform — macOS IOKit and Windows SPTI backends are planned. | Platform | Status | Backend |
|----------|--------|---------|
| Linux | Supported | SG_IO ioctl |
| macOS | Planned | IOKit |
| Windows | Planned | SPTI |
The `ScsiTransport` trait abstracts the platform. Adding a backend is one file behind a `cfg` gate.
## Contributing ## Contributing