Luna/kernel/src/memory
apio e5cf32c7b3 Kernel: Introduce page ownership
Some pages, such as framebuffer pages, are not physical memory frames reserved for the current process.
Some, such as the framebuffer, may be shared between all processes.
Yet, on exit() or on exec(), a process frees all frames mapped into its address spaces.
And on fork(), it copies all data between frames. So how could we map framebuffers.

Simple: we use one of the bits in page table entries which are available to the OS, and mark whether that page is owned by the current process.

If it is owned, it will be:
- Freed on address space destruction
- Its data will be copied to a new page owned by the child process on fork()

If it is not owned, it will be:
- Left alone on address space destruction
- On fork(), the child's virtual page will be mapped to the same physical frame as the parent

This still needs a bit more work, such as keeping a reference of how many processes use a page to free it when all processes using it exit/exec.
This should be done for MAP_SHARED mappings, for example, since they are not permanent forever,
unlike the framebuffer for example.
2022-11-02 19:32:28 +01:00
..
liballoc libc: Enable even more warnings 2022-10-07 18:19:06 +02:00
AddressSpace.cpp Kernel: Introduce page ownership 2022-11-02 19:32:28 +01:00
KernelHeap.cpp KernelHeap: Add more debug logging 2022-10-20 18:49:33 +02:00
Memory.cpp ELFLoader: Add check_elf_image() and check_elf_image_from_filesystem() 2022-10-12 18:37:00 +02:00
MemoryManager.cpp Kernel: Add support for the NX bit 2022-11-02 18:34:57 +01:00
MemoryMap.cpp LOTS MORE LOGGING. which is great, of course. 2022-09-07 19:41:08 +02:00
Paging.cpp VMM: Fix naming convention 2022-10-13 18:42:53 +02:00
PMM.cpp PMM: Log invalid frees 2022-10-20 18:49:12 +02:00
UserHeap.cpp UserHeap: allocate needed memory in request_virtual_pages 2022-10-17 18:52:11 +02:00
VMM.cpp Kernel: Introduce page ownership 2022-11-02 19:32:28 +01:00