Enable interrupts and halt CPU
This commit is contained in:
parent
bc7fd3f2fc
commit
43d945b5e8
@ -5,6 +5,16 @@ void cli()
|
|||||||
__asm("cli", "");
|
__asm("cli", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sti()
|
||||||
|
{
|
||||||
|
__asm("sti", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
void hlt()
|
||||||
|
{
|
||||||
|
__asm("hlt", "");
|
||||||
|
}
|
||||||
|
|
||||||
ulong read_cr0()
|
ulong read_cr0()
|
||||||
{
|
{
|
||||||
return __asm!ulong("mov %cr0, %rax", "={rax}");
|
return __asm!ulong("mov %cr0, %rax", "={rax}");
|
||||||
|
@ -16,6 +16,7 @@ import hulk.pci;
|
|||||||
import hulk.gdt;
|
import hulk.gdt;
|
||||||
import hulk.idt;
|
import hulk.idt;
|
||||||
import hos.cpu;
|
import hos.cpu;
|
||||||
|
import ldc.llvmasm;
|
||||||
|
|
||||||
extern extern(C) __gshared ubyte _hulk_total_size;
|
extern extern(C) __gshared ubyte _hulk_total_size;
|
||||||
|
|
||||||
@ -46,8 +47,10 @@ void hulk_start()
|
|||||||
|
|
||||||
hippo.initialize(&hulk_header);
|
hippo.initialize(&hulk_header);
|
||||||
pci.initialize();
|
pci.initialize();
|
||||||
|
sti();
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
hlt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user