luxos/Kernel/tasking/tasking-asm.asm

50 lines
532 B
NASM
Raw Normal View History

2021-09-14 16:02:20 +00:00
;
; tasking-asm.asm
;
; Created on: Sep 6, 2011
; Author: Tiberiu
;
bits 32
2021-09-14 16:02:20 +00:00
global PagingCopyPagePhysical
PagingCopyPagePhysical:
push ebx
pushf
cli
mov ebx, [esp+12]
mov ecx, [esp+16]
; Disable paging
mov edx, cr0
and edx, 0x7fffffff
mov cr0, edx
; copy
mov edx, 1024
.loop:
mov eax, [ebx]
mov [ecx], eax
add ebx, 4
add ecx, 4
dec edx
jnz .loop
; reenable paging
mov edx, cr0
or edx, 0x80000000
mov cr0, edx
; return
popf
pop ebx
ret
global TaskingReadEip
TaskingReadEip:
pop eax
jmp eax