Skip to content
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

Add PhysBuf for DMA #16

Merged
merged 10 commits into from
Feb 5, 2020
Merged

Add PhysBuf for DMA #16

merged 10 commits into from
Feb 5, 2020

Conversation

vinc
Copy link
Owner

@vinc vinc commented Feb 4, 2020

When we allocate on the heap, the next three frames after the first allocated frame are used to create new page tables, and are therefor unavailable.

If we allocate a buffer larger that the space available in the first frame, it will then use the fifth frame, but if we use the buffer for DMA the frames used for the page tables will be overwritten.

https://docs.rs/x86_64/0.8.3/x86_64/structures/paging/mapper/trait.Mapper.html#tymethod.map_to
https://docs.rs/x86_64/0.8.3/src/x86_64/structures/paging/mapper/mapped_page_table.rs.html#92

@vinc
Copy link
Owner Author

vinc commented Feb 4, 2020

For now a naive solution is to reallocate if the space is not contiguous in physical memory.

@vinc vinc merged commit d2fe9e6 into master Feb 5, 2020
@vinc vinc deleted the feature/physbuf branch February 5, 2020 18:32
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.

1 participant