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

Kernel mapping #594

Merged
merged 6 commits into from Mar 28, 2016
Merged

Kernel mapping #594

merged 6 commits into from Mar 28, 2016

Conversation

jackpot51
Copy link
Member

Problem:

The allocator does not map memory correctly, causing allocations to fail when it hits an address that is not identity mapped.

Solution:

Make the allocator remap memory when necessary, refactor the kernel to allow for the use of "logical" addresses

Changes introduced by this pull request:

  • Logical offsets for kernel allocations, map virtual memory when allocations happen
  • Undo logical offset for use in drivers, when detected
  • Do not identity map all memory
  • Add three context "zones" for allocating memory to contexts: image, heap, and mmap
  • The image zone is for the program's image (text, data, bss, loaded by exec)
  • The heap zone is for the program's dynamic allocations (done by brk)
  • The mmap zone is for the program's shared memory (while handling scheme operations as a server).
  • The mmap zone will also be reused for mapping MMIO

Drawbacks:

This is by no means done in a safe, reliable, consistent, clean, idiomatic, or efficient way, and significant improvements can be made to the code quality and performance.

TODOs:

  • Code cleanup
  • Improvements for safety
  • Improvements for performance
  • Testing

Fixes:
Fixes #536
Fixes #549
Fixes #590
Fixes #591
Fixes #592

@jackpot51 jackpot51 merged commit be2ee4f into master Mar 28, 2016
@jackpot51 jackpot51 deleted the kernel_mapping branch March 28, 2016 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant