Skip to content

[metal] Fix sys_mmap_metal() issues for non-MAP_FIXED case #651

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
Oct 6, 2022
Merged

[metal] Fix sys_mmap_metal() issues for non-MAP_FIXED case #651

merged 1 commit into from
Oct 6, 2022

Conversation

tkchia
Copy link
Contributor

@tkchia tkchia commented Oct 6, 2022

  • correctly check that virtual region we want to use is unmapped, rather than accidentally clobbering existing pages
  • avoid placing mmap'd memory at null virtual address

- correctly check that virtual region we want to use is
  unmapped, rather than accidentally clobbering existing pages
- avoid placing mmap'd memory at null virtual address
@tkchia
Copy link
Contributor Author

tkchia commented Oct 6, 2022

sys_mmap_metal() caused a crash when I tried to get vga.com to use a 1600 × 1200 × 32bpp (16M-color) screen — this involved creating a 7.3MiB off-screen canvas. sys_mmap_metal() incorrectly reused (and clobbered) the virtual address space for the text section, instead of finding an unmapped range of virtual addresses.

I am not sure why the patches are causing the GitHub CI tests to fail.

Thank you!

Copy link
Owner

@jart jart left a comment

Choose a reason for hiding this comment

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

Thanks!

@jart jart merged commit bc353f4 into jart:master Oct 6, 2022
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.

2 participants