mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-30 05:58:22 +00:00
kernel: initial vmm implementation
This commit is contained in:
@@ -7,12 +7,14 @@
|
||||
#include <arch/msr.h>
|
||||
#include <arch/ist.h>
|
||||
#include <kernel/interrupt.h>
|
||||
#include <kernel/vmm.h>
|
||||
|
||||
typedef struct {
|
||||
uint64_t gdt[7];
|
||||
ist_t ist;
|
||||
long id;
|
||||
isr_t isr[MAX_ISR_COUNT];
|
||||
vmmcontext_t *vmmctx;
|
||||
} cpu_t;
|
||||
|
||||
static inline cpu_t *_cpu() {
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define KERNELSPACE_START (void *)0xffff800000000000
|
||||
#define KERNELSPACE_END (void *)0xffffffffffffffff
|
||||
#define USERSPACE_START (void *)0x0000000000001000
|
||||
#define USERSPACE_END (void *)0x00007fffffffffff
|
||||
|
||||
#define PAGE_SIZE 4096
|
||||
#define ARCH_MMU_FLAG_READ (uint64_t)1
|
||||
#define ARCH_MMU_FLAG_WRITE (uint64_t)2
|
||||
@@ -20,6 +25,7 @@ void arch_mmu_unmap(pagetableptr_t table, void *vaddr);
|
||||
void arch_mmu_remap(pagetableptr_t table, void *paddr, void *vaddr, mmuflags_t flags);
|
||||
void arch_mmu_switch(pagetableptr_t table);
|
||||
void *arch_mmu_getphysical(pagetableptr_t table, void *vaddr);
|
||||
pagetableptr_t arch_mmu_newtable();
|
||||
void arch_mmu_init();
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user