summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAiden Gall <aiden@aidengall.xyz>2024-05-15 00:26:59 +0100
committerAiden Gall <aiden@aidengall.xyz>2024-05-15 00:26:59 +0100
commitd28457e416f7ba7c903c4db6bff73fb87f77e3e6 (patch)
treeb435ba6b5840fb205e91539fff92b11becb8743c
parent8ae71180b37cee5fda7717226a1704ac7ef3db08 (diff)
align e820 table to 8 byte boundary
-rw-r--r--boot/bios.inc2
-rw-r--r--kernel/main.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/boot/bios.inc b/boot/bios.inc
index ccc94e3..eede41e 100644
--- a/boot/bios.inc
+++ b/boot/bios.inc
@@ -73,7 +73,7 @@ e820:
.sizeof = $ - e820_entry
end virtual
- mov di, mmap + 4
+ mov di, mmap + 8
xor ebx, ebx
xor bp, bp
diff --git a/kernel/main.c b/kernel/main.c
index e69af30..8c120e9 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -45,9 +45,9 @@ puts(uint16_t *dst, const char *str)
}
static uint16_t *
-print_e820_table(uint16_t *dst, const struct e820_entry *const entries, const uint32_t count)
+print_e820_table(uint16_t *dst, const struct e820_entry *const entries, const uint16_t count)
{
- for (uint32_t i = 0; i < count; ++i, dst += VGA_WIDTH) {
+ for (uint16_t i = 0; i < count; ++i, dst += VGA_WIDTH) {
uint16_t *cursor;
cursor = print_hex(dst, entries[i].base);
@@ -74,8 +74,8 @@ kmain(void)
puts(vga_memory, "ProvidenceOS v0.1");
puts(vga_memory+VGA_WIDTH*2, "e820 memory map:");
- const uint32_t e820_size = *(uint32_t *)0xf000;
- const struct e820_entry *const e820_mmap = (struct e820_entry *)0xf004;
+ const uint16_t e820_size = *(uint16_t *)0xf000;
+ const struct e820_entry *const e820_mmap = (struct e820_entry *)0xf008;
print_e820_table(vga_memory+(VGA_WIDTH*3), e820_mmap, e820_size);