50 lines
532 B
NASM
50 lines
532 B
NASM
;
|
|
; tasking-asm.asm
|
|
;
|
|
; Created on: Sep 6, 2011
|
|
; Author: Tiberiu
|
|
;
|
|
|
|
bits 32
|
|
|
|
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
|