BarinkOS/source/kernel/cpu.s
Nigel 0f0fc9f252 Adding a skeleton for the memory management code
Moved the PMM away from being object orientated as it is just plain annoying
renamed src folder to source
Set timeout to 5 seconds in the grub config
2022-08-21 21:18:53 +02:00

64 lines
942 B
ArmAsm

# Basic cpu functions
.globl GetCR0
GetCR0:
push %ebp # save the base pointer on the stack
mov %esp, %ebp # Set the base pointer to the current stack pointer
xor %eax, %eax # Clear EAX to make sure no weird stuff is going on
mov %cr0, %eax # Copy the value of the CR0 register into EAX
mov %ebp, %esp # restore the base pointer
pop %ebp
ret
.globl GetCR4
GetCR4:
push %ebp
mov %esp, %ebp
xor %eax, %eax
mov %cr4, %eax
mov %ebp, %esp
pop %ebp
ret
.globl GetEFLAGS
GetEFLAGS:
push %ebp
mov %esp, %ebp
xor %eax, %eax
pushfl # Push the EFLAGS register content onto the stack, should be pushfd but GAS apparently doesn't agree
mov 4(%esp) , %eax
mov %ebp, %esp
pop %ebp
ret
.globl GetCR2
GetCR2:
push %ebp
mov %esp, %ebp
xor %eax, %eax
mov %cr2, %eax
mov %ebp, %esp
pop %ebp
ret
.globl GetCR3
GetCR3:
push %ebp
mov %esp, %ebp
xor %eax, %eax
mov %cr3, %eax
mov %ebp, %esp
pop %ebp
ret