Skip to content

Add initial partial UDF support#403

Open
Zopolis4 wants to merge 1 commit into
superg:mainfrom
Zopolis4:overconfident
Open

Add initial partial UDF support#403
Zopolis4 wants to merge 1 commit into
superg:mainfrom
Zopolis4:overconfident

Conversation

@Zopolis4

@Zopolis4 Zopolis4 commented Jun 30, 2026

Copy link
Copy Markdown

This PR only supports up to UDF 1.02 (maybe 1.50, haven't found any discs to test it with), and also doesn't fully support parsing the filesystem beyond the initial directory yet. Those will be in later PRs once I. figure out how to implement them.

In the meantime, the added functionality is tested and working, but as it isn't ready to be directly used by anything yet I haven't committed the temporary command I used to test it.

Summary by CodeRabbit

  • New Features

    • Expanded UDF metadata parsing with additional descriptor types for interpreting timestamps, character set specifiers, allocation descriptors, and file entry structures.
    • Added a UDF browsing capability that locates core volume descriptors and resolves the media’s root directory when supported.
  • Bug Fixes

    • Improved partition descriptor parsing by updating how partition and implementation identifiers are represented, aligning them with the expected on-disk layout.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 40fed61b-4a62-47c8-beda-600c65f01d51

📥 Commits

Reviewing files that changed from the base of the PR and between 771f049 and 8fdea50.

📒 Files selected for processing (4)
  • CMakeLists.txt
  • filesystem/udf/udf.ixx
  • filesystem/udf/udf_browser.ixx
  • filesystem/udf/udf_defs.ixx
🚧 Files skipped from review as they are similar to previous changes (3)
  • CMakeLists.txt
  • filesystem/udf/udf_defs.ixx
  • filesystem/udf/udf_browser.ixx

📝 Walkthrough

Walkthrough

Adds packed UDF descriptor types, updates PartitionDescriptor, and introduces an exported filesystem.udf:browser module that locates UDF volume descriptors and resolves the root directory.

Changes

UDF Browser Module

Layer / File(s) Summary
UDF descriptor layouts
filesystem/udf/udf_defs.ixx
Adds packed UDF descriptor and address types, higher-level volume and file structures, and replaces PartitionDescriptor identifier arrays with EntityID fields.
Browser lookup flow
filesystem/udf/udf_browser.ixx, filesystem/udf/udf.ixx, CMakeLists.txt
Adds anchor, descriptor-scan, and root-directory lookup helpers, then exports and registers the new browser module.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant Browser
  participant DataReader
  Caller->>Browser: rootDirectory(data_reader)
  Browser->>DataReader: read AVDP_PRIMARY_LBA
  Browser->>DataReader: scan main_vds
  Browser->>DataReader: read FileSetDescriptor and root_directory_icb
  Browser-->>Caller: return FileEntry
Loading

Possibly related PRs

  • superg/redumper#309: Modifies related filesystem/udf module plumbing and UDF descriptor support.

Suggested reviewers: superg

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding initial, partial support for UDF filesystem reading.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Zopolis4
Zopolis4 marked this pull request as ready for review June 30, 2026 10:57

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@filesystem/udf/udf_browser.ixx`:
- Around line 36-55: The findDescriptorOffset helper currently signals “not
found” with a uint32_t return value, which turns into UINT32_MAX and can be read
later in the descriptor parsing path. Change findDescriptorOffset to return
std::optional<uint32_t>, have callers like the logic around descriptor reads
check for the empty case before using the LBA, and add a guard for
main_vds.length == 0 so the loop bound in findDescriptorOffset cannot underflow.
Update the related read flow in udf_browser.ixx (including the code that uses
the returned offset) to skip reads when no descriptor is found.
- Around line 90-94: The root entry creation in the UDF browser currently
returns a copied udf::FileEntry from root_directory_data, but that object does
not retain the backing payload needed for extended attributes and allocation
descriptors. Update the root_directory_data / root_directory_file_entry flow so
the returned object owns or references the full buffer, and ensure the logic in
the root-directory reader and udf::FileEntry construction/usage in udf_defs.ixx
preserves the trailing payload instead of exposing only the fixed header.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c953c3c2-003f-421e-8a5a-53bea78e1ddd

📥 Commits

Reviewing files that changed from the base of the PR and between cbf7c9b and d1dabdd.

📒 Files selected for processing (4)
  • CMakeLists.txt
  • filesystem/udf/udf.ixx
  • filesystem/udf/udf_browser.ixx
  • filesystem/udf/udf_defs.ixx

Comment thread filesystem/udf/udf_browser.ixx Outdated
Comment thread filesystem/udf/udf_browser.ixx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@filesystem/udf/udf_browser.ixx`:
- Line 24: The descriptor parsing in udf_browser.ixx is reading fields by
casting raw std::vector<uint8_t> storage directly to udf::* references, which is
undefined behavior. Update the descriptor access in the relevant parsing code
around AnchorVolumeDescriptorPointer and similar reads to first copy the bytes
into a properly created object, using a small std::memcpy or std::bit_cast
helper for fixed-size descriptors. Keep the existing flow, but ensure all udf::
descriptor reads go through real objects whose lifetime has started before
accessing their fields.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7a226576-bd5f-4799-8f17-0ca5982f2c6e

📥 Commits

Reviewing files that changed from the base of the PR and between d1dabdd and 291aa91.

📒 Files selected for processing (4)
  • CMakeLists.txt
  • filesystem/udf/udf.ixx
  • filesystem/udf/udf_browser.ixx
  • filesystem/udf/udf_defs.ixx
✅ Files skipped from review due to trivial changes (2)
  • filesystem/udf/udf.ixx
  • CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • filesystem/udf/udf_defs.ixx

Comment thread filesystem/udf/udf_browser.ixx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant