Expand description
MediaTek MT1959 / MT1939 optical drive (BD/DVD) protocol: command encoding, identity decoding, firmware image analysis and OEM image reconstruction.
The crate root is no_std, allocation-free and dependency-free:
cdb— the command descriptor blocks, as byte constructors.Identity— the decoded INQUIRY, boot banner and identity descriptor.Chip— which controller generation a drive or image belongs to.DriveClass— the update dialect a drive speaks (Identity::class).layout— the fixed 2 MiB image geometry and the drive-written regions.sense— sense-data parsing and classification of flash faults.
Optional features add:
drive—drive: the command sequences (identify, memory read, flash session) over a caller-supplieddrive::Transport.image—image: chip detection from image bytes and the AES-CMAC integrity table (image::cmac). Usesstd.enc—enc: the AES-128-ECB transport envelope.oem—oem: rebuild the flashable OEM image from a drive read, with the provenance of every substituted byte. Impliesimage.imagealso enablesupdate: an update prepared against the installed firmware, refused across chips and hardware families. Withdrive, the receiver-boundreceiver::PreparedUpdate::flashruns it.std— links the standard library (implied byimage).
§Drive memory
READ BUFFER mode 6 exposes the 2 MiB flash at file offsets, with one
exception: the boot page 0x0..0x400 reads back as the image’s own page at
layout::BOOT_MIRROR instead of its stored form. The drive also rewrites
the regions in layout::DRIVE_WRITTEN at runtime (revocation lists,
settings, calibration), so a read is never byte-identical to the image that
was flashed. oem::rebuild undoes both.
Modules§
- cdb
- Command descriptor blocks, as byte constructors.
- drive
- Command sequences over a caller-supplied
Transport: identify, memory read and the flash session. - enc
- The AES-128-ECB
enctransport envelope. - envelope
- Validated input framing, independent of the running receiver’s wire format.
- image
- Firmware image analysis: chip detection, the hardware family and the AES-CMAC integrity table.
- layout
- The fixed geometry of an MT19xx flash image.
- oem
- Rebuild the flashable OEM image from a drive read.
- receiver
- Read-only detection of the active MediaTek update receiver.
- recovery
- Explicit recovery without installed-firmware, model, family or backup policy.
Requires
drive,imageandenc. Identification and preparation are read-only; the caller owns consent and write authorization. - sense
- Sense-data parsing and classification.
- update
- An update prepared against the drive’s installed firmware.
Structs§
- Identity
- A drive’s identity: the standard INQUIRY response, the boot banner at
layout::BANNERand the identity descriptor atlayout::DESCRIPTOR. - Unknown
Chip Chip::labeldid not name a chip.
Enums§
- Chip
- A MediaTek optical controller generation.
- Drive
Class - The update dialect a drive speaks, chosen by
Identity::class.
Constants§
- INQUIRY_
LEN - Length of a standard INQUIRY response header, in bytes.
Traits§
- Coded
Error - A typed error with a stable, namespaced identifier.