Skip to content

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

Merged
merged 1 commit into from
Jul 4, 2020

Conversation

dlrobertson
Copy link
Contributor

Add the validate_checksum method to the implementation of the RsdpV1Tag
and RsdpV2Tag.

CC: @phil-opp @IsaacWoods
Fixes: #63

pub fn checksum(&self) -> u8 {
self.checksum
/// Validation of the RSDPv2 extended checksum
pub fn checksum_is_valid(&self) -> bool {
Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

@IsaacWoods IsaacWoods left a 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 {
Copy link
Member

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.
Copy link
Member

@IsaacWoods IsaacWoods left a 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.

@IsaacWoods IsaacWoods merged commit f558a8c into rust-osdev:master Jul 4, 2020
@IsaacWoods IsaacWoods mentioned this pull request Jul 4, 2020
@IsaacWoods
Copy link
Member

Published as multiboot2 v0.9.0

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.

RSDP checksum and ext_checksum are not particularly useful
2 participants