Commit Graph

8 Commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen 4bc2841ef0 Restored the partial support for x64. 2011-09-08 21:09:14 +02:00
Jonas 'Sortie' Termansen b80195dc19 Implemented the new physical page allocator API. 2011-08-22 21:12:55 +02:00
Jonas 'Sortie' Termansen d392045559 Extended and documented the memory management API.
Physical paging have been extended with Page::Insert() and Page::GetStats()
which allows the physical paging system to add new pages to the physical page
allocator, and still keep the "free/used pages" count accurate, and providing
this information to the kernel (and user-space at some point).

The virtual memory API has been extended with RemapKernel(), RemapUser(),
MapRangeKernel(), UnmapRangeKernel(), MapRangeUser(), and UnmapRangeUser().
This huge number of related functions have been created in the hope that it
hides the internal complexity of portable virtual memory management and avoid
bugs. It is crucial that the correct group of functions are used when solving
a problem and that they are not mixed in a manner not documented.

I probably overdocumented the code - hopefully it should help avoiding making
stupid or bothersome code.

Another problem is that code calling Page::Get() often should call something
like Page::AlwaysGetPageEvenIfYouHaveToSwap(). I'd be swell to have a function
that always gets a page under heavily-swapping conditions. Possibly Page::Get()
could become that?
2011-08-22 21:05:10 +02:00
Jonas 'Sortie' Termansen e95eb60d31 Provide a virtual address where pages can be temporarily mapped. 2011-08-08 15:20:02 +02:00
Jonas 'Sortie' Termansen 412d3e78b2 AlignDown and AlignUp aligns an address on a page boundary. 2011-08-08 15:20:02 +02:00
Jonas 'Sortie' Termansen 90ebfe7f0a Improvements to the address space switching function.
It now only switches when needed and returns the old addr space.
2011-08-07 01:16:53 +02:00
Jonas 'Sortie' Termansen 66c058fba1 Refactored virtual memory management, making it less buggy.
uintptr_t is now replaced with addr_t when referring to physical memory
addresses in Sortix. Many bugs in the previous memory management code have been
fixed. The new interface is less flexible - but should prove more solid as the
nasty internals have been hidden away. The current interface design should also
make the code more 64-bit ready/friendly. And so on.
2011-08-07 00:18:41 +02:00
Jonas 'Sortie' Termansen 9b79673dcb Initial version of Sortix. 2011-08-05 14:25:00 +02:00