limine: Ensure framebuffer pointer of terminal is always valid

This commit is contained in:
mintsuki 2022-05-13 19:14:10 +02:00
parent 39559b39ff
commit 688c118caa

View File

@ -547,6 +547,13 @@ skip_fb_init:;
(uint64_t)fb.framebuffer_pitch * fb.framebuffer_height, (uint64_t)fb.framebuffer_pitch * fb.framebuffer_height,
MEMMAP_FRAMEBUFFER, false, false, false, true); MEMMAP_FRAMEBUFFER, false, false, false, true);
// For now we only support 1 framebuffer
struct limine_framebuffer *fbp = ext_mem_alloc(sizeof(struct limine_framebuffer));
if (term_fb_ptr != NULL) {
*term_fb_ptr = reported_addr(fbp);
}
struct limine_framebuffer_request *framebuffer_request = get_request(LIMINE_FRAMEBUFFER_REQUEST); struct limine_framebuffer_request *framebuffer_request = get_request(LIMINE_FRAMEBUFFER_REQUEST);
if (framebuffer_request == NULL) { if (framebuffer_request == NULL) {
break; // next feature break; // next feature
@ -555,13 +562,6 @@ skip_fb_init:;
struct limine_framebuffer_response *framebuffer_response = struct limine_framebuffer_response *framebuffer_response =
ext_mem_alloc(sizeof(struct limine_framebuffer_response)); ext_mem_alloc(sizeof(struct limine_framebuffer_response));
// For now we only support 1 framebuffer
struct limine_framebuffer *fbp = ext_mem_alloc(sizeof(struct limine_framebuffer));
if (term_fb_ptr != NULL) {
*term_fb_ptr = reported_addr(fbp);
}
struct edid_info_struct *edid_info = get_edid_info(); struct edid_info_struct *edid_info = get_edid_info();
if (edid_info != NULL) { if (edid_info != NULL) {
fbp->edid_size = sizeof(struct edid_info_struct); fbp->edid_size = sizeof(struct edid_info_struct);