use boot_ctx
This commit is contained in:
@@ -10,7 +10,7 @@ because this shitty implementation will be replaced one day by Flanterm
|
||||
#include <kernel.h>
|
||||
#include "term.h"
|
||||
|
||||
extern struct limine_framebuffer* framebuffer;
|
||||
extern struct boot_context boot_ctx;
|
||||
|
||||
// Importing the PSF object file
|
||||
extern unsigned char _binary_zap_light16_psf_start[];
|
||||
@@ -33,13 +33,16 @@ Cursor cursor = {0};
|
||||
|
||||
unsigned char* fb;
|
||||
|
||||
struct limine_framebuffer* framebuffer;
|
||||
|
||||
int term_init()
|
||||
{
|
||||
// Get framebuffer address from Limine struct
|
||||
|
||||
if (framebuffer)
|
||||
if (boot_ctx.fb)
|
||||
{
|
||||
fb = framebuffer->address;
|
||||
fb = boot_ctx.fb->address;
|
||||
framebuffer = boot_ctx.fb;
|
||||
DEBUG("terminal initialized");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -53,8 +53,6 @@ static volatile LIMINE_REQUESTS_START_MARKER;
|
||||
__attribute__((used, section(".limine_requests_end")))
|
||||
static volatile LIMINE_REQUESTS_END_MARKER;
|
||||
|
||||
struct limine_framebuffer* framebuffer;
|
||||
|
||||
// Panic (should dump registers etc. in the future)
|
||||
void hcf()
|
||||
{
|
||||
@@ -64,6 +62,8 @@ void hcf()
|
||||
}
|
||||
}
|
||||
|
||||
const char* splash = "pepperOS version "PEPPEROS_VERSION_MAJOR"."PEPPEROS_VERSION_MINOR"."PEPPEROS_VERSION_PATCH"\n";
|
||||
|
||||
struct boot_context boot_ctx;
|
||||
|
||||
// This is our entry point
|
||||
@@ -77,9 +77,6 @@ void kmain()
|
||||
boot_ctx.hhdm = hhdm_request.response ? hhdm_request.response : NULL;
|
||||
boot_ctx.kaddr = kerneladdr_request.response ? kerneladdr_request.response : NULL;
|
||||
|
||||
// Get the first framebuffer from the response
|
||||
framebuffer = framebuffer_request.response->framebuffers[0];
|
||||
|
||||
serial_init();
|
||||
|
||||
memmap_display(boot_ctx.mmap);
|
||||
@@ -109,7 +106,7 @@ void kmain()
|
||||
keyboard_init(FR);
|
||||
|
||||
term_init();
|
||||
kputs("pepperOS version "PEPPEROS_VERSION_MAJOR"."PEPPEROS_VERSION_MINOR"."PEPPEROS_VERSION_PATCH"\n");
|
||||
kputs(splash);
|
||||
|
||||
hcf();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user