aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/acpi
diff options
context:
space:
mode:
authorMarvin Borner2020-02-22 17:22:17 +0100
committerMarvin Borner2020-02-22 17:22:17 +0100
commitadd6efeb22ffb7695d5c9addcef073fc653f700e (patch)
tree147c99f2f3e037c877a34468f1494c412ec53416 /src/kernel/acpi
parent86ef6a779a42cf5701632ccb82714a006bae4ee9 (diff)
Well basically nothing really works I guess
I've worked quite a while on several small things which I didn't commit but I'm going away for a week (holiday) soooo I synced these useless and dumb files :)
Diffstat (limited to 'src/kernel/acpi')
-rw-r--r--src/kernel/acpi/acpi.c5
-rw-r--r--src/kernel/acpi/acpi.h30
2 files changed, 31 insertions, 4 deletions
diff --git a/src/kernel/acpi/acpi.c b/src/kernel/acpi/acpi.c
index 60ed4f9..0122450 100644
--- a/src/kernel/acpi/acpi.c
+++ b/src/kernel/acpi/acpi.c
@@ -162,7 +162,10 @@ int acpi_install()
}
if (memcmp((unsigned int *) *ptr, "HPET", 4) == 0) {
hpet = (struct HPET *) *ptr;
- // serial_printf("%d", hpet->base_address);
+ serial_printf("%c%c%c%c", hpet->signature[0], hpet->signature[1], hpet->signature[2],
+ hpet->signature[3]);
+ serial_printf("%d", hpet->legacy_replacement);
+ serial_printf("%d", hpet->address.address);
}
ptr++;
} // Else: no valid FADT present
diff --git a/src/kernel/acpi/acpi.h b/src/kernel/acpi/acpi.h
index 43cb61e..8544090 100644
--- a/src/kernel/acpi/acpi.h
+++ b/src/kernel/acpi/acpi.h
@@ -43,11 +43,35 @@ struct FADT {
char century;
};
+struct address_structure {
+ uint8_t address_space_id;
+ uint8_t register_bit_width;
+ uint8_t register_bit_offset;
+ uint8_t reserved;
+ uint64_t address;
+} __attribute__((packed));
+
struct HPET {
char signature[4];
- char unneeded[36];
- char base_address[12];
-};
+ uint32_t length;
+ uint8_t revision;
+ uint8_t checksum;
+ char oemid[6];
+ uint64_t oem_tableid;
+ uint32_t oem_revision;
+ uint32_t creator_id;
+ uint32_t creator_revision;
+ uint8_t hardware_rev_id;
+ uint8_t comparator_count:5;
+ uint8_t counter_size:1;
+ uint8_t reserved:1;
+ uint8_t legacy_replacement:1;
+ uint16_t pci_vendor_id;
+ struct address_structure address;
+ uint8_t hpet_number;
+ uint16_t minimum_tick;
+ uint8_t page_protection;
+} __attribute__((packed));
struct FADT *fadt;