mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
f1d3126990
As of now the VMM (pretty much a doubly linked list of regions) supports allocating and demand paging. still no deallocation though so if you allocate something you can't free it yet :')
21 lines
365 B
C
21 lines
365 B
C
#include <arch/cls.h>
|
|
#include <arch/msr.h>
|
|
#include <stdint.h>
|
|
|
|
cls_t bspcls;
|
|
vmm_context initialvmmcontext;
|
|
|
|
void arch_setcls(cls_t* addr){
|
|
wrmsr(MSR_GSBASE, (uint64_t)addr);
|
|
wrmsr(MSR_KERNELGSBASE, (uint64_t)addr);
|
|
}
|
|
|
|
cls_t* arch_getcls(){
|
|
return (cls_t*)rdmsr(MSR_GSBASE);
|
|
}
|
|
|
|
void bsp_setcls(){
|
|
arch_setcls(&bspcls);
|
|
bspcls.context = &initialvmmcontext;
|
|
}
|