mov ds, ax
lgdt [DWORD ds:lGDTPtr-KERNEL_BASE-0xFFFF0]
mov eax, cr0
- or al, 1
- mov cr0, eax
+ or al, 1
+ mov cr0, eax
jmp 08h:DWORD .ProtectedMode-KERNEL_BASE
[bits 32]
.ProtectedMode:
mov eax, gaInitPageDir - KERNEL_BASE
mov cr3, eax
mov eax, cr0
- or eax, 0x80010000 ; PG and WP
+ or eax, 0x80010000 ; PG and WP
mov cr0, eax
; Jump to higher half
lea eax, [.higherHalf]
void Timer_CallTimers(void);
// === GLOBALS ===
-Uint64 giTicks = 0;
-Sint64 giTimestamp = 0;
-Uint64 giPartMiliseconds = 0;
+volatile Uint64 giTicks = 0;
+volatile Sint64 giTimestamp = 0;
+volatile Uint64 giPartMiliseconds = 0;
tTimer gTimers[NUM_TIMERS]; // TODO: Replace by a ring-list timer
// === CODE ===
void Time_Delay(int Delay)
{
Sint64 dest = giTimestamp + Delay;
+ //Log("Time_Delay: dest = %lli", dest);
while(dest > giTimestamp) Threads_Yield();
+ //Log("Time_Delay: giTimestamp = %lli", giTimestamp);
}
// === EXPORTS ===