-
Notifications
You must be signed in to change notification settings - Fork 56
rsdp: add the validate_checksum to rsdp #64
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
Conversation
pub fn checksum(&self) -> u8 { | ||
self.checksum | ||
/// Validation of the RSDPv2 extended checksum | ||
pub fn checksum_is_valid(&self) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only added a validation of the RSDPv2 extended checksum for the RsdpV2Tag. Should we have a RSDPv1 checksum validation and extended checksum validation function for the RsdpV2Tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, with the later revisions, it is correct to check that the entire structure (including both the checksum and extended checksum fields) sums to 0
, and so we only need the one function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the checksum of the ACPI 1.0 fields is still valid in the a RSDPv2 structure, but I don't know of a reason for a user to only check this. If we do find a reason to include it, it shouldn't be hard to add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting this PR :)
Looks good overall, just a question about the calculation to validate the checksum.
pub fn checksum(&self) -> u8 { | ||
self.checksum | ||
/// Validation of the RSDPv2 extended checksum | ||
pub fn checksum_is_valid(&self) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, with the later revisions, it is correct to check that the entire structure (including both the checksum and extended checksum fields) sums to 0
, and so we only need the one function.
Add the validate_checksum method to the implementation of the RsdpV1Tag and RsdpV2Tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much for this; looks good now.
Published as multiboot2 v0.9.0 |
Add the validate_checksum method to the implementation of the RsdpV1Tag
and RsdpV2Tag.
CC: @phil-opp @IsaacWoods
Fixes: #63