summaryrefslogtreecommitdiff
path: root/kernel/x86.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/x86.c')
-rw-r--r--kernel/x86.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/kernel/x86.c b/kernel/x86.c
index 0b6a448..782baec 100644
--- a/kernel/x86.c
+++ b/kernel/x86.c
@@ -1,14 +1,23 @@
+#define FOOLOS_MODULE_NAME "x86"
+
#include "x86.h"
+#include "lib/int/stdint.h"
+#include "lib/logger/log.h"
+
+extern volatile uint64_t task_system_clock; // from task.c
-//TODO!!!
void sleep(int i)
{
- i*=1000000;
- for(;i>0;i--)
- {
-
- }
+ volatile uint64_t clock=task_system_clock;
+
+// while(clock+i>task_system_clock)
+// {
+// log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"It is %d but I will sleep until %d...",task_system_clock,clock+i);
+ for(int j=0;j<i;j++)asm("hlt");
+
+ // }
}
+
// disable interrupts
void x86_int_disable()
{
@@ -22,7 +31,6 @@ void x86_int_enable()
}
// get control registers (cr0-cr4)
-
uint32_t x86_get_cr0()
{
uint32_t cr;