Skip to content

Commit

Permalink
Merge pull request #43 from redrabbyte/master
Browse files Browse the repository at this point in the history
Fix virt2phys.c demo 2MB translation
  • Loading branch information
misc0110 authored Oct 23, 2024
2 parents f1c6822 + eea61d9 commit 2965f83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion demos/virt2phys.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) {
} else {
printf(TAG_PROGRESS "Page is 2MB\n");
ptedit_print_entry(entry.pd);
phys = (ptedit_get_pfn(entry.pd) << 21) | (((size_t)&target) & 0x1fffff);
phys = (ptedit_get_pfn(entry.pd) << 12) | (((size_t)&target) & 0x1fffff);
}

printf(TAG_OK "Virtual address: %p\n", &target);
Expand Down

0 comments on commit 2965f83

Please sign in to comment.