Skip to content

Support dumping Turin data structures and Milan data structures at th… #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

daym
Copy link
Collaborator

@daym daym commented Aug 15, 2024

…e same time.

Fixes #135.

@daym daym requested review from luqmana and dancrossnyc August 15, 2024 09:15
@daym daym self-assigned this Aug 15, 2024
@daym daym force-pushed the issue-135 branch 10 times, most recently from a0f3645 to 8beb37d Compare August 15, 2024 12:47
@daym
Copy link
Collaborator Author

daym commented Aug 15, 2024

More context see #134 (comment)

General design is right now (all this is just for serde):

  • Add context field at the root of the Apcb--visible to the user but not mandatory
  • Thread through its value all the way down to entry handlers
  • Have the entry Serialize handler check that value and use it to decide which version of MemDfeSearchElement to use.
  • Keep the entry Deserialize handler unchanged so that the new context field can be "half" optional (optional for deserialization, optional-ish for serialization). What I mean is that if the Serialize handler finds None in context, it will not pick any of the struct versions and instead serialize out a byte array into JSON.

@daym daym marked this pull request as ready for review August 20, 2024 20:31
@daym daym force-pushed the issue-135 branch 5 times, most recently from 713c4fb to f9187b0 Compare August 22, 2024 22:45
@luqmana
Copy link
Contributor

luqmana commented Sep 4, 2024

Mind up'ing Apcb::MAX_SIZE to 0x8000 or so? Trying to dump turin-1.0.0.0 currently fails:

$ ../../amd-host-image-builder/target/debug/amd-host-image-builder dump -i RRRT1000F.FD -b dump
WARNING: PSP entry with unknown type was skipped PspDirectoryEntry { type_: Err(InvalidBitPattern { invalid_bytes: 105 }), sub_program: Ok(0), rom_id: Ok(SpiCs1), size: Some(8176), source: Ok(PhysicalAddress(0x515500)) }
WARNING: PSP entry with unknown type was skipped PspDirectoryEntry { type_: Err(InvalidBitPattern { invalid_bytes: 105 }), sub_program: Ok(0), rom_id: Ok(SpiCs1), size: Some(8176), source: Ok(PhysicalAddress(0x1fdd00)) }
thread 'main' panicked at src/main.rs:804:53:
range end index 30976 out of range for slice of length 25856
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@daym daym force-pushed the issue-135 branch 2 times, most recently from 7135ee4 to 4d86f83 Compare September 5, 2024 16:12
@daym daym merged commit 0f0e074 into main Sep 18, 2024
4 checks passed
@daym daym deleted the issue-135 branch September 18, 2024 17:52
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.

Support dumping Turin data structures and Milan data structures at the same time
3 participants