vmmcache: initial implementation

This commit is contained in:
Matheus
2024-05-24 18:03:24 -03:00
parent 7673a365e8
commit 48b7fb4324
21 changed files with 772 additions and 134 deletions
+4
View File
@@ -37,6 +37,7 @@
#include <kernel/mouse.h>
#include <kernel/tty.h>
#include <kernel/pty.h>
#include <kernel/vmmcache.h>
static cpu_t bsp_cpu;
@@ -64,6 +65,9 @@ void kernel_entry() {
arch_apic_timerinit();
sched_init();
arch_smp_wakeup();
vmmcache_init();
vfs_init();
tmpfs_init();
devfs_init();
+7
View File
@@ -175,6 +175,13 @@ bool arch_mmu_iswritable(pagetableptr_t table, void *vaddr) {
return entry == NULL ? false : *entry & ARCH_MMU_FLAGS_WRITE;
}
#define ARCH_MMU_FLAGS_DIRTY (1 << 6)
bool arch_mmu_isdirty(pagetableptr_t table, void *vaddr) {
uint64_t *entry = get_page(table, vaddr);
return entry == NULL ? false : *entry & ARCH_MMU_FLAGS_DIRTY;
}
void arch_mmu_switch(pagetableptr_t table) {
asm volatile("mov %%rax, %%cr3" : : "a"(table));
}