oops
This commit is contained in:
+34
-6
@@ -1,4 +1,5 @@
|
||||
#include <zinnia/alloc.h>
|
||||
#include <zinnia/assert.h>
|
||||
#include <zinnia/cmdline.h>
|
||||
#include <zinnia/init.h>
|
||||
#include <zinnia/print.h>
|
||||
@@ -41,10 +42,15 @@ void kernel_entry() {
|
||||
|
||||
struct boot_info info = {};
|
||||
|
||||
struct limine_memmap_response* mm_res = memmap_request.response;
|
||||
struct limine_module_response* module_res = module_request.response;
|
||||
struct limine_executable_address_response* exec_res = executable_address_request.response;
|
||||
struct limine_executable_file_response* exec_file_res = executable_file_request.response;
|
||||
const struct limine_memmap_response* mm_res = memmap_request.response;
|
||||
const struct limine_hhdm_response* hhdm_res = hhdm_request.response;
|
||||
const struct limine_module_response* module_res = module_request.response;
|
||||
const struct limine_executable_address_response* exec_res = executable_address_request.response;
|
||||
const struct limine_executable_file_response* exec_file_res = executable_file_request.response;
|
||||
const struct limine_rsdp_response* rsdp_res = rsdp_request.response;
|
||||
|
||||
assert(mm_res, "memmap_request returned no response!");
|
||||
assert(hhdm_res, "hhdm_request returned no response!");
|
||||
|
||||
info.cmdline = exec_file_res->executable_file->string;
|
||||
|
||||
@@ -74,7 +80,7 @@ void kernel_entry() {
|
||||
info.files = files;
|
||||
info.num_files = MIN(ARRAY_SIZE(files), module_res->module_count);
|
||||
for (size_t i = 0; i < info.num_files; i++) {
|
||||
files[i].data = (phys_t)module_res->modules[i]->address - hhdm_request.response->offset;
|
||||
files[i].data = (phys_t)module_res->modules[i]->address - hhdm_res->offset;
|
||||
files[i].length = module_res->modules[i]->size;
|
||||
strncpy(files[i].path, module_res->modules[i]->path, sizeof(files[i].path) - 1);
|
||||
files[i].path[sizeof(files[i].path) - 1] = 0;
|
||||
@@ -84,7 +90,29 @@ void kernel_entry() {
|
||||
info.mem_map = mem;
|
||||
info.phys_base = (phys_t)exec_res->physical_base;
|
||||
info.virt_base = (uintptr_t)exec_res->virtual_base;
|
||||
info.hhdm_base = (uintptr_t)hhdm_request.response->offset;
|
||||
info.hhdm_base = (uintptr_t)hhdm_res->offset;
|
||||
|
||||
const struct limine_framebuffer_response* fb_res = framebuffer_request.response;
|
||||
if (fb_res) {
|
||||
// Only use the first framebuffer.
|
||||
if (fb_res->framebuffer_count >= 1) {
|
||||
const struct limine_framebuffer* fb = framebuffer_request.response->framebuffers[0];
|
||||
info.fb.base = (phys_t)((uintptr_t)fb->address - hhdm_res->offset);
|
||||
info.fb.width = fb->width;
|
||||
info.fb.height = fb->height;
|
||||
info.fb.pitch = fb->pitch;
|
||||
info.fb.bytes_per_pixel = fb->bpp / 8;
|
||||
|
||||
info.fb.red.shift = fb->red_mask_shift;
|
||||
info.fb.red.size = fb->red_mask_size;
|
||||
|
||||
info.fb.green.shift = fb->green_mask_shift;
|
||||
info.fb.green.size = fb->green_mask_size;
|
||||
|
||||
info.fb.blue.shift = fb->blue_mask_shift;
|
||||
info.fb.blue.size = fb->blue_mask_size;
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_ACPI
|
||||
if (rsdp_request.response) {
|
||||
|
||||
Reference in New Issue
Block a user