working on exposing vga to userspace
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
#include "drivers/serial/serial.h"
|
||||
#include "vfs.h"
|
||||
#include <lib/font.h>
|
||||
#include <lib/memory.h>
|
||||
#include <lib/print.h>
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
psf_font_t* load_font(const char* path) {
|
||||
int fd = vfs_open(path, 0);
|
||||
if (fd == -1) {
|
||||
kprintf("failed to open font file %s\n", path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
psf_hdr_t* header = kalloc(sizeof(psf_hdr_t));
|
||||
int rd = vfs_read(fd, header, sizeof(psf_hdr_t));
|
||||
if (rd <= 0) {
|
||||
kprintf("failed to read font header\n");
|
||||
kfree(header);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user