kernel: user safe strlen

This commit is contained in:
Matheus
2022-12-13 23:41:40 -03:00
parent 9fc62579ea
commit c17a2f4c6c
5 changed files with 55 additions and 1 deletions
+19
View File
@@ -0,0 +1,19 @@
section .text:
global arch_u_strlen
global arch_u_strlen_cont
arch_u_strlen:
xor rcx, rcx
.loop:
cmp byte [rdi],0
je .done
inc rcx
inc rdi
.done:
mov [rsi], rcx
xor rax, rax
ret
arch_u_strlen_cont:
mov rax, 1
ret