diff options
| author | EmulatedSeasons <89668582+EmulatedSeasons@users.noreply.github.com> | 2024-06-14 21:36:33 -0400 |
|---|---|---|
| committer | EmulatedSeasons <89668582+EmulatedSeasons@users.noreply.github.com> | 2024-06-14 21:36:33 -0400 |
| commit | 8322f42a0b23ed5bd9c40e64b204f0dad935ff63 (patch) | |
| tree | 3a9ddf5e16e32239183e0c1067b4a8b452688c01 /kernel/arch/x86_64/limine.cpp | |
| parent | 27a44e0d79d1c6e01cd832feb8ad958d5999b5e3 (diff) | |
Broken attempt at freelist pmm.
Diffstat (limited to 'kernel/arch/x86_64/limine.cpp')
| -rw-r--r-- | kernel/arch/x86_64/limine.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/kernel/arch/x86_64/limine.cpp b/kernel/arch/x86_64/limine.cpp index b592592..5e9905f 100644 --- a/kernel/arch/x86_64/limine.cpp +++ b/kernel/arch/x86_64/limine.cpp @@ -62,12 +62,17 @@ extern void (*__init_array_end[])(); void kernel_main();
+// this will cause problems later
+uint64_t _hhdm_offset;
+
extern "C" void _start() {
asm("cli");
if (!LIMINE_BASE_REVISION_SUPPORTED) {
hcf();
}
+ _hhdm_offset = hhdm_request.response->offset;
+
// setup gdt
SegDesc segs[5];
GDTR gdtr{sizeof(struct SegDesc) * 5 - 1, (uint64_t)&segs};
@@ -129,10 +134,15 @@ extern "C" void _start() { memmap->entries[i]->base, memmap->entries[i]->length, memmap->entries[i]->type);
}
- // broken printf mirroring 64 bit values for some reason
- //uint64_t tester = 0xFFFE0000000000AE + 1;
- //printf("aaaa: %lx\n", tester);
- pmm_init(memmap_request.response, hhdm_request.response->offset);
+ printf("hhdm offset: %lx\n", _hhdm_offset);
+ // pmm_init(memmap_request.response);
+
+ // asm("xchgw %bx, %bx");
+ // uint64_t pmm_test[5];
+ // for (size_t i = 0; i < 5; i++) {
+ // pmm_test[i] = (uint64_t)palloc();
+ // printf("Alloc %d: %lx\n", i, pmm_test[i]);
+ // }
kernel_main();
|
