summaryrefslogtreecommitdiffstats
path: root/boot/limine
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-09-18 15:46:18 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-09-18 15:46:18 -0400
commit6da70f16c584ee897a4ac4f51d016a615c84042b (patch)
treece5458f9daa9f055340bfafc85d5197ce9aa678a /boot/limine
parent13adbc58eb9f5eb5d6f0e4454bd005e9adbb47c8 (diff)
downloadjove-kernel-6da70f16c584ee897a4ac4f51d016a615c84042b.tar.gz
jove-kernel-6da70f16c584ee897a4ac4f51d016a615c84042b.tar.bz2
jove-kernel-6da70f16c584ee897a4ac4f51d016a615c84042b.zip
cleanup for real hw attempt
Diffstat (limited to 'boot/limine')
-rw-r--r--boot/limine/framebuffer.c2
-rw-r--r--boot/limine/memorymap.c21
-rw-r--r--boot/limine/start.c6
-rw-r--r--boot/limine/uacpi.c10
4 files changed, 26 insertions, 13 deletions
diff --git a/boot/limine/framebuffer.c b/boot/limine/framebuffer.c
index 71d4c48..3758167 100644
--- a/boot/limine/framebuffer.c
+++ b/boot/limine/framebuffer.c
@@ -58,6 +58,8 @@ fb_init()
struct limine_framebuffer *fb = _limine_framebuffers->framebuffers[0];
size_t fb_bytes = fb->width * fb->height * (fb->bpp / 8);
void *fb_virt = fb_remap((uintptr_t)fb->address, fb_bytes);
+
+ //void *fb_virt = fb->address;
if(fb_virt == NULL) {
kprintf("Unable to remap framebuffer.\n");
return;
diff --git a/boot/limine/memorymap.c b/boot/limine/memorymap.c
index 72c8de3..25dcc61 100644
--- a/boot/limine/memorymap.c
+++ b/boot/limine/memorymap.c
@@ -1,4 +1,5 @@
#include "hal/obj.h"
+#include "jove.h"
#include "limine.h"
#include "hal/memory.h"
#include "hal/obj.h"
@@ -7,7 +8,10 @@
#include "lib/printf.h"
extern struct limine_memmap_response *_limine_memmap_resp;
+
+PAGEALIGN
static jove_objdir_t s_untyped_objdir;
+static jove_objdir_t s_hwmemory_objdir;
#define MEMMAP_MAX_ENTRIES 255
@@ -40,7 +44,7 @@ mem_setup_untyped(void)
kprintf("Memory map provided by Limine:\n");
size_t untyped_i = 0;
- size_t acpi_i = 0;
+ size_t hwmem_i = 0;
uintptr_t highest_phys = 0;
for(size_t i = 0; i < _limine_memmap_resp->entry_count; i++) {
@@ -70,6 +74,21 @@ mem_setup_untyped(void)
break;
}
}
+ if(entry->type == LIMINE_MEMMAP_RESERVED |
+ entry->type == LIMINE_MEMMAP_ACPI_NVS |
+ entry->type == LIMINE_MEMMAP_ACPI_TABLES)
+ {
+ size_t hw_pages = entry->length >> 12;
+ if(hw_pages > 4095) {
+ klogf("HW memory page is too big!\n", "");
+ }
+
+ jove_owned_obj_t *hwmem_obj = obj_take(&s_hwmemory_objdir.entries[hwmem_i++]);
+ obj_settype(hwmem_obj, JOVE_OBJ_HWMEMORY);
+ obj_setvalue(hwmem_obj, entry->base | (entry->length >> 12));
+
+ obj_release(hwmem_obj);
+ }
}
kprintf("Highest physical address: %p\n", highest_phys);
}
diff --git a/boot/limine/start.c b/boot/limine/start.c
index 9fffb0b..803c1de 100644
--- a/boot/limine/start.c
+++ b/boot/limine/start.c
@@ -1,6 +1,7 @@
#include <stdint.h>
#include <stddef.h>
+#include "api/init.h"
#include "boot/cmdline.h"
#include "limine.h"
@@ -64,7 +65,6 @@ void *_kernel_physptr = NULL;
void *_initrd_module = NULL;
struct limine_framebuffer_response *_limine_framebuffers;
struct limine_memmap_response *_limine_memmap_resp = NULL;
-struct limine_rsdp_response *_limine_rsdp_resp = NULL;
__attribute__((noreturn))
void
@@ -73,7 +73,9 @@ _start(void)
_kernel_physptr = (void*)executable_address_req.response->physical_base;
_limine_memmap_resp = memmap_req.response;
_limine_framebuffers = framebuffer_request.response;
- _limine_rsdp_resp = rsdp_request.response;
+
+ extern struct init_payload _init_payload;
+ _init_payload.rsdp = (void*)((uintptr_t)rsdp_request.response->address & 0xFFFFFFFF);
if(module_req.response->module_count > 0) {
_initrd_module = module_req.response->modules[0]->address;
diff --git a/boot/limine/uacpi.c b/boot/limine/uacpi.c
deleted file mode 100644
index 93b4fd1..0000000
--- a/boot/limine/uacpi.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "uacpi/kernel_api.h"
-#include "limine.h"
-
-extern struct limine_rsdp_response *_limine_rsdp_resp;
-
-uacpi_status uacpi_kernel_get_rsdp(uacpi_phys_addr *out_rsdp_address)
-{
- *out_rsdp_address = (uintptr_t)_limine_rsdp_resp->address;
- return UACPI_STATUS_OK;
-}