40 lines
495 B
NASM
40 lines
495 B
NASM
global _main
|
|
extern _start
|
|
|
|
_main:
|
|
xor rbp, rbp
|
|
call _start
|
|
cli
|
|
.hang:
|
|
hlt
|
|
jmp .hang
|
|
|
|
global idle_task_function
|
|
idle_task_function:
|
|
sti
|
|
.idle:
|
|
hlt
|
|
jmp .idle
|
|
|
|
global asm_enable_sse
|
|
asm_enable_sse:
|
|
mov rax, cr0
|
|
and ax, 0xFFFB
|
|
or ax, 0x2
|
|
mov cr0, rax
|
|
mov rax, cr4
|
|
or ax, 3 << 9
|
|
mov cr4, rax
|
|
ret
|
|
|
|
global asm_get_rflags
|
|
asm_get_rflags:
|
|
pushfq
|
|
pop rax
|
|
ret
|
|
|
|
global asm_set_rflags
|
|
asm_set_rflags:
|
|
push rdi
|
|
popfq
|
|
ret |