a cow based x86_64 operating system, using limine and stivale2
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
943 B

11 months ago
#include <stivale2.h>
#include "early_video.h"
#include "drivers/terminal/terminal.h"
#include "memory/vmap.h"
typedef struct framebuffer_dev fd_t;
driver_t* video_init(
11 months ago
const struct stivale2_struct_tag_framebuffer* framebuffer_tag
11 months ago
) {
// framebuffer virtual device
fd_t* fb_dev =
malloc(sizeof(fd_t));
*fb_dev = (fd_t){
.dev = {
.type = DEVICE_ID_FRAMEBUFFER,
.name = {"stivale2 framebuffer",0},
.driver = NULL
},
.width = framebuffer_tag->framebuffer_width,
.height = framebuffer_tag->framebuffer_height,
.bpp = framebuffer_tag->framebuffer_bpp,
.pitch = framebuffer_tag->framebuffer_pitch,
.pix = (void *)MMIO_BEGIN,
};
register_dev((struct dev *)fb_dev);
return driver_register_and_install(
11 months ago
(int (*)(struct driver*))
terminal_install,
(struct dev *)fb_dev
);
}