Files
my-os-project2/kernel/dev/fbdev.c

30 lines
661 B
C

#include <stdint.h>
#include <stddef.h>
#include "fbdev.h"
#include "dev.h"
#include "sysdefs/devctl.h"
#include "hshtb.h"
#include "spinlock/spinlock.h"
#include "util/util.h"
#include "hal/hal.h"
#include "bootinfo/bootinfo.h"
#include "errors.h"
int32_t fbdev_getinfo(uint8_t *buffer, size_t len, void *extra) {
FbDevGetInfo info = {
.w = BOOT_INFO.fb->width,
.h = BOOT_INFO.fb->height,
.margin = 20,
.fontw = 8,
.fonth = 16,
};
hal_memcpy(buffer, &info, sizeof(info));
return E_OK;
}
void fbdev_init(void) {
Dev *fbdev;
HSHTB_ALLOC(DEVTABLE.devs, ident, "fbdev", fbdev);
fbdev->fns[DEV_FBDEV_GETINFO] = &fbdev_getinfo;
}