Skip to content

device_path: add more convenience (part 1) #827

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
Jun 20, 2023

Conversation

phip1611
Copy link
Member

@phip1611 phip1611 commented May 25, 2023

This MR adds convenient methods to transform device paths easier to text. This should make it easier for devs to work with device paths (through convenient debug output).

The debug output of my example is sth like this:

for the first helper method (.to_node_string_pairs)

image

for the second helper method (.to_string)

image

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See the Rewriting History guide for help.
  • Update the changelog (if necessary)

@phip1611
Copy link
Member Author

@blitz Is this something that you think is helpful?

@phip1611 phip1611 changed the title WIP: make device path suck less WIP: make device paths suck less May 25, 2023
@phip1611 phip1611 requested a review from nicholasbishop May 25, 2023 14:34
Copy link
Contributor

@blitz blitz left a comment

Choose a reason for hiding this comment

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

Should be useful for our internal loader usecase. 👍

@phip1611 phip1611 changed the title WIP: make device paths suck less device_path: add more convenience (part 1) Jun 9, 2023
@phip1611 phip1611 force-pushed the device-path-sucks-less branch from 016e890 to da33c00 Compare June 11, 2023 08:13
@phip1611 phip1611 marked this pull request as ready for review June 11, 2023 08:14
@phip1611 phip1611 force-pushed the device-path-sucks-less branch 3 times, most recently from 59494c5 to bace1c6 Compare June 11, 2023 08:21
@phip1611 phip1611 force-pushed the device-path-sucks-less branch from bace1c6 to 48b7b5d Compare June 20, 2023 15:05
@phip1611 phip1611 requested a review from nicholasbishop June 20, 2023 15:05
@phip1611 phip1611 force-pushed the device-path-sucks-less branch 2 times, most recently from b5abddc to 4038e0d Compare June 20, 2023 15:09
"HD(1,MBR,0xBE1AFDFA,0x3F,0xFBFC1)",
"\\efi\\boot\\test_runner.efi"
]
);
Copy link
Member

Choose a reason for hiding this comment

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

The path will be different on aarch64, so might want to use an if cfg!(...) here

Copy link
Member Author

Choose a reason for hiding this comment

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

right! At the first glance, I do not see where this difference comes from. Can you give me a pointer, please? I guess, its the way that xtask prepares the QEMU command.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's just due to the edk2 firmware. Although we tend to refer to it as OVMF, OVMF is actually only for ia32/x86_64, while ArmVirtPkg is used on ARM.

@phip1611 phip1611 force-pushed the device-path-sucks-less branch 3 times, most recently from bbe32d6 to 60e4979 Compare June 20, 2023 15:45
@phip1611 phip1611 force-pushed the device-path-sucks-less branch from 60e4979 to 91abef9 Compare June 20, 2023 15:50
@nicholasbishop nicholasbishop merged commit ea968e1 into rust-osdev:main Jun 20, 2023
@phip1611 phip1611 deleted the device-path-sucks-less branch July 14, 2024 06:58
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.

4 participants