mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
Add a WIP VMM
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 :')
This commit is contained in:
+17
-3
@@ -2,6 +2,8 @@ section .text
|
||||
|
||||
%macro pushregs 0
|
||||
|
||||
|
||||
|
||||
push rbp
|
||||
push rsi
|
||||
push rdi
|
||||
@@ -27,6 +29,11 @@ section .text
|
||||
mov rax, gs
|
||||
push rax
|
||||
|
||||
cmp rax,0x30
|
||||
jmp .noswapgs
|
||||
swapgs
|
||||
.noswapgs:
|
||||
|
||||
mov rdi,cr2
|
||||
push rdi
|
||||
|
||||
@@ -36,8 +43,10 @@ section .text
|
||||
%macro popregs 0
|
||||
|
||||
add rsp, 8 ; cr2
|
||||
|
||||
|
||||
pop rax
|
||||
cmp rax,0x30
|
||||
je .dontpopsegs
|
||||
mov gs,rax
|
||||
pop rax
|
||||
mov fs,rax
|
||||
@@ -45,7 +54,12 @@ section .text
|
||||
mov es,rax
|
||||
pop rax
|
||||
mov ds,rax
|
||||
|
||||
swapgs
|
||||
jmp .poprest
|
||||
.dontpopsegs:
|
||||
add rsp,24
|
||||
|
||||
.poprest:
|
||||
pop rax
|
||||
pop rbx
|
||||
pop rcx
|
||||
@@ -89,7 +103,7 @@ section .text
|
||||
|
||||
|
||||
%macro except 2
|
||||
|
||||
|
||||
global %1
|
||||
%1:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user