Add apic module that does not do anything yet
This commit is contained in:
parent
dba58b2277
commit
b1be5b888f
22
src/hulk/apic.d
Normal file
22
src/hulk/apic.d
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
/**
|
||||||
|
* APIC (Advanced Programmable Interrupt Controller) functionality.
|
||||||
|
*/
|
||||||
|
module hulk.apic;
|
||||||
|
|
||||||
|
import hulk.klog;
|
||||||
|
import hulk.hurl;
|
||||||
|
import hulk.acpi;
|
||||||
|
|
||||||
|
struct apic
|
||||||
|
{
|
||||||
|
public enum uint * local_apic_registers = cast(uint *)0xFEE0_0000u;
|
||||||
|
|
||||||
|
public static void initialize()
|
||||||
|
{
|
||||||
|
Hurl.map(cast(ulong)local_apic_registers,
|
||||||
|
cast(ulong)local_apic_registers,
|
||||||
|
MAP_WRITABLE | MAP_WRITE_THROUGH | MAP_DISABLE_CACHE | MAP_NO_EXECUTE);
|
||||||
|
klog.writefln("LAPIC ID: 0x%08x", local_apic_registers[0x20/4]);
|
||||||
|
klog.writefln("LAPIC version: 0x%08x", local_apic_registers[0x30/4]);
|
||||||
|
}
|
||||||
|
}
|
@ -19,6 +19,7 @@ import hos.cpu;
|
|||||||
import ldc.llvmasm;
|
import ldc.llvmasm;
|
||||||
import hulk.pic;
|
import hulk.pic;
|
||||||
import hulk.acpi;
|
import hulk.acpi;
|
||||||
|
import hulk.apic;
|
||||||
|
|
||||||
extern extern(C) __gshared ubyte _hulk_total_size;
|
extern extern(C) __gshared ubyte _hulk_total_size;
|
||||||
|
|
||||||
@ -52,6 +53,7 @@ void hulk_start()
|
|||||||
pci.initialize();
|
pci.initialize();
|
||||||
pic.initialize();
|
pic.initialize();
|
||||||
acpi.initialize(hulk_header.bootinfo.acpi_xsdt_phys);
|
acpi.initialize(hulk_header.bootinfo.acpi_xsdt_phys);
|
||||||
|
apic.initialize();
|
||||||
sti();
|
sti();
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user