bSchnepp / Feral

A 64-bit operating system kernel for PCs
Boost Software License 1.0
9 stars 1 forks source link

Virtual memory subsystem #14

Open bSchnepp opened 5 years ago

bSchnepp commented 5 years ago

Need to support actually using virtual memory. VMM should be built up with basic components, primarily as Pager and a Swapper. The Pager handles actually mapping physical memory into a contiguous, flat virtual address space, whereas the Swapper handles moving those to disk if we were to run out of physical space. The important part is doing the former, as we can dump pages to disk later on.

Feral kernel mode code should be easy to identify: if we're in ring 0, and the bit indicating higher half memory (bit 47 or 48, whichever it is that has to be copied over to the rest of the address space), is 1, then we're in the kernel. Otherwise, user mode pointer. If the rings don't match the pointer (not higher half pointer), do a bugcheck.

bSchnepp commented 4 years ago

To clarify: the issue is that the only paging code is some basic stuff done in assembly at initial boot stage. Additional pages are never created, nor are more P3 and P2 tables. In the future, we should be able to have more pages than physically available (and use a swapfile), and should support swapping for both kernel and user pages.