Clean up process memory on exit.

Additionally, there were several bug fixes needed to allow this:
- frame_allocator was allocating its frame_blocks from the heap, causing
  a circular dependency. Now it gives itself a page on its own when
  needed.
- frame_allocator::free was putting any trailing pages in a block back
  into the list after the current block, so they would be the next block
  iterated to.
- frame_allocator::free was updating the address it was looking for
  after freeing some pages, but not the count it was looking for, so it
  would eventually free all pages after the initial address.
This commit is contained in:
Justin C. Miller
2019-04-06 11:19:38 -07:00
parent c605793a9d
commit 863555ec6b
8 changed files with 110 additions and 31 deletions

View File

@@ -12,6 +12,7 @@ process::exit(uint32_t code)
{
return_code = code;
flags -= process_flags::running;
page_manager::get()->delete_process_map(pml4);
}
pid_t