summaryrefslogtreecommitdiff
path: root/process.s
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-10-22 19:50:38 +0200
committerAnton Kling <anton@kling.gg>2023-10-22 19:50:38 +0200
commit4e09bca9e34c226b6d7e34b4fa11248405fd988e (patch)
tree80f156b7940d9d19971395f335530170c69516c7 /process.s
Move everything into a new repo.
Diffstat (limited to 'process.s')
-rw-r--r--process.s33
1 files changed, 33 insertions, 0 deletions
diff --git a/process.s b/process.s
new file mode 100644
index 0000000..24e1869
--- /dev/null
+++ b/process.s
@@ -0,0 +1,33 @@
+.intel_syntax noprefix
+.global copy_page_physical
+.global loop_m
+copy_page_physical:
+ push ebx
+ pushf
+
+ cli
+
+ mov ebx, [esp+12]
+ mov ecx, [esp+16]
+
+ mov edx, cr0
+ and edx, 0x7fffffff
+ mov cr0, edx
+
+ mov edx, 1024
+
+.loop:
+ mov eax, [ebx]
+ mov [ecx], eax
+ add ebx, 4
+ add ecx, 4
+ dec edx
+ jnz .loop
+
+ mov edx, cr0
+ or edx, 0x80000000
+ mov cr0, edx
+
+ popf
+ pop ebx
+ ret