kernel: update limine to 11 and use base revision 6

This commit is contained in:
Matheus
2026-04-01 16:45:42 -03:00
parent 02b88573b0
commit 774ae10e99
18 changed files with 64 additions and 52 deletions
+2 -7
View File
@@ -70,7 +70,7 @@ typedef struct {
#define FB_TYPE_PACKED_PIXELS 0
volatile struct limine_framebuffer_request fb_liminereq = {
.id = LIMINE_FRAMEBUFFER_REQUEST,
.id = LIMINE_FRAMEBUFFER_REQUEST_ID,
.revision = 0
};
@@ -153,7 +153,7 @@ static int mmap(int minor, void *addr, uintmax_t offset, int flags) {
memcpy(MAKE_HHDM(paddr), (void *)((uintptr_t)fbs[minor]->address + offset), size);
if (arch_mmu_map(current_vmm_context()->pagetable, paddr, addr, vnodeflagstommuflags(flags)) == false) {
if (arch_mmu_map(current_vmm_context()->pagetable, paddr, addr, vnodeflagstommuflags(flags) | ARCH_MMU_FLAGS_WC) == false) {
pmm_release(paddr);
return ENOMEM;
}
@@ -257,11 +257,6 @@ void fb_init() {
printf("%s: %dx%d %d bpp\n", name, fb->width, fb->height, fb->bpp);
}
void *fb_map = vmm_map(NULL, fbs[0]->pitch * fbs[0]->height, VMM_FLAGS_PHYSICAL, ARCH_MMU_FLAGS_READ | ARCH_MMU_FLAGS_WRITE | ARCH_MMU_FLAGS_NOEXEC | ARCH_MMU_FLAGS_WC, FROM_HHDM(fbs[0]->address));
__assert(fb_map);
term_update_framebuffer(fb_map);
}
INIT_ROUTINE_DEFINE(fb, INIT_ROUTINE_FLAGS_NONE, fb_init, devfs);
+2
View File
@@ -124,6 +124,7 @@ size_t pci_initmsix(pcienum_t *e) {
#define PCI_MSI_64BIT (1 << 7)
size_t pci_initmsi(pcienum_t *e, int requested) {
// TODO maybe initialize mask if applicable?
__assert(requested == 1);
if (e->msi.exists == false)
return 0;
@@ -131,6 +132,7 @@ size_t pci_initmsi(pcienum_t *e, int requested) {
uint16_t msgctl = PCI_READ16(e, e->msi.offset + 2);
msgctl |= PCI_MSI_ENABLE;
msgctl &= ~(PCI_MSI_MULTIPLE_MESSAGE_SUPPORT_MASK); // no multiple message support
PCI_WRITE16(e, e->msi.offset + 2, msgctl);
pci_setcommand(e, PCI_COMMAND_IRQDISABLE, 1);
+20 -13
View File
@@ -1,5 +1,5 @@
#include <flanterm.h>
#include <backends/fb.h>
#include <flanterm_backends/fb.h>
#include <limine.h>
#include <stddef.h>
#include <stdint.h>
@@ -11,6 +11,10 @@
#include <kernel/init.h>
#include <logging.h>
static volatile struct limine_flanterm_fb_init_params_request flanterm_request = {
.id = LIMINE_FLANTERM_FB_INIT_PARAMS_REQUEST_ID
};
extern volatile struct limine_framebuffer_request fb_liminereq;
static size_t xs, ys, fbxs, fbys;
bool init_done;
@@ -70,26 +74,29 @@ void term_init() {
uint32_t defaultbg = 0x1b1c1b;
uint32_t defaultfg = 0xffffff;
// TODO add support for a background if desired by the user
term_ctx = flanterm_fb_init(internalalloc, noop, fb->address, fb->width, fb->height, fb->pitch,
fb->red_mask_size, fb->red_mask_shift, fb->green_mask_size, fb->green_mask_shift, fb->blue_mask_size, fb->blue_mask_shift,
NULL, NULL, NULL, &defaultbg, &defaultfg, NULL, NULL, NULL,
0, 0, 1, 1, 1, 0);
if (flanterm_request.response && flanterm_request.response->entry_count) {
struct limine_flanterm_fb_init_params *param = flanterm_request.response->entries[0];
term_ctx = flanterm_fb_init(internalalloc, noop, fb->address, fb->width, fb->height, fb->pitch,
fb->red_mask_size, fb->red_mask_shift, fb->green_mask_size, fb->green_mask_shift, fb->blue_mask_size, fb->blue_mask_shift,
param->canvas, param->ansi_colours, param->ansi_bright_colours,
&param->default_bg, &param->default_fg, &param->default_bg_bright, &param->default_fg_bright,
param->font, param->font_width, param->font_height, param->font_spacing, param->font_scale_x, param->font_scale_y,
param->margin, param->rotation);
} else {
term_ctx = flanterm_fb_init(internalalloc, noop, fb->address, fb->width, fb->height, fb->pitch,
fb->red_mask_size, fb->red_mask_shift, fb->green_mask_size, fb->green_mask_shift, fb->blue_mask_size, fb->blue_mask_shift,
NULL, NULL, NULL, &defaultbg, &defaultfg, NULL, NULL, NULL,
0, 0, 1, 1, 1, 0, 0);
}
__assert(term_ctx);
xs = term_ctx->cols;
ys = term_ctx->rows;
flanterm_get_dimensions(term_ctx, &xs, &ys);
fbxs = fb->width;
fbys = fb->height;
MUTEX_INIT(&term_mutex);
logging_sethook(term_putchar);
}
void term_update_framebuffer(void *fb) {
((struct flanterm_fb_context *)fb)->framebuffer = fb;
}
INIT_ROUTINE_DEFINE(term, INIT_ROUTINE_FLAGS_NONE, term_init, vmm);