aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/graphics/vesa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/graphics/vesa.c')
-rw-r--r--src/kernel/graphics/vesa.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c
index 8213c12..c6c828b 100644
--- a/src/kernel/graphics/vesa.c
+++ b/src/kernel/graphics/vesa.c
@@ -5,6 +5,8 @@
#include <kernel/lib/stdio.h>
#include <kernel/memory/alloc.h>
#include <kernel/memory/paging.h>
+#include <kernel/fs/dev.h>
+#include <kernel/fs/ext2.h>
void vbe_error()
{
@@ -81,6 +83,12 @@ struct vbe_mode_info *vbe_get_mode_info(uint16_t mode)
return ret;
}
+uint32_t fb_write(struct fs_node *node, uint32_t offset, uint32_t size, uint8_t *buffer)
+{
+ log("FB WRITE!");
+ return 0;
+}
+
void set_optimal_resolution()
{
log("Switching to graphics mode");
@@ -170,6 +178,12 @@ void set_optimal_resolution()
paging_map_user(paging_root_directory, (uint32_t)fb + z, (uint32_t)fb + z);
}
+ dev_make("fb", NULL, (write)fb_write);
+ struct fs_node *node = (struct fs_node *)kmalloc(sizeof(struct fs_node));
+ strcpy(node->name, "/dev/fb");
+ ext2_root->open(node);
+ node->dev->block_size = 0;
+
if (vbe_height > 1440)
vesa_set_font(32);
else if (vbe_height > 720)